Skip to content

Commit

Permalink
Adjust test to reflect fix of JDK-8237528 in JDK 15 EA b08 (#1011)
Browse files Browse the repository at this point in the history
  • Loading branch information
Godin committed Jan 31, 2020
1 parent 17313eb commit d013ac8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
Expand Up @@ -12,6 +12,7 @@
*******************************************************************************/
package org.jacoco.core.test.validation.java14;

import org.jacoco.core.test.validation.Source.Line;
import org.jacoco.core.test.validation.ValidationTestBase;
import org.jacoco.core.test.validation.java14.targets.InstanceofTarget;

Expand All @@ -24,4 +25,13 @@ public InstanceofTest() {
super(InstanceofTarget.class);
}

public void assertInstanceof(final Line line) {
if (isJDKCompiler && JAVA_VERSION.isBefore("15")) {
// https://bugs.openjdk.java.net/browse/JDK-8237528
assertFullyCovered(line, 1, 3);
} else {
assertFullyCovered(line, 0, 2);
}
}

}
Expand Up @@ -20,8 +20,7 @@
public class InstanceofTarget {

private static void ifInstanceof(Object e) {
/* See https://bugs.openjdk.java.net/browse/JDK-8237528 */
if (e instanceof String s) { // assertFullyCovered(1, 3)
if (e instanceof String s) { // assertInstanceof()
nop(s);
}
}
Expand Down

0 comments on commit d013ac8

Please sign in to comment.