forked from phoedos/pmd
use pmd core to test supported jdk values -> no need to keep updating the
code here for newly supported jdk versions. git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5684 51baf565-9d33-0410-a72c-fc3788e3496d
This commit is contained in:
@@ -320,14 +320,9 @@ public class ReviewCodeCmd extends AbstractDefaultCommand {
|
||||
if (javaProject.exists()) {
|
||||
final String compilerCompliance = javaProject.getOption(JavaCore.COMPILER_COMPLIANCE, true);
|
||||
log.debug("compilerCompliance = " + compilerCompliance);
|
||||
if (JavaCore.VERSION_1_3.equals(compilerCompliance)) {
|
||||
pmdEngine.setJavaVersion(SourceType.JAVA_13);
|
||||
} else if (JavaCore.VERSION_1_4.equals(compilerCompliance)) {
|
||||
pmdEngine.setJavaVersion(SourceType.JAVA_14);
|
||||
} else if (JavaCore.VERSION_1_5.equals(compilerCompliance)) {
|
||||
pmdEngine.setJavaVersion(SourceType.JAVA_15);
|
||||
} else if (JavaCore.VERSION_1_6.equals(compilerCompliance)) {
|
||||
pmdEngine.setJavaVersion(SourceType.JAVA_16);
|
||||
final SourceType s = SourceType.getSourceTypeForId("java " + compilerCompliance);
|
||||
if (s != null) {
|
||||
pmdEngine.setJavaVersion(s);
|
||||
} else {
|
||||
throw new CommandException("The target JDK, " + compilerCompliance + " is not yet supported"); // TODO:
|
||||
// NLS
|
||||
|
||||
@@ -137,14 +137,9 @@ public class ReviewResourceForRuleCommand extends AbstractDefaultCommand {
|
||||
if (javaProject.exists()) {
|
||||
final String compilerCompliance = javaProject.getOption(JavaCore.COMPILER_COMPLIANCE, true);
|
||||
log.debug("compilerCompliance = " + compilerCompliance);
|
||||
if (JavaCore.VERSION_1_3.equals(compilerCompliance)) {
|
||||
pmdEngine.setJavaVersion(SourceType.JAVA_13);
|
||||
} else if (JavaCore.VERSION_1_4.equals(compilerCompliance)) {
|
||||
pmdEngine.setJavaVersion(SourceType.JAVA_14);
|
||||
} else if (JavaCore.VERSION_1_5.equals(compilerCompliance)) {
|
||||
pmdEngine.setJavaVersion(SourceType.JAVA_15);
|
||||
} else if (JavaCore.VERSION_1_6.equals(compilerCompliance)) {
|
||||
pmdEngine.setJavaVersion(SourceType.JAVA_16);
|
||||
final SourceType s = SourceType.getSourceTypeForId("java " + compilerCompliance);
|
||||
if (s != null) {
|
||||
pmdEngine.setJavaVersion(s);
|
||||
} else {
|
||||
throw new CommandException("The target JDK, " + compilerCompliance + " is not yet supported"); // TODO:
|
||||
// NLS
|
||||
|
||||
Reference in New Issue
Block a user