@Test public void shouldnt_fail_on_valid_java_version() { PmdTemplate.create("6", mock(ClassLoader.class), Charsets.UTF_8); }
public static PmdTemplate create(String javaVersion, ClassLoader classloader, Charset charset) { PMDConfiguration configuration = new PMDConfiguration(); List<LanguageVersion> languageVersions = new ArrayList<>(); languageVersions.add(languageVersion(javaVersion)); configuration.setDefaultLanguageVersions(languageVersions); configuration.setClassLoader(classloader); configuration.setSourceEncoding(charset.name()); SourceCodeProcessor processor = new SourceCodeProcessor(configuration); return new PmdTemplate(configuration, processor); }
PmdTemplate { public static PmdTemplate create(String javaVersion, ClassLoader classloader, Charset charset) { PMDConfiguration configuration = new PMDConfiguration(); List<LanguageVersion> languageVersions = new ArrayList<>(); languageVersions.add(languageVersion(javaVersion)); configuration.setDefaultLanguageVersions(languageVersions); configuration.setClassLoader(classloader); configuration.setSourceEncoding(charset.name()); SourceCodeProcessor processor = new SourceCodeProcessor(configuration); return new PmdTemplate(configuration, processor); } }
PmdTemplate { public static PmdTemplate create(String javaVersion, ClassLoader classloader, Charset charset) { PMDConfiguration configuration = new PMDConfiguration(); List<LanguageVersion> languageVersions = new ArrayList<>(); languageVersions.add(languageVersion(javaVersion)); configuration.setDefaultLanguageVersions(languageVersions); configuration.setClassLoader(classloader); configuration.setSourceEncoding(charset.name()); SourceCodeProcessor processor = new SourceCodeProcessor(configuration); return new PmdTemplate(configuration, processor); } @VisibleForTesting  PmdTemplate(PMDConfiguration configuration, SourceCodeProcessor processor); }
PmdTemplate { public static PmdTemplate create(String javaVersion, ClassLoader classloader, Charset charset) { PMDConfiguration configuration = new PMDConfiguration(); List<LanguageVersion> languageVersions = new ArrayList<>(); languageVersions.add(languageVersion(javaVersion)); configuration.setDefaultLanguageVersions(languageVersions); configuration.setClassLoader(classloader); configuration.setSourceEncoding(charset.name()); SourceCodeProcessor processor = new SourceCodeProcessor(configuration); return new PmdTemplate(configuration, processor); } @VisibleForTesting  PmdTemplate(PMDConfiguration configuration, SourceCodeProcessor processor); static PmdTemplate create(String javaVersion, ClassLoader classloader, Charset charset); void process(File file, RuleSets rulesets, RuleContext ruleContext); }
PmdTemplate { public static PmdTemplate create(String javaVersion, ClassLoader classloader, Charset charset) { PMDConfiguration configuration = new PMDConfiguration(); List<LanguageVersion> languageVersions = new ArrayList<>(); languageVersions.add(languageVersion(javaVersion)); configuration.setDefaultLanguageVersions(languageVersions); configuration.setClassLoader(classloader); configuration.setSourceEncoding(charset.name()); SourceCodeProcessor processor = new SourceCodeProcessor(configuration); return new PmdTemplate(configuration, processor); } @VisibleForTesting  PmdTemplate(PMDConfiguration configuration, SourceCodeProcessor processor); static PmdTemplate create(String javaVersion, ClassLoader classloader, Charset charset); void process(File file, RuleSets rulesets, RuleContext ruleContext);  }