com.sun:tools:jar and, therefore is incompatible with JDK9.
https://github.com/cobertura/cobertura/issues/271[ERROR] Failed to execute goal on project cobertura-maven-plugin:
Could not resolve dependencies for project
org.codehaus.mojo:cobertura-maven-plugin:maven-plugin:2.7:
Could not find artifact com.sun:tools:jar:0 at specified path
/usr/lib/jvm/java-9-jdk/../lib/tools.jar
They are all bad. Does anyone know the better option?
Recent release (very long awaited) https://github.com/jacoco/jacoco/releases/tag/v0.8.0 have all required features for us to give it one more chance.
this is unrelated issues. Do you know exact problems?We have to process jdk9 compiled sources, and with jdk9 in runtime, right now.In scope of this issue to try to be compiled by jdk9, build time, not a runtime.
--
You received this message because you are subscribed to the Google Groups "checkstyle-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to checkstyle-devel+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
ClassResolver::resolve
This is a known Jacoco "feature" for methods that always throw an exception.
Not a big problem. By the way, this method can be rewritten from overnested if mess to
something like this:
public Class<?> resolve(String name, String currentClass)
throws ClassNotFoundException {
Stream<Function<String, Class<?>>> resolvers = Stream.of(this::resolveQualifiedName,// see if the class is full qualified
// try matching explicit imports
this::resolveMatchingExplicitImport,
// see if in the package
this::resolveInPackage,
// see if inner class of this class
n -> resolveInnerClass(n, currentClass),
// try matching star imports
this::resolveByStarImports
);
return resolvers.map(r -> r.apply(name)).filter(Objects::nonNull).findFirst()
.orElseThrow(() -> new ClassNotFoundException(name));
}
PackageNamesLoader::getPackageNames same bug. Can be fixed with adding a test case that will NOT cause PackageNamesLoader::processFile to throw an exception.
System.exit in Main::main also lacks coverage, as it should be. Can be disabled.
JavadocUtils::static init I have no idea, why Cobertura misses this. Seems to be a bug in Cobertura.
Can be fixed with extracting the part of the code to another method.
Actually, the code in JavadocUtils duplicates the code in TokenUtils.
Thats all. If you are OK with these changes, I'll send a PR soon.
please send PR with update to allow to run validation from CI.please update TravisCI config to do jacoco coverage check.
> System.exit in Main::main also lacks coverage, as it should be. Can be disabled.please propose PR, to let me see how it will looks like.
/**
* This test verifies nothing. It is a workaround for the Jacoco limitations.
* @see <a href="https://github.com/jacoco/jacoco/issues/117">Jacoco issue 117</a>
* @throws Exception if there is a problem
*/
@Test
public void testJacocoWorkaround() throws Exception {
mockStatic(System.class);
Main.main();
verifyStatic(System.class);
}
>JavadocUtils::static init I have no idea, why Cobertura misses this. Seems to be a bug in Cobertura.Are you sure ? to prove this , lets merge current coverage now and by special PR fix coverage to 100%.
--
This supposed to be caught by pitest execution. If this case is not used, we can remove it and none of UT notice it (pure pitest scenario) ... It is a bug in pitest.Please investigate this case.
--
This supposed to be caught by pitest execution. Is this case is not used, we can remove it and non of UT notice it (pure pitest scenario) ... It is a bug in pitest.Please investigate this case.
<profile>
<id>pitest-checks-metrics</id>
<properties>
<skipTests>true</skipTests>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.pitest</groupId>
<artifactId>pitest-maven</artifactId>
<version>${pitest.plugin.version}</version>
<configuration>
<mutators>
<mutator>DEFAULTS</mutator>
<mutator>REMOVE_SWITCH</mutator>
</mutators>
<targetClasses>
<param>com.puppycrawl.tools.checkstyle.checks.metrics.*</param>
</targetClasses>
<targetTests>
<param>com.puppycrawl.tools.checkstyle.checks.metrics.*</param>
</targetTests>
<coverageThreshold>100</coverageThreshold>
<mutationThreshold>100</mutationThreshold>
<timeoutFactor>${pitest.plugin.timeout.factor}</timeoutFactor>
<timeoutConstant>${pitest.plugin.timeout.constant}</timeoutConstant>
<threads>${pitest.plugin.threads}</threads>
</configuration>
</plugin>
</plugins>
</build>
</profile>
You can see them in my repo: