aboutsummaryrefslogtreecommitdiff
path: root/org.jacoco.core.test
diff options
context:
space:
mode:
Diffstat (limited to 'org.jacoco.core.test')
-rw-r--r--org.jacoco.core.test/pom.xml4
-rw-r--r--org.jacoco.core.test/src-java7/org/jacoco/core/test/filter/StringSwitchTest.java2
-rw-r--r--org.jacoco.core.test/src-java7/org/jacoco/core/test/filter/TryWithResourcesTest.java20
-rw-r--r--org.jacoco.core.test/src-java7/org/jacoco/core/test/filter/targets/StringSwitch.java2
-rw-r--r--org.jacoco.core.test/src-java7/org/jacoco/core/test/filter/targets/TryWithResources.java2
-rw-r--r--org.jacoco.core.test/src-java8/org/jacoco/core/test/validation/BadCycleInterfaceTest.java2
-rw-r--r--org.jacoco.core.test/src-java8/org/jacoco/core/test/validation/BootstrapMethodReferenceTest.java2
-rw-r--r--org.jacoco.core.test/src-java8/org/jacoco/core/test/validation/InterfaceDefaultMethodsTest.java2
-rw-r--r--org.jacoco.core.test/src-java8/org/jacoco/core/test/validation/InterfaceOnlyDefaultMethodsTest.java2
-rw-r--r--org.jacoco.core.test/src-java8/org/jacoco/core/test/validation/LambdaExpressionsTest.java2
-rw-r--r--org.jacoco.core.test/src-java8/org/jacoco/core/test/validation/LambdaInInterfaceTest.java2
-rw-r--r--org.jacoco.core.test/src-java8/org/jacoco/core/test/validation/targets/BadCycleInterface.java2
-rw-r--r--org.jacoco.core.test/src-java8/org/jacoco/core/test/validation/targets/InterfaceDefaultMethodsTarget.java2
-rw-r--r--org.jacoco.core.test/src-java8/org/jacoco/core/test/validation/targets/InterfaceOnlyDefaultMethodsTarget.java2
-rw-r--r--org.jacoco.core.test/src-java8/org/jacoco/core/test/validation/targets/LambdaExpressionsTarget.java2
-rw-r--r--org.jacoco.core.test/src-java8/org/jacoco/core/test/validation/targets/LambdaInInterfaceTarget.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/JaCoCoTest.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/analysis/AnalyzerTest.java4
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/analysis/CounterComparatorTest.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/analysis/CoverageBuilderTest.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/analysis/CoverageNodeImplTest.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/analysis/NodeComparatorTest.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/data/ExecutionDataReaderWriterTest.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/data/ExecutionDataStoreTest.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/data/ExecutionDataTest.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/data/IncompatibleExecDataVersionExceptionTest.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/data/SessionInfoStoreTest.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/data/SessionInfoTest.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/instr/InstrumenterTest.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/instr/MethodRecorder.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/internal/ContentTypeDetectorTest.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/internal/Pack200StreamsTest.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/internal/analysis/BundleCoverageImplTest.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/internal/analysis/ClassAnalyzerTest.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/internal/analysis/ClassCoverageImplTest.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/internal/analysis/CounterImplTest.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/internal/analysis/LineImplTest.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/internal/analysis/MethodAnalyzerTest.java8
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/internal/analysis/MethodCoverageImplTest.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/internal/analysis/PackageCoverageTest.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/internal/analysis/SourceFileCoverageImplTest.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/internal/analysis/SourceNodeImplTest.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/internal/analysis/StringPoolTest.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/internal/analysis/filter/EnumFilterTest.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/internal/analysis/filter/FinallyFilterTest.java421
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/internal/analysis/filter/GroovyGeneratedFilterTest.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/internal/analysis/filter/LombokGeneratedFilterTest.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/internal/analysis/filter/PrivateEmptyNoArgConstructorFilterTest.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/internal/analysis/filter/StringSwitchJavacFilterTest.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/internal/analysis/filter/SynchronizedFilterTest.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/internal/analysis/filter/SyntheticFilterTest.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/internal/analysis/filter/TryWithResourcesEcjFilterTest.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/internal/analysis/filter/TryWithResourcesJavacFilterTest.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/internal/data/CRC64Test.java37
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/internal/data/CompactDataInputOutputTest.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/internal/flow/ClassProbesAdapterTest.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/internal/flow/FrameSnapshotTest.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/internal/flow/InstructionTest.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/internal/flow/LabelFlowAnalyzerTest.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/internal/flow/LabelInfoTest.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/internal/flow/MethodProbesAdapterTest.java128
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/internal/flow/MethodSanitizerTest.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/internal/instr/ClassInstrumenterTest.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/internal/instr/DuplicateFrameEliminatorTest.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/internal/instr/InstrSupportTest.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/internal/instr/MethodInstrumenterTest.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/internal/instr/ProbeArrayStrategyFactoryTest.java15
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/internal/instr/ProbeCounterTest.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/internal/instr/ProbeInserterTest.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/internal/instr/SignatureRemoverTest.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/runtime/AgentOptionsTest.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/runtime/CommandLineSupportTest.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/runtime/LoggerRuntimeTest.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/runtime/ModifiedSystemClassRuntimeTest.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/runtime/OfflineInstrumentationAccessGeneratorTest.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/runtime/RemoteControlReaderWriterTest.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/runtime/RuntimeDataTest.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/runtime/RuntimeTestBase.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/runtime/SystemPropertiesRuntimeTest.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/runtime/TestStorage.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/runtime/URLStreamHandlerRuntimeTest.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/runtime/WildcardMatcherTest.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/test/InstrumentingLoader.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/test/TargetLoader.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/test/filter/ConstructorTest.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/test/filter/FinallyTest.java266
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/test/filter/SynchronizedTest.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/test/filter/SyntheticTest.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/test/filter/targets/Constructor.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/test/filter/targets/Finally.java148
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/test/filter/targets/Synchronized.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/test/filter/targets/Synthetic.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/test/perf/AnalysisTimeScenario.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/test/perf/ExecuteInstrumentedCodeScenario.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/test/perf/IPerfOutput.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/test/perf/IPerfScenario.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/test/perf/InstrumentationSizeSzenario.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/test/perf/InstrumentationTimeScenario.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/test/perf/PerfOutputWriter.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/test/perf/PerformanceSuite.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/test/perf/TimedScenario.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/test/perf/targets/Target01.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/test/perf/targets/Target02.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/test/perf/targets/Target03.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/test/validation/AnnotationInitializerTest.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/test/validation/BadCycleClassTest.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/test/validation/BooleanExpressionsTest.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/test/validation/ClassFileVersionsTest.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/test/validation/ClassInitializerTest.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/test/validation/Compiler.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/test/validation/ControlStructuresTest.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/test/validation/CyclomaticComplexityTest.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/test/validation/EnumImplicitMethodsTest.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/test/validation/ExceptionsTest.java59
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/test/validation/ExplicitInitialFrameTest.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/test/validation/FieldInitializationInTwoConstructorsTest.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/test/validation/FramesTest.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/test/validation/ImplicitDefaultConstructorTest.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/test/validation/ImplicitFieldInitializationTest.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/test/validation/InterfaceClassInitializerTest.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/test/validation/PrivateEmptyDefaultConstructorTest.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/test/validation/ProbesBeforeSuperConstructorTest.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/test/validation/ResizeInstructionsTest.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/test/validation/Source.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/test/validation/SourceTest.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/test/validation/StructuredLockingTest.java15
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/test/validation/ValidationTestBase.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/AnnotationInitializer.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/BadCycleClass.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/EnumImplicitMethods.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Stubs.java11
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Target01.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Target02.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Target03.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Target04.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Target05.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Target06.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Target07.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Target08.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Target09.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Target10.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Target11.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Target12.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/tools/ExecDumpClientTest.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/tools/ExecFileLoaderTest.java2
145 files changed, 1164 insertions, 236 deletions
diff --git a/org.jacoco.core.test/pom.xml b/org.jacoco.core.test/pom.xml
index 31ef2e37..4a6f5add 100644
--- a/org.jacoco.core.test/pom.xml
+++ b/org.jacoco.core.test/pom.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
which accompanies this distribution, and is available at
@@ -15,7 +15,7 @@
<parent>
<groupId>org.jacoco</groupId>
<artifactId>org.jacoco.tests</artifactId>
- <version>0.7.10-SNAPSHOT</version>
+ <version>0.8.0</version>
<relativePath>../org.jacoco.tests</relativePath>
</parent>
diff --git a/org.jacoco.core.test/src-java7/org/jacoco/core/test/filter/StringSwitchTest.java b/org.jacoco.core.test/src-java7/org/jacoco/core/test/filter/StringSwitchTest.java
index 93bc55be..eefff0fb 100644
--- a/org.jacoco.core.test/src-java7/org/jacoco/core/test/filter/StringSwitchTest.java
+++ b/org.jacoco.core.test/src-java7/org/jacoco/core/test/filter/StringSwitchTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src-java7/org/jacoco/core/test/filter/TryWithResourcesTest.java b/org.jacoco.core.test/src-java7/org/jacoco/core/test/filter/TryWithResourcesTest.java
index 6c9db09c..3e4dbd8a 100644
--- a/org.jacoco.core.test/src-java7/org/jacoco/core/test/filter/TryWithResourcesTest.java
+++ b/org.jacoco.core.test/src-java7/org/jacoco/core/test/filter/TryWithResourcesTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -44,7 +44,7 @@ public class TryWithResourcesTest extends ValidationTestBase {
// without filter next line has branches:
assertLine("test.close", ICounter.EMPTY);
assertLine("test.catch", ICounter.NOT_COVERED);
- assertLine("test.finally", ICounter.PARTLY_COVERED);
+ assertLine("test.finally", ICounter.FULLY_COVERED);
}
/**
@@ -62,7 +62,7 @@ public class TryWithResourcesTest extends ValidationTestBase {
// without filter next line has branches:
assertLine("test2.close", ICounter.EMPTY);
assertLine("test2.catch", ICounter.NOT_COVERED);
- assertLine("test2.finally", ICounter.PARTLY_COVERED);
+ assertLine("test2.finally", ICounter.FULLY_COVERED);
assertLine("test2.after", ICounter.FULLY_COVERED);
}
@@ -109,14 +109,14 @@ public class TryWithResourcesTest extends ValidationTestBase {
assertLine("nested.try2", ICounter.FULLY_COVERED);
assertLine("nested.body", ICounter.FULLY_COVERED);
assertLine("nested.catch2", ICounter.NOT_COVERED);
- assertLine("nested.finally2", ICounter.PARTLY_COVERED);
+ assertLine("nested.finally2", ICounter.FULLY_COVERED);
// next lines not covered on exceptional path:
- assertLine("nested.try3", ICounter.PARTLY_COVERED, 0, 0);
- assertLine("nested.open3", ICounter.PARTLY_COVERED, 0, 0);
- assertLine("nested.body3", ICounter.PARTLY_COVERED, 0, 0);
+ assertLine("nested.try3", ICounter.FULLY_COVERED, 0, 0);
+ assertLine("nested.open3", ICounter.FULLY_COVERED, 0, 0);
+ assertLine("nested.body3", ICounter.FULLY_COVERED, 0, 0);
assertLine("nested.catch3", ICounter.NOT_COVERED);
- assertLine("nested.finally3", ICounter.PARTLY_COVERED, 0, 0);
+ assertLine("nested.finally3", ICounter.FULLY_COVERED, 0, 0);
// without filter next lines have branches:
assertLine("nested.close3", ICounter.EMPTY);
@@ -132,12 +132,12 @@ public class TryWithResourcesTest extends ValidationTestBase {
// without filter next line covered partly:
assertLine("returnInCatch.try1", ICounter.FULLY_COVERED);
assertLine("returnInCatch.open", ICounter.FULLY_COVERED);
- assertLine("returnInCatch.finally1", ICounter.PARTLY_COVERED, 5, 1);
+ assertLine("returnInCatch.finally1", ICounter.PARTLY_COVERED, 1, 1);
// without filter next line has branches:
assertLine("returnInCatch.close", ICounter.EMPTY);
assertLine("returnInCatch.try2", ICounter.EMPTY);
- assertLine("returnInCatch.finally2", ICounter.PARTLY_COVERED, 5, 1);
+ assertLine("returnInCatch.finally2", ICounter.PARTLY_COVERED, 1, 1);
}
/*
diff --git a/org.jacoco.core.test/src-java7/org/jacoco/core/test/filter/targets/StringSwitch.java b/org.jacoco.core.test/src-java7/org/jacoco/core/test/filter/targets/StringSwitch.java
index beaa9797..c8b9a232 100644
--- a/org.jacoco.core.test/src-java7/org/jacoco/core/test/filter/targets/StringSwitch.java
+++ b/org.jacoco.core.test/src-java7/org/jacoco/core/test/filter/targets/StringSwitch.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src-java7/org/jacoco/core/test/filter/targets/TryWithResources.java b/org.jacoco.core.test/src-java7/org/jacoco/core/test/filter/targets/TryWithResources.java
index 19a4651d..3d3a30db 100644
--- a/org.jacoco.core.test/src-java7/org/jacoco/core/test/filter/targets/TryWithResources.java
+++ b/org.jacoco.core.test/src-java7/org/jacoco/core/test/filter/targets/TryWithResources.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src-java8/org/jacoco/core/test/validation/BadCycleInterfaceTest.java b/org.jacoco.core.test/src-java8/org/jacoco/core/test/validation/BadCycleInterfaceTest.java
index 7b7c99aa..ae38ce5e 100644
--- a/org.jacoco.core.test/src-java8/org/jacoco/core/test/validation/BadCycleInterfaceTest.java
+++ b/org.jacoco.core.test/src-java8/org/jacoco/core/test/validation/BadCycleInterfaceTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src-java8/org/jacoco/core/test/validation/BootstrapMethodReferenceTest.java b/org.jacoco.core.test/src-java8/org/jacoco/core/test/validation/BootstrapMethodReferenceTest.java
index e55c2277..79744248 100644
--- a/org.jacoco.core.test/src-java8/org/jacoco/core/test/validation/BootstrapMethodReferenceTest.java
+++ b/org.jacoco.core.test/src-java8/org/jacoco/core/test/validation/BootstrapMethodReferenceTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src-java8/org/jacoco/core/test/validation/InterfaceDefaultMethodsTest.java b/org.jacoco.core.test/src-java8/org/jacoco/core/test/validation/InterfaceDefaultMethodsTest.java
index f73a984e..56998513 100644
--- a/org.jacoco.core.test/src-java8/org/jacoco/core/test/validation/InterfaceDefaultMethodsTest.java
+++ b/org.jacoco.core.test/src-java8/org/jacoco/core/test/validation/InterfaceDefaultMethodsTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src-java8/org/jacoco/core/test/validation/InterfaceOnlyDefaultMethodsTest.java b/org.jacoco.core.test/src-java8/org/jacoco/core/test/validation/InterfaceOnlyDefaultMethodsTest.java
index aeb51821..e572c630 100644
--- a/org.jacoco.core.test/src-java8/org/jacoco/core/test/validation/InterfaceOnlyDefaultMethodsTest.java
+++ b/org.jacoco.core.test/src-java8/org/jacoco/core/test/validation/InterfaceOnlyDefaultMethodsTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src-java8/org/jacoco/core/test/validation/LambdaExpressionsTest.java b/org.jacoco.core.test/src-java8/org/jacoco/core/test/validation/LambdaExpressionsTest.java
index 56bdb2b0..2e8da872 100644
--- a/org.jacoco.core.test/src-java8/org/jacoco/core/test/validation/LambdaExpressionsTest.java
+++ b/org.jacoco.core.test/src-java8/org/jacoco/core/test/validation/LambdaExpressionsTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src-java8/org/jacoco/core/test/validation/LambdaInInterfaceTest.java b/org.jacoco.core.test/src-java8/org/jacoco/core/test/validation/LambdaInInterfaceTest.java
index 304f7630..afa2e986 100644
--- a/org.jacoco.core.test/src-java8/org/jacoco/core/test/validation/LambdaInInterfaceTest.java
+++ b/org.jacoco.core.test/src-java8/org/jacoco/core/test/validation/LambdaInInterfaceTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src-java8/org/jacoco/core/test/validation/targets/BadCycleInterface.java b/org.jacoco.core.test/src-java8/org/jacoco/core/test/validation/targets/BadCycleInterface.java
index e33bf0d7..d7e7a746 100644
--- a/org.jacoco.core.test/src-java8/org/jacoco/core/test/validation/targets/BadCycleInterface.java
+++ b/org.jacoco.core.test/src-java8/org/jacoco/core/test/validation/targets/BadCycleInterface.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src-java8/org/jacoco/core/test/validation/targets/InterfaceDefaultMethodsTarget.java b/org.jacoco.core.test/src-java8/org/jacoco/core/test/validation/targets/InterfaceDefaultMethodsTarget.java
index ef43215b..2e952995 100644
--- a/org.jacoco.core.test/src-java8/org/jacoco/core/test/validation/targets/InterfaceDefaultMethodsTarget.java
+++ b/org.jacoco.core.test/src-java8/org/jacoco/core/test/validation/targets/InterfaceDefaultMethodsTarget.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src-java8/org/jacoco/core/test/validation/targets/InterfaceOnlyDefaultMethodsTarget.java b/org.jacoco.core.test/src-java8/org/jacoco/core/test/validation/targets/InterfaceOnlyDefaultMethodsTarget.java
index f324cdfa..5fa48fb8 100644
--- a/org.jacoco.core.test/src-java8/org/jacoco/core/test/validation/targets/InterfaceOnlyDefaultMethodsTarget.java
+++ b/org.jacoco.core.test/src-java8/org/jacoco/core/test/validation/targets/InterfaceOnlyDefaultMethodsTarget.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src-java8/org/jacoco/core/test/validation/targets/LambdaExpressionsTarget.java b/org.jacoco.core.test/src-java8/org/jacoco/core/test/validation/targets/LambdaExpressionsTarget.java
index 0d75b68f..bcb65b60 100644
--- a/org.jacoco.core.test/src-java8/org/jacoco/core/test/validation/targets/LambdaExpressionsTarget.java
+++ b/org.jacoco.core.test/src-java8/org/jacoco/core/test/validation/targets/LambdaExpressionsTarget.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src-java8/org/jacoco/core/test/validation/targets/LambdaInInterfaceTarget.java b/org.jacoco.core.test/src-java8/org/jacoco/core/test/validation/targets/LambdaInInterfaceTarget.java
index a4b55dc4..23edc6dd 100644
--- a/org.jacoco.core.test/src-java8/org/jacoco/core/test/validation/targets/LambdaInInterfaceTarget.java
+++ b/org.jacoco.core.test/src-java8/org/jacoco/core/test/validation/targets/LambdaInInterfaceTarget.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/JaCoCoTest.java b/org.jacoco.core.test/src/org/jacoco/core/JaCoCoTest.java
index 80f8e052..759fab61 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/JaCoCoTest.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/JaCoCoTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/analysis/AnalyzerTest.java b/org.jacoco.core.test/src/org/jacoco/core/analysis/AnalyzerTest.java
index 71808496..9d3ce065 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/analysis/AnalyzerTest.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/analysis/AnalyzerTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -94,7 +94,7 @@ public class AnalyzerTest {
// class IDs are always calculated after downgrade of the version
final byte[] bytes = TargetLoader
.getClassDataAsBytes(AnalyzerTest.class);
- executionData.get(Long.valueOf(CRC64.checksum(bytes)),
+ executionData.get(Long.valueOf(CRC64.classId(bytes)),
"org/jacoco/core/analysis/AnalyzerTest", 200);
analyzer.analyzeClass(bytes, "Test");
assertFalse(classes.get("org/jacoco/core/analysis/AnalyzerTest")
diff --git a/org.jacoco.core.test/src/org/jacoco/core/analysis/CounterComparatorTest.java b/org.jacoco.core.test/src/org/jacoco/core/analysis/CounterComparatorTest.java
index bb73416c..a81ca245 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/analysis/CounterComparatorTest.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/analysis/CounterComparatorTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/analysis/CoverageBuilderTest.java b/org.jacoco.core.test/src/org/jacoco/core/analysis/CoverageBuilderTest.java
index 277c8c9e..a4a38954 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/analysis/CoverageBuilderTest.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/analysis/CoverageBuilderTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/analysis/CoverageNodeImplTest.java b/org.jacoco.core.test/src/org/jacoco/core/analysis/CoverageNodeImplTest.java
index be0b581d..0ccab814 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/analysis/CoverageNodeImplTest.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/analysis/CoverageNodeImplTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/analysis/NodeComparatorTest.java b/org.jacoco.core.test/src/org/jacoco/core/analysis/NodeComparatorTest.java
index a1c7ec13..ec4928a5 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/analysis/NodeComparatorTest.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/analysis/NodeComparatorTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/data/ExecutionDataReaderWriterTest.java b/org.jacoco.core.test/src/org/jacoco/core/data/ExecutionDataReaderWriterTest.java
index beb2df5c..a1700229 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/data/ExecutionDataReaderWriterTest.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/data/ExecutionDataReaderWriterTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/data/ExecutionDataStoreTest.java b/org.jacoco.core.test/src/org/jacoco/core/data/ExecutionDataStoreTest.java
index 7185cd23..c0fc7f8b 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/data/ExecutionDataStoreTest.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/data/ExecutionDataStoreTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/data/ExecutionDataTest.java b/org.jacoco.core.test/src/org/jacoco/core/data/ExecutionDataTest.java
index eba3d7c2..89ed7b40 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/data/ExecutionDataTest.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/data/ExecutionDataTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/data/IncompatibleExecDataVersionExceptionTest.java b/org.jacoco.core.test/src/org/jacoco/core/data/IncompatibleExecDataVersionExceptionTest.java
index 4d4a3c86..dbbe657c 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/data/IncompatibleExecDataVersionExceptionTest.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/data/IncompatibleExecDataVersionExceptionTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/data/SessionInfoStoreTest.java b/org.jacoco.core.test/src/org/jacoco/core/data/SessionInfoStoreTest.java
index 52846f4a..3427da49 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/data/SessionInfoStoreTest.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/data/SessionInfoStoreTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/data/SessionInfoTest.java b/org.jacoco.core.test/src/org/jacoco/core/data/SessionInfoTest.java
index 2a2725c5..48c37cd8 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/data/SessionInfoTest.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/data/SessionInfoTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/instr/InstrumenterTest.java b/org.jacoco.core.test/src/org/jacoco/core/instr/InstrumenterTest.java
index f674c666..95960477 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/instr/InstrumenterTest.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/instr/InstrumenterTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/instr/MethodRecorder.java b/org.jacoco.core.test/src/org/jacoco/core/instr/MethodRecorder.java
index 8aefa108..8dc22dba 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/instr/MethodRecorder.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/instr/MethodRecorder.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/internal/ContentTypeDetectorTest.java b/org.jacoco.core.test/src/org/jacoco/core/internal/ContentTypeDetectorTest.java
index b9e04d1f..a61d6997 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/internal/ContentTypeDetectorTest.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/internal/ContentTypeDetectorTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/internal/Pack200StreamsTest.java b/org.jacoco.core.test/src/org/jacoco/core/internal/Pack200StreamsTest.java
index 47980e77..f242c2fd 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/internal/Pack200StreamsTest.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/internal/Pack200StreamsTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/internal/analysis/BundleCoverageImplTest.java b/org.jacoco.core.test/src/org/jacoco/core/internal/analysis/BundleCoverageImplTest.java
index bd16d47c..82ad63fa 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/internal/analysis/BundleCoverageImplTest.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/internal/analysis/BundleCoverageImplTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/internal/analysis/ClassAnalyzerTest.java b/org.jacoco.core.test/src/org/jacoco/core/internal/analysis/ClassAnalyzerTest.java
index c990d534..ec65035f 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/internal/analysis/ClassAnalyzerTest.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/internal/analysis/ClassAnalyzerTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/internal/analysis/ClassCoverageImplTest.java b/org.jacoco.core.test/src/org/jacoco/core/internal/analysis/ClassCoverageImplTest.java
index b55626a3..b219a878 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/internal/analysis/ClassCoverageImplTest.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/internal/analysis/ClassCoverageImplTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/internal/analysis/CounterImplTest.java b/org.jacoco.core.test/src/org/jacoco/core/internal/analysis/CounterImplTest.java
index 9aa3631d..8e8f769e 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/internal/analysis/CounterImplTest.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/internal/analysis/CounterImplTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/internal/analysis/LineImplTest.java b/org.jacoco.core.test/src/org/jacoco/core/internal/analysis/LineImplTest.java
index 1a3576b9..ffc3bfc1 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/internal/analysis/LineImplTest.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/internal/analysis/LineImplTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/internal/analysis/MethodAnalyzerTest.java b/org.jacoco.core.test/src/org/jacoco/core/internal/analysis/MethodAnalyzerTest.java
index c327f6bb..c312e60c 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/internal/analysis/MethodAnalyzerTest.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/internal/analysis/MethodAnalyzerTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -695,7 +695,7 @@ public class MethodAnalyzerTest implements IProbeIdGenerator {
}
@Test
- public void try_catch_should_should_show_missed_when_no_probes_are_executed() {
+ public void try_catch_should_show_missed_when_no_probes_are_executed() {
createTryCatchBlock();
runMethodAnalzer();
@@ -705,7 +705,7 @@ public class MethodAnalyzerTest implements IProbeIdGenerator {
}
@Test
- public void try_catch_should_should_show_exception_handler_missed_when_probe_is_not_executed() {
+ public void try_catch_should_show_exception_handler_missed_when_probe_is_not_executed() {
createTryCatchBlock();
probes[0] = true;
probes[1] = true;
@@ -718,7 +718,7 @@ public class MethodAnalyzerTest implements IProbeIdGenerator {
}
@Test
- public void try_catch_should_should_show_all_covered_when_all_probes_are_executed() {
+ public void try_catch_should_show_all_covered_when_all_probes_are_executed() {
createTryCatchBlock();
probes[0] = true;
probes[1] = true;
diff --git a/org.jacoco.core.test/src/org/jacoco/core/internal/analysis/MethodCoverageImplTest.java b/org.jacoco.core.test/src/org/jacoco/core/internal/analysis/MethodCoverageImplTest.java
index d26adda9..fd04f448 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/internal/analysis/MethodCoverageImplTest.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/internal/analysis/MethodCoverageImplTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/internal/analysis/PackageCoverageTest.java b/org.jacoco.core.test/src/org/jacoco/core/internal/analysis/PackageCoverageTest.java
index 599ea4e6..76cf684a 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/internal/analysis/PackageCoverageTest.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/internal/analysis/PackageCoverageTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/internal/analysis/SourceFileCoverageImplTest.java b/org.jacoco.core.test/src/org/jacoco/core/internal/analysis/SourceFileCoverageImplTest.java
index 5e5c8aa9..69183e85 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/internal/analysis/SourceFileCoverageImplTest.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/internal/analysis/SourceFileCoverageImplTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/internal/analysis/SourceNodeImplTest.java b/org.jacoco.core.test/src/org/jacoco/core/internal/analysis/SourceNodeImplTest.java
index 3167e42f..7e9a4233 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/internal/analysis/SourceNodeImplTest.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/internal/analysis/SourceNodeImplTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/internal/analysis/StringPoolTest.java b/org.jacoco.core.test/src/org/jacoco/core/internal/analysis/StringPoolTest.java
index d629978c..18ca05d1 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/internal/analysis/StringPoolTest.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/internal/analysis/StringPoolTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/internal/analysis/filter/EnumFilterTest.java b/org.jacoco.core.test/src/org/jacoco/core/internal/analysis/filter/EnumFilterTest.java
index a46a0d64..9d7fb2ca 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/internal/analysis/filter/EnumFilterTest.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/internal/analysis/filter/EnumFilterTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/internal/analysis/filter/FinallyFilterTest.java b/org.jacoco.core.test/src/org/jacoco/core/internal/analysis/filter/FinallyFilterTest.java
new file mode 100644
index 00000000..5e0ed6c9
--- /dev/null
+++ b/org.jacoco.core.test/src/org/jacoco/core/internal/analysis/filter/FinallyFilterTest.java
@@ -0,0 +1,421 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Evgeny Mandrikov - initial API and implementation
+ *
+ *******************************************************************************/
+package org.jacoco.core.internal.analysis.filter;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import org.jacoco.core.internal.instr.InstrSupport;
+import org.junit.Test;
+import org.objectweb.asm.Label;
+import org.objectweb.asm.Opcodes;
+import org.objectweb.asm.tree.AbstractInsnNode;
+import org.objectweb.asm.tree.MethodNode;
+
+public class FinallyFilterTest implements IFilterOutput {
+
+ private final IFilter filter = new FinallyFilter();
+
+ private final MethodNode m = new MethodNode(InstrSupport.ASM_API_VERSION, 0,
+ "name", "()V", null, null);
+
+ /**
+ * <pre>
+ * try {
+ * ...
+ * if (...) {
+ * ...
+ * return;
+ * } else {
+ * ...
+ * return;
+ * }
+ * } finally {
+ * ...
+ * }
+ * </pre>
+ */
+ @Test
+ public void should_analyze_control_flow() {
+ final Label start1 = new Label();
+ final Label end1 = new Label();
+ final Label start2 = new Label();
+ final Label end2 = new Label();
+ final Label finallyStart = new Label();
+
+ m.visitTryCatchBlock(start1, end1, finallyStart, null);
+ m.visitTryCatchBlock(start2, end2, finallyStart, null);
+
+ m.visitLabel(start1);
+ // jump to another region associated with same handler:
+ m.visitJumpInsn(Opcodes.IFEQ, start2);
+ m.visitInsn(Opcodes.NOP);
+ m.visitLabel(end1);
+
+ m.visitInsn(Opcodes.NOP); // finally block
+ shouldMergeLast();
+ m.visitInsn(Opcodes.RETURN);
+
+ m.visitLabel(start2);
+ m.visitInsn(Opcodes.NOP);
+ m.visitLabel(end2);
+ m.visitInsn(Opcodes.NOP); // finally block
+ shouldMergeLast();
+ m.visitInsn(Opcodes.RETURN);
+
+ m.visitLabel(finallyStart);
+ m.visitVarInsn(Opcodes.ASTORE, 1);
+ shouldIgnoreLast();
+ m.visitInsn(Opcodes.NOP); // finally block
+ shouldMergeLast();
+ m.visitVarInsn(Opcodes.ALOAD, 1);
+ shouldIgnoreLast();
+ m.visitInsn(Opcodes.ATHROW);
+ shouldIgnoreLast();
+
+ execute();
+ }
+
+ // === try/catch/finally ===
+
+ @Test
+ public void javac_try_catch_finally() {
+ final Label tryStart = new Label();
+ final Label tryEnd = new Label();
+ final Label catchStart = new Label();
+ final Label catchEnd = new Label();
+ final Label finallyStart = new Label();
+ final Label finallyEnd = new Label();
+
+ m.visitTryCatchBlock(tryStart, tryEnd, catchStart,
+ "java/lang/Exception");
+ m.visitTryCatchBlock(catchStart, catchEnd, finallyStart, null);
+ m.visitTryCatchBlock(tryStart, tryEnd, finallyStart, null);
+
+ m.visitLabel(tryStart);
+ m.visitInsn(Opcodes.NOP); // try body
+ m.visitLabel(tryEnd);
+ m.visitInsn(Opcodes.NOP); // finally body
+ shouldMergeLast();
+ m.visitJumpInsn(Opcodes.GOTO, finallyEnd);
+ shouldIgnoreLast();
+
+ m.visitLabel(catchStart);
+ m.visitInsn(Opcodes.NOP); // catch body
+ m.visitLabel(catchEnd);
+ m.visitInsn(Opcodes.NOP); // finally body
+ shouldMergeLast();
+ m.visitInsn(Opcodes.ATHROW);
+
+ m.visitLabel(finallyStart);
+ m.visitVarInsn(Opcodes.ASTORE, 1);
+ shouldIgnoreLast();
+ m.visitInsn(Opcodes.NOP); // finally body
+ shouldMergeLast();
+ m.visitVarInsn(Opcodes.ALOAD, 1);
+ shouldIgnoreLast();
+ m.visitInsn(Opcodes.ATHROW);
+ shouldIgnoreLast();
+ m.visitLabel(finallyEnd);
+
+ m.visitInsn(Opcodes.NOP);
+
+ execute();
+ }
+
+ @Test
+ public void ecj_try_catch_finally() {
+ final Label tryStart = new Label();
+ final Label tryEnd = new Label();
+ final Label catchStart = new Label();
+ final Label catchEnd = new Label();
+ final Label finallyStart = new Label();
+ final Label finallyEnd = new Label();
+ final Label after = new Label();
+
+ m.visitTryCatchBlock(tryStart, tryEnd, catchStart,
+ "java/lang/Exception");
+ m.visitTryCatchBlock(tryStart, catchEnd, finallyStart, null);
+
+ m.visitLabel(tryStart);
+ m.visitInsn(Opcodes.NOP); // try body
+ m.visitLabel(tryEnd);
+ m.visitJumpInsn(Opcodes.GOTO, finallyEnd);
+
+ m.visitLabel(catchStart);
+ m.visitInsn(Opcodes.POP);
+ m.visitInsn(Opcodes.NOP); // catch body
+ m.visitLabel(catchEnd);
+ m.visitInsn(Opcodes.NOP); // finally body
+ shouldMergeLast();
+ m.visitJumpInsn(Opcodes.GOTO, after);
+ shouldIgnoreLast();
+
+ m.visitLabel(finallyStart);
+ m.visitVarInsn(Opcodes.ASTORE, 1);
+ shouldIgnoreLast();
+ m.visitInsn(Opcodes.NOP); // finally body
+ shouldMergeLast();
+ m.visitVarInsn(Opcodes.ALOAD, 1);
+ shouldIgnoreLast();
+ m.visitInsn(Opcodes.ATHROW);
+ shouldIgnoreLast();
+ m.visitLabel(finallyEnd);
+
+ m.visitInsn(Opcodes.NOP); // finally body
+ shouldMergeLast();
+ m.visitLabel(after);
+ m.visitInsn(Opcodes.NOP);
+
+ execute();
+ }
+
+ // === empty catch ===
+
+ /**
+ * javac 1.5 - 1.7
+ */
+ @Test
+ public void javac_empty_catch() {
+ final Label tryStart = new Label();
+ final Label tryEnd = new Label();
+ final Label catchStart = new Label();
+ final Label catchEnd = new Label();
+ final Label finallyStart = new Label();
+ final Label finallyEnd = new Label();
+
+ m.visitTryCatchBlock(tryStart, tryEnd, catchStart,
+ "java/lang/Exception");
+ m.visitTryCatchBlock(tryStart, tryEnd, finallyStart, null);
+ m.visitTryCatchBlock(catchStart, catchEnd, finallyStart, null);
+ // actually one more useless TryCatchBlock for ASTORE in finally
+
+ m.visitLabel(tryStart);
+ m.visitInsn(Opcodes.NOP); // try body
+ m.visitLabel(tryEnd);
+ m.visitInsn(Opcodes.NOP); // finally body
+ shouldMergeLast();
+ m.visitJumpInsn(Opcodes.GOTO, finallyEnd);
+ shouldIgnoreLast();
+
+ m.visitLabel(catchStart);
+ m.visitVarInsn(Opcodes.ASTORE, 1);
+ m.visitLabel(catchEnd);
+ m.visitInsn(Opcodes.NOP); // finally body
+ shouldMergeLast();
+ m.visitJumpInsn(Opcodes.GOTO, finallyEnd);
+ shouldIgnoreLast();
+
+ m.visitLabel(finallyStart);
+ m.visitVarInsn(Opcodes.ASTORE, 1);
+ shouldIgnoreLast();
+ m.visitInsn(Opcodes.NOP); // finally body
+ shouldMergeLast();
+ m.visitVarInsn(Opcodes.ALOAD, 1);
+ shouldIgnoreLast();
+ m.visitInsn(Opcodes.ATHROW);
+ shouldIgnoreLast();
+ m.visitLabel(finallyEnd);
+
+ m.visitInsn(Opcodes.NOP);
+
+ execute();
+ }
+
+ /**
+ * javac >= 1.8
+ *
+ * Probably related to https://bugs.openjdk.java.net/browse/JDK-7093325
+ */
+ @Test
+ public void javac_8_empty_catch() throws Exception {
+ final Label tryStart = new Label();
+ final Label tryEnd = new Label();
+ final Label catchStart = new Label();
+ final Label finallyStart = new Label();
+ final Label finallyEnd = new Label();
+
+ m.visitTryCatchBlock(tryStart, tryEnd, catchStart,
+ "java/lang/Exception");
+ m.visitTryCatchBlock(tryStart, tryEnd, finallyStart, null);
+
+ m.visitLabel(tryStart);
+ m.visitInsn(Opcodes.NOP); // try body
+ m.visitLabel(tryEnd);
+ m.visitInsn(Opcodes.NOP); // finally body
+ shouldMergeLast();
+ m.visitJumpInsn(Opcodes.GOTO, finallyEnd);
+ shouldIgnoreLast();
+ shouldIgnoreLast();
+
+ m.visitLabel(catchStart);
+ m.visitVarInsn(Opcodes.ASTORE, 1);
+ m.visitInsn(Opcodes.NOP); // finally body
+ shouldMergeLast();
+ m.visitJumpInsn(Opcodes.GOTO, finallyEnd);
+ shouldIgnoreLast();
+
+ m.visitLabel(finallyStart);
+ m.visitVarInsn(Opcodes.ASTORE, 1);
+ shouldIgnoreLast();
+ m.visitInsn(Opcodes.NOP); // finally body
+ shouldMergeLast();
+ m.visitVarInsn(Opcodes.ALOAD, 1);
+ shouldIgnoreLast();
+ m.visitInsn(Opcodes.ATHROW);
+ shouldIgnoreLast();
+ m.visitLabel(finallyEnd);
+
+ execute();
+ }
+
+ @Test
+ public void ecj_empty_catch() {
+ final Label tryStart = new Label();
+ final Label tryEnd = new Label();
+ final Label catchStart = new Label();
+ final Label catchEnd = new Label();
+ final Label finallyStart = new Label();
+ final Label finallyEnd = new Label();
+ final Label after = new Label();
+
+ m.visitTryCatchBlock(tryStart, tryEnd, catchStart,
+ "java/lang/Exception");
+ m.visitTryCatchBlock(tryStart, catchEnd, finallyStart, null);
+
+ m.visitLabel(tryStart);
+ m.visitInsn(Opcodes.NOP); // try body
+ m.visitLabel(tryEnd);
+ m.visitJumpInsn(Opcodes.GOTO, finallyEnd);
+
+ m.visitLabel(catchStart);
+ m.visitInsn(Opcodes.POP);
+ m.visitLabel(catchEnd);
+ m.visitInsn(Opcodes.NOP); // finally body
+ shouldMergeLast();
+ m.visitJumpInsn(Opcodes.GOTO, after);
+ shouldIgnoreLast();
+
+ m.visitLabel(finallyStart);
+ m.visitVarInsn(Opcodes.ASTORE, 1);
+ shouldIgnoreLast();
+ m.visitInsn(Opcodes.NOP); // finally body
+ shouldMergeLast();
+ m.visitVarInsn(Opcodes.ALOAD, 1);
+ shouldIgnoreLast();
+ m.visitInsn(Opcodes.ATHROW);
+ shouldIgnoreLast();
+ m.visitLabel(finallyEnd);
+
+ m.visitInsn(Opcodes.NOP); // finally body
+ shouldMergeLast();
+ m.visitLabel(after);
+ m.visitInsn(Opcodes.NOP);
+
+ execute();
+ }
+
+ // === always completes abruptly ===
+
+ @Test
+ public void javac_always_completes_abruptly() {
+ final Label tryStart = new Label();
+ final Label tryEnd = new Label();
+ final Label finallyStart = new Label();
+
+ m.visitTryCatchBlock(tryStart, tryEnd, finallyStart, null);
+
+ m.visitLabel(tryStart);
+ m.visitInsn(Opcodes.NOP); // try body
+ m.visitLabel(tryEnd);
+ m.visitInsn(Opcodes.RETURN); // finally body
+
+ m.visitLabel(finallyStart);
+ m.visitVarInsn(Opcodes.ASTORE, 1);
+ m.visitInsn(Opcodes.RETURN); // finally body
+
+ execute();
+ }
+
+ @Test
+ public void ecj_always_completes_abruptly() {
+ final Label tryStart = new Label();
+ final Label tryEnd = new Label();
+ final Label finallyStart = new Label();
+
+ m.visitTryCatchBlock(tryStart, tryEnd, tryEnd, null);
+
+ m.visitLabel(tryStart);
+ m.visitInsn(Opcodes.NOP); // try body
+ m.visitJumpInsn(Opcodes.GOTO, finallyStart);
+ m.visitLabel(tryEnd);
+
+ m.visitInsn(Opcodes.POP);
+ m.visitLabel(finallyStart);
+ m.visitInsn(Opcodes.RETURN); // finally body
+
+ execute();
+ }
+
+ private final Set<AbstractInsnNode> expectedIgnored = new HashSet<AbstractInsnNode>();
+ private final Set<AbstractInsnNode> actualIgnored = new HashSet<AbstractInsnNode>();
+ private final Set<AbstractInsnNode> expectedMerged = new HashSet<AbstractInsnNode>();
+ private final Set<AbstractInsnNode> actualMerged = new HashSet<AbstractInsnNode>();
+
+ private void shouldMergeLast() {
+ expectedMerged.add(m.instructions.getLast());
+ }
+
+ private void shouldIgnoreLast() {
+ expectedIgnored.add(m.instructions.getLast());
+ }
+
+ private void execute() {
+ filter.filter("", "", m, this);
+ assertEquals("ignored", toIndexes(expectedIgnored),
+ toIndexes(actualIgnored));
+ assertEquals("merged", toIndexes(expectedMerged),
+ toIndexes(actualMerged));
+ }
+
+ @SuppressWarnings("boxing")
+ private Set<Integer> toIndexes(Set<AbstractInsnNode> set) {
+ final Set<Integer> result = new HashSet<Integer>();
+ for (final AbstractInsnNode i : set) {
+ result.add(m.instructions.indexOf(i));
+ }
+ return result;
+ }
+
+ public void ignore(final AbstractInsnNode fromInclusive,
+ final AbstractInsnNode toInclusive) {
+ for (AbstractInsnNode i = fromInclusive; i != toInclusive; i = i
+ .getNext()) {
+ actualIgnored.add(i);
+ }
+ actualIgnored.add(toInclusive);
+ }
+
+ public void merge(final AbstractInsnNode i1, final AbstractInsnNode i2) {
+ if (actualMerged.isEmpty() || actualMerged.contains(i1)
+ || actualMerged.contains(i2)) {
+ actualMerged.add(i1);
+ actualMerged.add(i2);
+ } else {
+ fail();
+ }
+ }
+
+}
diff --git a/org.jacoco.core.test/src/org/jacoco/core/internal/analysis/filter/GroovyGeneratedFilterTest.java b/org.jacoco.core.test/src/org/jacoco/core/internal/analysis/filter/GroovyGeneratedFilterTest.java
index 4630762a..6cf0febe 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/internal/analysis/filter/GroovyGeneratedFilterTest.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/internal/analysis/filter/GroovyGeneratedFilterTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/internal/analysis/filter/LombokGeneratedFilterTest.java b/org.jacoco.core.test/src/org/jacoco/core/internal/analysis/filter/LombokGeneratedFilterTest.java
index e68b3a3c..3e2b497a 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/internal/analysis/filter/LombokGeneratedFilterTest.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/internal/analysis/filter/LombokGeneratedFilterTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/internal/analysis/filter/PrivateEmptyNoArgConstructorFilterTest.java b/org.jacoco.core.test/src/org/jacoco/core/internal/analysis/filter/PrivateEmptyNoArgConstructorFilterTest.java
index 36c57ecb..24c67609 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/internal/analysis/filter/PrivateEmptyNoArgConstructorFilterTest.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/internal/analysis/filter/PrivateEmptyNoArgConstructorFilterTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/internal/analysis/filter/StringSwitchJavacFilterTest.java b/org.jacoco.core.test/src/org/jacoco/core/internal/analysis/filter/StringSwitchJavacFilterTest.java
index 96683961..2dd9359d 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/internal/analysis/filter/StringSwitchJavacFilterTest.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/internal/analysis/filter/StringSwitchJavacFilterTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/internal/analysis/filter/SynchronizedFilterTest.java b/org.jacoco.core.test/src/org/jacoco/core/internal/analysis/filter/SynchronizedFilterTest.java
index a67eaa5f..5e2b4379 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/internal/analysis/filter/SynchronizedFilterTest.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/internal/analysis/filter/SynchronizedFilterTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/internal/analysis/filter/SyntheticFilterTest.java b/org.jacoco.core.test/src/org/jacoco/core/internal/analysis/filter/SyntheticFilterTest.java
index b8a6e9dd..06344d52 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/internal/analysis/filter/SyntheticFilterTest.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/internal/analysis/filter/SyntheticFilterTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/internal/analysis/filter/TryWithResourcesEcjFilterTest.java b/org.jacoco.core.test/src/org/jacoco/core/internal/analysis/filter/TryWithResourcesEcjFilterTest.java
index 57e9145b..248ca4e9 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/internal/analysis/filter/TryWithResourcesEcjFilterTest.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/internal/analysis/filter/TryWithResourcesEcjFilterTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/internal/analysis/filter/TryWithResourcesJavacFilterTest.java b/org.jacoco.core.test/src/org/jacoco/core/internal/analysis/filter/TryWithResourcesJavacFilterTest.java
index a19cfe2c..83109eae 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/internal/analysis/filter/TryWithResourcesJavacFilterTest.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/internal/analysis/filter/TryWithResourcesJavacFilterTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/internal/data/CRC64Test.java b/org.jacoco.core.test/src/org/jacoco/core/internal/data/CRC64Test.java
index b8bed886..5b5f421a 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/internal/data/CRC64Test.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/internal/data/CRC64Test.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -15,7 +15,10 @@ import static org.junit.Assert.assertEquals;
import java.io.UnsupportedEncodingException;
+import org.jacoco.core.data.ExecutionDataWriter;
import org.junit.Test;
+import org.objectweb.asm.ClassWriter;
+import org.objectweb.asm.Opcodes;
/**
* Unit tests for {@link CRC64}.
@@ -23,8 +26,32 @@ import org.junit.Test;
public class CRC64Test {
@Test
+ public void testJava9() {
+ // should remove workaround for Java 9
+ // during change of exec file version
+ assertEquals(0x1007, ExecutionDataWriter.FORMAT_VERSION);
+
+ assertEquals(0xB5284860A572741CL,
+ CRC64.classId(createClass(Opcodes.V9)));
+
+ assertEquals(0xB5284860A572741CL,
+ CRC64.classId(createClass(Opcodes.V1_8)));
+
+ assertEquals(0x45284D30A572741AL,
+ CRC64.classId(createClass(Opcodes.V1_7)));
+ }
+
+ private static byte[] createClass(final int version) {
+ final ClassWriter cw = new ClassWriter(0);
+ cw.visit(version, 0, "Foo", null, "java/lang/Object", null);
+ cw.visitEnd();
+ cw.toByteArray();
+ return cw.toByteArray();
+ }
+
+ @Test
public void test0() {
- final long sum = CRC64.checksum(new byte[0]);
+ final long sum = CRC64.classId(new byte[0]);
assertEquals(0L, sum);
}
@@ -35,7 +62,7 @@ public class CRC64Test {
*/
@Test
public void test1() throws UnsupportedEncodingException {
- final long sum = CRC64.checksum("IHATEMATH".getBytes("ASCII"));
+ final long sum = CRC64.classId("IHATEMATH".getBytes("ASCII"));
assertEquals(0xE3DCADD69B01ADD1L, sum);
}
@@ -46,7 +73,7 @@ public class CRC64Test {
*/
@Test
public void test2() {
- final long sum = CRC64.checksum(new byte[] { (byte) 0xff, (byte) 0xff,
+ final long sum = CRC64.classId(new byte[] { (byte) 0xff, (byte) 0xff,
(byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
(byte) 0xff, (byte) 0xff });
assertEquals(0x5300000000000000L, sum);
@@ -59,7 +86,7 @@ public class CRC64Test {
*/
@Test
public void test3() throws UnsupportedEncodingException {
- final long sum = CRC64.checksum("JACOCO_JACOCO_JACOCO_JACOCO"
+ final long sum = CRC64.classId("JACOCO_JACOCO_JACOCO_JACOCO"
.getBytes("ASCII"));
assertEquals(0xD8016B38AAD48308L, sum);
}
diff --git a/org.jacoco.core.test/src/org/jacoco/core/internal/data/CompactDataInputOutputTest.java b/org.jacoco.core.test/src/org/jacoco/core/internal/data/CompactDataInputOutputTest.java
index 0f018754..098db91b 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/internal/data/CompactDataInputOutputTest.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/internal/data/CompactDataInputOutputTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/internal/flow/ClassProbesAdapterTest.java b/org.jacoco.core.test/src/org/jacoco/core/internal/flow/ClassProbesAdapterTest.java
index a55615af..66374f27 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/internal/flow/ClassProbesAdapterTest.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/internal/flow/ClassProbesAdapterTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/internal/flow/FrameSnapshotTest.java b/org.jacoco.core.test/src/org/jacoco/core/internal/flow/FrameSnapshotTest.java
index 9df32e11..e3436579 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/internal/flow/FrameSnapshotTest.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/internal/flow/FrameSnapshotTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/internal/flow/InstructionTest.java b/org.jacoco.core.test/src/org/jacoco/core/internal/flow/InstructionTest.java
index a6a7ee6d..950827c1 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/internal/flow/InstructionTest.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/internal/flow/InstructionTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/internal/flow/LabelFlowAnalyzerTest.java b/org.jacoco.core.test/src/org/jacoco/core/internal/flow/LabelFlowAnalyzerTest.java
index 8777c9ba..972ca8a5 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/internal/flow/LabelFlowAnalyzerTest.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/internal/flow/LabelFlowAnalyzerTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/internal/flow/LabelInfoTest.java b/org.jacoco.core.test/src/org/jacoco/core/internal/flow/LabelInfoTest.java
index b2fd0b5d..85007950 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/internal/flow/LabelInfoTest.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/internal/flow/LabelInfoTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/internal/flow/MethodProbesAdapterTest.java b/org.jacoco.core.test/src/org/jacoco/core/internal/flow/MethodProbesAdapterTest.java
index 083ec0a3..4b81ae37 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/internal/flow/MethodProbesAdapterTest.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/internal/flow/MethodProbesAdapterTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -320,52 +320,132 @@ public class MethodProbesAdapterTest implements IProbeIdGenerator {
adapter.visitTryCatchBlock(start, end, handler, "java/lang/Exception");
adapter.visitLabel(start);
+ adapter.visitInsn(Opcodes.NOP);
+ adapter.visitLabel(end);
expectedVisitor.visitTryCatchBlock(start, end, handler,
"java/lang/Exception");
expectedVisitor.visitLabel(start);
+ expectedVisitor.visitInsn(Opcodes.NOP);
+ expectedVisitor.visitLabel(end);
}
@Test
- public void testVisitTryCatchBlockWithProbe() {
- Label target = new Label();
- LabelInfo.setSuccessor(target);
- LabelInfo.setTarget(target);
- Label end = new Label();
- Label handler = new Label();
+ public void testVisitTryCatchBlockWithProbeBeforeStart() {
Label start = new Label();
+ LabelInfo.setSuccessor(start);
+ LabelInfo.setTarget(start);
+ Label end = new Label();
+ Label handler1 = new Label();
+ Label handler2 = new Label();
- adapter.visitTryCatchBlock(target, end, handler, "java/lang/Exception");
- adapter.visitLabel(target);
+ adapter.visitTryCatchBlock(start, end, handler1, "java/lang/Exception");
+ adapter.visitTryCatchBlock(start, end, handler2, "java/lang/Throwable");
+ adapter.visitLabel(start);
+ adapter.visitInsn(Opcodes.NOP);
+ adapter.visitLabel(end);
- expectedVisitor.visitTryCatchBlock(start, end, handler,
+ Label probe = new Label();
+ expectedVisitor.visitTryCatchBlock(probe, end, handler1,
"java/lang/Exception");
- expectedVisitor.visitLabel(start);
+ expectedVisitor.visitTryCatchBlock(probe, end, handler2,
+ "java/lang/Throwable");
+ expectedVisitor.visitLabel(probe);
expectedVisitor.visitProbe(1000);
- expectedVisitor.visitLabel(target);
+ expectedVisitor.visitLabel(start);
+ expectedVisitor.visitInsn(Opcodes.NOP);
+ expectedVisitor.visitLabel(end);
}
@Test
- public void testVisitMultipleTryCatchBlocksWithProbe() {
- Label target = new Label();
- LabelInfo.setSuccessor(target);
- LabelInfo.setTarget(target);
+ public void testVisitTryCatchBlockWithProbeBeforeEnd() {
+ Label start = new Label();
Label end = new Label();
+ LabelInfo.setSuccessor(end);
+ LabelInfo.setTarget(end);
Label handler1 = new Label();
Label handler2 = new Label();
- Label start = new Label();
- adapter.visitTryCatchBlock(target, end, handler1, "java/lang/Exception");
- adapter.visitTryCatchBlock(target, end, handler2, "java/io/IOException");
- adapter.visitLabel(target);
+ adapter.visitTryCatchBlock(start, end, handler1, "java/lang/Exception");
+ adapter.visitTryCatchBlock(start, end, handler2, "java/lang/Throwable");
+ adapter.visitLabel(start);
+ adapter.visitInsn(Opcodes.NOP);
+ adapter.visitLabel(end);
- expectedVisitor.visitTryCatchBlock(start, end, handler1,
+ Label probe = new Label();
+ expectedVisitor.visitTryCatchBlock(start, probe, handler1,
"java/lang/Exception");
- expectedVisitor.visitTryCatchBlock(start, end, handler2,
- "java/io/IOException");
+ expectedVisitor.visitTryCatchBlock(start, probe, handler2,
+ "java/lang/Throwable");
expectedVisitor.visitLabel(start);
+ expectedVisitor.visitInsn(Opcodes.NOP);
+ expectedVisitor.visitLabel(probe);
+ expectedVisitor.visitProbe(1000);
+ expectedVisitor.visitLabel(end);
+ }
+
+ /**
+ * https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-2.html#jvms-2.11.10
+ */
+ @Test
+ public void testStructuredLocking() {
+ Label start = new Label();
+ LabelInfo.setSuccessor(start);
+ LabelInfo.setTarget(start);
+ Label end = new Label();
+ LabelInfo.setSuccessor(end);
+ LabelInfo.setTarget(end);
+ Label handlerStart = new Label();
+ Label handlerEnd = new Label();
+ Label after = new Label();
+
+ adapter.visitTryCatchBlock(start, end, handlerStart, null);
+ adapter.visitTryCatchBlock(handlerStart, handlerEnd, handlerStart,
+ null);
+ adapter.visitVarInsn(Opcodes.ALOAD, 1);
+ adapter.visitInsn(Opcodes.MONITORENTER);
+ adapter.visitLabel(start);
+ adapter.visitInsn(Opcodes.NOP);
+ adapter.visitVarInsn(Opcodes.ALOAD, 1);
+ adapter.visitInsn(Opcodes.MONITOREXIT);
+ adapter.visitLabel(end);
+ adapter.visitJumpInsn(Opcodes.GOTO, after);
+ adapter.visitLabel(handlerStart);
+ adapter.visitVarInsn(Opcodes.ALOAD, 1);
+ adapter.visitInsn(Opcodes.MONITOREXIT);
+ adapter.visitLabel(handlerEnd);
+ adapter.visitInsn(Opcodes.ATHROW);
+ adapter.visitLabel(after);
+
+ Label probe1 = new Label();
+ Label probe2 = new Label();
+ expectedVisitor.visitTryCatchBlock(probe1, probe2, handlerStart, null);
+ expectedVisitor.visitTryCatchBlock(handlerStart, handlerEnd,
+ handlerStart, null);
+ expectedVisitor.visitVarInsn(Opcodes.ALOAD, 1);
+ expectedVisitor.visitInsn(Opcodes.MONITORENTER);
+ // next probe must be INSIDE range of instructions covered by handler,
+ // otherwise monitorexit won't be executed
+ // in case if probe causes exception
+ expectedVisitor.visitLabel(probe1);
expectedVisitor.visitProbe(1000);
- expectedVisitor.visitLabel(target);
+ expectedVisitor.visitLabel(start);
+ expectedVisitor.visitInsn(Opcodes.NOP);
+ expectedVisitor.visitVarInsn(Opcodes.ALOAD, 1);
+ expectedVisitor.visitInsn(Opcodes.MONITOREXIT);
+ // next probe must be OUTSIDE range of instructions covered by handler,
+ // otherwise monitorexit will be executed second time
+ // in case if probe causes exception
+ expectedVisitor.visitLabel(probe2);
+ expectedVisitor.visitProbe(1001);
+ expectedVisitor.visitLabel(end);
+ expectedVisitor.visitJumpInsn(Opcodes.GOTO, after);
+ expectedVisitor.visitLabel(handlerStart);
+ expectedVisitor.visitVarInsn(Opcodes.ALOAD, 1);
+ expectedVisitor.visitInsn(Opcodes.MONITOREXIT);
+ expectedVisitor.visitLabel(handlerEnd);
+ expectedVisitor.visitInsnWithProbe(Opcodes.ATHROW, 1002);
+ expectedVisitor.visitLabel(after);
}
// === IProbeIdGenerator ===
diff --git a/org.jacoco.core.test/src/org/jacoco/core/internal/flow/MethodSanitizerTest.java b/org.jacoco.core.test/src/org/jacoco/core/internal/flow/MethodSanitizerTest.java
index d2464270..90bc881e 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/internal/flow/MethodSanitizerTest.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/internal/flow/MethodSanitizerTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/internal/instr/ClassInstrumenterTest.java b/org.jacoco.core.test/src/org/jacoco/core/internal/instr/ClassInstrumenterTest.java
index 9700d9e4..30bce8ca 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/internal/instr/ClassInstrumenterTest.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/internal/instr/ClassInstrumenterTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/internal/instr/DuplicateFrameEliminatorTest.java b/org.jacoco.core.test/src/org/jacoco/core/internal/instr/DuplicateFrameEliminatorTest.java
index b1cc96b9..2042397b 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/internal/instr/DuplicateFrameEliminatorTest.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/internal/instr/DuplicateFrameEliminatorTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/internal/instr/InstrSupportTest.java b/org.jacoco.core.test/src/org/jacoco/core/internal/instr/InstrSupportTest.java
index 63a61b0b..fb1cb3e3 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/internal/instr/InstrSupportTest.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/internal/instr/InstrSupportTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/internal/instr/MethodInstrumenterTest.java b/org.jacoco.core.test/src/org/jacoco/core/internal/instr/MethodInstrumenterTest.java
index 41101432..6d7c4de0 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/internal/instr/MethodInstrumenterTest.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/internal/instr/MethodInstrumenterTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/internal/instr/ProbeArrayStrategyFactoryTest.java b/org.jacoco.core.test/src/org/jacoco/core/internal/instr/ProbeArrayStrategyFactoryTest.java
index a68e4990..6d9ed5ca 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/internal/instr/ProbeArrayStrategyFactoryTest.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/internal/instr/ProbeArrayStrategyFactoryTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -211,6 +211,19 @@ public class ProbeArrayStrategyFactoryTest {
true, 0);
}
+ @Test
+ public void testModule() {
+ final ClassWriter writer = new ClassWriter(0);
+ writer.visit(Opcodes.V9, Opcodes.ACC_MODULE, "module-info", null, null,
+ null);
+ writer.visitModule("module", 0, null).visitEnd();
+ writer.visitEnd();
+
+ final IProbeArrayStrategy strategy = ProbeArrayStrategyFactory
+ .createFor(new ClassReader(writer.toByteArray()), generator);
+ assertEquals(NoneProbeArrayStrategy.class, strategy.getClass());
+ }
+
private IProbeArrayStrategy test(int version, int access, boolean clinit,
boolean method, boolean abstractMethod) {
final ClassWriter writer = new ClassWriter(0);
diff --git a/org.jacoco.core.test/src/org/jacoco/core/internal/instr/ProbeCounterTest.java b/org.jacoco.core.test/src/org/jacoco/core/internal/instr/ProbeCounterTest.java
index c55f06d4..928cdf13 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/internal/instr/ProbeCounterTest.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/internal/instr/ProbeCounterTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/internal/instr/ProbeInserterTest.java b/org.jacoco.core.test/src/org/jacoco/core/internal/instr/ProbeInserterTest.java
index 87f6ec69..79224d3f 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/internal/instr/ProbeInserterTest.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/internal/instr/ProbeInserterTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/internal/instr/SignatureRemoverTest.java b/org.jacoco.core.test/src/org/jacoco/core/internal/instr/SignatureRemoverTest.java
index 899af15a..f8254f08 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/internal/instr/SignatureRemoverTest.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/internal/instr/SignatureRemoverTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/runtime/AgentOptionsTest.java b/org.jacoco.core.test/src/org/jacoco/core/runtime/AgentOptionsTest.java
index 9470e869..f65142e9 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/runtime/AgentOptionsTest.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/runtime/AgentOptionsTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/runtime/CommandLineSupportTest.java b/org.jacoco.core.test/src/org/jacoco/core/runtime/CommandLineSupportTest.java
index bbf3129f..b221a394 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/runtime/CommandLineSupportTest.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/runtime/CommandLineSupportTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/runtime/LoggerRuntimeTest.java b/org.jacoco.core.test/src/org/jacoco/core/runtime/LoggerRuntimeTest.java
index 7a0e7cdd..20a67502 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/runtime/LoggerRuntimeTest.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/runtime/LoggerRuntimeTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/runtime/ModifiedSystemClassRuntimeTest.java b/org.jacoco.core.test/src/org/jacoco/core/runtime/ModifiedSystemClassRuntimeTest.java
index 08a22898..8a968840 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/runtime/ModifiedSystemClassRuntimeTest.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/runtime/ModifiedSystemClassRuntimeTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/runtime/OfflineInstrumentationAccessGeneratorTest.java b/org.jacoco.core.test/src/org/jacoco/core/runtime/OfflineInstrumentationAccessGeneratorTest.java
index 8f2ac4f9..cf41bf64 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/runtime/OfflineInstrumentationAccessGeneratorTest.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/runtime/OfflineInstrumentationAccessGeneratorTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/runtime/RemoteControlReaderWriterTest.java b/org.jacoco.core.test/src/org/jacoco/core/runtime/RemoteControlReaderWriterTest.java
index 5497ef95..e098798e 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/runtime/RemoteControlReaderWriterTest.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/runtime/RemoteControlReaderWriterTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/runtime/RuntimeDataTest.java b/org.jacoco.core.test/src/org/jacoco/core/runtime/RuntimeDataTest.java
index fb3d48ec..dd3e3521 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/runtime/RuntimeDataTest.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/runtime/RuntimeDataTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/runtime/RuntimeTestBase.java b/org.jacoco.core.test/src/org/jacoco/core/runtime/RuntimeTestBase.java
index 2ed92fa3..d912e875 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/runtime/RuntimeTestBase.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/runtime/RuntimeTestBase.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/runtime/SystemPropertiesRuntimeTest.java b/org.jacoco.core.test/src/org/jacoco/core/runtime/SystemPropertiesRuntimeTest.java
index f5b47193..6ad96310 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/runtime/SystemPropertiesRuntimeTest.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/runtime/SystemPropertiesRuntimeTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/runtime/TestStorage.java b/org.jacoco.core.test/src/org/jacoco/core/runtime/TestStorage.java
index 98d35639..e133c5c7 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/runtime/TestStorage.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/runtime/TestStorage.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/runtime/URLStreamHandlerRuntimeTest.java b/org.jacoco.core.test/src/org/jacoco/core/runtime/URLStreamHandlerRuntimeTest.java
index bfed2f30..2184f468 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/runtime/URLStreamHandlerRuntimeTest.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/runtime/URLStreamHandlerRuntimeTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/runtime/WildcardMatcherTest.java b/org.jacoco.core.test/src/org/jacoco/core/runtime/WildcardMatcherTest.java
index 10e012c4..21d50f80 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/runtime/WildcardMatcherTest.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/runtime/WildcardMatcherTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/test/InstrumentingLoader.java b/org.jacoco.core.test/src/org/jacoco/core/test/InstrumentingLoader.java
index d79ae62b..a870267e 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/test/InstrumentingLoader.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/test/InstrumentingLoader.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/test/TargetLoader.java b/org.jacoco.core.test/src/org/jacoco/core/test/TargetLoader.java
index 4c57fd8c..43a4fb37 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/test/TargetLoader.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/test/TargetLoader.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/test/filter/ConstructorTest.java b/org.jacoco.core.test/src/org/jacoco/core/test/filter/ConstructorTest.java
index a74d4671..1dffc684 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/test/filter/ConstructorTest.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/test/filter/ConstructorTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/test/filter/FinallyTest.java b/org.jacoco.core.test/src/org/jacoco/core/test/filter/FinallyTest.java
new file mode 100644
index 00000000..758bec3c
--- /dev/null
+++ b/org.jacoco.core.test/src/org/jacoco/core/test/filter/FinallyTest.java
@@ -0,0 +1,266 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Evgeny Mandrikov - initial API and implementation
+ *
+ *******************************************************************************/
+package org.jacoco.core.test.filter;
+
+import static org.junit.Assert.assertEquals;
+
+import java.io.IOException;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.regex.Pattern;
+
+import org.jacoco.core.analysis.ICounter;
+import org.jacoco.core.test.TargetLoader;
+import org.jacoco.core.test.filter.targets.Finally;
+import org.jacoco.core.test.validation.Source;
+import org.jacoco.core.test.validation.ValidationTestBase;
+import org.junit.Test;
+import org.objectweb.asm.ClassReader;
+import org.objectweb.asm.Opcodes;
+import org.objectweb.asm.tree.AbstractInsnNode;
+import org.objectweb.asm.tree.ClassNode;
+import org.objectweb.asm.tree.LineNumberNode;
+import org.objectweb.asm.tree.MethodNode;
+
+/**
+ * Test of filtering of duplicated bytecode that is generated for finally block.
+ */
+public class FinallyTest extends ValidationTestBase {
+
+ private static boolean isJDK8 = !Pattern.compile("1\\.[567]\\.0_(\\d++)")
+ .matcher(System.getProperty("java.version")).matches();
+
+ public FinallyTest() {
+ super(Finally.class);
+ }
+
+ /**
+ * {@link Finally#example(boolean)}
+ */
+ @Test
+ public void example() {
+ if (isJDKCompiler) {
+ assertLine("example.0", ICounter.EMPTY);
+ } else {
+ assertLine("example.0", ICounter.FULLY_COVERED);
+ }
+ assertLine("example.1", ICounter.FULLY_COVERED, 0, 2);
+ assertLine("example.2", ICounter.FULLY_COVERED);
+ assertLine("example.3", ICounter.EMPTY);
+ assertLine("example.4", ICounter.EMPTY);
+ }
+
+ /**
+ * GOTO instructions at the end of duplicates of finally block might have
+ * line number of a last instruction of finally block and hence lead to
+ * unexpected coverage results, like for example in case of ECJ for
+ * {@link Finally#catchNotExecuted()}, {@link Finally#emptyCatch()}. So we
+ * decided to ignore them, even if they can correspond to a real break
+ * statement.
+ * <p>
+ * See also <a href=
+ * "https://bugs.openjdk.java.net/browse/JDK-8180141">JDK-8180141</a> and
+ * <a href=
+ * "https://bugs.openjdk.java.net/browse/JDK-7008643">JDK-7008643</a>.
+ * <p>
+ * {@link Finally#breakStatement()}
+ */
+ @Test
+ public void breakStatement() {
+ assertLine("breakStatement", ICounter.EMPTY);
+
+ assertLine("breakStatement.1", ICounter.FULLY_COVERED);
+ assertLine("breakStatement.2", ICounter.EMPTY);
+ }
+
+ /**
+ * {@link Finally#catchNotExecuted()}
+ */
+ @Test
+ public void catchNotExecuted() {
+ assertLine("catchNotExecuted.catch", ICounter.NOT_COVERED);
+ assertLine("catchNotExecuted.0", ICounter.EMPTY);
+ assertLine("catchNotExecuted.1", ICounter.FULLY_COVERED);
+ assertLine("catchNotExecuted.2", ICounter.EMPTY);
+ }
+
+ /**
+ * {@link Finally#emptyCatch()}
+ */
+ @Test
+ public void emptyCatch() {
+ assertLine("emptyCatch.0", ICounter.EMPTY);
+ assertLine("emptyCatch.1", ICounter.FULLY_COVERED);
+ assertLine("emptyCatch.2", ICounter.EMPTY);
+ }
+
+ /**
+ * {@link Finally#twoRegions()}
+ */
+ @Test
+ public void twoRegions() {
+ assertLine("twoRegions.0", ICounter.EMPTY);
+ if (isJDKCompiler && !isJDK8) {
+ // https://bugs.openjdk.java.net/browse/JDK-7008643
+ assertLine("twoRegions.1", ICounter.PARTLY_COVERED);
+ assertLine("twoRegions.return.1", ICounter.EMPTY);
+ assertLine("twoRegions.return.2", ICounter.EMPTY);
+ } else {
+ assertLine("twoRegions.1", ICounter.FULLY_COVERED);
+ assertLine("twoRegions.return.1", ICounter.FULLY_COVERED);
+ assertLine("twoRegions.return.2", ICounter.NOT_COVERED);
+ }
+ assertLine("twoRegions.2", ICounter.EMPTY);
+
+ assertLine("twoRegions.if", ICounter.FULLY_COVERED);
+ assertLine("twoRegions.region.1", ICounter.FULLY_COVERED);
+ assertLine("twoRegions.region.2", ICounter.NOT_COVERED);
+ }
+
+ /**
+ * {@link Finally#nested()}
+ */
+ @Test
+ public void nested() {
+ if (isJDKCompiler) {
+ assertLine("nested.0", ICounter.EMPTY);
+ } else {
+ assertLine("nested.0", ICounter.FULLY_COVERED);
+ }
+ assertLine("nested.1", ICounter.EMPTY);
+ assertLine("nested.2", ICounter.FULLY_COVERED);
+ if (isJDKCompiler) {
+ assertLine("nested.3", ICounter.EMPTY);
+ } else {
+ assertLine("nested.3", ICounter.FULLY_COVERED);
+ }
+ assertLine("nested.4", ICounter.FULLY_COVERED);
+ }
+
+ /**
+ * {@link Finally#emptyTry()}
+ */
+ @Test
+ public void emptyTry() {
+ assertLine("emptyTry.0", ICounter.EMPTY);
+ if (!isJDKCompiler || isJDK8) {
+ assertLine("emptyTry.1", ICounter.FULLY_COVERED);
+ assertLine("emptyTry.2", ICounter.EMPTY);
+ } else {
+ // compiler bug fixed in javac >= 1.8:
+ assertLine("emptyTry.1", ICounter.PARTLY_COVERED);
+ assertLine("emptyTry.2", ICounter.FULLY_COVERED);
+ }
+ }
+
+ /**
+ * {@link Finally#alwaysCompletesAbruptly()}
+ */
+ @Test
+ public void alwaysCompletesAbruptly() {
+ if (isJDKCompiler) {
+ // uncovered case:
+ assertLine("alwaysCompletesAbruptly.0", ICounter.EMPTY);
+ assertLine("alwaysCompletesAbruptly.1", ICounter.PARTLY_COVERED);
+ } else {
+ assertLine("alwaysCompletesAbruptly.0", ICounter.PARTLY_COVERED);
+ assertLine("alwaysCompletesAbruptly.1", ICounter.FULLY_COVERED);
+ }
+ assertLine("alwaysCompletesAbruptly.2", ICounter.EMPTY);
+ }
+
+ /**
+ * This test studies placement of GOTO instructions.
+ */
+ @Test
+ public void gotos() throws IOException {
+ final Source source = Source.getSourceFor("src", Finally.class);
+
+ final ClassNode classNode = new ClassNode();
+ new ClassReader(TargetLoader.getClassDataAsBytes(Finally.class))
+ .accept(classNode, 0);
+ final Set<String> tags = new HashSet<String>();
+ for (final MethodNode m : classNode.methods) {
+ if ("main".equals(m.name)) {
+ // skip it
+ continue;
+ }
+ int lineNumber = -1;
+ for (AbstractInsnNode i = m.instructions
+ .getFirst(); i != null; i = i.getNext()) {
+ if (AbstractInsnNode.LINE == i.getType()) {
+ lineNumber = ((LineNumberNode) i).line;
+ }
+ if (Opcodes.GOTO == i.getOpcode()) {
+ final String line = source.getLine(lineNumber);
+ if (line.indexOf('$') < 0) {
+ throw new AssertionError(
+ "No tag at line " + lineNumber);
+ }
+ final String tag = line.substring(
+ line.indexOf('$') + "$line-".length(),
+ line.lastIndexOf('$'));
+ tags.add(tag);
+ }
+ }
+ }
+
+ final Set<String> expected = new HashSet<String>();
+
+ if (isJDKCompiler) {
+ expected.add("example.2");
+ } else {
+ expected.add("example.0");
+ }
+
+ expected.add("breakStatement.for");
+ if (isJDKCompiler) {
+ expected.add("breakStatement.1");
+ expected.add("breakStatement.2");
+ } else {
+ expected.add("breakStatement");
+ }
+
+ if (isJDKCompiler) {
+ expected.add("emptyCatch.2");
+ } else {
+ expected.add("emptyCatch");
+ expected.add("emptyCatch.1");
+ }
+
+ if (isJDKCompiler) {
+ expected.add("catchNotExecuted.2");
+ } else {
+ expected.add("catchNotExecuted");
+ expected.add("catchNotExecuted.1");
+ }
+
+ if (isJDKCompiler) {
+ expected.add("nested.5");
+ expected.add("nested.6");
+ } else {
+ expected.add("nested.0");
+ expected.add("nested.3");
+ }
+
+ if (isJDKCompiler && !isJDK8) {
+ expected.add("emptyTry.2");
+ }
+
+ if (!isJDKCompiler) {
+ expected.add("alwaysCompletesAbruptly.0");
+ }
+
+ assertEquals(expected, tags);
+ }
+
+}
diff --git a/org.jacoco.core.test/src/org/jacoco/core/test/filter/SynchronizedTest.java b/org.jacoco.core.test/src/org/jacoco/core/test/filter/SynchronizedTest.java
index 1cfce301..2d0fa973 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/test/filter/SynchronizedTest.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/test/filter/SynchronizedTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/test/filter/SyntheticTest.java b/org.jacoco.core.test/src/org/jacoco/core/test/filter/SyntheticTest.java
index 8f8d2538..f439736b 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/test/filter/SyntheticTest.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/test/filter/SyntheticTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/test/filter/targets/Constructor.java b/org.jacoco.core.test/src/org/jacoco/core/test/filter/targets/Constructor.java
index f5237b26..8a3e394a 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/test/filter/targets/Constructor.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/test/filter/targets/Constructor.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/test/filter/targets/Finally.java b/org.jacoco.core.test/src/org/jacoco/core/test/filter/targets/Finally.java
new file mode 100644
index 00000000..6471a809
--- /dev/null
+++ b/org.jacoco.core.test/src/org/jacoco/core/test/filter/targets/Finally.java
@@ -0,0 +1,148 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Evgeny Mandrikov - initial API and implementation
+ *
+ *******************************************************************************/
+package org.jacoco.core.test.filter.targets;
+
+import static org.jacoco.core.test.validation.targets.Stubs.ex;
+import static org.jacoco.core.test.validation.targets.Stubs.f;
+import static org.jacoco.core.test.validation.targets.Stubs.nop;
+import static org.jacoco.core.test.validation.targets.Stubs.t;
+
+public class Finally {
+
+ /**
+ * <pre>
+ * InputStream in = null;
+ * try {
+ * in = ...;
+ * ...
+ * } finally {
+ * if (in != null) {
+ * in.close();
+ * }
+ * }
+ * </pre>
+ */
+ private static void example(boolean t) {
+ Object in = null;
+ try {
+ in = open(t);
+ } finally { // $line-example.0$
+ if (in != null) { // $line-example.1$
+ nop(); // $line-example.2$
+ } // $line-example.3$
+ } // $line-example.4$
+ }
+
+ private static Object open(boolean t) {
+ ex(t);
+ return new Object();
+ }
+
+ private static void breakStatement() {
+ for (int i = 0; i < 1; i++) { // $line-breakStatement.for$
+ try {
+ if (f()) {
+ break; // $line-breakStatement$
+ }
+ } finally {
+ nop("finally"); // $line-breakStatement.1$
+ } // $line-breakStatement.2$
+ }
+ }
+
+ private static void catchNotExecuted() {
+ try {
+ nop("try");
+ } catch (Exception e) { // $line-catchNotExecuted$
+ nop("catch"); // $line-catchNotExecuted.catch$
+ } finally { // $line-catchNotExecuted.0$
+ nop("finally"); // $line-catchNotExecuted.1$
+ } // $line-catchNotExecuted.2$
+ }
+
+ private static void emptyCatch() {
+ try {
+ nop("try");
+ } catch (Exception e) { // $line-emptyCatch$
+ // empty
+ } finally { // $line-emptyCatch.0$
+ nop("finally"); // $line-emptyCatch.1$
+ } // $line-emptyCatch.2$
+ }
+
+ private static void twoRegions() {
+ try {
+ // jump to another region associated with same handler:
+ if (t()) { // $line-twoRegions.if$
+ nop(); // $line-twoRegions.region.1$
+ return; // $line-twoRegions.return.1$
+ } else {
+ nop(); // $line-twoRegions.region.2$
+ return; // $line-twoRegions.return.2$
+ }
+ } finally { // $line-twoRegions.0$
+ nop(); // $line-twoRegions.1$
+ } // $line-twoRegions.2$
+ }
+
+ private static void nested() {
+ try {
+ nop();
+ } finally { // $line-nested.0$
+ try { // $line-nested.1$
+ nop(); // $line-nested.2$
+ } finally { // $line-nested.3$
+ nop(); // $line-nested.4$
+ } // $line-nested.5$
+ } // $line-nested.6$
+ }
+
+ private static void emptyTry() {
+ try {
+ // empty
+ } finally { // $line-emptyTry.0$
+ nop(); // $line-emptyTry.1$
+ } // $line-emptyTry.2$
+ }
+
+ @SuppressWarnings("finally")
+ private static void alwaysCompletesAbruptly() {
+ try {
+ nop();
+ } finally { // $line-alwaysCompletesAbruptly.0$
+ return; // $line-alwaysCompletesAbruptly.1$
+ } // $line-alwaysCompletesAbruptly.2$
+ }
+
+ public static void main(String[] args) {
+ example(false);
+ try {
+ example(true);
+ } catch (Exception ignore) {
+ }
+
+ breakStatement();
+
+ catchNotExecuted();
+
+ emptyCatch();
+
+ twoRegions();
+
+ nested();
+
+ emptyTry();
+
+ alwaysCompletesAbruptly();
+ }
+
+}
diff --git a/org.jacoco.core.test/src/org/jacoco/core/test/filter/targets/Synchronized.java b/org.jacoco.core.test/src/org/jacoco/core/test/filter/targets/Synchronized.java
index 94030978..b2d503f8 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/test/filter/targets/Synchronized.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/test/filter/targets/Synchronized.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/test/filter/targets/Synthetic.java b/org.jacoco.core.test/src/org/jacoco/core/test/filter/targets/Synthetic.java
index 43826a8b..6e2f6266 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/test/filter/targets/Synthetic.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/test/filter/targets/Synthetic.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/test/perf/AnalysisTimeScenario.java b/org.jacoco.core.test/src/org/jacoco/core/test/perf/AnalysisTimeScenario.java
index 0fcabb25..41da19c2 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/test/perf/AnalysisTimeScenario.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/test/perf/AnalysisTimeScenario.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/test/perf/ExecuteInstrumentedCodeScenario.java b/org.jacoco.core.test/src/org/jacoco/core/test/perf/ExecuteInstrumentedCodeScenario.java
index 8e283ade..d199b0cb 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/test/perf/ExecuteInstrumentedCodeScenario.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/test/perf/ExecuteInstrumentedCodeScenario.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/test/perf/IPerfOutput.java b/org.jacoco.core.test/src/org/jacoco/core/test/perf/IPerfOutput.java
index e9633922..2298111e 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/test/perf/IPerfOutput.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/test/perf/IPerfOutput.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/test/perf/IPerfScenario.java b/org.jacoco.core.test/src/org/jacoco/core/test/perf/IPerfScenario.java
index 42fa951d..471b839b 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/test/perf/IPerfScenario.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/test/perf/IPerfScenario.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/test/perf/InstrumentationSizeSzenario.java b/org.jacoco.core.test/src/org/jacoco/core/test/perf/InstrumentationSizeSzenario.java
index c2a7b999..f11a39d5 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/test/perf/InstrumentationSizeSzenario.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/test/perf/InstrumentationSizeSzenario.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/test/perf/InstrumentationTimeScenario.java b/org.jacoco.core.test/src/org/jacoco/core/test/perf/InstrumentationTimeScenario.java
index 91c4a3f6..bf85f0c3 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/test/perf/InstrumentationTimeScenario.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/test/perf/InstrumentationTimeScenario.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/test/perf/PerfOutputWriter.java b/org.jacoco.core.test/src/org/jacoco/core/test/perf/PerfOutputWriter.java
index ceabde97..bba15e4b 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/test/perf/PerfOutputWriter.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/test/perf/PerfOutputWriter.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/test/perf/PerformanceSuite.java b/org.jacoco.core.test/src/org/jacoco/core/test/perf/PerformanceSuite.java
index 5a689c41..b0aa47be 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/test/perf/PerformanceSuite.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/test/perf/PerformanceSuite.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/test/perf/TimedScenario.java b/org.jacoco.core.test/src/org/jacoco/core/test/perf/TimedScenario.java
index 6688faf1..414a1ce7 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/test/perf/TimedScenario.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/test/perf/TimedScenario.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/test/perf/targets/Target01.java b/org.jacoco.core.test/src/org/jacoco/core/test/perf/targets/Target01.java
index 2e792342..4c9f2c21 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/test/perf/targets/Target01.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/test/perf/targets/Target01.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/test/perf/targets/Target02.java b/org.jacoco.core.test/src/org/jacoco/core/test/perf/targets/Target02.java
index 441866bb..0b79b52f 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/test/perf/targets/Target02.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/test/perf/targets/Target02.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/test/perf/targets/Target03.java b/org.jacoco.core.test/src/org/jacoco/core/test/perf/targets/Target03.java
index 46160c12..98470224 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/test/perf/targets/Target03.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/test/perf/targets/Target03.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/test/validation/AnnotationInitializerTest.java b/org.jacoco.core.test/src/org/jacoco/core/test/validation/AnnotationInitializerTest.java
index ce695d64..60a38339 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/test/validation/AnnotationInitializerTest.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/test/validation/AnnotationInitializerTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/test/validation/BadCycleClassTest.java b/org.jacoco.core.test/src/org/jacoco/core/test/validation/BadCycleClassTest.java
index ab759c37..aa646ddf 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/test/validation/BadCycleClassTest.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/test/validation/BadCycleClassTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/test/validation/BooleanExpressionsTest.java b/org.jacoco.core.test/src/org/jacoco/core/test/validation/BooleanExpressionsTest.java
index bebd7215..64dee474 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/test/validation/BooleanExpressionsTest.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/test/validation/BooleanExpressionsTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/test/validation/ClassFileVersionsTest.java b/org.jacoco.core.test/src/org/jacoco/core/test/validation/ClassFileVersionsTest.java
index 8465b833..d73fc642 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/test/validation/ClassFileVersionsTest.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/test/validation/ClassFileVersionsTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/test/validation/ClassInitializerTest.java b/org.jacoco.core.test/src/org/jacoco/core/test/validation/ClassInitializerTest.java
index 2bae651a..f87e705c 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/test/validation/ClassInitializerTest.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/test/validation/ClassInitializerTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/test/validation/Compiler.java b/org.jacoco.core.test/src/org/jacoco/core/test/validation/Compiler.java
index c15ae1f8..a273e845 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/test/validation/Compiler.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/test/validation/Compiler.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/test/validation/ControlStructuresTest.java b/org.jacoco.core.test/src/org/jacoco/core/test/validation/ControlStructuresTest.java
index 1c33521d..37db4c14 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/test/validation/ControlStructuresTest.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/test/validation/ControlStructuresTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/test/validation/CyclomaticComplexityTest.java b/org.jacoco.core.test/src/org/jacoco/core/test/validation/CyclomaticComplexityTest.java
index 575bf2ef..122612ce 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/test/validation/CyclomaticComplexityTest.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/test/validation/CyclomaticComplexityTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/test/validation/EnumImplicitMethodsTest.java b/org.jacoco.core.test/src/org/jacoco/core/test/validation/EnumImplicitMethodsTest.java
index 643b5991..fbd9e540 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/test/validation/EnumImplicitMethodsTest.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/test/validation/EnumImplicitMethodsTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/test/validation/ExceptionsTest.java b/org.jacoco.core.test/src/org/jacoco/core/test/validation/ExceptionsTest.java
index e1baec7d..c68bd374 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/test/validation/ExceptionsTest.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/test/validation/ExceptionsTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -15,27 +15,11 @@ import org.jacoco.core.analysis.ICounter;
import org.jacoco.core.test.validation.targets.Target03;
import org.junit.Test;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
/**
* Tests of exception based control flow.
*/
public class ExceptionsTest extends ValidationTestBase {
- /**
- * https://bugs.openjdk.java.net/browse/JDK-8180660
- */
- private static final boolean isJDK8u152;
- private static final boolean isJDK10;
-
- static {
- final Matcher m = Pattern.compile("1\\.8\\.0_(\\d++)(-ea)?")
- .matcher(System.getProperty("java.version"));
- isJDK8u152 = m.matches() && Integer.parseInt(m.group(1)) >= 152;
- isJDK10 = System.getProperty("java.version").startsWith("10");
- }
-
public ExceptionsTest() {
super(Target03.class);
}
@@ -109,45 +93,25 @@ public class ExceptionsTest extends ValidationTestBase {
ICounter.FULLY_COVERED);
// 7. Finally Block Without Exception Thrown
- // Finally block is yellow as the exception path is missing.
assertLine("noExceptionFinally.beforeBlock", ICounter.FULLY_COVERED);
assertLine("noExceptionFinally.tryBlock", ICounter.FULLY_COVERED);
assertLine("noExceptionFinally.finally",
- isJDKCompiler ? ICounter.EMPTY : ICounter.PARTLY_COVERED);
- assertLine("noExceptionFinally.finallyBlock", ICounter.PARTLY_COVERED);
- if (!isJDKCompiler) {
- assertLine("noExceptionFinally.finallyBlockEnd",
- ICounter.NOT_COVERED);
- } else if (isJDK8u152 || isJDK10) {
- assertLine("noExceptionFinally.finallyBlockEnd",
- ICounter.PARTLY_COVERED);
- } else {
- assertLine("noExceptionFinally.finallyBlockEnd",
- ICounter.FULLY_COVERED);
- }
+ isJDKCompiler ? ICounter.EMPTY : ICounter.FULLY_COVERED);
+ assertLine("noExceptionFinally.finallyBlock", ICounter.FULLY_COVERED);
+ assertLine("noExceptionFinally.finallyBlockEnd", ICounter.EMPTY);
assertLine("noExceptionFinally.afterBlock", ICounter.FULLY_COVERED);
// 8. Finally Block With Implicit Exception
- // Finally block is yellow as the non-exception path is missing.
assertLine("implicitExceptionFinally.beforeBlock",
ICounter.FULLY_COVERED);
assertLine("implicitExceptionFinally.before", ICounter.FULLY_COVERED);
assertLine("implicitExceptionFinally.exception", ICounter.NOT_COVERED);
assertLine("implicitExceptionFinally.after", ICounter.NOT_COVERED);
assertLine("implicitExceptionFinally.finally",
- isJDKCompiler ? ICounter.EMPTY : ICounter.PARTLY_COVERED);
+ isJDKCompiler ? ICounter.EMPTY : ICounter.NOT_COVERED);
assertLine("implicitExceptionFinally.finallyBlock",
- ICounter.PARTLY_COVERED);
- if (!isJDKCompiler) {
- assertLine("implicitExceptionFinally.finallyBlockEnd",
- ICounter.FULLY_COVERED);
- } else if (isJDK8u152 || isJDK10) {
- assertLine("implicitExceptionFinally.finallyBlockEnd",
- ICounter.PARTLY_COVERED);
- } else {
- assertLine("implicitExceptionFinally.finallyBlockEnd",
- ICounter.NOT_COVERED);
- }
+ ICounter.FULLY_COVERED);
+ assertLine("implicitExceptionFinally.finallyBlockEnd", ICounter.EMPTY);
assertLine("implicitExceptionFinally.afterBlock", ICounter.NOT_COVERED);
// 9. Finally Block With Exception Thrown Explicitly
@@ -159,13 +123,8 @@ public class ExceptionsTest extends ValidationTestBase {
isJDKCompiler ? ICounter.EMPTY : ICounter.FULLY_COVERED);
assertLine("explicitExceptionFinally.finallyBlock",
ICounter.FULLY_COVERED);
- if (!isJDKCompiler || isJDK8u152 || isJDK10) {
- assertLine("explicitExceptionFinally.finallyBlockEnd",
- ICounter.FULLY_COVERED);
- } else {
- assertLine("explicitExceptionFinally.finallyBlockEnd",
- ICounter.EMPTY);
- }
+ assertLine("explicitExceptionFinally.finallyBlockEnd",
+ isJDKCompiler ? ICounter.EMPTY : ICounter.FULLY_COVERED);
assertLine("explicitExceptionFinally.afterBlock", ICounter.EMPTY);
}
diff --git a/org.jacoco.core.test/src/org/jacoco/core/test/validation/ExplicitInitialFrameTest.java b/org.jacoco.core.test/src/org/jacoco/core/test/validation/ExplicitInitialFrameTest.java
index 9045bee5..1c0a02f1 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/test/validation/ExplicitInitialFrameTest.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/test/validation/ExplicitInitialFrameTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/test/validation/FieldInitializationInTwoConstructorsTest.java b/org.jacoco.core.test/src/org/jacoco/core/test/validation/FieldInitializationInTwoConstructorsTest.java
index 67f9e832..6896bf6d 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/test/validation/FieldInitializationInTwoConstructorsTest.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/test/validation/FieldInitializationInTwoConstructorsTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/test/validation/FramesTest.java b/org.jacoco.core.test/src/org/jacoco/core/test/validation/FramesTest.java
index afc4978f..35fdbf6a 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/test/validation/FramesTest.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/test/validation/FramesTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/test/validation/ImplicitDefaultConstructorTest.java b/org.jacoco.core.test/src/org/jacoco/core/test/validation/ImplicitDefaultConstructorTest.java
index 592623e7..09872e8d 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/test/validation/ImplicitDefaultConstructorTest.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/test/validation/ImplicitDefaultConstructorTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/test/validation/ImplicitFieldInitializationTest.java b/org.jacoco.core.test/src/org/jacoco/core/test/validation/ImplicitFieldInitializationTest.java
index b6bf91dd..769593d7 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/test/validation/ImplicitFieldInitializationTest.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/test/validation/ImplicitFieldInitializationTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/test/validation/InterfaceClassInitializerTest.java b/org.jacoco.core.test/src/org/jacoco/core/test/validation/InterfaceClassInitializerTest.java
index 1f01887d..5675dbb0 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/test/validation/InterfaceClassInitializerTest.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/test/validation/InterfaceClassInitializerTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/test/validation/PrivateEmptyDefaultConstructorTest.java b/org.jacoco.core.test/src/org/jacoco/core/test/validation/PrivateEmptyDefaultConstructorTest.java
index ac9b9271..1d144b7d 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/test/validation/PrivateEmptyDefaultConstructorTest.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/test/validation/PrivateEmptyDefaultConstructorTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/test/validation/ProbesBeforeSuperConstructorTest.java b/org.jacoco.core.test/src/org/jacoco/core/test/validation/ProbesBeforeSuperConstructorTest.java
index 95190dc2..88b1ae54 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/test/validation/ProbesBeforeSuperConstructorTest.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/test/validation/ProbesBeforeSuperConstructorTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/test/validation/ResizeInstructionsTest.java b/org.jacoco.core.test/src/org/jacoco/core/test/validation/ResizeInstructionsTest.java
index 913171ab..9ba6f613 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/test/validation/ResizeInstructionsTest.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/test/validation/ResizeInstructionsTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/test/validation/Source.java b/org.jacoco.core.test/src/org/jacoco/core/test/validation/Source.java
index 5bf4f86f..c04841e2 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/test/validation/Source.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/test/validation/Source.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/test/validation/SourceTest.java b/org.jacoco.core.test/src/org/jacoco/core/test/validation/SourceTest.java
index a5a78e92..6432c392 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/test/validation/SourceTest.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/test/validation/SourceTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/test/validation/StructuredLockingTest.java b/org.jacoco.core.test/src/org/jacoco/core/test/validation/StructuredLockingTest.java
index ef95e591..5640fdc7 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/test/validation/StructuredLockingTest.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/test/validation/StructuredLockingTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -40,11 +40,16 @@ import org.objectweb.asm.tree.analysis.Frame;
import org.objectweb.asm.tree.analysis.Interpreter;
/**
- * Tests that the invariants specified in chapter 2.11.10 of the JVM Spec do
- * also hold for instrumented classes. Note that only some runtimes like Android
- * ART do actually check these invariants.
+ * Tests that the invariants specified in <a href=
+ * "https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-2.html#jvms-2.11.10">chapter
+ * 2.11.10 of the JVM Spec</a> do also hold for instrumented classes.
*
- * https://docs.oracle.com/javase/specs/jvms/se7/html/jvms-2.html#jvms-2.11.10
+ * This is important because JIT compiler in HotSpot JVM ignores methods with
+ * unstructured locking, so that they executed by interpreter. Android Runtime
+ * also doesn't optimize such methods.
+ *
+ * TODO verification implemented here is incomplete - in particular it is unable
+ * to catch problem described in https://github.com/jacoco/jacoco/issues/626
*/
public class StructuredLockingTest {
diff --git a/org.jacoco.core.test/src/org/jacoco/core/test/validation/ValidationTestBase.java b/org.jacoco.core.test/src/org/jacoco/core/test/validation/ValidationTestBase.java
index c8693f97..d7a2fd0b 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/test/validation/ValidationTestBase.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/test/validation/ValidationTestBase.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/AnnotationInitializer.java b/org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/AnnotationInitializer.java
index 9efae8c1..f7b9e0af 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/AnnotationInitializer.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/AnnotationInitializer.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/BadCycleClass.java b/org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/BadCycleClass.java
index 0044004d..c1826646 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/BadCycleClass.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/BadCycleClass.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/EnumImplicitMethods.java b/org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/EnumImplicitMethods.java
index 69a2ed9f..afbc46fd 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/EnumImplicitMethods.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/EnumImplicitMethods.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Stubs.java b/org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Stubs.java
index 97b49e4b..372af224 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Stubs.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Stubs.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -108,6 +108,15 @@ public class Stubs {
}
/**
+ * Throws a {@link RuntimeException} if given argument is <code>true</code>.
+ */
+ public static void ex(boolean t) {
+ if (t) {
+ throw new StubException();
+ }
+ }
+
+ /**
* Directly executes the given runnable.
*/
public static void exec(Runnable task) {
diff --git a/org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Target01.java b/org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Target01.java
index 411691b8..81d00fa5 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Target01.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Target01.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Target02.java b/org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Target02.java
index e8ca4da5..62e22ef9 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Target02.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Target02.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Target03.java b/org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Target03.java
index 195d1f38..b4418edd 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Target03.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Target03.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Target04.java b/org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Target04.java
index d64d25dd..8384744b 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Target04.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Target04.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Target05.java b/org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Target05.java
index fc06538b..ef5c3989 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Target05.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Target05.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Target06.java b/org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Target06.java
index 64a283b6..f6bc75e8 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Target06.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Target06.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Target07.java b/org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Target07.java
index 96a7c581..18c3ba52 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Target07.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Target07.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Target08.java b/org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Target08.java
index bdece3ff..1fe938aa 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Target08.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Target08.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Target09.java b/org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Target09.java
index 444d89d0..a8589d1d 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Target09.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Target09.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Target10.java b/org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Target10.java
index d07981eb..bb4496e9 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Target10.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Target10.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Target11.java b/org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Target11.java
index b03d952b..d393cb7f 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Target11.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Target11.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Target12.java b/org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Target12.java
index 5c7bc57b..5ee2e324 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Target12.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Target12.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/tools/ExecDumpClientTest.java b/org.jacoco.core.test/src/org/jacoco/core/tools/ExecDumpClientTest.java
index d0f21f98..591d032f 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/tools/ExecDumpClientTest.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/tools/ExecDumpClientTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/org.jacoco.core.test/src/org/jacoco/core/tools/ExecFileLoaderTest.java b/org.jacoco.core.test/src/org/jacoco/core/tools/ExecFileLoaderTest.java
index dc2d44ef..d825910f 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/tools/ExecFileLoaderTest.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/tools/ExecFileLoaderTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 Mountainminds GmbH & Co. KG and Contributors
+ * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at