[Fb-contrib-commit] SF.net SVN: fb-contrib: [837] trunk/fb-contrib/src/com/mebigfatguy/ fbcontrib/
Brought to you by:
dbrosius
From: <dbr...@us...> - 2007-02-04 07:45:50
|
Revision: 837 http://svn.sourceforge.net/fb-contrib/?rev=837&view=rev Author: dbrosius Date: 2007-02-03 23:45:50 -0800 (Sat, 03 Feb 2007) Log Message: ----------- better message Modified Paths: -------------- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousJDKVersionUse.java Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousJDKVersionUse.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousJDKVersionUse.java 2007-02-04 07:23:47 UTC (rev 836) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousJDKVersionUse.java 2007-02-04 07:45:50 UTC (rev 837) @@ -58,6 +58,15 @@ verRegEx.put(Integer14.valueOf(Constants.MAJOR_1_5), "(jdk|j2?re)1.5"); verRegEx.put(Integer14.valueOf(50), "(jdk|j2?re)1.6"); } + private static final Map<Integer, String> versionStrings = new HashMap<Integer, String>(); + static { + versionStrings.put(Integer14.valueOf(Constants.MAJOR_1_1), "JDK 1.1"); + versionStrings.put(Integer14.valueOf(Constants.MAJOR_1_2), "JDK 1.2"); + versionStrings.put(Integer14.valueOf(Constants.MAJOR_1_3), "JDK 1.3"); + versionStrings.put(Integer14.valueOf(Constants.MAJOR_1_4), "JDK 1.4"); + versionStrings.put(Integer14.valueOf(Constants.MAJOR_1_5), "JDK 1.5"); + versionStrings.put(Integer14.valueOf(50), "JDK 1.6"); + } private static final Pattern jarPattern = Pattern.compile("jar:file:/*([^!]*)"); private static final String SJVU_JDKHOME = "fb-contrib.sjvu.jdkhome"; @@ -90,7 +99,12 @@ jdkZip = new ZipFile(rtJar); super.visitClassContext(classContext); } else { - ClassNotFoundException cnfe = new ClassNotFoundException("The JDK rt.jar for class version " + clsMajorVersion + " was not found. The system property 'fb-contrib.sjvu.jdkhome' can be used to specify the location."); + String version = versionStrings.get(clsMajorVersion); + ClassNotFoundException cnfe; + if (version != null) + cnfe = new ClassNotFoundException("The " + version + " rt.jar was not found. This file is needed for finding invalid methods with the SuspiciousJDKVersionUse detector. The system property 'fb-contrib.sjvu.jdkhome' can be used to specify the location of the appropriate JDK."); + else + cnfe = new ClassNotFoundException("The JDK's rt.jar for classes with class version " + clsMajorVersion + " was not found. This file is needed for finding invalid methods with the SuspiciousJDKVersionUse detector. The system property 'fb-contrib.sjvu.jdkhome' can be used to specify the location of the appropriate JDK."); cnfe.fillInStackTrace(); bugReporter.reportMissingClass(cnfe); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |