Skip to content

Commit

Permalink
7903355: JMH: Drop support for JDK 7
Browse files Browse the repository at this point in the history
  • Loading branch information
shipilev authored Oct 20, 2022
1 parent 0cffac9 commit 0c68719
Show file tree
Hide file tree
Showing 59 changed files with 127 additions and 216 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pre-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
java: [7, 8, 11, 17, 19-ea]
java: [8, 11, 17, 19-ea]
os: [ubuntu-20.04, windows-2022, macos-11]
profile: [default, reflection, asm]
fail-fast: false
Expand Down
5 changes: 0 additions & 5 deletions jmh-core-benchmarks/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,6 @@ questions.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<compilerVersion>1.7</compilerVersion>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public void prepare() {
longs[c] = c;
doubles[c] = c;
objects[c] = (double) c;
arrays[c] = new Double[]{Double.valueOf(c)};
arrays[c] = new Double[]{(double) c};
}
}

Expand Down
3 changes: 0 additions & 3 deletions jmh-core-ct/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,6 @@ questions.
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<compilerVersion>1.7</compilerVersion>
<source>1.7</source>
<target>1.7</target>
<compilerArgument>-proc:none</compilerArgument>
</configuration>
</plugin>
Expand Down
11 changes: 0 additions & 11 deletions jmh-core-it/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,6 @@ questions.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<compilerVersion>1.7</compilerVersion>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
Expand All @@ -148,9 +143,6 @@ questions.
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<compilerVersion>1.7</compilerVersion>
<source>1.7</source>
<target>1.7</target>
<compilerArgument>-proc:none</compilerArgument>
</configuration>
<executions>
Expand Down Expand Up @@ -235,9 +227,6 @@ questions.
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<compilerVersion>1.7</compilerVersion>
<source>1.7</source>
<target>1.7</target>
<compilerArgument>-proc:none</compilerArgument>
</configuration>
<executions>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@
@Fork(1)
public class ExactThreadCountTest {

private final Set<Thread> test1threads = Collections.synchronizedSet(new HashSet<Thread>());
private final Set<Thread> test2threads = Collections.synchronizedSet(new HashSet<Thread>());
private final Set<Thread> test1threads = Collections.synchronizedSet(new HashSet<>());
private final Set<Thread> test2threads = Collections.synchronizedSet(new HashSet<>());

@Setup(Level.Iteration)
public void setup() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@
@Fork(1)
public class Zero1ThreadCountTest {

private final Set<Thread> test1threads = Collections.synchronizedSet(new HashSet<Thread>());
private final Set<Thread> test2threads = Collections.synchronizedSet(new HashSet<Thread>());
private final Set<Thread> test1threads = Collections.synchronizedSet(new HashSet<>());
private final Set<Thread> test2threads = Collections.synchronizedSet(new HashSet<>());

@TearDown
public void check() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@
@Fork(1)
public class Zero2ThreadCountTest {

private final Set<Thread> test1threads = Collections.synchronizedSet(new HashSet<Thread>());
private final Set<Thread> test2threads = Collections.synchronizedSet(new HashSet<Thread>());
private final Set<Thread> test1threads = Collections.synchronizedSet(new HashSet<>());
private final Set<Thread> test2threads = Collections.synchronizedSet(new HashSet<>());

@TearDown
public void check() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,13 @@ public class ForkedStuckShutdownHookTest {
@Setup
public void setup() {
Runtime.getRuntime().addShutdownHook(
new Thread() {
@Override
public void run() {
try {
TimeUnit.DAYS.sleep(1);
} catch (InterruptedException e) {
e.printStackTrace();
}
new Thread(() -> {
try {
TimeUnit.DAYS.sleep(1);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
})
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,11 @@ public class ForkedStuckThreadTest {

@Setup
public void setup() {
Thread t = new Thread(new Runnable() {
@Override
public void run() {
try {
TimeUnit.DAYS.sleep(1);
} catch (InterruptedException e) {
e.printStackTrace();
}
Thread t = new Thread(() -> {
try {
TimeUnit.DAYS.sleep(1);
} catch (InterruptedException e) {
e.printStackTrace();
}
});
t.setDaemon(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public class BenchmarkParamsTest {

@Setup(Level.Iteration)
public void setup() {
set = Collections.synchronizedSet(Collections.newSetFromMap(new IdentityHashMap<BenchmarkParams, Boolean>()));
set = Collections.synchronizedSet(Collections.newSetFromMap(new IdentityHashMap<>()));
}

@TearDown(Level.Iteration)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public class IterationParamsTest {

@Setup(Level.Iteration)
public void setup() {
set = Collections.synchronizedSet(Collections.newSetFromMap(new IdentityHashMap<IterationParams, Boolean>()));
set = Collections.synchronizedSet(Collections.newSetFromMap(new IdentityHashMap<>()));
}

@TearDown(Level.Iteration)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public class ThreadParamsTest {

@Setup(Level.Iteration)
public void setup() {
set = Collections.synchronizedSet(Collections.newSetFromMap(new IdentityHashMap<ThreadParams, Boolean>()));
set = Collections.synchronizedSet(Collections.newSetFromMap(new IdentityHashMap<>()));
}

@TearDown(Level.Iteration)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
@State(Scope.Benchmark)
public class BenchmarkBenchSharingTest {

final Set<Thread> visitors = Collections.synchronizedSet(new HashSet<Thread>());
final Set<Thread> visitors = Collections.synchronizedSet(new HashSet<>());

@TearDown(Level.Trial)
public void tearDown() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public class BenchmarkStateSharingTest {

@State(Scope.Benchmark)
public static class MyState {
final Set<Thread> visitors = Collections.synchronizedSet(new HashSet<Thread>());
final Set<Thread> visitors = Collections.synchronizedSet(new HashSet<>());

@TearDown(Level.Trial)
public void tearDown() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
@State(Scope.Group)
public class GroupBenchSharingTest {

final Set<Thread> visitors = Collections.synchronizedSet(new HashSet<Thread>());
final Set<Thread> visitors = Collections.synchronizedSet(new HashSet<>());

@TearDown(Level.Trial)
public void tearDown() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
@State(Scope.Group)
public class GroupDefaultBenchSharingTest {

final Set<Thread> visitors = Collections.synchronizedSet(new HashSet<Thread>());
final Set<Thread> visitors = Collections.synchronizedSet(new HashSet<>());

@TearDown(Level.Trial)
public void tearDown() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public class GroupDefaultStateSharingTest {

@State(Scope.Group)
public static class MyState {
final Set<Thread> visitors = Collections.synchronizedSet(new HashSet<Thread>());
final Set<Thread> visitors = Collections.synchronizedSet(new HashSet<>());

@TearDown(Level.Trial)
public void tearDown() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public class GroupStateSharingTest {

@State(Scope.Group)
public static class MyState {
final Set<Thread> visitors = Collections.synchronizedSet(new HashSet<Thread>());
final Set<Thread> visitors = Collections.synchronizedSet(new HashSet<>());

@TearDown(Level.Trial)
public void tearDown() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
@State(Scope.Thread)
public class ThreadBenchSharingTest {

final Set<Thread> visitors = Collections.synchronizedSet(new HashSet<Thread>());
final Set<Thread> visitors = Collections.synchronizedSet(new HashSet<>());

@TearDown(Level.Trial)
public void tearDown() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public class ThreadStateSharingTest {

@State(Scope.Thread)
public static class MyState {
final Set<Thread> visitors = Collections.synchronizedSet(new HashSet<Thread>());
final Set<Thread> visitors = Collections.synchronizedSet(new HashSet<>());

@TearDown(Level.Trial)
public void tearDown() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@
@State(Scope.Benchmark)
public class BenchmarkBenchSameThreadTest {

private final Set<Thread> setupRunThread = Collections.synchronizedSet(new HashSet<Thread>());
private final Set<Thread> setupIterationThread = Collections.synchronizedSet(new HashSet<Thread>());
private final Set<Thread> setupInvocationThread = Collections.synchronizedSet(new HashSet<Thread>());
private final Set<Thread> teardownRunThread = Collections.synchronizedSet(new HashSet<Thread>());
private final Set<Thread> teardownIterationThread = Collections.synchronizedSet(new HashSet<Thread>());
private final Set<Thread> teardownInvocationThread = Collections.synchronizedSet(new HashSet<Thread>());
private final Set<Thread> testInvocationThread = Collections.synchronizedSet(new HashSet<Thread>());
private final Set<Thread> setupRunThread = Collections.synchronizedSet(new HashSet<>());
private final Set<Thread> setupIterationThread = Collections.synchronizedSet(new HashSet<>());
private final Set<Thread> setupInvocationThread = Collections.synchronizedSet(new HashSet<>());
private final Set<Thread> teardownRunThread = Collections.synchronizedSet(new HashSet<>());
private final Set<Thread> teardownIterationThread = Collections.synchronizedSet(new HashSet<>());
private final Set<Thread> teardownInvocationThread = Collections.synchronizedSet(new HashSet<>());
private final Set<Thread> testInvocationThread = Collections.synchronizedSet(new HashSet<>());

@Setup(Level.Trial)
public void setupRun() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ public class BenchmarkStateSameThreadTest {
@State(Scope.Benchmark)
public static class MyState {

private final Set<Thread> setupRunThread = Collections.synchronizedSet(new HashSet<Thread>());
private final Set<Thread> setupIterationThread = Collections.synchronizedSet(new HashSet<Thread>());
private final Set<Thread> setupInvocationThread = Collections.synchronizedSet(new HashSet<Thread>());
private final Set<Thread> teardownRunThread = Collections.synchronizedSet(new HashSet<Thread>());
private final Set<Thread> teardownIterationThread = Collections.synchronizedSet(new HashSet<Thread>());
private final Set<Thread> teardownInvocationThread = Collections.synchronizedSet(new HashSet<Thread>());
private final Set<Thread> testInvocationThread = Collections.synchronizedSet(new HashSet<Thread>());
private final Set<Thread> setupRunThread = Collections.synchronizedSet(new HashSet<>());
private final Set<Thread> setupIterationThread = Collections.synchronizedSet(new HashSet<>());
private final Set<Thread> setupInvocationThread = Collections.synchronizedSet(new HashSet<>());
private final Set<Thread> teardownRunThread = Collections.synchronizedSet(new HashSet<>());
private final Set<Thread> teardownIterationThread = Collections.synchronizedSet(new HashSet<>());
private final Set<Thread> teardownInvocationThread = Collections.synchronizedSet(new HashSet<>());
private final Set<Thread> testInvocationThread = Collections.synchronizedSet(new HashSet<>());

@Setup(Level.Trial)
public void setupRun() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,13 @@
@State(Scope.Group)
public class GroupBenchSameThreadTest {

private final Set<Thread> setupRunThread = Collections.synchronizedSet(new HashSet<Thread>());
private final Set<Thread> setupIterationThread = Collections.synchronizedSet(new HashSet<Thread>());
private final Set<Thread> setupInvocationThread = Collections.synchronizedSet(new HashSet<Thread>());
private final Set<Thread> teardownRunThread = Collections.synchronizedSet(new HashSet<Thread>());
private final Set<Thread> teardownIterationThread = Collections.synchronizedSet(new HashSet<Thread>());
private final Set<Thread> teardownInvocationThread = Collections.synchronizedSet(new HashSet<Thread>());
private final Set<Thread> testInvocationThread = Collections.synchronizedSet(new HashSet<Thread>());
private final Set<Thread> setupRunThread = Collections.synchronizedSet(new HashSet<>());
private final Set<Thread> setupIterationThread = Collections.synchronizedSet(new HashSet<>());
private final Set<Thread> setupInvocationThread = Collections.synchronizedSet(new HashSet<>());
private final Set<Thread> teardownRunThread = Collections.synchronizedSet(new HashSet<>());
private final Set<Thread> teardownIterationThread = Collections.synchronizedSet(new HashSet<>());
private final Set<Thread> teardownInvocationThread = Collections.synchronizedSet(new HashSet<>());
private final Set<Thread> testInvocationThread = Collections.synchronizedSet(new HashSet<>());

@Setup(Level.Trial)
public void setupRun() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,13 @@ public class GroupStateSameThreadTest {
@State(Scope.Group)
public static class MyState {

private final Set<Thread> setupRunThread = Collections.synchronizedSet(new HashSet<Thread>());
private final Set<Thread> setupIterationThread = Collections.synchronizedSet(new HashSet<Thread>());
private final Set<Thread> setupInvocationThread = Collections.synchronizedSet(new HashSet<Thread>());
private final Set<Thread> teardownRunThread = Collections.synchronizedSet(new HashSet<Thread>());
private final Set<Thread> teardownIterationThread = Collections.synchronizedSet(new HashSet<Thread>());
private final Set<Thread> teardownInvocationThread = Collections.synchronizedSet(new HashSet<Thread>());
private final Set<Thread> testInvocationThread = Collections.synchronizedSet(new HashSet<Thread>());
private final Set<Thread> setupRunThread = Collections.synchronizedSet(new HashSet<>());
private final Set<Thread> setupIterationThread = Collections.synchronizedSet(new HashSet<>());
private final Set<Thread> setupInvocationThread = Collections.synchronizedSet(new HashSet<>());
private final Set<Thread> teardownRunThread = Collections.synchronizedSet(new HashSet<>());
private final Set<Thread> teardownIterationThread = Collections.synchronizedSet(new HashSet<>());
private final Set<Thread> teardownInvocationThread = Collections.synchronizedSet(new HashSet<>());
private final Set<Thread> testInvocationThread = Collections.synchronizedSet(new HashSet<>());

@Setup(Level.Trial)
public void setupRun() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@
@State(Scope.Group)
public class GroupThreadGroupOrderTest {

private final Set<Thread> abc = Collections.synchronizedSet(new HashSet<Thread>());
private final Set<Thread> def = Collections.synchronizedSet(new HashSet<Thread>());
private final Set<Thread> ghi = Collections.synchronizedSet(new HashSet<Thread>());
private final Set<Thread> abc = Collections.synchronizedSet(new HashSet<>());
private final Set<Thread> def = Collections.synchronizedSet(new HashSet<>());
private final Set<Thread> ghi = Collections.synchronizedSet(new HashSet<>());

@Setup(Level.Iteration)
public void prepare() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
@State(Scope.Benchmark)
public class MaxThreadCountTest {

private final Set<Thread> threads = Collections.synchronizedSet(new HashSet<Thread>());
private final Set<Thread> threads = Collections.synchronizedSet(new HashSet<>());

@TearDown(Level.Iteration)
public void tearDown() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
@State(Scope.Benchmark)
public class OneThreadCountTest {

private final Set<Thread> threads = Collections.synchronizedSet(new HashSet<Thread>());
private final Set<Thread> threads = Collections.synchronizedSet(new HashSet<>());

@TearDown(Level.Iteration)
public void tearDown() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
@State(Scope.Benchmark)
public class TwoThreadCountTest {

private final Set<Thread> threads = Collections.synchronizedSet(new HashSet<Thread>());
private final Set<Thread> threads = Collections.synchronizedSet(new HashSet<>());

@TearDown(Level.Iteration)
public void tearDown() {
Expand Down
3 changes: 0 additions & 3 deletions jmh-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,6 @@ questions.
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<compilerVersion>1.7</compilerVersion>
<source>1.7</source>
<target>1.7</target>
<fork>true</fork>
<compilerArgs>
<arg>-proc:none</arg>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,7 @@ class CompilerControlPlugin {

private final SortedSet<String> lines = new TreeSet<>();

private final Set<MethodInfo> defaultForceInlineMethods = new TreeSet<>(new Comparator<MethodInfo>() {
@Override
public int compare(MethodInfo o1, MethodInfo o2) {
return o1.getQualifiedName().compareTo(o2.getQualifiedName());
}
});
private final Set<MethodInfo> defaultForceInlineMethods = new TreeSet<>(Comparator.comparing(MethodInfo::getQualifiedName));

private final Set<String> alwaysDontInlineMethods = new TreeSet<>();

Expand Down
Loading

0 comments on commit 0c68719

Please sign in to comment.