diff --git a/common.json b/common.json index 500a16f186d7..2ad62cc0e20d 100644 --- a/common.json +++ b/common.json @@ -4,7 +4,7 @@ "Jsonnet files should not include this file directly but use ci/common.jsonnet instead." ], - "mx_version": "7.36.1", + "mx_version": "7.36.5", "COMMENT.jdks": "When adding or removing JDKs keep in sync with JDKs in ci/common.jsonnet", "jdks": { diff --git a/compiler/mx.compiler/suite.py b/compiler/mx.compiler/suite.py index a85fe56f4aed..44e3d98e945d 100644 --- a/compiler/mx.compiler/suite.py +++ b/compiler/mx.compiler/suite.py @@ -212,7 +212,7 @@ "GRAAL_PROCESSOR" ], "checkPackagePrefix": "false", - "checkstyleVersion" : "10.7.0", + "checkstyleVersion" : "10.21.0", "javaCompliance" : "21+", "workingSets" : "API,Graal", "jacoco" : "include", diff --git a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/api/directives/test/BlackholeDirectiveTest.java b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/api/directives/test/BlackholeDirectiveTest.java index 470411b99ec6..f1b4efbf59f5 100644 --- a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/api/directives/test/BlackholeDirectiveTest.java +++ b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/api/directives/test/BlackholeDirectiveTest.java @@ -103,7 +103,7 @@ public void testInt() { test("blackholeIntSnippet", 17); } - private static class Dummy { + private static final class Dummy { private int x = 42; } diff --git a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/api/directives/test/OpaqueDirectiveTest.java b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/api/directives/test/OpaqueDirectiveTest.java index 18c06d2f9a18..be08f1d885f5 100644 --- a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/api/directives/test/OpaqueDirectiveTest.java +++ b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/api/directives/test/OpaqueDirectiveTest.java @@ -108,7 +108,7 @@ public void testDouble() { test("opaqueDoubleSnippet"); } - private static class Dummy { + private static final class Dummy { } @OpaqueSnippet(expectedReturnNode = ConstantNode.class) diff --git a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/core/test/CompilationResultTest.java b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/core/test/CompilationResultTest.java index 85f6fe07db0d..5b29279d32b7 100644 --- a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/core/test/CompilationResultTest.java +++ b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/core/test/CompilationResultTest.java @@ -77,7 +77,7 @@ public void testCompilationResult() { assertTrue(result.toString().length() > 0); // test for NPE } - private static class TestMarkId implements CompilationResult.MarkId { + private static final class TestMarkId implements CompilationResult.MarkId { @Override public String getName() { return "test"; diff --git a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/core/test/ConditionalEliminationTest10.java b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/core/test/ConditionalEliminationTest10.java index 26503412dc8d..09cbb937c293 100644 --- a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/core/test/ConditionalEliminationTest10.java +++ b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/core/test/ConditionalEliminationTest10.java @@ -47,7 +47,7 @@ public class ConditionalEliminationTest10 extends ConditionalEliminationTestBase private static boolean condition1; private static boolean condition2; - private static class TestClass { + private static final class TestClass { int x; } diff --git a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/core/test/DegeneratedLoopsTest.java b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/core/test/DegeneratedLoopsTest.java index b0510d27c01e..85dac4c9af79 100644 --- a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/core/test/DegeneratedLoopsTest.java +++ b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/core/test/DegeneratedLoopsTest.java @@ -50,7 +50,7 @@ public void test1() { test("test1Snippet"); } - private static class UnresolvedException extends RuntimeException { + private static final class UnresolvedException extends RuntimeException { private static final long serialVersionUID = 5215434338750728440L; diff --git a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/core/test/NodePropertiesTest.java b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/core/test/NodePropertiesTest.java index 572ff76d3881..bafad149d11f 100644 --- a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/core/test/NodePropertiesTest.java +++ b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/core/test/NodePropertiesTest.java @@ -318,7 +318,7 @@ public void simplify(Node node, SimplifierTool tool) { } } - private static class GraphCostPhase extends TestBasePhase { + private static final class GraphCostPhase extends TestBasePhase { private double finalCycles; private double finalSize; diff --git a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/core/test/VerifyAssertionUsageTest.java b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/core/test/VerifyAssertionUsageTest.java index 3cadb2349bf9..e1bd5c39d6ab 100644 --- a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/core/test/VerifyAssertionUsageTest.java +++ b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/core/test/VerifyAssertionUsageTest.java @@ -87,7 +87,7 @@ public static void afterClass() { /** * Valid call with an assertion message. */ - private static class ValidAssertUsage1 extends TestPhase { + private static final class ValidAssertUsage1 extends TestPhase { @Override protected void run(StructuredGraph graph) { assert graph.hasLoops() : "Must have loops"; @@ -98,7 +98,7 @@ protected void run(StructuredGraph graph) { * Valid call with a trivial condition. Null check is trivial in that if it fails the error is * "clear" to spot by inspecting the code. */ - private static class ValidAssertUsage2 extends TestPhase { + private static final class ValidAssertUsage2 extends TestPhase { @Override protected void run(StructuredGraph graph) { assert graph != null; @@ -108,7 +108,7 @@ protected void run(StructuredGraph graph) { /** * Valid usage of known assertion methods that are always safe to call. */ - private static class ValidAssertUsage3 extends TestPhase { + private static final class ValidAssertUsage3 extends TestPhase { @Override protected void run(StructuredGraph graph) { assert GraphOrder.assertSchedulableGraph(graph); @@ -119,7 +119,7 @@ protected void run(StructuredGraph graph) { /** * Invalid assertion call: missing assertion message. */ - private static class InvalidAssertUsage extends TestPhase { + private static final class InvalidAssertUsage extends TestPhase { @Override protected void run(StructuredGraph graph) { assert graph.hasLoops(); @@ -131,7 +131,7 @@ protected void run(StructuredGraph graph) { * further but call further eventually calls a method with an assertion error message so the * assertion usage is correct several levels down the call graph. */ - private static class ValidCallGraphUsage1 extends TestPhase { + private static final class ValidCallGraphUsage1 extends TestPhase { @Override protected void run(StructuredGraph graph) { assert verifyGraph(graph); @@ -160,7 +160,7 @@ private static boolean callFurther1(StructuredGraph g) { * Invalid call: call further is missing the assertion message and run calls callFurther so this * is a missing assertion message 1 level down the call graph. */ - private static class InvalidCallGraphUsage1 extends TestPhase { + private static final class InvalidCallGraphUsage1 extends TestPhase { @Override protected void run(StructuredGraph graph) { assert callFurther(graph); @@ -182,7 +182,7 @@ private static boolean callFurther(StructuredGraph g) { * Invalid call graph usage: multiple calls to methods without an error message a second level * down the call graph. */ - private static class InvalidCallGraphUsage2 extends TestPhase { + private static final class InvalidCallGraphUsage2 extends TestPhase { @Override protected void run(StructuredGraph graph) { assert callFurther(graph); @@ -207,7 +207,7 @@ private static boolean callFurther(StructuredGraph g) { * superfluous: callFurther does assertion checking and will always return true - thus the error * message in run is never used. */ - private static class InvalidCallGraphUsage3 extends TestPhase { + private static final class InvalidCallGraphUsage3 extends TestPhase { @Override protected void run(StructuredGraph graph) { assert callFurther(graph) : "Invalid superfluous message"; @@ -235,7 +235,7 @@ private static boolean callFurther1(StructuredGraph g) { /** * Same as {@link InvalidCallGraphUsage3} but without multiple levels. */ - private static class InvalidCallGraphUsage31 extends TestPhase { + private static final class InvalidCallGraphUsage31 extends TestPhase { @Override protected void run(StructuredGraph graph) { assert verifyGraph(graph) : "Invalid superfluous message"; @@ -254,7 +254,7 @@ private static boolean verifyGraph(StructuredGraph graph) { * the caller. Specifically assertSth has a return false path that would fire the error in the * caller run without a message. */ - private static class InvalidCallGraphUsage4 extends TestPhase { + private static final class InvalidCallGraphUsage4 extends TestPhase { @Override protected void run(StructuredGraph graph) { assert assertSth(graph); @@ -282,7 +282,7 @@ private static boolean assertSth1(StructuredGraph g) { /** * Invalid assertion usage: the path doSth() does not assert anything. */ - private static class InvalidCallGraphUsage5 extends TestPhase { + private static final class InvalidCallGraphUsage5 extends TestPhase { @Override protected void run(StructuredGraph graph) { assert assertSth(graph); @@ -304,7 +304,7 @@ static void doSth() { * - the paths where they are missing them is loop iterations so those are fine. They still * return {@code true} on all paths. */ - private static class ValidCallGraphUsage5 extends TestPhase { + private static final class ValidCallGraphUsage5 extends TestPhase { @Override protected void run(StructuredGraph graph) { assert assertSth(graph); @@ -339,7 +339,7 @@ private static boolean assertSth2(StructuredGraph g) { * Correct assertion usage: calling another method not via an assert but regularly where that * method itself calls an assertion. */ - private static class ValidCallGraphUsage6 extends TestPhase { + private static final class ValidCallGraphUsage6 extends TestPhase { @Override protected void run(StructuredGraph graph) { assert assertSth(graph); diff --git a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/core/test/VerifyBailoutUsageTest.java b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/core/test/VerifyBailoutUsageTest.java index a6dcc7c721e6..fe4a62b987de 100644 --- a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/core/test/VerifyBailoutUsageTest.java +++ b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/core/test/VerifyBailoutUsageTest.java @@ -53,35 +53,35 @@ public class VerifyBailoutUsageTest { - private static class InvalidBailoutUsagePhase1 extends TestPhase { + private static final class InvalidBailoutUsagePhase1 extends TestPhase { @Override protected void run(StructuredGraph graph) { throw new BailoutException("Bailout in graph %s", graph); } } - private static class InvalidBailoutUsagePhase2 extends TestPhase { + private static final class InvalidBailoutUsagePhase2 extends TestPhase { @Override protected void run(StructuredGraph graph) { throw new BailoutException(new GraalError("other cause"), "Bailout in graph %s", graph); } } - private static class InvalidBailoutUsagePhase3 extends TestPhase { + private static final class InvalidBailoutUsagePhase3 extends TestPhase { @Override protected void run(StructuredGraph graph) { throw new BailoutException(true/* permanent */, "Bailout in graph %s", graph); } } - private static class ValidPermanentBailoutUsage extends TestPhase { + private static final class ValidPermanentBailoutUsage extends TestPhase { @Override protected void run(StructuredGraph graph) { throw new PermanentBailoutException("Valid permanent bailout %s", graph); } } - private static class ValidRetryableBailoutUsage extends TestPhase { + private static final class ValidRetryableBailoutUsage extends TestPhase { @Override protected void run(StructuredGraph graph) { throw new RetryableBailoutException("Valid retryable bailout %s", graph); diff --git a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/core/test/VerifyDebugUsageTest.java b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/core/test/VerifyDebugUsageTest.java index d7500c7263f3..e3982f327814 100644 --- a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/core/test/VerifyDebugUsageTest.java +++ b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/core/test/VerifyDebugUsageTest.java @@ -54,7 +54,7 @@ public class VerifyDebugUsageTest { - private static class InvalidLogUsagePhase extends TestPhase { + private static final class InvalidLogUsagePhase extends TestPhase { @Override protected void run(StructuredGraph graph) { DebugContext debug = graph.getDebug(); @@ -65,7 +65,7 @@ protected void run(StructuredGraph graph) { } - private static class InvalidLogAndIndentUsagePhase extends TestPhase { + private static final class InvalidLogAndIndentUsagePhase extends TestPhase { @Override @SuppressWarnings("try") protected void run(StructuredGraph graph) { @@ -107,7 +107,7 @@ int getLevel() { } } - private static class InvalidVerifyUsagePhase extends TestPhase { + private static final class InvalidVerifyUsagePhase extends TestPhase { @Override protected void run(StructuredGraph graph) { DebugContext debug = graph.getDebug(); @@ -116,7 +116,7 @@ protected void run(StructuredGraph graph) { } - private static class InvalidConcatLogUsagePhase extends TestPhase { + private static final class InvalidConcatLogUsagePhase extends TestPhase { @Override protected void run(StructuredGraph graph) { DebugContext debug = graph.getDebug(); @@ -127,7 +127,7 @@ protected void run(StructuredGraph graph) { } - private static class InvalidConcatLogAndIndentUsagePhase extends TestPhase { + private static final class InvalidConcatLogAndIndentUsagePhase extends TestPhase { @Override @SuppressWarnings("try") protected void run(StructuredGraph graph) { @@ -218,14 +218,14 @@ protected void run(StructuredGraph graph) { public static Object sideEffect; - private static class InvalidGraalErrorCtorPhase extends TestPhase { + private static final class InvalidGraalErrorCtorPhase extends TestPhase { @Override protected void run(StructuredGraph graph) { sideEffect = new GraalError("No Error %s", graph.toString()); } } - private static class ValidGraalErrorCtorPhase extends TestPhase { + private static final class ValidGraalErrorCtorPhase extends TestPhase { @Override protected void run(StructuredGraph graph) { sideEffect = new GraalError("Error %s", graph); diff --git a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/core/test/deopt/MonitorDeoptTest.java b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/core/test/deopt/MonitorDeoptTest.java index cf7683a30e75..6da74c71b219 100644 --- a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/core/test/deopt/MonitorDeoptTest.java +++ b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/core/test/deopt/MonitorDeoptTest.java @@ -55,7 +55,7 @@ private enum State { static final long TIMEOUT = 5000; - private static class Monitor { + private static final class Monitor { private volatile State state = State.INITIAL; public synchronized void setState(State newState) { diff --git a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/core/test/inlining/ImpreciseArgumentStampInliningTest.java b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/core/test/inlining/ImpreciseArgumentStampInliningTest.java index 798c6cf70f8f..fa30902e6923 100644 --- a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/core/test/inlining/ImpreciseArgumentStampInliningTest.java +++ b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/core/test/inlining/ImpreciseArgumentStampInliningTest.java @@ -60,7 +60,7 @@ */ public class ImpreciseArgumentStampInliningTest extends GraalCompilerTest { - private static class InlineMethodHolder { + private static final class InlineMethodHolder { static void inlineMe(UnresolveableClass argument) { GraalDirectives.blackhole(argument); } @@ -76,7 +76,7 @@ public static void snippet() { } // Will be unresolved during bytecode parsing, and resolved during inlining. - private static class UnresolveableClass { + private static final class UnresolveableClass { } @Test diff --git a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/hotspot/test/ArrayNewInstanceTest.java b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/hotspot/test/ArrayNewInstanceTest.java index 37f056cd11e1..5eb83da96799 100644 --- a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/hotspot/test/ArrayNewInstanceTest.java +++ b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/hotspot/test/ArrayNewInstanceTest.java @@ -102,7 +102,7 @@ public void testNewArrayInLoop() { assertTrue(box.inCompiledCode != shouldDeopt); } - private static class DeoptimizationBox { + private static final class DeoptimizationBox { volatile boolean inCompiledCode = false; } diff --git a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/hotspot/test/ClassSubstitutionsTests.java b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/hotspot/test/ClassSubstitutionsTests.java index d95354cae749..779bcad01c0c 100644 --- a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/hotspot/test/ClassSubstitutionsTests.java +++ b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/hotspot/test/ClassSubstitutionsTests.java @@ -208,10 +208,10 @@ public boolean fieldIsArray() { private static class A { } - private static class B extends A { + private static final class B extends A { } - private static class C { + private static final class C { } private static final A aInstance = new A(); diff --git a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/hotspot/test/ExplicitExceptionTest.java b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/hotspot/test/ExplicitExceptionTest.java index 74216599fea2..0980a6447ede 100644 --- a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/hotspot/test/ExplicitExceptionTest.java +++ b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/hotspot/test/ExplicitExceptionTest.java @@ -102,7 +102,7 @@ public void testNPEArray() { test("testNPEArraySnippet", array); } - private static class TestClass { + private static final class TestClass { int field; } diff --git a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/hotspot/test/HotSpotMethodSubstitutionTest.java b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/hotspot/test/HotSpotMethodSubstitutionTest.java index 71c8819bd98f..2a4cceec053d 100644 --- a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/hotspot/test/HotSpotMethodSubstitutionTest.java +++ b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/hotspot/test/HotSpotMethodSubstitutionTest.java @@ -170,7 +170,7 @@ public static int systemIdentityHashCode(Object obj) { return System.identityHashCode(obj); } - private static class TestClassA { + private static final class TestClassA { } public static String testCallSiteGetTargetSnippet(int i) throws Exception { diff --git a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/hotspot/test/JVMCIInfopointErrorTest.java b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/hotspot/test/JVMCIInfopointErrorTest.java index 7e2c4178b0d7..4f5d3d63909f 100644 --- a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/hotspot/test/JVMCIInfopointErrorTest.java +++ b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/hotspot/test/JVMCIInfopointErrorTest.java @@ -276,7 +276,7 @@ public void testUnexpectedObject() { }); } - private static class UnknownJavaValue implements JavaValue { + private static final class UnknownJavaValue implements JavaValue { } @SuppressWarnings("try") diff --git a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/hotspot/test/PolymorphicInliningTest.java b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/hotspot/test/PolymorphicInliningTest.java index 64bee38dd1f5..6652366c6c96 100644 --- a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/hotspot/test/PolymorphicInliningTest.java +++ b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/hotspot/test/PolymorphicInliningTest.java @@ -156,21 +156,21 @@ private abstract static class SuperClass { abstract int foo(); } - private static class A extends SuperClass { + private static final class A extends SuperClass { @Override public int foo() { return 'A'; } } - private static class B extends SuperClass { + private static final class B extends SuperClass { @Override public int foo() { return 'B'; } } - private static class NotInlinableSubClass extends SuperClass { + private static final class NotInlinableSubClass extends SuperClass { @Override public int foo() { return 'X'; diff --git a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/hotspot/test/VirtualThreadJFRTest.java b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/hotspot/test/VirtualThreadJFRTest.java index 75d3ca62381e..9cb322612ce4 100644 --- a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/hotspot/test/VirtualThreadJFRTest.java +++ b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/hotspot/test/VirtualThreadJFRTest.java @@ -50,7 +50,7 @@ public class VirtualThreadJFRTest extends SubprocessTest { private static final int STARTER_THREADS = 10; @Name("test.Tester") - private static class TestEvent extends Event { + private static final class TestEvent extends Event { } private static boolean isJFRAvailable() { diff --git a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/bytecode/BC_checkcast01.java b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/bytecode/BC_checkcast01.java index 7d6355099e2f..1593f4338f1b 100644 --- a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/bytecode/BC_checkcast01.java +++ b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/bytecode/BC_checkcast01.java @@ -31,7 +31,7 @@ */ public class BC_checkcast01 extends JTTTest { - private static class TestClass { + private static final class TestClass { } static Object object2 = new Object(); diff --git a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/bytecode/BC_checkcast02.java b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/bytecode/BC_checkcast02.java index 668b022c1e72..4ddb5e1eda65 100644 --- a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/bytecode/BC_checkcast02.java +++ b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/bytecode/BC_checkcast02.java @@ -31,7 +31,7 @@ */ public class BC_checkcast02 extends JTTTest { - private static class TestClass { + private static final class TestClass { } static Object[] o1 = {new Object()}; diff --git a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/bytecode/BC_checkcast03.java b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/bytecode/BC_checkcast03.java index 61c379ad3089..d495c951e4db 100644 --- a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/bytecode/BC_checkcast03.java +++ b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/bytecode/BC_checkcast03.java @@ -40,7 +40,7 @@ private static class BaseClass { } - private static class TestClass extends BaseClass implements IObject { + private static final class TestClass extends BaseClass implements IObject { } static TestClass[] a1 = {new TestClass()}; diff --git a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/bytecode/BC_instanceof.java b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/bytecode/BC_instanceof.java index e35a02f54f95..5e40e6e75000 100644 --- a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/bytecode/BC_instanceof.java +++ b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/bytecode/BC_instanceof.java @@ -31,7 +31,7 @@ */ public class BC_instanceof extends JTTTest { - private static class TestClass { + private static final class TestClass { } static Object object2 = new Object(); diff --git a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/bytecode/BC_instanceof01.java b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/bytecode/BC_instanceof01.java index 2f418d0860ed..70d63f496866 100644 --- a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/bytecode/BC_instanceof01.java +++ b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/bytecode/BC_instanceof01.java @@ -48,10 +48,10 @@ private static class BaseClass { } - private static class TestClass extends BaseClass implements IObject { + private static final class TestClass extends BaseClass implements IObject { } - private static class DerivedTestClass extends BaseClass implements IDerivedObject { + private static final class DerivedTestClass extends BaseClass implements IDerivedObject { } diff --git a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/bytecode/BC_invokespecial.java b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/bytecode/BC_invokespecial.java index 810d9b734033..3c3e27141d7e 100644 --- a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/bytecode/BC_invokespecial.java +++ b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/bytecode/BC_invokespecial.java @@ -31,7 +31,7 @@ */ public class BC_invokespecial extends JTTTest { - private static class TestClass { + private static final class TestClass { @SuppressWarnings("static-method") private int id(int i) { return i; diff --git a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/bytecode/BC_invokespecial2.java b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/bytecode/BC_invokespecial2.java index d375164a9160..b4f9fe130053 100644 --- a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/bytecode/BC_invokespecial2.java +++ b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/bytecode/BC_invokespecial2.java @@ -34,7 +34,7 @@ */ public class BC_invokespecial2 extends JTTTest { - private static class TestClass { + private static final class TestClass { @SuppressWarnings("static-method") private int id(int i) { return 4 + i; diff --git a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/bytecode/BC_invokevirtual.java b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/bytecode/BC_invokevirtual.java index 1a1e34faeb39..68b10471c628 100644 --- a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/bytecode/BC_invokevirtual.java +++ b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/bytecode/BC_invokevirtual.java @@ -31,7 +31,9 @@ */ public class BC_invokevirtual extends JTTTest { - private static class TestClass { + private static final class TestClass { + + @SuppressWarnings("static-method") public int id(int i) { return i; } diff --git a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/bytecode/BC_putfield_01.java b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/bytecode/BC_putfield_01.java index f49c0d033d90..26264f4393aa 100644 --- a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/bytecode/BC_putfield_01.java +++ b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/bytecode/BC_putfield_01.java @@ -31,7 +31,7 @@ */ public class BC_putfield_01 extends JTTTest { - private static class TestClass { + private static final class TestClass { private int field; } diff --git a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/bytecode/BC_putfield_02.java b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/bytecode/BC_putfield_02.java index 32e1b6dcf1f8..cdc42361e135 100644 --- a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/bytecode/BC_putfield_02.java +++ b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/bytecode/BC_putfield_02.java @@ -31,7 +31,7 @@ */ public class BC_putfield_02 extends JTTTest { - private static class TestClass { + private static final class TestClass { private Object field; } diff --git a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/bytecode/BC_putfield_03.java b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/bytecode/BC_putfield_03.java index 510831a87f83..63094a410e10 100644 --- a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/bytecode/BC_putfield_03.java +++ b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/bytecode/BC_putfield_03.java @@ -31,7 +31,7 @@ */ public class BC_putfield_03 extends JTTTest { - private static class TestClass { + private static final class TestClass { private volatile int field; } diff --git a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/bytecode/BC_putfield_04.java b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/bytecode/BC_putfield_04.java index 32e67048dd1a..d9758a01822c 100644 --- a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/bytecode/BC_putfield_04.java +++ b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/bytecode/BC_putfield_04.java @@ -31,7 +31,7 @@ */ public class BC_putfield_04 extends JTTTest { - private static class TestClass { + private static final class TestClass { private volatile Object field; } diff --git a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/except/BC_getfield.java b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/except/BC_getfield.java index 6ae781e17926..efce8203892b 100644 --- a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/except/BC_getfield.java +++ b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/except/BC_getfield.java @@ -32,7 +32,7 @@ public class BC_getfield extends JTTTest { - private static class TestClass { + private static final class TestClass { private int field = 13; } diff --git a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/except/BC_getfield1.java b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/except/BC_getfield1.java index b23857ba69e8..148c772bf71d 100644 --- a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/except/BC_getfield1.java +++ b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/except/BC_getfield1.java @@ -38,7 +38,7 @@ protected OptimisticOptimizations getOptimisticOptimizations() { return OptimisticOptimizations.NONE; } - private static class TestClass { + private static final class TestClass { private int field = 13; } diff --git a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/except/BC_invokespecial01.java b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/except/BC_invokespecial01.java index a04ea9895b69..aeb54b571ed9 100644 --- a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/except/BC_invokespecial01.java +++ b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/except/BC_invokespecial01.java @@ -32,7 +32,7 @@ */ public class BC_invokespecial01 extends JTTTest { - private static class TestClass { + private static final class TestClass { @SuppressWarnings("static-method") private boolean method() { return true; diff --git a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/except/BC_invokevirtual01.java b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/except/BC_invokevirtual01.java index 57aeb0e6dd1b..896229d0a4ce 100644 --- a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/except/BC_invokevirtual01.java +++ b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/except/BC_invokevirtual01.java @@ -32,7 +32,8 @@ */ public class BC_invokevirtual01 extends JTTTest { - private static class TestClass { + private static final class TestClass { + @SuppressWarnings("static-method") public boolean method() { return true; } diff --git a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/except/BC_invokevirtual02.java b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/except/BC_invokevirtual02.java index 5f1ee8c31d79..690246a53696 100644 --- a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/except/BC_invokevirtual02.java +++ b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/except/BC_invokevirtual02.java @@ -32,9 +32,9 @@ */ public class BC_invokevirtual02 extends JTTTest { - private static class TestClass { + private static final class TestClass { @SuppressWarnings("static-method") - public final boolean method() { + public boolean method() { return true; } } diff --git a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/except/BC_putfield.java b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/except/BC_putfield.java index 4c884108b96d..4293096e4916 100644 --- a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/except/BC_putfield.java +++ b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/except/BC_putfield.java @@ -32,7 +32,7 @@ public class BC_putfield extends JTTTest { - private static class TestClass { + private static final class TestClass { private int field; } diff --git a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/except/Except_Synchronized01.java b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/except/Except_Synchronized01.java index ece7667ca745..f1fd4ea3f9d8 100644 --- a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/except/Except_Synchronized01.java +++ b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/except/Except_Synchronized01.java @@ -32,7 +32,7 @@ */ public class Except_Synchronized01 extends JTTTest { - private static class TestClass { + private static final class TestClass { final int x = 1; @SuppressWarnings("all") diff --git a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/except/Except_Synchronized02.java b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/except/Except_Synchronized02.java index b169c5f9daad..b024038c900d 100644 --- a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/except/Except_Synchronized02.java +++ b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/except/Except_Synchronized02.java @@ -32,7 +32,7 @@ public class Except_Synchronized02 extends JTTTest { - private static class TestClass { + private static final class TestClass { final int x = 1; diff --git a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/except/Except_Synchronized03.java b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/except/Except_Synchronized03.java index 65351b0fff76..9b74ca6278fb 100644 --- a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/except/Except_Synchronized03.java +++ b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/except/Except_Synchronized03.java @@ -32,7 +32,7 @@ */ public class Except_Synchronized03 extends JTTTest { - private static class TestClass { + private static final class TestClass { int x = 1; @SuppressWarnings("all") diff --git a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/except/Except_Synchronized04.java b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/except/Except_Synchronized04.java index fa4668ef840d..fb22dbd46bf0 100644 --- a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/except/Except_Synchronized04.java +++ b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/except/Except_Synchronized04.java @@ -32,7 +32,7 @@ public class Except_Synchronized04 extends JTTTest { - private static class TestClass { + private static final class TestClass { final int x = 1; diff --git a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/except/Throw_Synchronized04.java b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/except/Throw_Synchronized04.java index 81e8ba182945..629966b2228b 100644 --- a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/except/Throw_Synchronized04.java +++ b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/except/Throw_Synchronized04.java @@ -32,8 +32,8 @@ public class Throw_Synchronized04 extends JTTTest { - private static class TestClass { - @SuppressWarnings("unused") + private static final class TestClass { + @SuppressWarnings({"unused", "static-method"}) public synchronized boolean test2(int i) throws Exception { throw new Exception(); } diff --git a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/except/Throw_Synchronized05.java b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/except/Throw_Synchronized05.java index cea2926691f2..c43c3d7935b8 100644 --- a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/except/Throw_Synchronized05.java +++ b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/except/Throw_Synchronized05.java @@ -32,8 +32,8 @@ public class Throw_Synchronized05 extends JTTTest { - private static class TestClass { - @SuppressWarnings("unused") + private static final class TestClass { + @SuppressWarnings({"unused", "static-method"}) public synchronized boolean test2(int i) throws Exception { try { throw new Exception(); diff --git a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/except/UntrustedInterfaces.java b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/except/UntrustedInterfaces.java index 78559e9d837a..fe388c7809f0 100644 --- a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/except/UntrustedInterfaces.java +++ b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/except/UntrustedInterfaces.java @@ -217,7 +217,7 @@ public void testReturn2() { runTest("returnCheckcast", poisonPill); } - private static class PoisonLoader extends ExportingClassLoader { + private static final class PoisonLoader extends ExportingClassLoader { public static final String POISON_IMPL_NAME = "jdk.graal.compiler.jtt.except.PoisonPill"; @Override diff --git a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/jdk/UnsafeAccess01.java b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/jdk/UnsafeAccess01.java index 6664e80bc418..523cef07aa6d 100644 --- a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/jdk/UnsafeAccess01.java +++ b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/jdk/UnsafeAccess01.java @@ -47,7 +47,7 @@ public class UnsafeAccess01 extends JTTTest { offset = UNSAFE.objectFieldOffset(field); } - private static class TestClass { + private static final class TestClass { private int field = 42; } diff --git a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/lang/Bridge_method01.java b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/lang/Bridge_method01.java index 26e0833eb6d2..42f2723ba6f5 100644 --- a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/lang/Bridge_method01.java +++ b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/lang/Bridge_method01.java @@ -37,7 +37,7 @@ private abstract static class Wrap { abstract T get(); } - private static class IWrap extends Wrap { + private static final class IWrap extends Wrap { @Override Integer get() { diff --git a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/lang/Class_getModifiers01.java b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/lang/Class_getModifiers01.java index eddade33835e..e625a59b2e8d 100644 --- a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/lang/Class_getModifiers01.java +++ b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/lang/Class_getModifiers01.java @@ -32,13 +32,13 @@ public final class Class_getModifiers01 extends JTTTest { - private static class PrivateStatic { + private static final class PrivateStatic { } private static final class PrivateStaticFinal { } - private static class Private { + private static final class Private { } public static int test(Class c) { diff --git a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/lang/Class_isInstance06.java b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/lang/Class_isInstance06.java index 6001341b1aeb..3ae86c5dba33 100644 --- a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/lang/Class_isInstance06.java +++ b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/lang/Class_isInstance06.java @@ -32,7 +32,7 @@ public final class Class_isInstance06 extends JTTTest { - private static class TestClass implements Cloneable { + private static final class TestClass implements Cloneable { } static final String string = ""; diff --git a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/lang/Object_clone01.java b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/lang/Object_clone01.java index 97831723e1e4..3f41dcccf880 100644 --- a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/lang/Object_clone01.java +++ b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/lang/Object_clone01.java @@ -32,7 +32,7 @@ public class Object_clone01 extends JTTTest { - private static class TestClass { + private static final class TestClass { @SuppressWarnings("unused") private boolean tryClone(int i) throws CloneNotSupportedException { return this == this.clone(); diff --git a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/lang/Object_clone02.java b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/lang/Object_clone02.java index b344fd7dfbda..4a511fcd057b 100644 --- a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/lang/Object_clone02.java +++ b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/lang/Object_clone02.java @@ -32,7 +32,7 @@ public class Object_clone02 extends JTTTest { - private static class TestClass implements Cloneable { + private static final class TestClass implements Cloneable { @SuppressWarnings("unused") private boolean tryClone(int i) throws CloneNotSupportedException { return this == this.clone(); diff --git a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/lang/Object_toString01.java b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/lang/Object_toString01.java index 2d55f2b363d4..0ff0d23ccb5a 100644 --- a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/lang/Object_toString01.java +++ b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/lang/Object_toString01.java @@ -32,7 +32,7 @@ public class Object_toString01 extends JTTTest { - private static class TestClass { + private static final class TestClass { @Override public String toString() { return string; diff --git a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/lang/Object_toString02.java b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/lang/Object_toString02.java index 8a1c9e64c3a8..f8d4fde77b29 100644 --- a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/lang/Object_toString02.java +++ b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/lang/Object_toString02.java @@ -35,7 +35,7 @@ public class Object_toString02 extends JTTTest { - private static class TestClass { + private static final class TestClass { @Override public String toString() { return "XYZ"; diff --git a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/optimize/Conditional01.java b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/optimize/Conditional01.java index e7ab30926f22..e6f2ed528cfa 100644 --- a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/optimize/Conditional01.java +++ b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/optimize/Conditional01.java @@ -35,7 +35,7 @@ @SuppressWarnings("unused") public class Conditional01 extends JTTTest { - private static class TestClass { + private static final class TestClass { private int nextPC; private int pc; private boolean aC; @@ -75,11 +75,11 @@ public int getRegisterByte(Register r1) { return r1.val; } - public int low(int tmp3) { + public static int low(int tmp3) { return tmp3 & 0x01; } - public int bit(boolean c2) { + public static int bit(boolean c2) { return c2 ? 1 : 0; } } @@ -109,13 +109,13 @@ public static int test(int arg) { return c.cyclesConsumed; } - private static class Register { + private static final class Register { int val; int num; } - private static class CPC { + private static final class CPC { public Register r1; public Register r2; diff --git a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/optimize/Fold_Cast01.java b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/optimize/Fold_Cast01.java index b157bf811c19..552e392a4630 100644 --- a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/optimize/Fold_Cast01.java +++ b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/optimize/Fold_Cast01.java @@ -32,7 +32,7 @@ */ public class Fold_Cast01 extends JTTTest { - private static class TestClass { + private static final class TestClass { int field = 9; } diff --git a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/optimize/GuardMovement.java b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/optimize/GuardMovement.java index ac840da9f702..efc781213561 100644 --- a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/optimize/GuardMovement.java +++ b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/optimize/GuardMovement.java @@ -36,7 +36,7 @@ public class GuardMovement extends JTTTest { private static int staticValue; - private static class A { + private static final class A { int x; int y; } diff --git a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/optimize/LLE_01.java b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/optimize/LLE_01.java index 4d897c294c2c..9a3ca274fc3b 100644 --- a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/optimize/LLE_01.java +++ b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/optimize/LLE_01.java @@ -34,7 +34,7 @@ */ public class LLE_01 extends JTTTest { - private static class TestClass { + private static final class TestClass { int field1; } diff --git a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/optimize/List_reorder_bug.java b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/optimize/List_reorder_bug.java index 0696b8ab72cd..e06d2c339ff4 100644 --- a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/optimize/List_reorder_bug.java +++ b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/optimize/List_reorder_bug.java @@ -32,7 +32,7 @@ @SuppressWarnings("unused") public class List_reorder_bug extends JTTTest { - private static class TestClass { + private static final class TestClass { String s; private void print(String s2) { diff --git a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/optimize/NCE_01.java b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/optimize/NCE_01.java index 925cf87fecdd..33b796b73873 100644 --- a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/optimize/NCE_01.java +++ b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/optimize/NCE_01.java @@ -32,7 +32,7 @@ */ public class NCE_01 extends JTTTest { - private static class TestClass { + private static final class TestClass { int field1 = 22; int field2 = 23; } diff --git a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/optimize/SchedulingBug_01.java b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/optimize/SchedulingBug_01.java index 756a711f199a..13750d99311d 100644 --- a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/optimize/SchedulingBug_01.java +++ b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/optimize/SchedulingBug_01.java @@ -31,7 +31,7 @@ */ public class SchedulingBug_01 extends JTTTest { - private static class VolatileBoxHolder { + private static final class VolatileBoxHolder { volatile Integer box; } diff --git a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/optimize/VN_Cast01.java b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/optimize/VN_Cast01.java index 60665131e01d..5caa05d9df62 100644 --- a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/optimize/VN_Cast01.java +++ b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/optimize/VN_Cast01.java @@ -32,7 +32,7 @@ */ public class VN_Cast01 extends JTTTest { - private static class TestClass { + private static final class TestClass { int field = 9; } diff --git a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/optimize/VN_Cast02.java b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/optimize/VN_Cast02.java index 077ac36d1527..08ea2ccaa129 100644 --- a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/optimize/VN_Cast02.java +++ b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/optimize/VN_Cast02.java @@ -32,7 +32,7 @@ */ public class VN_Cast02 extends JTTTest { - private static class TestClass { + private static final class TestClass { int field = 9; } diff --git a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/optimize/VN_Field01.java b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/optimize/VN_Field01.java index b157f8f0b1cf..64ab6e59d60c 100644 --- a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/optimize/VN_Field01.java +++ b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/optimize/VN_Field01.java @@ -32,7 +32,7 @@ */ public class VN_Field01 extends JTTTest { - private static class TestClass { + private static final class TestClass { int field = 9; } diff --git a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/optimize/VN_Field02.java b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/optimize/VN_Field02.java index 3c8bb73a5371..853cf09e65d3 100644 --- a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/optimize/VN_Field02.java +++ b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/optimize/VN_Field02.java @@ -32,7 +32,7 @@ */ public class VN_Field02 extends JTTTest { - private static class TestClass { + private static final class TestClass { int field = 9; } diff --git a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/reflect/Field_get03.java b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/reflect/Field_get03.java index 3901fc70f773..340cf8f563c4 100644 --- a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/reflect/Field_get03.java +++ b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/reflect/Field_get03.java @@ -57,7 +57,7 @@ public class Field_get03 extends JTTTest { } } - private static class TestClass { + private static final class TestClass { public final byte byteField = 11; public final short shortField = 12; public final char charField = 13; diff --git a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/reflect/Field_get04.java b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/reflect/Field_get04.java index 2e82317b707c..9fb76da0ada7 100644 --- a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/reflect/Field_get04.java +++ b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/reflect/Field_get04.java @@ -31,7 +31,7 @@ */ public class Field_get04 extends JTTTest { - private static class TestClass { + private static final class TestClass { public final byte byteField = 11; public final short shortField = 12; public final char charField = 13; diff --git a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/reflect/Field_set02.java b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/reflect/Field_set02.java index 09ea48607fb7..f8f26c7b7362 100644 --- a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/reflect/Field_set02.java +++ b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/reflect/Field_set02.java @@ -33,7 +33,7 @@ */ public class Field_set02 extends JTTTest { - private static class TestClass { + private static final class TestClass { public byte byteField; public short shortField; public char charField; diff --git a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/reflect/Field_set03.java b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/reflect/Field_set03.java index 79e9e6dd1eaf..dcb7bcfc98d8 100644 --- a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/reflect/Field_set03.java +++ b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/reflect/Field_set03.java @@ -31,7 +31,7 @@ */ public class Field_set03 extends JTTTest { - private static class TestClass { + private static final class TestClass { public byte byteField; public short shortField; public char charField; diff --git a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/threads/Monitor_contended01.java b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/threads/Monitor_contended01.java index 755a11aeb517..260629ee709f 100644 --- a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/threads/Monitor_contended01.java +++ b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/threads/Monitor_contended01.java @@ -35,7 +35,7 @@ public final class Monitor_contended01 extends JTTTest { @Rule public TestRule timeout = createTimeoutSeconds(20); - private static class TestClass implements Runnable { + private static final class TestClass implements Runnable { boolean started = false; boolean acquired = false; diff --git a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/threads/Object_wait01.java b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/threads/Object_wait01.java index 39b1904b8f7f..c5578d1cbe50 100644 --- a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/threads/Object_wait01.java +++ b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/threads/Object_wait01.java @@ -35,7 +35,7 @@ public class Object_wait01 extends JTTTest { @Rule public TestRule timeout = createTimeoutSeconds(20); - private static class TestClass implements Runnable { + private static final class TestClass implements Runnable { @Override public void run() { int i = 0; diff --git a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/threads/Object_wait02.java b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/threads/Object_wait02.java index 6ccdf222af4b..9a2b9715a048 100644 --- a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/threads/Object_wait02.java +++ b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/threads/Object_wait02.java @@ -35,7 +35,7 @@ public class Object_wait02 extends JTTTest { @Rule public TestRule timeout = createTimeoutSeconds(20); - private static class TestClass implements Runnable { + private static final class TestClass implements Runnable { @Override public void run() { try { diff --git a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/threads/Object_wait03.java b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/threads/Object_wait03.java index 17be435b6c9c..063e987d3af4 100644 --- a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/threads/Object_wait03.java +++ b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/threads/Object_wait03.java @@ -50,7 +50,7 @@ public class Object_wait03 extends JTTTest { @Rule public TestRule timeout = createTimeoutMillis(TIMEOUT_MS); - private static class TestClass implements Runnable { + private static final class TestClass implements Runnable { @Override public void run() { try { diff --git a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/threads/Object_wait04.java b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/threads/Object_wait04.java index e0dc85427507..09d37a8444a8 100644 --- a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/threads/Object_wait04.java +++ b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/threads/Object_wait04.java @@ -35,7 +35,7 @@ public class Object_wait04 extends JTTTest { @Rule public TestRule timeout = createTimeoutSeconds(20); - private static class TestClass implements Runnable { + private static final class TestClass implements Runnable { @Override public void run() { try { diff --git a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/threads/ThreadLocal03.java b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/threads/ThreadLocal03.java index 3d47d7c3af91..7a716281dda7 100644 --- a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/threads/ThreadLocal03.java +++ b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/threads/ThreadLocal03.java @@ -49,7 +49,7 @@ public static int test(int i) { return sum; } - private static class TThread extends Thread { + private static final class TThread extends Thread { int input; int output; diff --git a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/threads/Thread_isInterrupted02.java b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/threads/Thread_isInterrupted02.java index 3ff8d9fbdb75..264c411d68cc 100644 --- a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/threads/Thread_isInterrupted02.java +++ b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/threads/Thread_isInterrupted02.java @@ -67,7 +67,7 @@ public static boolean test(int i, int time) throws InterruptedException { return thread.interrupted; } - private static class Thread extends java.lang.Thread { + private static final class Thread extends java.lang.Thread { private boolean interrupted; private boolean sentInterrupt; diff --git a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/threads/Thread_isInterrupted03.java b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/threads/Thread_isInterrupted03.java index 3197f1206162..436385fb2a84 100644 --- a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/threads/Thread_isInterrupted03.java +++ b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/threads/Thread_isInterrupted03.java @@ -50,7 +50,7 @@ public static boolean test() throws InterruptedException { return result; } - private static class Thread1 extends java.lang.Thread { + private static final class Thread1 extends java.lang.Thread { private boolean interrupted = false; diff --git a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/threads/Thread_join01.java b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/threads/Thread_join01.java index 1652081e2897..90cbfc44fda8 100644 --- a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/threads/Thread_join01.java +++ b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/threads/Thread_join01.java @@ -35,7 +35,7 @@ public class Thread_join01 extends JTTTest { @Rule public TestRule timeout = createTimeoutSeconds(20); - private static class TestClass implements Runnable { + private static final class TestClass implements Runnable { @Override public void run() { cont = false; diff --git a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/threads/Thread_join02.java b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/threads/Thread_join02.java index 3604cc59fea5..12737228b2ca 100644 --- a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/threads/Thread_join02.java +++ b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/threads/Thread_join02.java @@ -38,7 +38,7 @@ public class Thread_join02 extends JTTTest { @Rule public TestRule timeout = createTimeoutSeconds(20); - private static class TestClass implements Runnable { + private static final class TestClass implements Runnable { @Override public void run() { try { diff --git a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/threads/Thread_join03.java b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/threads/Thread_join03.java index 73a4c8de4389..529299a88ade 100644 --- a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/threads/Thread_join03.java +++ b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/threads/Thread_join03.java @@ -38,7 +38,7 @@ public class Thread_join03 extends JTTTest { @Rule public TestRule timeout = createTimeoutSeconds(20); - private static class TestClass implements Runnable { + private static final class TestClass implements Runnable { @Override public void run() { cont = false; diff --git a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/threads/Thread_new02.java b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/threads/Thread_new02.java index d6a506df900d..e08ed559082c 100644 --- a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/threads/Thread_new02.java +++ b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/jtt/threads/Thread_new02.java @@ -31,7 +31,7 @@ public class Thread_new02 extends JTTTest { - private static class TestClass implements Runnable { + private static final class TestClass implements Runnable { @Override public void run() { // do nothing. diff --git a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/lir/jtt/ConstantStackCastTest.java b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/lir/jtt/ConstantStackCastTest.java index 5bf8f6f5b70c..024f760b203f 100644 --- a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/lir/jtt/ConstantStackCastTest.java +++ b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/lir/jtt/ConstantStackCastTest.java @@ -57,7 +57,7 @@ public void setup() { stackCopyByte.srcKind = LIRKind.fromJavaKind(getBackend().getTarget().arch, JavaKind.Byte); } - private static class LoadConstantStackSpec extends LIRTestSpecification { + private static final class LoadConstantStackSpec extends LIRTestSpecification { LIRKind dstKind; LIRKind srcKind; diff --git a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/replacements/test/CompiledNullPointerExceptionTest.java b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/replacements/test/CompiledNullPointerExceptionTest.java index 227e836c9413..ca88c912ad4e 100644 --- a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/replacements/test/CompiledNullPointerExceptionTest.java +++ b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/replacements/test/CompiledNullPointerExceptionTest.java @@ -73,7 +73,7 @@ protected StructuredGraph parse(Builder builder, PhaseSuite gra return graph; } - private class TestClass { + private final class TestClass { @Override public String toString() { diff --git a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/replacements/test/DerivedOopTest.java b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/replacements/test/DerivedOopTest.java index a4f2a151f428..89c79decf7f2 100644 --- a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/replacements/test/DerivedOopTest.java +++ b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/replacements/test/DerivedOopTest.java @@ -52,7 +52,7 @@ */ public class DerivedOopTest extends ReplacementsTest implements Snippets { - private static class Pointers { + private static final class Pointers { public long basePointer; public long internalPointer; diff --git a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/replacements/test/DynamicNewArrayTest.java b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/replacements/test/DynamicNewArrayTest.java index 6f103add51c0..90d7fd08cc1d 100644 --- a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/replacements/test/DynamicNewArrayTest.java +++ b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/replacements/test/DynamicNewArrayTest.java @@ -37,7 +37,7 @@ */ public class DynamicNewArrayTest extends GraalCompilerTest { - private class Element { + private final class Element { } @Test diff --git a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/truffle/test/AssumedValuePartialEvaluationTest.java b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/truffle/test/AssumedValuePartialEvaluationTest.java index d717dad4fb47..4532c3871fda 100644 --- a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/truffle/test/AssumedValuePartialEvaluationTest.java +++ b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/truffle/test/AssumedValuePartialEvaluationTest.java @@ -115,7 +115,7 @@ public int execute(VirtualFrame frame) { } } - private static class ReadDynamicAssumedValueNode extends AbstractTestNode { + private static final class ReadDynamicAssumedValueNode extends AbstractTestNode { @Override public int execute(VirtualFrame frame) { diff --git a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/truffle/test/BytecodeDSLCompilationTest.java b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/truffle/test/BytecodeDSLCompilationTest.java index 47acbe5f53c5..34a5923a29c7 100644 --- a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/truffle/test/BytecodeDSLCompilationTest.java +++ b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/truffle/test/BytecodeDSLCompilationTest.java @@ -961,7 +961,7 @@ protected void onCreate(Env env) { } } - private static class Counter { + private static final class Counter { private int count = 0; public int get() { diff --git a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/truffle/test/ConditionAnchoringTest.java b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/truffle/test/ConditionAnchoringTest.java index 6cc494b56839..95c264403e5a 100644 --- a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/truffle/test/ConditionAnchoringTest.java +++ b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/truffle/test/ConditionAnchoringTest.java @@ -76,7 +76,7 @@ public class ConditionAnchoringTest extends GraalCompilerTest { offset = fieldOffset; } - private static class CheckedObject { + private static final class CheckedObject { int id; int iid; @SuppressWarnings("unused") int field; diff --git a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/truffle/test/JFRPartialEvaluationTest.java b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/truffle/test/JFRPartialEvaluationTest.java index d57bf7dee456..d0f6888119db 100644 --- a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/truffle/test/JFRPartialEvaluationTest.java +++ b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/truffle/test/JFRPartialEvaluationTest.java @@ -178,7 +178,7 @@ public int execute(VirtualFrame frame) { } @Name("test.JFRPartialEvaluationTestEvent") - private static class TestEvent extends Event { + private static final class TestEvent extends Event { } private static MethodCallTargetNode findInvoke(StructuredGraph graph, ResolvedJavaMethod expectedMethod) { diff --git a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/truffle/test/LanguageContextFreedTest.java b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/truffle/test/LanguageContextFreedTest.java index dab12531497d..65eec4727dbb 100644 --- a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/truffle/test/LanguageContextFreedTest.java +++ b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/truffle/test/LanguageContextFreedTest.java @@ -222,7 +222,7 @@ protected ContextReference getContextReference0() { } - private static class ContextLocalValue { + private static final class ContextLocalValue { } } diff --git a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/truffle/test/OptimizedOSRLoopNodeTest.java b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/truffle/test/OptimizedOSRLoopNodeTest.java index 749eb5cd6018..050aa1838fe1 100644 --- a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/truffle/test/OptimizedOSRLoopNodeTest.java +++ b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/truffle/test/OptimizedOSRLoopNodeTest.java @@ -487,7 +487,7 @@ public void testCustomLoopContributingToOSR4(OSRLoopFactory factory) { assertNotCompiled(rootNode.getOSRTarget()); } - private static class CustomInnerLoopRepeatingNode extends TestRepeatingNode { + private static final class CustomInnerLoopRepeatingNode extends TestRepeatingNode { @Override public boolean executeRepeating(VirtualFrame frame) { @@ -611,7 +611,7 @@ public Void visitFrame(FrameInstance frameInstance) { } - private static class TestOSRStackTraceFromAbove extends TestOSRStackTrace { + private static final class TestOSRStackTraceFromAbove extends TestOSRStackTrace { @Child DirectCallNode callNode; diff --git a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/truffle/test/PerformanceWarningTest.java b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/truffle/test/PerformanceWarningTest.java index 5124ceae1bff..585fe6793506 100644 --- a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/truffle/test/PerformanceWarningTest.java +++ b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/truffle/test/PerformanceWarningTest.java @@ -174,7 +174,7 @@ private interface SingleImplementedInterface { void doVirtual(); } - private static class VirtualObject1 implements Interface { + private static final class VirtualObject1 implements Interface { @Override public void doVirtual() { } @@ -184,7 +184,7 @@ public void doBoundaryVirtual() { } } - private static class VirtualObject2 implements Interface { + private static final class VirtualObject2 implements Interface { @Override public void doVirtual() { } @@ -200,7 +200,7 @@ public void doVirtual() { } } - private static class SubClass extends SingleImplementorClass { + private static final class SubClass extends SingleImplementorClass { } private static class L1 { @@ -227,10 +227,10 @@ private static class L7 extends L6 { private static class L8 extends L7 { } - private static class L9a extends L8 { + private static final class L9a extends L8 { } - private static class L9b extends L8 { + private static final class L9b extends L8 { } private abstract static class TestRootNode extends RootNode { diff --git a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/truffle/test/TransferToInterpreterTest.java b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/truffle/test/TransferToInterpreterTest.java index f111e5fd5ce4..84b491875423 100644 --- a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/truffle/test/TransferToInterpreterTest.java +++ b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/truffle/test/TransferToInterpreterTest.java @@ -61,7 +61,7 @@ public void test() { Assert.assertFalse(target.isValid()); } - private static class TestTruffleCompilationTask implements TruffleCompilationTask { + private static final class TestTruffleCompilationTask implements TruffleCompilationTask { @Override public boolean isCancelled() { diff --git a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/truffle/test/libgraal/JNIExceptionWrapperTest.java b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/truffle/test/libgraal/JNIExceptionWrapperTest.java index dec6396960d0..af7d3104de9c 100644 --- a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/truffle/test/libgraal/JNIExceptionWrapperTest.java +++ b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/truffle/test/libgraal/JNIExceptionWrapperTest.java @@ -101,7 +101,7 @@ public void onGraalTierFinished(TruffleCompilable compilable, GraphInfo graph) { } } - private static class TestTruffleCompilationTask implements TruffleCompilationTask { + private static final class TestTruffleCompilationTask implements TruffleCompilationTask { @Override public boolean isCancelled() { diff --git a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/truffle/test/nodes/NeverPartOfCompilationTestNode.java b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/truffle/test/nodes/NeverPartOfCompilationTestNode.java index 941995b74d66..d531ed94efb5 100644 --- a/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/truffle/test/nodes/NeverPartOfCompilationTestNode.java +++ b/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/truffle/test/nodes/NeverPartOfCompilationTestNode.java @@ -32,7 +32,7 @@ public class NeverPartOfCompilationTestNode extends AbstractTestNode { @Child private AbstractTestNode left; private final int value; - private static class ValueContainer { + private static final class ValueContainer { int value; } diff --git a/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/asm/amd64/AMD64BaseAssembler.java b/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/asm/amd64/AMD64BaseAssembler.java index bcd0073cceca..f9506a175e3b 100644 --- a/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/asm/amd64/AMD64BaseAssembler.java +++ b/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/asm/amd64/AMD64BaseAssembler.java @@ -351,7 +351,7 @@ protected static int encode(Register r) { /** * Constants for X86 prefix bytes. */ - private static class Prefix { + private static final class Prefix { private static final int REX = 0x40; private static final int REXB = 0x41; private static final int REXX = 0x42; @@ -828,7 +828,7 @@ private interface SIMDEncoder { } - private class SSEEncoderImpl implements SIMDEncoder { + private final class SSEEncoderImpl implements SIMDEncoder { @Override public void simdPrefix(Register xreg, Register nds, AMD64Address adr, int sizePrefix, int opcodeEscapePrefix, boolean isRexW) { @@ -890,7 +890,7 @@ private VEXPrefixConfig() { } } - private class VEXEncoderImpl implements SIMDEncoder { + private final class VEXEncoderImpl implements SIMDEncoder { private int sizePrefixToPP(int sizePrefix) { switch (sizePrefix) { diff --git a/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/core/common/calc/Condition.java b/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/core/common/calc/Condition.java index b5a20152a000..1c187c2d380e 100644 --- a/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/core/common/calc/Condition.java +++ b/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/core/common/calc/Condition.java @@ -387,6 +387,7 @@ public TriState foldCondition(Stamp compareStamp, Constant lt, Constant rt, Cons * false */ public boolean foldCondition(PrimitiveConstant lp, PrimitiveConstant rp, boolean unorderedIsTrue) { + // Checkstyle: stop FallThrough switch (lp.getJavaKind()) { case Boolean: case Byte: @@ -497,6 +498,7 @@ public boolean foldCondition(PrimitiveConstant lp, PrimitiveConstant rp, boolean default: throw new GraalError("expected value kind %s while folding condition: %s", lp.getJavaKind(), this); // ExcludeFromJacocoGeneratedReport } + // Checkstyle: resume FallThrough } private static boolean in(Condition needle, Condition... haystack) { diff --git a/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/core/common/type/FloatStamp.java b/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/core/common/type/FloatStamp.java index a18de1564ffa..01946ffe3db9 100644 --- a/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/core/common/type/FloatStamp.java +++ b/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/core/common/type/FloatStamp.java @@ -1680,7 +1680,7 @@ protected Stamp foldStampImpl(Stamp stamp) { }); // Use a separate class to avoid initialization cycles - private static class ConstantCache { + private static final class ConstantCache { private static final FloatStamp FLOAT_BOTTOM = new FloatStamp(Float.SIZE, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, false); private static final FloatStamp DOUBLE_BOTTOM = new FloatStamp(Double.SIZE, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, false); private static final FloatStamp FLOAT_TOP = new FloatStamp(Float.SIZE, Double.POSITIVE_INFINITY, Double.NEGATIVE_INFINITY, true); diff --git a/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/graphio/parsing/BinaryReader.java b/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/graphio/parsing/BinaryReader.java index 7b8881c43a1d..983d3c7beed3 100644 --- a/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/graphio/parsing/BinaryReader.java +++ b/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/graphio/parsing/BinaryReader.java @@ -103,7 +103,7 @@ public class BinaryReader implements GraphParser, ModelControl { private final Builder builder; - private static class ErrorReporter { + private static final class ErrorReporter { /** * Accumulates names of objects as they are parsed out of stream Used to report context for * irrecoverable errors which happen during reading BGV stream. @@ -184,7 +184,7 @@ public void reportLoadingError(String message, Builder builder) { } } - private static class ContextStrings { + private static final class ContextStrings { private static String propertyGraph(Object s) { return String.format("Property %s graph", s); } diff --git a/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/graphio/parsing/ModelBuilder.java b/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/graphio/parsing/ModelBuilder.java index c8df87e9c062..d539c0bdcea6 100644 --- a/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/graphio/parsing/ModelBuilder.java +++ b/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/graphio/parsing/ModelBuilder.java @@ -137,7 +137,7 @@ public int hashCode() { } } - private static class ErrorMessages { + private static final class ErrorMessages { public static String edgeStartNodeNotExists(String label, int node) { return String.format("Start node for edge %s does not exist: %d", label, node); } diff --git a/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/graphio/parsing/model/Properties.java b/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/graphio/parsing/model/Properties.java index b25c90c1a26d..73e5a1ff50ea 100644 --- a/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/graphio/parsing/model/Properties.java +++ b/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/graphio/parsing/model/Properties.java @@ -208,7 +208,7 @@ , TProp> void addFrom(TSource source, } } - private class ArrayPropertiesIterator implements Iterator> { + private final class ArrayPropertiesIterator implements Iterator> { int index; @Override @@ -575,7 +575,7 @@ public int hashCode() { } } - private static class PropertyCache { + private static final class PropertyCache { static final WeakHashMap> immutableCache = new WeakHashMap<>(); static synchronized SharedProperties intern(Properties properties) { diff --git a/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hightiercodegen/reconstruction/stackifier/blocks/LabeledBlockGeneration.java b/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hightiercodegen/reconstruction/stackifier/blocks/LabeledBlockGeneration.java index 136db5928690..f84d4a5be67d 100644 --- a/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hightiercodegen/reconstruction/stackifier/blocks/LabeledBlockGeneration.java +++ b/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hightiercodegen/reconstruction/stackifier/blocks/LabeledBlockGeneration.java @@ -531,7 +531,7 @@ private void addToMaps(LabeledBlock labeledBLock) { /** * Generates {@link LabeledBlock}s with unique labels. */ - private static class LabeledBlockGenerator { + private static final class LabeledBlockGenerator { private int currentId = 0; diff --git a/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/stubs/Stub.java b/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/stubs/Stub.java index 76bf4fd14ef2..ea38d909d002 100644 --- a/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/stubs/Stub.java +++ b/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/stubs/Stub.java @@ -290,7 +290,7 @@ protected void checkSafeDataReference(DataPatch data) { assert !(data.reference instanceof ConstantReference) : this + " cannot have embedded object or metadata constant: " + data.reference; } - private static class EmptyHighTier extends BasePhase { + private static final class EmptyHighTier extends BasePhase { @Override public Optional notApplicableTo(GraphState graphState) { return ALWAYS_APPLICABLE; diff --git a/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/lir/aarch64/AArch64ArrayIndexOfOp.java b/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/lir/aarch64/AArch64ArrayIndexOfOp.java index 9dc63915eaa6..a0e06bdbdc37 100644 --- a/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/lir/aarch64/AArch64ArrayIndexOfOp.java +++ b/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/lir/aarch64/AArch64ArrayIndexOfOp.java @@ -108,6 +108,7 @@ public AArch64ArrayIndexOfOp(Stride stride, ArrayIndexOfVariant variant, LIRGene } private static int getNumberOfRequiredVectorRegisters(ArrayIndexOfVariant variant, Stride stride, int nValues) { + // Checkstyle: stop FallThrough switch (variant) { case MatchAny: return nValues + (nValues > 1 ? 6 : 3); @@ -132,6 +133,7 @@ private static int getNumberOfRequiredVectorRegisters(ArrayIndexOfVariant varian default: throw GraalError.shouldNotReachHereUnexpectedValue(variant); // ExcludeFromJacocoGeneratedReport } + // Checkstyle: resume FallThrough } private void emitScalarCode(AArch64MacroAssembler masm, Register baseAddress, Register searchLength) { diff --git a/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/lir/amd64/AMD64ComplexVectorOp.java b/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/lir/amd64/AMD64ComplexVectorOp.java index 25cbb70f60e3..f51a09a3144f 100644 --- a/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/lir/amd64/AMD64ComplexVectorOp.java +++ b/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/lir/amd64/AMD64ComplexVectorOp.java @@ -88,6 +88,7 @@ private static boolean isXMMOrGreater(AVXSize size) { } protected AMD64Kind getVectorKind(JavaKind valueKind) { + // Checkstyle: stop FallThrough switch (vectorSize) { case XMM: switch (valueKind) { @@ -143,9 +144,11 @@ protected AMD64Kind getVectorKind(JavaKind valueKind) { default: throw GraalError.shouldNotReachHere("Unsupported vector size."); } + // Checkstyle: resume FallThrough } protected AMD64Kind getVectorKind(Stride stride) { + // Checkstyle: stop FallThrough switch (vectorSize) { case XMM: switch (stride) { @@ -189,6 +192,7 @@ protected AMD64Kind getVectorKind(Stride stride) { default: throw GraalError.shouldNotReachHere("Unsupported vector size."); // ExcludeFromJacocoGeneratedReport } + // Checkstyle: resume FallThrough } protected Value[] allocateTempRegisters(LIRGeneratorTool tool, AMD64Kind kind, int n) { diff --git a/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/lir/amd64/phases/StackMoveOptimizationPhase.java b/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/lir/amd64/phases/StackMoveOptimizationPhase.java index 94ebfdf0ffdc..23d808a6e64d 100644 --- a/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/lir/amd64/phases/StackMoveOptimizationPhase.java +++ b/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/lir/amd64/phases/StackMoveOptimizationPhase.java @@ -76,7 +76,7 @@ protected void run(TargetDescription target, LIRGenerationResult lirGenRes, Post } } - private static class Closure { + private static final class Closure { private static final int NONE = -1; private int begin = NONE; diff --git a/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/nodes/debug/NeverStripMineNode.java b/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/nodes/debug/NeverStripMineNode.java index cc0098c8c0e3..7fd106197d01 100644 --- a/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/nodes/debug/NeverStripMineNode.java +++ b/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/nodes/debug/NeverStripMineNode.java @@ -42,7 +42,7 @@ public final class NeverStripMineNode extends FixedWithNextNode implements LIRLo public static final NodeClass TYPE = NodeClass.create(NeverStripMineNode.class); - private static class Unique { + private static final class Unique { } protected Unique unique; diff --git a/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/nodes/debug/NeverWriteSinkNode.java b/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/nodes/debug/NeverWriteSinkNode.java index 53aab793a2ec..0be84e614146 100644 --- a/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/nodes/debug/NeverWriteSinkNode.java +++ b/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/nodes/debug/NeverWriteSinkNode.java @@ -42,7 +42,7 @@ public final class NeverWriteSinkNode extends FixedWithNextNode implements LIRLo public static final NodeClass TYPE = NodeClass.create(NeverWriteSinkNode.class); - private static class Unique { + private static final class Unique { } protected Unique unique; diff --git a/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/nodes/graphbuilderconf/InvocationPlugins.java b/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/nodes/graphbuilderconf/InvocationPlugins.java index 3faae8f9c4a9..5ded5f9bcc23 100644 --- a/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/nodes/graphbuilderconf/InvocationPlugins.java +++ b/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/nodes/graphbuilderconf/InvocationPlugins.java @@ -1057,7 +1057,7 @@ public boolean maybePrintIntrinsics(OptionValues options) { /** * Code only used in assertions. Putting this in a separate class reduces class load time. */ - private static class Checks { + private static final class Checks { private static final int MAX_ARITY = 13; /** * The set of all {@link InvocationPlugin#apply} method signatures. diff --git a/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/phases/common/FrameStateAssignmentPhase.java b/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/phases/common/FrameStateAssignmentPhase.java index 46ed6ac580fe..8b7af0388d00 100644 --- a/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/phases/common/FrameStateAssignmentPhase.java +++ b/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/phases/common/FrameStateAssignmentPhase.java @@ -61,7 +61,7 @@ */ public class FrameStateAssignmentPhase extends Phase { - private static class FrameStateAssignmentClosure extends ReentrantNodeIterator.NodeIteratorClosure { + private static final class FrameStateAssignmentClosure extends ReentrantNodeIterator.NodeIteratorClosure { @Override protected FrameState processNode(FixedNode node, FrameState previousState) { diff --git a/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/phases/common/InitMemoryVerificationPhase.java b/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/phases/common/InitMemoryVerificationPhase.java index 38320626146b..8a5adeb68569 100644 --- a/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/phases/common/InitMemoryVerificationPhase.java +++ b/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/phases/common/InitMemoryVerificationPhase.java @@ -85,7 +85,7 @@ public Optional notApplicableTo(GraphState graphState) { * {@link MemoryKill} writing to, we simply count the number of memory kills that are "live" * (not protected by a barrier) at any point in the control flow graph.. */ - private static class InitBarrierVerificationClosure extends ReentrantNodeIterator.NodeIteratorClosure { + private static final class InitBarrierVerificationClosure extends ReentrantNodeIterator.NodeIteratorClosure { @Override protected Integer processNode(FixedNode node, Integer kills) { int liveKills = kills; @@ -131,7 +131,7 @@ protected EconomicMap processLoop(LoopBeginNode loop, Int * Verifies that all {@link AbstractNewObjectNode AbstractNewObjectNodes} are published by a * {@link PublishWritesNode}. */ - private static class AllocPublishVerificationClosure extends ReentrantNodeIterator.NodeIteratorClosure> { + private static final class AllocPublishVerificationClosure extends ReentrantNodeIterator.NodeIteratorClosure> { private static void processAlloc(AbstractNewObjectNode allocation, EconomicSet unpublished) { if (allocation.emitMemoryBarrier() && allocation.fillContents()) { // Allocation was not lowered from a CommitAllocationNode, can ignore diff --git a/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/phases/schedule/SchedulePhase.java b/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/phases/schedule/SchedulePhase.java index 4c0d1c40db43..34c3e7c00a0b 100644 --- a/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/phases/schedule/SchedulePhase.java +++ b/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/phases/schedule/SchedulePhase.java @@ -1126,7 +1126,7 @@ private static void processStack(Node first, MicroBlock startBlock, NodeMap createHandlers(OptionValues options) { return handlers; } - private static class NodeDumper implements DebugDumpHandler { + private static final class NodeDumper implements DebugDumpHandler { @Override public void dump(Object object, DebugContext debug, boolean forced, String format, Object... arguments) { if (debug.isLogEnabled()) { diff --git a/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/replacements/nodes/ArrayIndexOfForeignCalls.java b/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/replacements/nodes/ArrayIndexOfForeignCalls.java index f56769e8dafe..19cbfe9cdb9d 100644 --- a/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/replacements/nodes/ArrayIndexOfForeignCalls.java +++ b/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/replacements/nodes/ArrayIndexOfForeignCalls.java @@ -159,6 +159,7 @@ private static LIRGeneratorTool.ArrayIndexOfVariant getVariant(ForeignCallDescri public static ForeignCallDescriptor getStub(ArrayIndexOfNode indexOfNode) { Stride stride = indexOfNode.getStride(); int valueCount = indexOfNode.getNumberOfValues(); + // Checkstyle: stop FallThrough switch (indexOfNode.getVariant()) { case MatchAny: int index = (4 * stride.log2) + (valueCount - 1); @@ -221,5 +222,6 @@ public static ForeignCallDescriptor getStub(ArrayIndexOfNode indexOfNode) { default: throw GraalError.shouldNotReachHereUnexpectedValue(indexOfNode.getVariant()); // ExcludeFromJacocoGeneratedReport } + // Checkstyle: resume FallThrough } } diff --git a/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/truffle/TruffleCompilerImpl.java b/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/truffle/TruffleCompilerImpl.java index 773c6d51e1b4..a227137e5f28 100644 --- a/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/truffle/TruffleCompilerImpl.java +++ b/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/truffle/TruffleCompilerImpl.java @@ -902,7 +902,7 @@ public final SnippetReflectionProvider getSnippetReflection() { return config.snippetReflection(); } - private class TrufflePostCodeInstallationTaskFactory extends Backend.CodeInstallationTaskFactory { + private final class TrufflePostCodeInstallationTaskFactory extends Backend.CodeInstallationTaskFactory { @Override public Backend.CodeInstallationTask create() { diff --git a/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/virtual/phases/ea/PartialEscapeBlockState.java b/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/virtual/phases/ea/PartialEscapeBlockState.java index 9eaf47a022a8..4e0380b0e0ec 100644 --- a/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/virtual/phases/ea/PartialEscapeBlockState.java +++ b/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/virtual/phases/ea/PartialEscapeBlockState.java @@ -74,7 +74,7 @@ public boolean contains(VirtualObjectNode value) { return false; } - private static class RefCount { + private static final class RefCount { private int refCount = 1; } diff --git a/compiler/src/org.graalvm.profdiff.test/src/org/graalvm/profdiff/test/DeltaTreeTest.java b/compiler/src/org.graalvm.profdiff.test/src/org/graalvm/profdiff/test/DeltaTreeTest.java index 69c85876d61a..d8e4754d3828 100644 --- a/compiler/src/org.graalvm.profdiff.test/src/org/graalvm/profdiff/test/DeltaTreeTest.java +++ b/compiler/src/org.graalvm.profdiff.test/src/org/graalvm/profdiff/test/DeltaTreeTest.java @@ -68,7 +68,7 @@ protected MockTreeNode() { } } - private static class MockInfoNode extends MockTreeNode { + private static final class MockInfoNode extends MockTreeNode { @Override public boolean isInfoNode() { return true; diff --git a/compiler/src/org.graalvm.profdiff.test/src/org/graalvm/profdiff/test/TreeMatcherTest.java b/compiler/src/org.graalvm.profdiff.test/src/org/graalvm/profdiff/test/TreeMatcherTest.java index bb5c8f07504b..78271a651e87 100644 --- a/compiler/src/org.graalvm.profdiff.test/src/org/graalvm/profdiff/test/TreeMatcherTest.java +++ b/compiler/src/org.graalvm.profdiff.test/src/org/graalvm/profdiff/test/TreeMatcherTest.java @@ -39,7 +39,7 @@ public class TreeMatcherTest { * The {@link OptimizationTreeEditPolicy} discourages relabelling, however, we still want to * test that the algorithm can find relabelling. */ - private static class TestOptimizationTreeEditPolicy extends OptimizationTreeEditPolicy { + private static final class TestOptimizationTreeEditPolicy extends OptimizationTreeEditPolicy { @Override public long relabelCost(OptimizationTreeNode node1, OptimizationTreeNode node2) { assert node1 != node2; diff --git a/compiler/src/org.graalvm.profdiff/src/org/graalvm/profdiff/parser/ExperimentParser.java b/compiler/src/org.graalvm.profdiff/src/org/graalvm/profdiff/parser/ExperimentParser.java index 082520da3378..b015ab486c9c 100644 --- a/compiler/src/org.graalvm.profdiff/src/org/graalvm/profdiff/parser/ExperimentParser.java +++ b/compiler/src/org.graalvm.profdiff/src/org/graalvm/profdiff/parser/ExperimentParser.java @@ -138,7 +138,7 @@ private static final class PartialCompilationUnit { /** * A parsed proftool log. */ - private static class ProftoolLog { + private static final class ProftoolLog { /** * The compilation kind of the parsed experiment (JIT/AOT). */ diff --git a/regex/mx.regex/suite.py b/regex/mx.regex/suite.py index 6d10d646e0af..a2e14840e04f 100644 --- a/regex/mx.regex/suite.py +++ b/regex/mx.regex/suite.py @@ -92,7 +92,7 @@ "jdk.unsupported", # sun.misc.Unsafe ], "annotationProcessors" : ["truffle:TRUFFLE_DSL_PROCESSOR"], - "checkstyleVersion" : "10.7.0", + "checkstyleVersion" : "10.21.0", "javaCompliance" : "17+", "workingSets" : "Truffle,Regex", "spotbugsIgnoresGenerated" : True, diff --git a/sdk/mx.sdk/suite.py b/sdk/mx.sdk/suite.py index 47c3323c02fa..9acea82d8953 100644 --- a/sdk/mx.sdk/suite.py +++ b/sdk/mx.sdk/suite.py @@ -39,7 +39,7 @@ # SOFTWARE. # suite = { - "mxversion": "7.36.0", + "mxversion": "7.36.5", "name" : "sdk", "version" : "25.0.0", "release" : False, @@ -409,7 +409,7 @@ "dependencies" : [], "checkstyle" : "org.graalvm.word", "javaCompliance" : "11+", - "checkstyleVersion" : "10.7.0", + "checkstyleVersion" : "10.21.0", "workingSets" : "API,SDK", }, diff --git a/substratevm/mx.substratevm/suite.py b/substratevm/mx.substratevm/suite.py index d527e1f0936b..c1076f561a03 100644 --- a/substratevm/mx.substratevm/suite.py +++ b/substratevm/mx.substratevm/suite.py @@ -347,7 +347,7 @@ ], }, "javaCompliance" : "21+", - "checkstyleVersion" : "10.7.0", + "checkstyleVersion" : "10.21.0", "annotationProcessors": [ "compiler:GRAAL_PROCESSOR", "SVM_PROCESSOR", @@ -709,7 +709,7 @@ ], }, "javaCompliance" : "21+", - "checkstyleVersion": "10.7.0", + "checkstyleVersion": "10.21.0", "annotationProcessors": [ "compiler:GRAAL_PROCESSOR", "SVM_PROCESSOR", @@ -1047,7 +1047,7 @@ ], }, "checkstyle": "com.oracle.svm.test", - "checkstyleVersion" : "10.7.0", + "checkstyleVersion" : "10.21.0", "workingSets": "SVM", "annotationProcessors": [ "compiler:GRAAL_PROCESSOR", diff --git a/substratevm/src/com.oracle.objectfile/src/com/oracle/objectfile/macho/MachOObjectFile.java b/substratevm/src/com.oracle.objectfile/src/com/oracle/objectfile/macho/MachOObjectFile.java index 4ea5a2d02bd8..eb833b4c777e 100644 --- a/substratevm/src/com.oracle.objectfile/src/com/oracle/objectfile/macho/MachOObjectFile.java +++ b/substratevm/src/com.oracle.objectfile/src/com/oracle/objectfile/macho/MachOObjectFile.java @@ -381,7 +381,7 @@ public int getWrittenSize() { private LoadCommandList loadCommands = new LoadCommandList(); - private class LoadCommandList implements Iterable { + private final class LoadCommandList implements Iterable { LinkEditSegment64Command linkEditCommand; // or null; if present, always comes last! List otherCommands = new ArrayList<>(); diff --git a/substratevm/src/com.oracle.svm.configure.test/src/com/oracle/svm/configure/test/conditionalconfig/ConfigurationGenerator.java b/substratevm/src/com.oracle.svm.configure.test/src/com/oracle/svm/configure/test/conditionalconfig/ConfigurationGenerator.java index c96455a9164e..3ae40ae003b5 100644 --- a/substratevm/src/com.oracle.svm.configure.test/src/com/oracle/svm/configure/test/conditionalconfig/ConfigurationGenerator.java +++ b/substratevm/src/com.oracle.svm.configure.test/src/com/oracle/svm/configure/test/conditionalconfig/ConfigurationGenerator.java @@ -85,7 +85,7 @@ public static void runTest() { } @SuppressWarnings("unused") - private static class A { + private static final class A { } interface IA { @@ -105,7 +105,7 @@ public static void runTest() { ParentB.doWork(); } - private static class ParentA { + private static final class ParentA { static void doWork() { Util.doWork("PropagateToParent$ParentA", "PropagateToParentA.txt", IA.class); } @@ -114,7 +114,7 @@ static void doWork() { interface IA { } - private static class ParentB { + private static final class ParentB { static void doWork() { Util.doWork("PropagateToParent$ParentB", "PropagateToParentB.txt", IB.class); } @@ -123,7 +123,7 @@ static void doWork() { interface IB { } - private static class Util { + private static final class Util { static void doWork(String clazz, String resource, Class... interfaceList) { ClassUtil.forName(clazz); ClassUtil.getResource(resource); @@ -148,20 +148,20 @@ public static void runTest() { ParentB.doWork(); } - private static class ParentA { + private static final class ParentA { static void doWork() { Util.doWork("PropagateButLeaveCommonConfiguration$ParentA", "PropagateToParentA.txt", IA.class); } } - private static class ParentB { + private static final class ParentB { static void doWork() { Util.doWork("PropagateButLeaveCommonConfiguration$ParentB", "PropagateToParentB.txt", IB.class); } } @SuppressWarnings("unused") - private static class C { + private static final class C { } interface IA { @@ -173,7 +173,7 @@ interface IB { interface IC { } - private static class Util { + private static final class Util { static void doWork(String clazz, String resource, Class... intefaceList) { ClassUtil.forName(clazz); ClassUtil.forName("PropagateButLeaveCommonConfiguration$C"); diff --git a/substratevm/src/com.oracle.svm.core.foreign/src/com/oracle/svm/core/foreign/AbiUtils.java b/substratevm/src/com.oracle.svm.core.foreign/src/com/oracle/svm/core/foreign/AbiUtils.java index 4485b5781def..e9f8fd56e142 100644 --- a/substratevm/src/com.oracle.svm.core.foreign/src/com/oracle/svm/core/foreign/AbiUtils.java +++ b/substratevm/src/com.oracle.svm.core.foreign/src/com/oracle/svm/core/foreign/AbiUtils.java @@ -406,7 +406,7 @@ public List apply(ValueNode parameter, Map extr } } - private final static class ExtractSingle extends Extract { + private static final class ExtractSingle extends Extract { private final Class type; private ExtractSingle(Extracted as, Class type) { diff --git a/substratevm/src/com.oracle.svm.core.foreign/src/com/oracle/svm/core/foreign/Target_jdk_internal_foreign_abi_AbstractLinker.java b/substratevm/src/com.oracle.svm.core.foreign/src/com/oracle/svm/core/foreign/Target_jdk_internal_foreign_abi_AbstractLinker.java index 4871809310e8..2505a994d9ce 100644 --- a/substratevm/src/com.oracle.svm.core.foreign/src/com/oracle/svm/core/foreign/Target_jdk_internal_foreign_abi_AbstractLinker.java +++ b/substratevm/src/com.oracle.svm.core.foreign/src/com/oracle/svm/core/foreign/Target_jdk_internal_foreign_abi_AbstractLinker.java @@ -111,4 +111,4 @@ UpcallStubFactory arrangeUpcall(MethodType targetType, FunctionDescriptor functi /* * GR-58659, GR-58660: add substitutions for LinuxAArch64Linker and MacOsAArch64Linker here once we * support them. - */ \ No newline at end of file + */ diff --git a/substratevm/src/com.oracle.svm.core.genscavenge/src/com/oracle/svm/core/genscavenge/ChunkedImageHeapPartition.java b/substratevm/src/com.oracle.svm.core.genscavenge/src/com/oracle/svm/core/genscavenge/ChunkedImageHeapPartition.java index 19292edb16a3..3f8232a42e97 100644 --- a/substratevm/src/com.oracle.svm.core.genscavenge/src/com/oracle/svm/core/genscavenge/ChunkedImageHeapPartition.java +++ b/substratevm/src/com.oracle.svm.core.genscavenge/src/com/oracle/svm/core/genscavenge/ChunkedImageHeapPartition.java @@ -225,7 +225,7 @@ public String toString() { return name; } - private static class SizeComparator implements Comparator { + private static final class SizeComparator implements Comparator { @Override public int compare(ImageHeapObject o1, ImageHeapObject o2) { return Long.signum(o1.getSize() - o2.getSize()); diff --git a/substratevm/src/com.oracle.svm.core.genscavenge/src/com/oracle/svm/core/genscavenge/HeapImpl.java b/substratevm/src/com.oracle.svm.core.genscavenge/src/com/oracle/svm/core/genscavenge/HeapImpl.java index eb38e7dc100d..17f57d86f5a9 100644 --- a/substratevm/src/com.oracle.svm.core.genscavenge/src/com/oracle/svm/core/genscavenge/HeapImpl.java +++ b/substratevm/src/com.oracle.svm.core.genscavenge/src/com/oracle/svm/core/genscavenge/HeapImpl.java @@ -879,7 +879,7 @@ private static void writeToEachChunk(HeapChunk.Header firstChunk, HeapChunk.H } } - private static class DumpHeapSettingsAndStatistics extends DiagnosticThunk { + private static final class DumpHeapSettingsAndStatistics extends DiagnosticThunk { @Override public int maxInvocationCount() { return 1; @@ -907,7 +907,7 @@ public void printDiagnostics(Log log, ErrorContext context, int maxDiagnosticLev } } - private static class DumpHeapUsage extends DiagnosticThunk { + private static final class DumpHeapUsage extends DiagnosticThunk { @Override public int maxInvocationCount() { return 1; @@ -922,7 +922,7 @@ public void printDiagnostics(Log log, ErrorContext context, int maxDiagnosticLev } } - private static class DumpChunkInformation extends DiagnosticThunk { + private static final class DumpChunkInformation extends DiagnosticThunk { @Override public int maxInvocationCount() { return 1; diff --git a/substratevm/src/com.oracle.svm.core.genscavenge/src/com/oracle/svm/core/genscavenge/graal/GenScavengeAllocationSnippets.java b/substratevm/src/com.oracle.svm.core.genscavenge/src/com/oracle/svm/core/genscavenge/graal/GenScavengeAllocationSnippets.java index 4c80a282573b..fe0bd294fd84 100644 --- a/substratevm/src/com.oracle.svm.core.genscavenge/src/com/oracle/svm/core/genscavenge/graal/GenScavengeAllocationSnippets.java +++ b/substratevm/src/com.oracle.svm.core.genscavenge/src/com/oracle/svm/core/genscavenge/graal/GenScavengeAllocationSnippets.java @@ -147,7 +147,7 @@ public void registerLowering(Map, NodeLoweringProvider> } } - private class FormatObjectLowering implements NodeLoweringProvider { + private final class FormatObjectLowering implements NodeLoweringProvider { @Override public void lower(FormatObjectNode node, LoweringTool tool) { StructuredGraph graph = node.graph(); @@ -165,7 +165,7 @@ public void lower(FormatObjectNode node, LoweringTool tool) { } } - private class FormatArrayLowering implements NodeLoweringProvider { + private final class FormatArrayLowering implements NodeLoweringProvider { @Override public void lower(FormatArrayNode node, LoweringTool tool) { StructuredGraph graph = node.graph(); @@ -187,7 +187,7 @@ public void lower(FormatArrayNode node, LoweringTool tool) { } } - private class FormatStoredContinuationLowering implements NodeLoweringProvider { + private final class FormatStoredContinuationLowering implements NodeLoweringProvider { @Override public void lower(FormatStoredContinuationNode node, LoweringTool tool) { StructuredGraph graph = node.graph(); @@ -207,7 +207,7 @@ public void lower(FormatStoredContinuationNode node, LoweringTool tool) { } } - private class FormatPodLowering implements NodeLoweringProvider { + private final class FormatPodLowering implements NodeLoweringProvider { @Override public void lower(FormatPodNode node, LoweringTool tool) { StructuredGraph graph = node.graph(); diff --git a/substratevm/src/com.oracle.svm.core.genscavenge/src/com/oracle/svm/core/genscavenge/remset/CardTable.java b/substratevm/src/com.oracle.svm.core.genscavenge/src/com/oracle/svm/core/genscavenge/remset/CardTable.java index 4c2159fe7459..48eaa6c642f9 100644 --- a/substratevm/src/com.oracle.svm.core.genscavenge/src/com/oracle/svm/core/genscavenge/remset/CardTable.java +++ b/substratevm/src/com.oracle.svm.core.genscavenge/src/com/oracle/svm/core/genscavenge/remset/CardTable.java @@ -220,7 +220,7 @@ private static boolean verifyReference(Object parentObject, Pointer cardTableSta return true; } - private static class CardTableVerificationVisitor implements ObjectReferenceVisitor { + private static final class CardTableVerificationVisitor implements ObjectReferenceVisitor { private Object parentObject; private Pointer cardTableStart; private Pointer objectsStart; diff --git a/substratevm/src/com.oracle.svm.core.graal.amd64/src/com/oracle/svm/core/graal/amd64/AMD64CalleeSavedRegisters.java b/substratevm/src/com.oracle.svm.core.graal.amd64/src/com/oracle/svm/core/graal/amd64/AMD64CalleeSavedRegisters.java index dd727e79a35c..2effa91e82b0 100644 --- a/substratevm/src/com.oracle.svm.core.graal.amd64/src/com/oracle/svm/core/graal/amd64/AMD64CalleeSavedRegisters.java +++ b/substratevm/src/com.oracle.svm.core.graal.amd64/src/com/oracle/svm/core/graal/amd64/AMD64CalleeSavedRegisters.java @@ -262,7 +262,7 @@ private enum Mode { * "Control-flow exception" to indicate that a CPU feature is statically available and no * further dynamic feature checks are needed. */ - private static class StaticFeatureException extends Exception { + private static final class StaticFeatureException extends Exception { static final long serialVersionUID = -1; } diff --git a/substratevm/src/com.oracle.svm.core.graal.llvm/src/com/oracle/svm/core/graal/llvm/LLVMNativeImageCodeCache.java b/substratevm/src/com.oracle.svm.core.graal.llvm/src/com/oracle/svm/core/graal/llvm/LLVMNativeImageCodeCache.java index f0a6e6d6994a..1cedfffa2785 100644 --- a/substratevm/src/com.oracle.svm.core.graal.llvm/src/com/oracle/svm/core/graal/llvm/LLVMNativeImageCodeCache.java +++ b/substratevm/src/com.oracle.svm.core.graal.llvm/src/com/oracle/svm/core/graal/llvm/LLVMNativeImageCodeCache.java @@ -374,7 +374,7 @@ public interface StackMapDumper { void close(); } - private class EnabledStackMapDumper implements StackMapDumper { + private final class EnabledStackMapDumper implements StackMapDumper { private final FileWriter stackMapDump; { @@ -454,7 +454,7 @@ private void dump(String str) { } } - private static class DisabledStackMapDumper implements StackMapDumper { + private static final class DisabledStackMapDumper implements StackMapDumper { @Override public void dumpOffsets(LLVMTextSectionInfo textSectionInfo) { } diff --git a/substratevm/src/com.oracle.svm.core.graal.llvm/src/com/oracle/svm/core/graal/llvm/runtime/LLVMExceptionUnwind.java b/substratevm/src/com.oracle.svm.core.graal.llvm/src/com/oracle/svm/core/graal/llvm/runtime/LLVMExceptionUnwind.java index 534db288dddb..b9953d72aa34 100644 --- a/substratevm/src/com.oracle.svm.core.graal.llvm/src/com/oracle/svm/core/graal/llvm/runtime/LLVMExceptionUnwind.java +++ b/substratevm/src/com.oracle.svm.core.graal.llvm/src/com/oracle/svm/core/graal/llvm/runtime/LLVMExceptionUnwind.java @@ -115,7 +115,7 @@ public static Throwable retrieveException() { return exception; } - private static class IncludeForLLVMOnly implements BooleanSupplier { + private static final class IncludeForLLVMOnly implements BooleanSupplier { @Override public boolean getAsBoolean() { return SubstrateOptions.useLLVMBackend(); diff --git a/substratevm/src/com.oracle.svm.core.graal.llvm/src/com/oracle/svm/core/graal/llvm/util/LLVMObjectFileReader.java b/substratevm/src/com.oracle.svm.core.graal.llvm/src/com/oracle/svm/core/graal/llvm/util/LLVMObjectFileReader.java index 1fed6b3517fd..969d824f3fea 100644 --- a/substratevm/src/com.oracle.svm.core.graal.llvm/src/com/oracle/svm/core/graal/llvm/util/LLVMObjectFileReader.java +++ b/substratevm/src/com.oracle.svm.core.graal.llvm/src/com/oracle/svm/core/graal/llvm/util/LLVMObjectFileReader.java @@ -80,7 +80,7 @@ private interface SymbolReader { Symbol apply(LLVMSymbolIteratorRef symbolIterator, LLVMSectionIteratorRef sectionIterator); } - private static class LLVMSectionInfo { + private static final class LLVMSectionInfo { private Section sectionInfo; private List symbolInfo = new ArrayList<>(); } diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/DebugHelper.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/DebugHelper.java index ec2cbcb86cea..f41c906804ff 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/DebugHelper.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/DebugHelper.java @@ -331,7 +331,7 @@ private static boolean isReference(DynamicHub hub) { } @Platforms(Platform.HOSTED_ONLY.class) - private static class IncludeDebugHelperMethods implements BooleanSupplier { + private static final class IncludeDebugHelperMethods implements BooleanSupplier { @Override public boolean getAsBoolean() { return SubstrateOptions.IncludeDebugHelperMethods.getValue(); diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/JavaMainWrapper.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/JavaMainWrapper.java index bb18e8e369af..497a1ce6e621 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/JavaMainWrapper.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/JavaMainWrapper.java @@ -341,7 +341,7 @@ private static int doRunInNewThread(int argc, CCharPointerPointer argv) { private static final CGlobalData RUN_MAIN_ROUTINE = CGlobalDataFactory.forSymbol("__svm_JavaMainWrapper_runMainRoutine"); - private static class RunMainInNewThreadBooleanSupplier implements BooleanSupplier { + private static final class RunMainInNewThreadBooleanSupplier implements BooleanSupplier { @Override public boolean getAsBoolean() { if (!ImageSingletons.contains(JavaMainSupport.class)) { @@ -438,7 +438,7 @@ public static String getCRuntimeArgument0() { return CTypeConversion.toJavaString(MAIN_ISOLATE_PARAMETERS.get().getArgv().read(0)); } - private static class EnterCreateIsolateWithCArgumentsPrologue implements CEntryPointOptions.Prologue { + private static final class EnterCreateIsolateWithCArgumentsPrologue implements CEntryPointOptions.Prologue { private static final CGlobalData errorMessage = CGlobalDataFactory.createCString( "Failed to create the main Isolate."); diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/SubstrateDiagnostics.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/SubstrateDiagnostics.java index f6c6809c52e0..57b31d6bd348 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/SubstrateDiagnostics.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/SubstrateDiagnostics.java @@ -568,7 +568,7 @@ public void clear() { } } - private static class DumpRegisters extends DiagnosticThunk { + private static final class DumpRegisters extends DiagnosticThunk { @Override public int maxInvocationCount() { return 4; @@ -590,7 +590,7 @@ public void printDiagnostics(Log log, ErrorContext context, int maxDiagnosticLev } } - private static class DumpInstructions extends DiagnosticThunk { + private static final class DumpInstructions extends DiagnosticThunk { @Override public int maxInvocationCount() { return 4; @@ -638,7 +638,7 @@ private static void hexDump(Log log, CodePointer ip, int bytesBefore, int bytesA } } - private static class DumpTopOfCurrentThreadStack extends DiagnosticThunk { + private static final class DumpTopOfCurrentThreadStack extends DiagnosticThunk { @Override public int maxInvocationCount() { return 1; @@ -699,7 +699,7 @@ public void printDiagnostics(Log log, ErrorContext context, int maxDiagnosticLev } } - private static class DumpThreads extends DiagnosticThunk { + private static final class DumpThreads extends DiagnosticThunk { @Override public int maxInvocationCount() { return 3; @@ -750,7 +750,7 @@ public void printDiagnostics(Log log, ErrorContext context, int maxDiagnosticLev } } - private static class DumpCurrentThreadLocals extends DiagnosticThunk { + private static final class DumpCurrentThreadLocals extends DiagnosticThunk { @Override public int maxInvocationCount() { return 2; @@ -774,7 +774,7 @@ public void printDiagnostics(Log log, ErrorContext context, int maxDiagnosticLev } } - private static class DumpCurrentVMOperation extends DiagnosticThunk { + private static final class DumpCurrentVMOperation extends DiagnosticThunk { @Override public int maxInvocationCount() { return 2; @@ -789,7 +789,7 @@ public void printDiagnostics(Log log, ErrorContext context, int maxDiagnosticLev } } - private static class DumpVMOperationHistory extends DiagnosticThunk { + private static final class DumpVMOperationHistory extends DiagnosticThunk { @Override public int maxInvocationCount() { return 2; @@ -973,7 +973,7 @@ private static UnsignedWord getContainerPhysicalMemory() { } } - private static class DumpCounters extends DiagnosticThunk { + private static final class DumpCounters extends DiagnosticThunk { @Override public int maxInvocationCount() { return 1; @@ -991,7 +991,7 @@ public void printDiagnostics(Log log, ErrorContext context, int maxDiagnosticLev } } - private static class DumpCurrentThreadFrameAnchors extends DiagnosticThunk { + private static final class DumpCurrentThreadFrameAnchors extends DiagnosticThunk { @Override public int maxInvocationCount() { return 1; @@ -1007,7 +1007,7 @@ public void printDiagnostics(Log log, ErrorContext context, int maxDiagnosticLev } } - private static class DumpCurrentThreadDecodedStackTrace extends DiagnosticThunk { + private static final class DumpCurrentThreadDecodedStackTrace extends DiagnosticThunk { @Override public int maxInvocationCount() { return 3; @@ -1055,7 +1055,7 @@ private static void startStackWalkInMostLikelyCaller(Log log, int invocationCoun } } - private static class DumpOtherStackTraces extends DiagnosticThunk { + private static final class DumpOtherStackTraces extends DiagnosticThunk { @Override public int maxInvocationCount() { return 3; @@ -1103,7 +1103,7 @@ private static void printStackTrace(Log log, IsolateThread vmThread, int invocat } } - private static class DumpCommandLine extends DiagnosticThunk { + private static final class DumpCommandLine extends DiagnosticThunk { @Override public int maxInvocationCount() { return 1; @@ -1123,7 +1123,7 @@ public void printDiagnostics(Log log, ErrorContext context, int maxDiagnosticLev } } - private static class ImageCodeLocationInfoPrinter { + private static final class ImageCodeLocationInfoPrinter { private final CodeInfoDecoder.FrameInfoCursor frameInfoCursor = new CodeInfoDecoder.FrameInfoCursor(); /** diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/code/CodeInfoDecoder.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/code/CodeInfoDecoder.java index 4a6e99458239..c91a875a5831 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/code/CodeInfoDecoder.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/code/CodeInfoDecoder.java @@ -758,7 +758,7 @@ public FrameInfoState reset() { } } - private static class SingleShotFrameInfoQueryResultAllocator implements FrameInfoDecoder.FrameInfoQueryResultAllocator { + private static final class SingleShotFrameInfoQueryResultAllocator implements FrameInfoDecoder.FrameInfoQueryResultAllocator { private final FrameInfoQueryResult frameInfoQueryResult = new FrameInfoQueryResult(); private boolean fired; diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/code/FrameInfoDecoder.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/code/FrameInfoDecoder.java index 19f26c790bc9..cfe4647edf55 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/code/FrameInfoDecoder.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/code/FrameInfoDecoder.java @@ -208,7 +208,7 @@ public void decodeConstant(ValueInfo valueInfo, NonmovableObjectArray frameIn static final HeapBasedValueInfoAllocator HeapBasedValueInfoAllocator = new HeapBasedValueInfoAllocator(); - private static class CompressedFrameDecoderHelper { + private static final class CompressedFrameDecoderHelper { /** * Differentiates between compressed and uncompressed frame slices. Uncompressed frame * slices start with {@link #UNCOMPRESSED_FRAME_SLICE_MARKER}. diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/code/FrameInfoEncoder.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/code/FrameInfoEncoder.java index 1634beabd0a6..8454d08dc8b7 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/code/FrameInfoEncoder.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/code/FrameInfoEncoder.java @@ -236,7 +236,7 @@ record CompressedFrameData( * compressed and uncompressed frame slices, uncompressed frame slices start with the * {@link FrameInfoDecoder#UNCOMPRESSED_FRAME_SLICE_MARKER}. */ - private static class CompressedFrameInfoEncodingMetadata { + private static final class CompressedFrameInfoEncodingMetadata { final List framesToEncode = new ArrayList<>(); final EconomicMap framesToEncodeIndexMap = EconomicMap.create(Equivalence.DEFAULT); final List> frameSlices = new ArrayList<>(); diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/container/Container.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/container/Container.java index 75892227f5e8..c20a0af1e969 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/container/Container.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/container/Container.java @@ -175,7 +175,7 @@ public long getCachedMemoryLimitInBytes() { return cachedMemoryLimitInBytes; } - private static class State { + private static final class State { static final UnsignedWord UNINITIALIZED = Word.unsigned(0); static final UnsignedWord INITIALIZING = Word.unsigned(1); static final UnsignedWord NOT_CONTAINERIZED = Word.unsigned(2); diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/graal/snippets/NonSnippetLowerings.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/graal/snippets/NonSnippetLowerings.java index 60f8ed9ba6ea..a38f4f1a4253 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/graal/snippets/NonSnippetLowerings.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/graal/snippets/NonSnippetLowerings.java @@ -235,7 +235,7 @@ private ForeignCallDescriptor lookupBytecodeException(BytecodeExceptionKind exce return descriptor; } - private class BytecodeExceptionLowering implements NodeLoweringProvider { + private final class BytecodeExceptionLowering implements NodeLoweringProvider { @Override public void lower(BytecodeExceptionNode node, LoweringTool tool) { if (tool.getLoweringStage() == StandardLoweringStage.HIGH_TIER) { @@ -256,7 +256,7 @@ public void lower(BytecodeExceptionNode node, LoweringTool tool) { } } - private class ThrowBytecodeExceptionLowering implements NodeLoweringProvider { + private final class ThrowBytecodeExceptionLowering implements NodeLoweringProvider { @Override public void lower(ThrowBytecodeExceptionNode node, LoweringTool tool) { if (tool.getLoweringStage() == StandardLoweringStage.HIGH_TIER) { @@ -279,7 +279,7 @@ public void lower(ThrowBytecodeExceptionNode node, LoweringTool tool) { } } - private static class GetClassLowering implements NodeLoweringProvider { + private static final class GetClassLowering implements NodeLoweringProvider { @Override public void lower(GetClassNode node, LoweringTool tool) { StampProvider stampProvider = tool.getStampProvider(); diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/graal/snippets/SubstrateAllocationSnippets.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/graal/snippets/SubstrateAllocationSnippets.java index bcdab1271587..657a47069e9f 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/graal/snippets/SubstrateAllocationSnippets.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/graal/snippets/SubstrateAllocationSnippets.java @@ -762,7 +762,7 @@ private static boolean shouldForceSlowPath(StructuredGraph graph) { return GraalOptions.ReduceCodeSize.getValue(graph.getOptions()); } - private class NewInstanceLowering implements NodeLoweringProvider { + private final class NewInstanceLowering implements NodeLoweringProvider { @Override public void lower(NewInstanceNode node, LoweringTool tool) { StructuredGraph graph = node.graph(); @@ -789,7 +789,7 @@ public void lower(NewInstanceNode node, LoweringTool tool) { } } - private class NewInstanceWithExceptionLowering implements NodeLoweringProvider { + private final class NewInstanceWithExceptionLowering implements NodeLoweringProvider { @Override public void lower(NewInstanceWithExceptionNode node, LoweringTool tool) { StructuredGraph graph = node.graph(); @@ -815,7 +815,7 @@ public void lower(NewInstanceWithExceptionNode node, LoweringTool tool) { } } - private class NewHybridInstanceLowering implements NodeLoweringProvider { + private final class NewHybridInstanceLowering implements NodeLoweringProvider { @Override public void lower(SubstrateNewHybridInstanceNode node, LoweringTool tool) { StructuredGraph graph = node.graph(); @@ -852,7 +852,7 @@ public void lower(SubstrateNewHybridInstanceNode node, LoweringTool tool) { } } - private class NewStoredContinuationLowering implements NodeLoweringProvider { + private final class NewStoredContinuationLowering implements NodeLoweringProvider { @Override public void lower(NewStoredContinuationNode node, LoweringTool tool) { StructuredGraph graph = node.graph(); @@ -883,7 +883,7 @@ public void lower(NewStoredContinuationNode node, LoweringTool tool) { } } - private class NewArrayLowering implements NodeLoweringProvider { + private final class NewArrayLowering implements NodeLoweringProvider { @Override public void lower(NewArrayNode node, LoweringTool tool) { StructuredGraph graph = node.graph(); @@ -917,7 +917,7 @@ public void lower(NewArrayNode node, LoweringTool tool) { } } - private class NewArrayWithExceptionLowering implements NodeLoweringProvider { + private final class NewArrayWithExceptionLowering implements NodeLoweringProvider { @Override public void lower(NewArrayWithExceptionNode node, LoweringTool tool) { StructuredGraph graph = node.graph(); @@ -952,7 +952,7 @@ public void lower(NewArrayWithExceptionNode node, LoweringTool tool) { } } - private class NewMultiArrayLowering implements NodeLoweringProvider { + private final class NewMultiArrayLowering implements NodeLoweringProvider { @Override public void lower(NewMultiArrayNode node, LoweringTool tool) { StructuredGraph graph = node.graph(); @@ -979,7 +979,7 @@ public void lower(NewMultiArrayNode node, LoweringTool tool) { } } - private class NewMultiArrayWithExceptionLowering implements NodeLoweringProvider { + private final class NewMultiArrayWithExceptionLowering implements NodeLoweringProvider { @Override public void lower(NewMultiArrayWithExceptionNode node, LoweringTool tool) { StructuredGraph graph = node.graph(); @@ -1006,7 +1006,7 @@ public void lower(NewMultiArrayWithExceptionNode node, LoweringTool tool) { } } - private class DynamicNewInstanceLowering implements NodeLoweringProvider { + private final class DynamicNewInstanceLowering implements NodeLoweringProvider { @Override public void lower(DynamicNewInstanceNode node, LoweringTool tool) { StructuredGraph graph = node.graph(); @@ -1028,7 +1028,7 @@ public void lower(DynamicNewInstanceNode node, LoweringTool tool) { } } - private class DynamicNewInstanceWithExceptionLowering implements NodeLoweringProvider { + private final class DynamicNewInstanceWithExceptionLowering implements NodeLoweringProvider { @Override public void lower(DynamicNewInstanceWithExceptionNode node, LoweringTool tool) { StructuredGraph graph = node.graph(); @@ -1050,7 +1050,7 @@ public void lower(DynamicNewInstanceWithExceptionNode node, LoweringTool tool) { } } - private class DynamicNewArrayLowering implements NodeLoweringProvider { + private final class DynamicNewArrayLowering implements NodeLoweringProvider { @Override public void lower(DynamicNewArrayNode node, LoweringTool tool) { StructuredGraph graph = node.graph(); @@ -1073,7 +1073,7 @@ public void lower(DynamicNewArrayNode node, LoweringTool tool) { } } - private class DynamicNewArrayWithExceptionLowering implements NodeLoweringProvider { + private final class DynamicNewArrayWithExceptionLowering implements NodeLoweringProvider { @Override public void lower(DynamicNewArrayWithExceptionNode node, LoweringTool tool) { StructuredGraph graph = node.graph(); @@ -1096,7 +1096,7 @@ public void lower(DynamicNewArrayWithExceptionNode node, LoweringTool tool) { } } - private class ValidateNewInstanceClassLowering implements NodeLoweringProvider { + private final class ValidateNewInstanceClassLowering implements NodeLoweringProvider { @Override public void lower(ValidateNewInstanceClassNode node, LoweringTool tool) { StructuredGraph graph = node.graph(); @@ -1108,7 +1108,7 @@ public void lower(ValidateNewInstanceClassNode node, LoweringTool tool) { } } - private class NewPodInstanceLowering implements NodeLoweringProvider { + private final class NewPodInstanceLowering implements NodeLoweringProvider { @Override public void lower(NewPodInstanceNode node, LoweringTool tool) { StructuredGraph graph = node.graph(); @@ -1135,7 +1135,7 @@ public void lower(NewPodInstanceNode node, LoweringTool tool) { } } - private class NewDynamicHubLowering implements NodeLoweringProvider { + private final class NewDynamicHubLowering implements NodeLoweringProvider { @Override public void lower(SubstrateNewDynamicHubNode node, LoweringTool tool) { StructuredGraph graph = node.graph(); diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/heap/dump/HeapDumpMetadata.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/heap/dump/HeapDumpMetadata.java index 79f73b148ae6..465402c7f2ef 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/heap/dump/HeapDumpMetadata.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/heap/dump/HeapDumpMetadata.java @@ -426,7 +426,7 @@ public interface FieldNamePointer extends PointerBase { FieldName read(); } - private static class ComputeHubDataVisitor implements ObjectVisitor { + private static final class ComputeHubDataVisitor implements ObjectVisitor { private int classSerialNum; public void initialize() { diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/heap/dump/HeapDumpWriter.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/heap/dump/HeapDumpWriter.java index 196999b34800..e2fa4ec17412 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/heap/dump/HeapDumpWriter.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/heap/dump/HeapDumpWriter.java @@ -1438,6 +1438,6 @@ private void markThreadLocalAsGCRoot(Object obj) { } } - private static class UnknownClass { + private static final class UnknownClass { } } diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/hub/DynamicHub.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/hub/DynamicHub.java index f329bf51111d..7a942170df11 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/hub/DynamicHub.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/hub/DynamicHub.java @@ -2137,35 +2137,35 @@ public boolean isReached() { return classInitializationInfo.isTypeReached(this); } - private static class ReflectionDataAccessors { + private static final class ReflectionDataAccessors { @SuppressWarnings("unused") private static SoftReference> getReflectionData(DynamicHub that) { return that.companion.getReflectionData(); } } - private static class ClassLoaderAccessors { + private static final class ClassLoaderAccessors { @SuppressWarnings("unused") private static ClassLoader getClassLoader(DynamicHub that) { return that.companion.getClassLoader(); } } - private static class AnnotationDataAccessors { + private static final class AnnotationDataAccessors { @SuppressWarnings("unused") private static Target_java_lang_Class_AnnotationData getAnnotationData(DynamicHub that) { return that.companion.getAnnotationData(); } } - private static class AnnotationTypeAccessors { + private static final class AnnotationTypeAccessors { @SuppressWarnings("unused") private static AnnotationType getAnnotationType(DynamicHub that) { return that.companion.getAnnotationType(); } } - private static class CachedConstructorAccessors { + private static final class CachedConstructorAccessors { @SuppressWarnings("unused") private static Constructor getCachedConstructor(DynamicHub that) { /* diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/localization/substitutions/Target_java_util_Locale.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/localization/substitutions/Target_java_util_Locale.java index 9b4473c24702..1ad0e9f5acdb 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/localization/substitutions/Target_java_util_Locale.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/localization/substitutions/Target_java_util_Locale.java @@ -45,7 +45,7 @@ final class Target_java_util_Locale { private static native Locale initDefault(); @SuppressWarnings("unused") - private static class DefaultLocaleAccessors { + private static final class DefaultLocaleAccessors { static Locale get() { if (Util_java_util_Locale.injectedDefaultLocale == null) { Util_java_util_Locale.injectedDefaultLocale = Target_java_util_Locale.initDefault(); diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jfr/JfrSymbolRepository.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jfr/JfrSymbolRepository.java index 57f8e1a9452b..9502dbd4d652 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jfr/JfrSymbolRepository.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jfr/JfrSymbolRepository.java @@ -245,7 +245,7 @@ void teardown() { } } - private static class ReplaceDotWithSlash implements CharReplacer { + private static final class ReplaceDotWithSlash implements CharReplacer { @Override @Uninterruptible(reason = "Called from uninterruptible code.", mayBeInlined = true) public char replace(char ch) { diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jfr/JfrTypeRepository.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jfr/JfrTypeRepository.java index 92cb6ee979e6..bd8d8f7f2d9f 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jfr/JfrTypeRepository.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jfr/JfrTypeRepository.java @@ -327,7 +327,7 @@ private void clearEpochData() { currentClassLoaderId = 0; } - private static class TypeInfo { + private static final class TypeInfo { final Set> classes = new HashSet<>(); final Map packages = new HashMap<>(); final Map modules = new HashMap<>(); diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jvmti/JvmtiFunctions.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jvmti/JvmtiFunctions.java index 6e0fd4c70286..78d7fdff7e3e 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jvmti/JvmtiFunctions.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jvmti/JvmtiFunctions.java @@ -1386,7 +1386,7 @@ static int SetHeapSamplingInterval(JvmtiExternalEnv externalEnv, int samplingInt // Checkstyle: resume - private static class JvmtiEnvEnterPrologue implements CEntryPointOptions.Prologue { + private static final class JvmtiEnvEnterPrologue implements CEntryPointOptions.Prologue { /** * In the prologue, we need to be careful that we don't access any image heap data before * the heap base is set up, so we use @CConstant instead of @CEnum. diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/log/RealLog.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/log/RealLog.java index 819e36de937f..e8b61e8650d9 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/log/RealLog.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/log/RealLog.java @@ -733,9 +733,9 @@ private void printRemainingFramesCount(int remaining) { } } - private class BacktracePrinter extends BacktraceDecoder { + private final class BacktracePrinter extends BacktraceDecoder { - protected final int printBacktrace(long[] backtrace, int maxFramesProcessed) { + protected int printBacktrace(long[] backtrace, int maxFramesProcessed) { return visitBacktrace(backtrace, maxFramesProcessed, SubstrateOptions.maxJavaStackTraceDepth()); } diff --git a/substratevm/src/com.oracle.svm.driver/src/com/oracle/svm/driver/ArgFilesOptionPreprocessor.java b/substratevm/src/com.oracle.svm.driver/src/com/oracle/svm/driver/ArgFilesOptionPreprocessor.java index 99a28e723261..1dfd37903942 100644 --- a/substratevm/src/com.oracle.svm.driver/src/com/oracle/svm/driver/ArgFilesOptionPreprocessor.java +++ b/substratevm/src/com.oracle.svm.driver/src/com/oracle/svm/driver/ArgFilesOptionPreprocessor.java @@ -71,7 +71,7 @@ private enum PARSER_STATE { IN_TOKEN } - private static class CTX_ARGS { + private static final class CTX_ARGS { PARSER_STATE state; int cptr; int eob; diff --git a/substratevm/src/com.oracle.svm.graal.hotspot.libgraal/src/com/oracle/svm/graal/hotspot/libgraal/LibGraalSubstitutions.java b/substratevm/src/com.oracle.svm.graal.hotspot.libgraal/src/com/oracle/svm/graal/hotspot/libgraal/LibGraalSubstitutions.java index 3a70db24f24b..14b29ffd7afd 100644 --- a/substratevm/src/com.oracle.svm.graal.hotspot.libgraal/src/com/oracle/svm/graal/hotspot/libgraal/LibGraalSubstitutions.java +++ b/substratevm/src/com.oracle.svm.graal.hotspot.libgraal/src/com/oracle/svm/graal/hotspot/libgraal/LibGraalSubstitutions.java @@ -203,7 +203,7 @@ private long getAddress() { * instance at image build-time. This FieldValueTransformer ensures that. */ @Platforms(HOSTED_ONLY.class) - private static class GlobalAtomicLongAddressProvider implements FieldValueTransformer { + private static final class GlobalAtomicLongAddressProvider implements FieldValueTransformer { @Override public Object transform(Object receiver, Object originalValue) { long initialValue; diff --git a/substratevm/src/com.oracle.svm.graal/src/com/oracle/svm/graal/hosted/runtimecompilation/RuntimeCompilationFeature.java b/substratevm/src/com.oracle.svm.graal/src/com/oracle/svm/graal/hosted/runtimecompilation/RuntimeCompilationFeature.java index 62d5d91f9c9d..ba21dd662f55 100644 --- a/substratevm/src/com.oracle.svm.graal/src/com/oracle/svm/graal/hosted/runtimecompilation/RuntimeCompilationFeature.java +++ b/substratevm/src/com.oracle.svm.graal/src/com/oracle/svm/graal/hosted/runtimecompilation/RuntimeCompilationFeature.java @@ -622,7 +622,7 @@ private void printFailingRuntimeMethodTrace(CallTreeInfo treeInfo, AnalysisMetho } } - private class RuntimeCompilationParsingSupport implements SVMParsingSupport { + private final class RuntimeCompilationParsingSupport implements SVMParsingSupport { RuntimeCompilationInlineBeforeAnalysisPolicy runtimeInlineBeforeAnalysisPolicy = null; @Override @@ -966,7 +966,7 @@ private static T getFullRuntimeVersion(BigBang bb, T return (T) runtimeMethod; } - private class RuntimeCompilationAnalysisPolicy implements HostVM.MultiMethodAnalysisPolicy { + private final class RuntimeCompilationAnalysisPolicy implements HostVM.MultiMethodAnalysisPolicy { @Override public Collection determineCallees(BigBang bb, T implementation, T target, MultiMethod.MultiMethodKey callerMultiMethodKey, InvokeTypeFlow invokeFlow) { diff --git a/substratevm/src/com.oracle.svm.graal/src/com/oracle/svm/graal/hosted/runtimecompilation/RuntimeCompiledMethodSupport.java b/substratevm/src/com.oracle.svm.graal/src/com/oracle/svm/graal/hosted/runtimecompilation/RuntimeCompiledMethodSupport.java index acb6133742e9..f7d6983baf61 100644 --- a/substratevm/src/com.oracle.svm.graal/src/com/oracle/svm/graal/hosted/runtimecompilation/RuntimeCompiledMethodSupport.java +++ b/substratevm/src/com.oracle.svm.graal/src/com/oracle/svm/graal/hosted/runtimecompilation/RuntimeCompiledMethodSupport.java @@ -499,7 +499,7 @@ protected void run(StructuredGraph graph) { * Removes {@link DeoptEntryNode}s, {@link DeoptProxyAnchorNode}s, and {@link DeoptProxyNode}s * which are determined to be unnecessary after the runtime compilation methods are optimized. */ - private static class RemoveUnneededDeoptSupport extends Phase { + private static final class RemoveUnneededDeoptSupport extends Phase { enum RemovalDecision { KEEP, PROXIFY, @@ -545,7 +545,7 @@ protected void run(StructuredGraph graph) { } } - RemovalDecision getDecision(StateSplit node, EconomicMap decisionCache) { + static RemovalDecision getDecision(StateSplit node, EconomicMap decisionCache) { RemovalDecision cached = decisionCache.get(node); if (cached != null) { return cached; diff --git a/substratevm/src/com.oracle.svm.graal/src/com/oracle/svm/graal/meta/RuntimeCodeInstaller.java b/substratevm/src/com.oracle.svm.graal/src/com/oracle/svm/graal/meta/RuntimeCodeInstaller.java index acf3c18576ff..5682a635e08e 100644 --- a/substratevm/src/com.oracle.svm.graal/src/com/oracle/svm/graal/meta/RuntimeCodeInstaller.java +++ b/substratevm/src/com.oracle.svm.graal/src/com/oracle/svm/graal/meta/RuntimeCodeInstaller.java @@ -300,7 +300,7 @@ private int patchData(Map patcher, ObjectConstantsH return patchesHandled; } - private static class RuntimeFrameInfoCustomization extends FrameInfoEncoder.SourceFieldsFromImage { + private static final class RuntimeFrameInfoCustomization extends FrameInfoEncoder.SourceFieldsFromImage { @Override protected boolean storeDeoptTargetMethod() { return true; diff --git a/substratevm/src/com.oracle.svm.hosted.foreign/src/com/oracle/svm/hosted/foreign/ForeignFunctionsFeature.java b/substratevm/src/com.oracle.svm.hosted.foreign/src/com/oracle/svm/hosted/foreign/ForeignFunctionsFeature.java index f673d4329c47..4fe28ec02cde 100644 --- a/substratevm/src/com.oracle.svm.hosted.foreign/src/com/oracle/svm/hosted/foreign/ForeignFunctionsFeature.java +++ b/substratevm/src/com.oracle.svm.hosted.foreign/src/com/oracle/svm/hosted/foreign/ForeignFunctionsFeature.java @@ -164,7 +164,7 @@ public int hashCode() { } } - private class RuntimeForeignAccessSupportImpl extends ConditionalConfigurationRegistry implements StronglyTypedRuntimeForeignAccessSupport { + private final class RuntimeForeignAccessSupportImpl extends ConditionalConfigurationRegistry implements StronglyTypedRuntimeForeignAccessSupport { private final Lookup implLookup = ReflectionUtil.readStaticField(MethodHandles.Lookup.class, "IMPL_LOOKUP"); @@ -186,7 +186,7 @@ public void registerForDirectUpcall(ConfigurationCondition condition, MethodHand DirectMethodHandleDesc directMethodHandleDesc = target.describeConstable() .filter(x -> x instanceof DirectMethodHandleDesc dmh && dmh.kind() == Kind.STATIC) .map(x -> ((DirectMethodHandleDesc) x)) - .orElseThrow(() -> new IllegalArgumentException("target must be a direct method handle to a static method")); + .orElseThrow(() -> new IllegalArgumentException("Target must be a direct method handle to a static method")); /* * The call 'implLookup.revealDirect' can only succeed if the method handle is * crackable. The call is expected to succeed because we already call diff --git a/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/ClassPredefinitionFeature.java b/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/ClassPredefinitionFeature.java index 0aa2d92bb2e1..b5eedb2c7aa0 100644 --- a/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/ClassPredefinitionFeature.java +++ b/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/ClassPredefinitionFeature.java @@ -152,7 +152,7 @@ public void beforeAnalysis(BeforeAnalysisAccess access) { } } - private class PredefinedClassesRegistryImpl implements PredefinedClassesRegistry { + private final class PredefinedClassesRegistryImpl implements PredefinedClassesRegistry { @Override public void add(String nameInfo, String providedHash, URI baseUri) { if (!PredefinedClassesSupport.supportsBytecodes()) { diff --git a/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/NativeImageClassLoader.java b/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/NativeImageClassLoader.java index d92e5cea00ca..59e3ecfc338d 100644 --- a/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/NativeImageClassLoader.java +++ b/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/NativeImageClassLoader.java @@ -794,7 +794,7 @@ private static ModuleReader createModuleReader(ModuleReference mref) { /** * See {@code jdk.internal.loader.Loader#NullModuleReader}. */ - private static class NullModuleReader implements ModuleReader { + private static final class NullModuleReader implements ModuleReader { @Override public Optional find(String name) { return Optional.empty(); diff --git a/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/NativeImageSystemIOWrappers.java b/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/NativeImageSystemIOWrappers.java index 77e2a7f80744..ce9830fa7539 100644 --- a/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/NativeImageSystemIOWrappers.java +++ b/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/NativeImageSystemIOWrappers.java @@ -109,7 +109,7 @@ private void maybeInformProgressReporterOnce() { } } - private static class NativeImageSystemIOWrappersDisabled extends NativeImageSystemIOWrappers { + private static final class NativeImageSystemIOWrappersDisabled extends NativeImageSystemIOWrappers { private static final PrintStream NULL_PRINT_STREAM = new PrintStream(OutputStream.nullOutputStream()); @Override diff --git a/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/OpenTypeWorldFeature.java b/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/OpenTypeWorldFeature.java index d15f230c9fad..7bea88352544 100644 --- a/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/OpenTypeWorldFeature.java +++ b/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/OpenTypeWorldFeature.java @@ -164,7 +164,7 @@ public int hashCode() { } } - private static class LayerTypeCheckInfo implements LayeredImageSingleton { + private static final class LayerTypeCheckInfo implements LayeredImageSingleton { Map identifierToTypeInfo = new HashMap<>(); int maxTypeID = 0; diff --git a/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/ProgressReporter.java b/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/ProgressReporter.java index a313f80ec77e..cf8debbbbd27 100644 --- a/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/ProgressReporter.java +++ b/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/ProgressReporter.java @@ -886,7 +886,7 @@ private static OperatingSystemMXBean getOperatingSystemMXBean() { return (OperatingSystemMXBean) ManagementFactory.getOperatingSystemMXBean(); } - private static class Utils { + private static final class Utils { private static final double MILLIS_TO_SECONDS = 1000d; private static final double NANOS_TO_SECONDS = 1000d * 1000d * 1000d; diff --git a/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/SubstitutionReportFeature.java b/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/SubstitutionReportFeature.java index 5bb641c25f80..98ef8061311a 100644 --- a/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/SubstitutionReportFeature.java +++ b/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/SubstitutionReportFeature.java @@ -155,7 +155,7 @@ private static String formatSubstitution(String jar, String type, T original return '\'' + jar + "'," + type + ',' + formatter.apply(original) + ',' + formatter.apply(annotated); } - private static class Substitutions { + private static final class Substitutions { private final Map substitutedTypes = new TreeMap<>(Comparator.comparing(SubstitutionReportFeature::formatType)); private final Map substitutedMethods = new TreeMap<>(Comparator.comparing(SubstitutionReportFeature::formatMethod)); private final Map substitutedFields = new TreeMap<>(Comparator.comparing(SubstitutionReportFeature::formatField)); diff --git a/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/code/CEntryPointCallStubMethod.java b/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/code/CEntryPointCallStubMethod.java index 9cdfa4b61c40..0cd79b174e31 100644 --- a/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/code/CEntryPointCallStubMethod.java +++ b/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/code/CEntryPointCallStubMethod.java @@ -446,7 +446,7 @@ private static InvokeWithExceptionNode generatePrologueOrEpilogueInvoke(Substrat return invoke; } - private static class ExecutionContextParameters { + private static final class ExecutionContextParameters { int isolateCount = 0; int lastIsolateIndex = -1; int designatedIsolateIndex = -1; diff --git a/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/dashboard/HeapBreakdown.java b/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/dashboard/HeapBreakdown.java index a71fc49af37d..2cc509b68068 100644 --- a/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/dashboard/HeapBreakdown.java +++ b/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/dashboard/HeapBreakdown.java @@ -51,7 +51,7 @@ Map getData() { return sizes.entrySet().stream().collect(Collectors.toMap(Entry::getKey, (Entry e) -> new Long[]{e.getValue().size, e.getValue().count})); } - private static class Statistics { + private static final class Statistics { long size = 0; long count = 0; } diff --git a/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/dashboard/PointsToBreakdown.java b/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/dashboard/PointsToBreakdown.java index 66770332b009..b5620ec77d06 100644 --- a/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/dashboard/PointsToBreakdown.java +++ b/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/dashboard/PointsToBreakdown.java @@ -233,7 +233,7 @@ static class Port { } } - private static class PointToStructure implements GraphStructure { + private static final class PointToStructure implements GraphStructure { enum EMPT { EDGE } diff --git a/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/image/NativeImageCodeCache.java b/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/image/NativeImageCodeCache.java index 4a45b8784331..f348152cc099 100644 --- a/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/image/NativeImageCodeCache.java +++ b/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/image/NativeImageCodeCache.java @@ -735,7 +735,7 @@ private void printCompilationResults(PrintWriter writer) { } - private static class HostedFrameInfoCustomization extends FrameInfoEncoder.SourceFieldsFromMethod { + private static final class HostedFrameInfoCustomization extends FrameInfoEncoder.SourceFieldsFromMethod { int numDeoptEntryPoints; int numDuringCallEntryPoints; diff --git a/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/image/sources/SourceCache.java b/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/image/sources/SourceCache.java index 70f8a46965b8..e18f037fe135 100644 --- a/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/image/sources/SourceCache.java +++ b/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/image/sources/SourceCache.java @@ -63,7 +63,7 @@ public class SourceCache { - private static class SourceRoots { + private static final class SourceRoots { /** * A list of root directories which may contain source files from which this cache can be * populated. diff --git a/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/jni/JNIAccessFeature.java b/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/jni/JNIAccessFeature.java index ecd895a00128..d56e64298552 100644 --- a/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/jni/JNIAccessFeature.java +++ b/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/jni/JNIAccessFeature.java @@ -216,7 +216,7 @@ public void afterRegistration(AfterRegistrationAccess arg) { ConfigurationFiles.Options.JNIConfigurationFiles, ConfigurationFiles.Options.JNIConfigurationResources, ConfigurationFile.JNI.getFileName()); } - private class JNIRuntimeAccessibilitySupportImpl extends ConditionalConfigurationRegistry + private final class JNIRuntimeAccessibilitySupportImpl extends ConditionalConfigurationRegistry implements RuntimeJNIAccessSupport { @Override diff --git a/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/meta/TypeCheckBuilder.java b/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/meta/TypeCheckBuilder.java index 663e6d735db4..d9531e8547be 100644 --- a/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/meta/TypeCheckBuilder.java +++ b/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/meta/TypeCheckBuilder.java @@ -1869,7 +1869,7 @@ static boolean runtimeIsAssignableFrom(HostedType superType, HostedType checkedT } } - private static class OpenTypeWorldTypeInfo { + private static final class OpenTypeWorldTypeInfo { /** * Within {@link com.oracle.svm.core.hub.DynamicHub} typecheck metadata the ids of the diff --git a/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/reflect/ReflectionGraphKit.java b/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/reflect/ReflectionGraphKit.java index a078629c321f..881d41fc412c 100644 --- a/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/reflect/ReflectionGraphKit.java +++ b/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/reflect/ReflectionGraphKit.java @@ -291,7 +291,7 @@ private ValueNode widenPrimitive(ValueNode unboxedValue, JavaKind fromKind, Java if (fromStackKind == toStackKind) { return unboxedValue; } - + // Checkstyle: stop switch (fromStackKind) { case Int: switch (toStackKind) { @@ -323,5 +323,6 @@ private ValueNode widenPrimitive(ValueNode unboxedValue, JavaKind fromKind, Java default: throw VMError.shouldNotReachHereUnexpectedInput(fromStackKind); // ExcludeFromJacocoGeneratedReport } + // Checkstyle: resume } } diff --git a/substratevm/src/com.oracle.svm.jdwp.bridge/src/com/oracle/svm/jdwp/bridge/ArgFilesOption.java b/substratevm/src/com.oracle.svm.jdwp.bridge/src/com/oracle/svm/jdwp/bridge/ArgFilesOption.java index 22f7062fc760..93394cd4ce3c 100644 --- a/substratevm/src/com.oracle.svm.jdwp.bridge/src/com/oracle/svm/jdwp/bridge/ArgFilesOption.java +++ b/substratevm/src/com.oracle.svm.jdwp.bridge/src/com/oracle/svm/jdwp/bridge/ArgFilesOption.java @@ -74,7 +74,7 @@ private enum PARSER_STATE { IN_TOKEN } - private static class CTX_ARGS { + private static final class CTX_ARGS { PARSER_STATE state; int cptr; int eob; diff --git a/substratevm/src/com.oracle.svm.jdwp.resident/src/com/oracle/svm/jdwp/resident/DebuggingOnDemandHandler.java b/substratevm/src/com.oracle.svm.jdwp.resident/src/com/oracle/svm/jdwp/resident/DebuggingOnDemandHandler.java index b15b8f28f312..ad5619a34ac1 100644 --- a/substratevm/src/com.oracle.svm.jdwp.resident/src/com/oracle/svm/jdwp/resident/DebuggingOnDemandHandler.java +++ b/substratevm/src/com.oracle.svm.jdwp.resident/src/com/oracle/svm/jdwp/resident/DebuggingOnDemandHandler.java @@ -538,7 +538,7 @@ public static boolean suspendDoneOnShellSide() { * com.oracle.svm.hosted.ImageClassLoader#findSystemElements for some reason. */ @SuppressWarnings("unused") - private static class EntryPointHolder { + private static final class EntryPointHolder { @Uninterruptible(reason = "Dummy symbol to make HotSpot's native method linking to look for symbols in the main executable. Required to run the JDWP server (debugger) on HotSpot") @CEntryPoint(name = "JNI_OnLoad_DEFAULT_NAMESPACE", include = ResidentJDWPFeatureEnabled.class) @CEntryPointOptions(prologue = CEntryPointOptions.NoPrologue.class, epilogue = CEntryPointOptions.NoEpilogue.class) diff --git a/substratevm/src/com.oracle.svm.test/src/com/oracle/svm/test/LambdaClassDeserializationTest.java b/substratevm/src/com.oracle.svm.test/src/com/oracle/svm/test/LambdaClassDeserializationTest.java index 534de73d68a9..c0fde7884651 100644 --- a/substratevm/src/com.oracle.svm.test/src/com/oracle/svm/test/LambdaClassDeserializationTest.java +++ b/substratevm/src/com.oracle.svm.test/src/com/oracle/svm/test/LambdaClassDeserializationTest.java @@ -39,7 +39,7 @@ // deserializes lambda class public class LambdaClassDeserializationTest { - private static class SerializeLambda { + private static final class SerializeLambda { public static Function createLambda() { @SuppressWarnings("unchecked") Function lambda = (Function & Serializable) (x) -> "Value of parameter is " + x; @@ -53,7 +53,7 @@ public static void serialize(ByteArrayOutputStream byteArrayOutputStream, Serial } } - private static class DeserializeLambda { + private static final class DeserializeLambda { public static Object deserialize(ByteArrayOutputStream byteArrayOutputStream) throws IOException, ClassNotFoundException { ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(byteArrayOutputStream.toByteArray()); ObjectInputStream objectInputStream = new ObjectInputStream(byteArrayInputStream); diff --git a/substratevm/src/com.oracle.svm.test/src/com/oracle/svm/test/NoHostedAnnotationsTest.java b/substratevm/src/com.oracle.svm.test/src/com/oracle/svm/test/NoHostedAnnotationsTest.java index 4353cdb7cd22..f1b130fd436e 100644 --- a/substratevm/src/com.oracle.svm.test/src/com/oracle/svm/test/NoHostedAnnotationsTest.java +++ b/substratevm/src/com.oracle.svm.test/src/com/oracle/svm/test/NoHostedAnnotationsTest.java @@ -35,7 +35,7 @@ public class NoHostedAnnotationsTest { @DuplicatedInNativeCode - private static class TestClass { + private static final class TestClass { } @Test diff --git a/substratevm/src/com.oracle.svm.test/src/com/oracle/svm/test/jfr/AbstractJfrTest.java b/substratevm/src/com.oracle.svm.test/src/com/oracle/svm/test/jfr/AbstractJfrTest.java index 3d1ba5c5da32..09896542e793 100644 --- a/substratevm/src/com.oracle.svm.test/src/com/oracle/svm/test/jfr/AbstractJfrTest.java +++ b/substratevm/src/com.oracle.svm.test/src/com/oracle/svm/test/jfr/AbstractJfrTest.java @@ -157,7 +157,7 @@ private static boolean isDebuggingEnabled() { return debugRecording != null && !"false".equals(debugRecording); } - private static class ChronologicalComparator implements Comparator { + private static final class ChronologicalComparator implements Comparator { @Override public int compare(RecordedEvent e1, RecordedEvent e2) { return e1.getEndTime().compareTo(e2.getEndTime()); diff --git a/substratevm/src/com.oracle.svm.test/src/com/oracle/svm/test/jfr/TestJavaMonitorEnterEvent.java b/substratevm/src/com.oracle.svm.test/src/com/oracle/svm/test/jfr/TestJavaMonitorEnterEvent.java index 0d38f527c060..ef6aba8397dc 100644 --- a/substratevm/src/com.oracle.svm.test/src/com/oracle/svm/test/jfr/TestJavaMonitorEnterEvent.java +++ b/substratevm/src/com.oracle.svm.test/src/com/oracle/svm/test/jfr/TestJavaMonitorEnterEvent.java @@ -94,7 +94,7 @@ private void validateEvents(List events) { assertTrue("Expected monitor blocked event not found", found); } - private class Helper { + private final class Helper { private synchronized void doWork() throws InterruptedException { if (Thread.currentThread().equals(secondThread)) { return; // second thread doesn't need to do work. diff --git a/substratevm/src/com.oracle.svm.test/src/com/oracle/svm/test/jfr/TestJavaMonitorInflateEvent.java b/substratevm/src/com.oracle.svm.test/src/com/oracle/svm/test/jfr/TestJavaMonitorInflateEvent.java index 39e761e7595e..30a80adc5072 100644 --- a/substratevm/src/com.oracle.svm.test/src/com/oracle/svm/test/jfr/TestJavaMonitorInflateEvent.java +++ b/substratevm/src/com.oracle.svm.test/src/com/oracle/svm/test/jfr/TestJavaMonitorInflateEvent.java @@ -94,7 +94,7 @@ private void validateEvents(List events) { assertTrue("Expected monitor inflate event not found.", foundCauseEnter); } - private class EnterHelper { + private final class EnterHelper { volatile boolean passedCheckpoint = false; synchronized void doWork() throws InterruptedException { diff --git a/substratevm/src/com.oracle.svm.test/src/com/oracle/svm/test/jfr/TestJavaMonitorWaitEvent.java b/substratevm/src/com.oracle.svm.test/src/com/oracle/svm/test/jfr/TestJavaMonitorWaitEvent.java index d31f508bb3d6..3e8ec8df90ef 100644 --- a/substratevm/src/com.oracle.svm.test/src/com/oracle/svm/test/jfr/TestJavaMonitorWaitEvent.java +++ b/substratevm/src/com.oracle.svm.test/src/com/oracle/svm/test/jfr/TestJavaMonitorWaitEvent.java @@ -118,7 +118,7 @@ private void validateEvents(List events) { abs(prodCount - consCount) > 1 || abs(consCount - COUNT) > 1); } - private static class Helper { + private static final class Helper { private int count = 0; private final int bufferSize = 1; diff --git a/substratevm/src/com.oracle.svm.test/src/com/oracle/svm/test/jfr/TestJavaMonitorWaitInterruptEvent.java b/substratevm/src/com.oracle.svm.test/src/com/oracle/svm/test/jfr/TestJavaMonitorWaitInterruptEvent.java index 9383d5ada0ef..56f054c0e9a8 100644 --- a/substratevm/src/com.oracle.svm.test/src/com/oracle/svm/test/jfr/TestJavaMonitorWaitInterruptEvent.java +++ b/substratevm/src/com.oracle.svm.test/src/com/oracle/svm/test/jfr/TestJavaMonitorWaitInterruptEvent.java @@ -144,7 +144,7 @@ private void validateEvents(List events) { simpleWaitFound && interruptedFound); } - private class Helper { + private final class Helper { public synchronized void interrupt() throws InterruptedException { if (Thread.currentThread().equals(interruptedThread)) { // Ensure T1 enters critical section first diff --git a/substratevm/src/com.oracle.svm.test/src/com/oracle/svm/test/jfr/TestJavaMonitorWaitNotifyAllEvent.java b/substratevm/src/com.oracle.svm.test/src/com/oracle/svm/test/jfr/TestJavaMonitorWaitNotifyAllEvent.java index 61e8cbf3ca07..6731315a287b 100644 --- a/substratevm/src/com.oracle.svm.test/src/com/oracle/svm/test/jfr/TestJavaMonitorWaitNotifyAllEvent.java +++ b/substratevm/src/com.oracle.svm.test/src/com/oracle/svm/test/jfr/TestJavaMonitorWaitNotifyAllEvent.java @@ -113,7 +113,7 @@ private void validateEvents(List events) { notifierFound && waitersFound == 2); } - private class Helper { + private final class Helper { public synchronized void doWork() throws InterruptedException { if (Thread.currentThread().equals(consumerThread)) { wait(MILLIS); diff --git a/substratevm/src/com.oracle.svm.test/src/com/oracle/svm/test/jfr/TestJavaMonitorWaitTimeoutEvent.java b/substratevm/src/com.oracle.svm.test/src/com/oracle/svm/test/jfr/TestJavaMonitorWaitTimeoutEvent.java index 08b57ac7b3fa..c1df85eb621c 100644 --- a/substratevm/src/com.oracle.svm.test/src/com/oracle/svm/test/jfr/TestJavaMonitorWaitTimeoutEvent.java +++ b/substratevm/src/com.oracle.svm.test/src/com/oracle/svm/test/jfr/TestJavaMonitorWaitTimeoutEvent.java @@ -139,7 +139,7 @@ private void validateEvents(List events) { simpleWaitFound && timeoutFound); } - private class Helper { + private final class Helper { public synchronized void timeout() throws InterruptedException { wait(MILLIS); } diff --git a/substratevm/src/com.oracle.svm.test/src/com/oracle/svm/test/jfr/TestObjectAllocationInNewTLABEvent.java b/substratevm/src/com.oracle.svm.test/src/com/oracle/svm/test/jfr/TestObjectAllocationInNewTLABEvent.java index 8e5e9157429a..a002310c53b5 100644 --- a/substratevm/src/com.oracle.svm.test/src/com/oracle/svm/test/jfr/TestObjectAllocationInNewTLABEvent.java +++ b/substratevm/src/com.oracle.svm.test/src/com/oracle/svm/test/jfr/TestObjectAllocationInNewTLABEvent.java @@ -127,6 +127,6 @@ private static Helper allocateInstance() { * This class is only needed to provide a unique name in the event's "objectClass" field that we * check. */ - private static class Helper { + private static final class Helper { } } diff --git a/substratevm/src/com.oracle.svm.test/src/com/oracle/svm/test/jfr/TestThreadParkEvents.java b/substratevm/src/com.oracle.svm.test/src/com/oracle/svm/test/jfr/TestThreadParkEvents.java index 6cb1b976081c..0ac39bae0408 100644 --- a/substratevm/src/com.oracle.svm.test/src/com/oracle/svm/test/jfr/TestThreadParkEvents.java +++ b/substratevm/src/com.oracle.svm.test/src/com/oracle/svm/test/jfr/TestThreadParkEvents.java @@ -104,6 +104,6 @@ private static void validateEvents(List events) { assertTrue(parkUnparkFound); } - private static class Blocker { + private static final class Blocker { } } diff --git a/substratevm/src/com.oracle.svm.test/src/com/oracle/svm/test/jfr/TestThreshold.java b/substratevm/src/com.oracle.svm.test/src/com/oracle/svm/test/jfr/TestThreshold.java index 74b10fd26bf6..03f7809c86d0 100644 --- a/substratevm/src/com.oracle.svm.test/src/com/oracle/svm/test/jfr/TestThreshold.java +++ b/substratevm/src/com.oracle.svm.test/src/com/oracle/svm/test/jfr/TestThreshold.java @@ -107,7 +107,7 @@ private static void validateEvents(List events) { assertTrue(foundJavaEvent && foundWaitEvent && foundParkEvent && foundSleepEvent); } - private static class Helper { + private static final class Helper { public synchronized void simpleWait(long millis) throws InterruptedException { wait(millis); } diff --git a/substratevm/src/com.oracle.svm.test/src/com/oracle/svm/test/thread/ThreadCpuTimeTest.java b/substratevm/src/com.oracle.svm.test/src/com/oracle/svm/test/thread/ThreadCpuTimeTest.java index 0dc1247bc6a0..61b0b9fcb08b 100644 --- a/substratevm/src/com.oracle.svm.test/src/com/oracle/svm/test/thread/ThreadCpuTimeTest.java +++ b/substratevm/src/com.oracle.svm.test/src/com/oracle/svm/test/thread/ThreadCpuTimeTest.java @@ -83,7 +83,7 @@ private static long getThreadId(Thread thread) { return thread.getId(); } - private class ThreadCpuTimeRunnable implements Runnable { + private final class ThreadCpuTimeRunnable implements Runnable { @Override public void run() { try { diff --git a/substratevm/src/com.oracle.svm.truffle/src/com/oracle/svm/truffle/TruffleBaseFeature.java b/substratevm/src/com.oracle.svm.truffle/src/com/oracle/svm/truffle/TruffleBaseFeature.java index 1ae36313f5dc..b7ecb5a9209d 100644 --- a/substratevm/src/com.oracle.svm.truffle/src/com/oracle/svm/truffle/TruffleBaseFeature.java +++ b/substratevm/src/com.oracle.svm.truffle/src/com/oracle/svm/truffle/TruffleBaseFeature.java @@ -1350,7 +1350,7 @@ final class Target_com_oracle_truffle_api_staticobject_ArrayBasedStaticShape { @Alias @RecomputeFieldValue(kind = Kind.Custom, declClass = MapCleaner.class, isFinal = true) // static ConcurrentHashMap replacements; - private static class MapCleaner implements FieldValueTransformerWithAvailability { + private static final class MapCleaner implements FieldValueTransformerWithAvailability { @Override public boolean isAvailable() { return BuildPhaseProvider.isCompilationFinished(); @@ -1582,7 +1582,7 @@ final class Target_com_oracle_truffle_api_nodes_NodeClassImpl_NodeFieldData { @Alias @RecomputeFieldValue(kind = Kind.Custom, declClass = OffsetComputer.class, isFinal = true) // private long offset; - private static class OffsetComputer implements FieldValueTransformerWithAvailability { + private static final class OffsetComputer implements FieldValueTransformerWithAvailability { @Override public boolean isAvailable() { return BuildPhaseProvider.isHostedUniverseBuilt(); @@ -1614,7 +1614,7 @@ final class Target_com_oracle_truffle_api_dsl_InlineSupport_UnsafeField { @Delete private Class declaringClass; @Delete private String name; - private static class OffsetComputer implements FieldValueTransformerWithAvailability { + private static final class OffsetComputer implements FieldValueTransformerWithAvailability { @Override public boolean isAvailable() { return BuildPhaseProvider.isHostedUniverseBuilt(); diff --git a/tools/mx.tools/suite.py b/tools/mx.tools/suite.py index 4f3920a9ff58..d97285538874 100644 --- a/tools/mx.tools/suite.py +++ b/tools/mx.tools/suite.py @@ -71,7 +71,7 @@ "com.oracle.truffle.tools.chromeinspector.instrument to org.graalvm.truffle" ], "javaCompliance" : "17+", - "checkstyleVersion" : "10.7.0", + "checkstyleVersion" : "10.21.0", "checkstyle" : "com.oracle.truffle.tools.chromeinspector", "annotationProcessors" : ["truffle:TRUFFLE_DSL_PROCESSOR"], "workingSets" : "Tools", diff --git a/tools/src/com.oracle.truffle.tools.chromeinspector.test/src/com/oracle/truffle/tools/chromeinspector/test/BuggyLanguageInspectDebugTest.java b/tools/src/com.oracle.truffle.tools.chromeinspector.test/src/com/oracle/truffle/tools/chromeinspector/test/BuggyLanguageInspectDebugTest.java index 04aa4b0e1246..c1bc76e2996d 100644 --- a/tools/src/com.oracle.truffle.tools.chromeinspector.test/src/com/oracle/truffle/tools/chromeinspector/test/BuggyLanguageInspectDebugTest.java +++ b/tools/src/com.oracle.truffle.tools.chromeinspector.test/src/com/oracle/truffle/tools/chromeinspector/test/BuggyLanguageInspectDebugTest.java @@ -265,7 +265,7 @@ public void verifyMessages(InspectorTester tester, int errNum) throws Interrupte } } - private static class ReadVarErrorVerifier extends ExceptionVerifier { + private static final class ReadVarErrorVerifier extends ExceptionVerifier { @Override public void verifyMessages(InspectorTester tester, int errNum) throws InterruptedException { @@ -281,7 +281,7 @@ public void verifyMessages(InspectorTester tester, int errNum) throws Interrupte } } - private static class WriteVarErrorVerifier implements BugVerifier { + private static final class WriteVarErrorVerifier implements BugVerifier { @Override public void verifyMessages(InspectorTester tester, int errNum) throws InterruptedException { diff --git a/tools/src/com.oracle.truffle.tools.chromeinspector.test/src/com/oracle/truffle/tools/chromeinspector/test/LazyAccessInspectDebugTest.java b/tools/src/com.oracle.truffle.tools.chromeinspector.test/src/com/oracle/truffle/tools/chromeinspector/test/LazyAccessInspectDebugTest.java index e725f05d1c65..d3f06cd732c7 100644 --- a/tools/src/com.oracle.truffle.tools.chromeinspector.test/src/com/oracle/truffle/tools/chromeinspector/test/LazyAccessInspectDebugTest.java +++ b/tools/src/com.oracle.truffle.tools.chromeinspector.test/src/com/oracle/truffle/tools/chromeinspector/test/LazyAccessInspectDebugTest.java @@ -346,7 +346,7 @@ protected Object toDisplayString(boolean allowSideEffects) { } } - private static class MetaObject extends ProxyInteropObject { + private static final class MetaObject extends ProxyInteropObject { @Override protected boolean isMetaObject() { @@ -370,7 +370,7 @@ protected String getMetaQualifiedName() throws UnsupportedMessageException { } - private static class Keys extends ProxyInteropObject { + private static final class Keys extends ProxyInteropObject { @Override protected boolean hasArrayElements() { diff --git a/tools/src/com.oracle.truffle.tools.chromeinspector.test/src/com/oracle/truffle/tools/chromeinspector/test/NotReadableValuesTest.java b/tools/src/com.oracle.truffle.tools.chromeinspector.test/src/com/oracle/truffle/tools/chromeinspector/test/NotReadableValuesTest.java index a07f844fc91e..e370bbce26c0 100644 --- a/tools/src/com.oracle.truffle.tools.chromeinspector.test/src/com/oracle/truffle/tools/chromeinspector/test/NotReadableValuesTest.java +++ b/tools/src/com.oracle.truffle.tools.chromeinspector.test/src/com/oracle/truffle/tools/chromeinspector/test/NotReadableValuesTest.java @@ -277,7 +277,7 @@ protected Object toDisplayString(boolean allowSideEffects) { } } - private static class MetaObject extends ProxyInteropObject { + private static final class MetaObject extends ProxyInteropObject { @Override protected boolean isMetaObject() { @@ -335,7 +335,7 @@ protected Object readArrayElement(long index) throws UnsupportedMessageException } } - private static class ArrayValue extends ProxyInteropObject { + private static final class ArrayValue extends ProxyInteropObject { private static final long LENGTH = 6; private static final Set NOT_READABLE = new HashSet<>(Arrays.asList(new Long[]{2L, 3L})); diff --git a/tools/src/com.oracle.truffle.tools.chromeinspector.test/src/com/oracle/truffle/tools/chromeinspector/test/ProfilerTest.java b/tools/src/com.oracle.truffle.tools.chromeinspector.test/src/com/oracle/truffle/tools/chromeinspector/test/ProfilerTest.java index 8d62f335bc62..f6892af677c0 100644 --- a/tools/src/com.oracle.truffle.tools.chromeinspector.test/src/com/oracle/truffle/tools/chromeinspector/test/ProfilerTest.java +++ b/tools/src/com.oracle.truffle.tools.chromeinspector.test/src/com/oracle/truffle/tools/chromeinspector/test/ProfilerTest.java @@ -108,10 +108,10 @@ public void testNoSourceCoverage() throws InterruptedException, IOException, Exe tester.finish(); } - private static class TestNoSourceLanguage extends ProxyLanguage { + private static final class TestNoSourceLanguage extends ProxyLanguage { @Override - protected final CallTarget parse(TruffleLanguage.ParsingRequest request) throws Exception { + protected CallTarget parse(TruffleLanguage.ParsingRequest request) throws Exception { return new NoSourceRootNode(languageInstance).getCallTarget(); } diff --git a/tools/src/com.oracle.truffle.tools.chromeinspector/src/com/oracle/truffle/tools/chromeinspector/InspectorDebugger.java b/tools/src/com.oracle.truffle.tools.chromeinspector/src/com/oracle/truffle/tools/chromeinspector/InspectorDebugger.java index 3c8d704ddd9d..d6e8a8205f2c 100644 --- a/tools/src/com.oracle.truffle.tools.chromeinspector/src/com/oracle/truffle/tools/chromeinspector/InspectorDebugger.java +++ b/tools/src/com.oracle.truffle.tools.chromeinspector/src/com/oracle/truffle/tools/chromeinspector/InspectorDebugger.java @@ -998,7 +998,7 @@ public boolean sourceMatchesBlackboxPatterns(Source source, Pattern[] patterns) return false; } - private class LoadScriptListenerImpl implements LoadScriptListener { + private final class LoadScriptListenerImpl implements LoadScriptListener { @Override public void loadedScript(Script script) { @@ -1077,7 +1077,7 @@ private CharSequence getSourceMapURL(Source source, int lastLine) { } - private class SuspendedCallbackImpl implements SuspendedCallback { + private final class SuspendedCallbackImpl implements SuspendedCallback { private final ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1, new SchedulerThreadFactory()); private final AtomicReference> future = new AtomicReference<>(); diff --git a/tools/src/com.oracle.truffle.tools.chromeinspector/src/com/oracle/truffle/tools/chromeinspector/InspectorRuntime.java b/tools/src/com.oracle.truffle.tools.chromeinspector/src/com/oracle/truffle/tools/chromeinspector/InspectorRuntime.java index 48a5c935d3b1..b528adb7339d 100644 --- a/tools/src/com.oracle.truffle.tools.chromeinspector/src/com/oracle/truffle/tools/chromeinspector/InspectorRuntime.java +++ b/tools/src/com.oracle.truffle.tools.chromeinspector/src/com/oracle/truffle/tools/chromeinspector/InspectorRuntime.java @@ -969,7 +969,7 @@ private static String eliminateWhiteSpaces(String str) { return WHITESPACES_PATTERN.matcher(str).replaceAll(""); } - private class ContextListener implements InspectorExecutionContext.Listener { + private final class ContextListener implements InspectorExecutionContext.Listener { @Override public void contextCreated(long id, String name) { diff --git a/tools/src/com.oracle.truffle.tools.chromeinspector/src/com/oracle/truffle/tools/chromeinspector/OutputHandler.java b/tools/src/com.oracle.truffle.tools.chromeinspector/src/com/oracle/truffle/tools/chromeinspector/OutputHandler.java index e7b0695d3f29..782a252bd06c 100644 --- a/tools/src/com.oracle.truffle.tools.chromeinspector/src/com/oracle/truffle/tools/chromeinspector/OutputHandler.java +++ b/tools/src/com.oracle.truffle.tools.chromeinspector/src/com/oracle/truffle/tools/chromeinspector/OutputHandler.java @@ -53,7 +53,7 @@ void setErrListener(Listener l) { err.l = l; } - private static class ListeneableOutputStream extends OutputStream { + private static final class ListeneableOutputStream extends OutputStream { private final CharBuffer cb = CharBuffer.allocate(8192); private final RBCH rbch = new RBCH(); @@ -94,7 +94,7 @@ private void wl() throws IOException { } } - private class RBCH implements ReadableByteChannel { + private final class RBCH implements ReadableByteChannel { private byte[] b; private int off; diff --git a/tools/src/com.oracle.truffle.tools.chromeinspector/src/com/oracle/truffle/tools/chromeinspector/server/InspectServerSession.java b/tools/src/com.oracle.truffle.tools.chromeinspector/src/com/oracle/truffle/tools/chromeinspector/server/InspectServerSession.java index 66816264f03a..8251ec193fd1 100644 --- a/tools/src/com.oracle.truffle.tools.chromeinspector/src/com/oracle/truffle/tools/chromeinspector/server/InspectServerSession.java +++ b/tools/src/com.oracle.truffle.tools.chromeinspector/src/com/oracle/truffle/tools/chromeinspector/server/InspectServerSession.java @@ -571,7 +571,7 @@ private static JSONObject createJsonDomain(String name) { return dom; } - private class EventHandlerImpl implements EventHandler { + private final class EventHandlerImpl implements EventHandler { @Override public void event(Event event) { diff --git a/tools/src/com.oracle.truffle.tools.chromeinspector/src/com/oracle/truffle/tools/chromeinspector/server/InspectorServer.java b/tools/src/com.oracle.truffle.tools.chromeinspector/src/com/oracle/truffle/tools/chromeinspector/server/InspectorServer.java index dd4fa49a69d9..2d6bdfd17f81 100644 --- a/tools/src/com.oracle.truffle.tools.chromeinspector/src/com/oracle/truffle/tools/chromeinspector/server/InspectorServer.java +++ b/tools/src/com.oracle.truffle.tools.chromeinspector/src/com/oracle/truffle/tools/chromeinspector/server/InspectorServer.java @@ -234,7 +234,7 @@ public static InspectorServer get(InetSocketAddress isa, Token token, String pat *
  • For everything else (including missing host header), we deny the request.
  • * */ - private class DNSRebindProtectionHandler implements Function { + private final class DNSRebindProtectionHandler implements Function { @Override public HttpResponse apply(HttpRequest request) { @@ -305,7 +305,7 @@ private static String getDevtoolsAddress(String wsAddress) { return DEV_TOOLS_PREFIX + wsAddress.replace("://", "="); } - private class JSONHandler implements Function { + private final class JSONHandler implements Function { @Override public HttpResponse apply(HttpRequest request) { diff --git a/tools/src/com.oracle.truffle.tools.dap/src/com/oracle/truffle/tools/dap/server/DebugProtocolServerImpl.java b/tools/src/com.oracle.truffle.tools.dap/src/com/oracle/truffle/tools/dap/server/DebugProtocolServerImpl.java index f5c89d2b63a3..281771cb9b5f 100644 --- a/tools/src/com.oracle.truffle.tools.dap/src/com/oracle/truffle/tools/dap/server/DebugProtocolServerImpl.java +++ b/tools/src/com.oracle.truffle.tools.dap/src/com/oracle/truffle/tools/dap/server/DebugProtocolServerImpl.java @@ -706,7 +706,7 @@ private DebuggerSession startDebuggerSession() { return session; } - private class SuspendedCallbackImpl implements SuspendedCallback { + private final class SuspendedCallbackImpl implements SuspendedCallback { @Override public void onSuspend(SuspendedEvent event) { @@ -756,7 +756,7 @@ public void outputText(String text) { } } - private static class AllContextsCancel implements ContextsListener { + private static final class AllContextsCancel implements ContextsListener { private final Phaser allClosed = new Phaser(1); diff --git a/tools/src/com.oracle.truffle.tools.dap/src/com/oracle/truffle/tools/dap/server/OutputHandler.java b/tools/src/com.oracle.truffle.tools.dap/src/com/oracle/truffle/tools/dap/server/OutputHandler.java index d3cc22385111..3ac9e0125917 100644 --- a/tools/src/com.oracle.truffle.tools.dap/src/com/oracle/truffle/tools/dap/server/OutputHandler.java +++ b/tools/src/com.oracle.truffle.tools.dap/src/com/oracle/truffle/tools/dap/server/OutputHandler.java @@ -53,7 +53,7 @@ void setErrListener(Listener l) { err.l = l; } - private static class ListeneableOutputStream extends OutputStream { + private static final class ListeneableOutputStream extends OutputStream { private final CharBuffer cb = CharBuffer.allocate(8192); private final RBCH rbch = new RBCH(); @@ -94,7 +94,7 @@ private void wl() throws IOException { } } - private class RBCH implements ReadableByteChannel { + private final class RBCH implements ReadableByteChannel { private byte[] b; private int off; diff --git a/tools/src/com.oracle.truffle.tools.profiler/src/com/oracle/truffle/tools/profiler/CPUSampler.java b/tools/src/com.oracle.truffle.tools.profiler/src/com/oracle/truffle/tools/profiler/CPUSampler.java index f9f128b4324e..7fc9679e9798 100644 --- a/tools/src/com.oracle.truffle.tools.profiler/src/com/oracle/truffle/tools/profiler/CPUSampler.java +++ b/tools/src/com.oracle.truffle.tools.profiler/src/com/oracle/truffle/tools/profiler/CPUSampler.java @@ -693,7 +693,7 @@ void addSelfHitTime(Long time) { * Process samples in a separate thread to avoid further delays during sampling and increase * accuracy. */ - private class ResultProcessingRunnable implements Runnable { + private final class ResultProcessingRunnable implements Runnable { private volatile boolean cancelled; @@ -806,7 +806,7 @@ static class SamplingResult { } - private class SamplingTask implements Runnable { + private final class SamplingTask implements Runnable { @Override public void run() { diff --git a/tools/src/com.oracle.truffle.tools.profiler/src/com/oracle/truffle/tools/profiler/HeapMonitor.java b/tools/src/com.oracle.truffle.tools.profiler/src/com/oracle/truffle/tools/profiler/HeapMonitor.java index 88abba85b0ef..4bd0a3c03fb3 100644 --- a/tools/src/com.oracle.truffle.tools.profiler/src/com/oracle/truffle/tools/profiler/HeapMonitor.java +++ b/tools/src/com.oracle.truffle.tools.profiler/src/com/oracle/truffle/tools/profiler/HeapMonitor.java @@ -399,7 +399,7 @@ private void cleanReferenceQueue() { } } - private class Listener implements AllocationListener { + private final class Listener implements AllocationListener { public void onEnter(AllocationEvent event) { // nothing to do diff --git a/tools/src/org.graalvm.tools.lsp.test/src/org/graalvm/tools/lsp/test/server/LSPExtensionTestInstance.java b/tools/src/org.graalvm.tools.lsp.test/src/org/graalvm/tools/lsp/test/server/LSPExtensionTestInstance.java index 30a961bcdecd..b7a365d295a2 100644 --- a/tools/src/org.graalvm.tools.lsp.test/src/org/graalvm/tools/lsp/test/server/LSPExtensionTestInstance.java +++ b/tools/src/org.graalvm.tools.lsp.test/src/org/graalvm/tools/lsp/test/server/LSPExtensionTestInstance.java @@ -48,7 +48,7 @@ protected void onCreate(Env env) { env.registerService(this); } - private static class LSPExtensionTestSimpleCommand implements LSPCommand { + private static final class LSPExtensionTestSimpleCommand implements LSPCommand { public String getName() { return COMMAND_SIMPLE; @@ -59,7 +59,7 @@ public Object execute(LSPServerAccessor server, Env env, List arguments) } } - private static class LSPExtensionTestTimeoutCommand implements LSPCommand { + private static final class LSPExtensionTestTimeoutCommand implements LSPCommand { public String getName() { return COMMAND_TIMEOUT; diff --git a/truffle/mx.truffle/suite.py b/truffle/mx.truffle/suite.py index 6e1011779b22..eb9e834c9eec 100644 --- a/truffle/mx.truffle/suite.py +++ b/truffle/mx.truffle/suite.py @@ -233,7 +233,7 @@ "jdk.unsupported", # sun.misc.Unsafe ], "javaCompliance" : "17+", - "checkstyleVersion" : "10.7.0", + "checkstyleVersion" : "10.21.0", "workingSets" : "API,Truffle", "javac.lint.overrides" : "none", "graalCompilerSourceEdition": "ignore", @@ -588,7 +588,7 @@ ], "checkstyle" : "com.oracle.truffle.dsl.processor", "javaCompliance" : "17+", - "checkstyleVersion" : "10.7.0", + "checkstyleVersion" : "10.21.0", "workingSets" : "Truffle,Codegen", "graalCompilerSourceEdition": "ignore", }, @@ -1195,7 +1195,7 @@ "TRUFFLE_API", ], "javaCompliance" : "17+", - "checkstyleVersion" : "10.7.0", + "checkstyleVersion" : "10.21.0", "annotationProcessors" : ["TRUFFLE_DSL_PROCESSOR"], "workingSets" : "Truffle,SimpleLanguage", "graalCompilerSourceEdition": "ignore", diff --git a/truffle/src/com.oracle.truffle.api.bytecode.test/src/com/oracle/truffle/api/bytecode/test/error_tests/ErrorTests.java b/truffle/src/com.oracle.truffle.api.bytecode.test/src/com/oracle/truffle/api/bytecode/test/error_tests/ErrorTests.java index f34fa4125787..4db712d3acf7 100644 --- a/truffle/src/com.oracle.truffle.api.bytecode.test/src/com/oracle/truffle/api/bytecode/test/error_tests/ErrorTests.java +++ b/truffle/src/com.oracle.truffle.api.bytecode.test/src/com/oracle/truffle/api/bytecode/test/error_tests/ErrorTests.java @@ -924,10 +924,12 @@ public boolean fromInt(int x) { } } + // Checkstyle: stop @ExpectError("%") @TypeSystem private class ErroredTypeSystem { } + // Checkstyle: resume @ProvidedTags({RootTag.class, RootBodyTag.class}) public class ErrorLanguage extends TruffleLanguage { diff --git a/truffle/src/com.oracle.truffle.api.debug.test/src/com/oracle/truffle/api/debug/test/DebuggerContextsTest.java b/truffle/src/com.oracle.truffle.api.debug.test/src/com/oracle/truffle/api/debug/test/DebuggerContextsTest.java index 2037760f7350..d6f6ac1779b7 100644 --- a/truffle/src/com.oracle.truffle.api.debug.test/src/com/oracle/truffle/api/debug/test/DebuggerContextsTest.java +++ b/truffle/src/com.oracle.truffle.api.debug.test/src/com/oracle/truffle/api/debug/test/DebuggerContextsTest.java @@ -256,7 +256,7 @@ public void testInContextEval() { } } - private static class TestContextsListener implements DebugContextsListener { + private static final class TestContextsListener implements DebugContextsListener { final List events = Collections.synchronizedList(new ArrayList<>()); diff --git a/truffle/src/com.oracle.truffle.api.debug.test/src/com/oracle/truffle/api/debug/test/DebuggerThreadsTest.java b/truffle/src/com.oracle.truffle.api.debug.test/src/com/oracle/truffle/api/debug/test/DebuggerThreadsTest.java index d83a1d9c9d3b..cfc3a160f923 100644 --- a/truffle/src/com.oracle.truffle.api.debug.test/src/com/oracle/truffle/api/debug/test/DebuggerThreadsTest.java +++ b/truffle/src/com.oracle.truffle.api.debug.test/src/com/oracle/truffle/api/debug/test/DebuggerThreadsTest.java @@ -211,7 +211,7 @@ public void onSuspend(SuspendedEvent event) { } } - private static class TestThreadsListener implements DebugThreadsListener { + private static final class TestThreadsListener implements DebugThreadsListener { final List events = Collections.synchronizedList(new ArrayList<>()); diff --git a/truffle/src/com.oracle.truffle.api.debug/src/com/oracle/truffle/api/debug/Breakpoint.java b/truffle/src/com.oracle.truffle.api.debug/src/com/oracle/truffle/api/debug/Breakpoint.java index 42d51addda23..ea8851ecd21c 100644 --- a/truffle/src/com.oracle.truffle.api.debug/src/com/oracle/truffle/api/debug/Breakpoint.java +++ b/truffle/src/com.oracle.truffle.api.debug/src/com/oracle/truffle/api/debug/Breakpoint.java @@ -584,7 +584,7 @@ private void installInstrumentation(Instrumenter instrumenter) { // We resolve breakpoints only in sources that are executed. // This prevents from premature breakpoint resolution to too distant locations. - private class LocationsInExecutedSources implements LoadSourceSectionListener, ExecuteSourceListener { + private final class LocationsInExecutedSources implements LoadSourceSectionListener, ExecuteSourceListener { private final EconomicMap loadedSections = EconomicMap.create(Equivalence.IDENTITY_WITH_SYSTEM_HASHCODE); private final EconomicSet executedSources = EconomicSet.create(Equivalence.IDENTITY_WITH_SYSTEM_HASHCODE); @@ -1248,7 +1248,7 @@ public interface ResolveListener { void breakpointResolved(Breakpoint breakpoint, SourceSection section); } - private class BreakpointNodeFactory implements ExecutionEventNodeFactory { + private final class BreakpointNodeFactory implements ExecutionEventNodeFactory { @Override public ExecutionEventNode create(EventContext context) { diff --git a/truffle/src/com.oracle.truffle.api.debug/src/com/oracle/truffle/api/debug/SuspendedEvent.java b/truffle/src/com.oracle.truffle.api.debug/src/com/oracle/truffle/api/debug/SuspendedEvent.java index 9bc64574f718..911d13dd9144 100644 --- a/truffle/src/com.oracle.truffle.api.debug/src/com/oracle/truffle/api/debug/SuspendedEvent.java +++ b/truffle/src/com.oracle.truffle.api.debug/src/com/oracle/truffle/api/debug/SuspendedEvent.java @@ -1069,7 +1069,7 @@ private static List getAsynchronousStackFrames(DebuggerS } // This implementation prevents from calling size() - private class Itr implements Iterator> { + private final class Itr implements Iterator> { int cursor = 0; @Override diff --git a/truffle/src/com.oracle.truffle.api.dsl.test/src/com/oracle/truffle/api/dsl/test/FallbackTest.java b/truffle/src/com.oracle.truffle.api.dsl.test/src/com/oracle/truffle/api/dsl/test/FallbackTest.java index 66c5319b4871..8807c0a8657b 100644 --- a/truffle/src/com.oracle.truffle.api.dsl.test/src/com/oracle/truffle/api/dsl/test/FallbackTest.java +++ b/truffle/src/com.oracle.truffle.api.dsl.test/src/com/oracle/truffle/api/dsl/test/FallbackTest.java @@ -263,7 +263,7 @@ public void testFallback6() { } @SuppressWarnings("serial") - private static class FallbackException extends RuntimeException { + private static final class FallbackException extends RuntimeException { } @NodeChild("a") diff --git a/truffle/src/com.oracle.truffle.api.dsl.test/src/com/oracle/truffle/api/dsl/test/ImportGuardsTest.java b/truffle/src/com.oracle.truffle.api.dsl.test/src/com/oracle/truffle/api/dsl/test/ImportGuardsTest.java index 9c14f4104304..42beaf7a306b 100644 --- a/truffle/src/com.oracle.truffle.api.dsl.test/src/com/oracle/truffle/api/dsl/test/ImportGuardsTest.java +++ b/truffle/src/com.oracle.truffle.api.dsl.test/src/com/oracle/truffle/api/dsl/test/ImportGuardsTest.java @@ -148,7 +148,7 @@ int do1(int a) { } } - private static class Imports2 { + private static final class Imports2 { } diff --git a/truffle/src/com.oracle.truffle.api.dsl.test/src/com/oracle/truffle/api/dsl/test/NodeChildNoNameTest.java b/truffle/src/com.oracle.truffle.api.dsl.test/src/com/oracle/truffle/api/dsl/test/NodeChildNoNameTest.java index 7aab33ab81a8..5ade745e9222 100644 --- a/truffle/src/com.oracle.truffle.api.dsl.test/src/com/oracle/truffle/api/dsl/test/NodeChildNoNameTest.java +++ b/truffle/src/com.oracle.truffle.api.dsl.test/src/com/oracle/truffle/api/dsl/test/NodeChildNoNameTest.java @@ -84,7 +84,7 @@ public void testThreeArg() { Assert.assertEquals(126, TestHelper.createCallTarget(arg).call()); } - private static class ConstantNode extends ValueNode { + private static final class ConstantNode extends ValueNode { @Override public Object execute(VirtualFrame frame) { diff --git a/truffle/src/com.oracle.truffle.api.instrumentation.test/src/com/oracle/truffle/api/instrumentation/test/GenerateWrapperTest.java b/truffle/src/com.oracle.truffle.api.instrumentation.test/src/com/oracle/truffle/api/instrumentation/test/GenerateWrapperTest.java index cad81af599cf..da0b33b3aec3 100644 --- a/truffle/src/com.oracle.truffle.api.instrumentation.test/src/com/oracle/truffle/api/instrumentation/test/GenerateWrapperTest.java +++ b/truffle/src/com.oracle.truffle.api.instrumentation.test/src/com/oracle/truffle/api/instrumentation/test/GenerateWrapperTest.java @@ -1023,7 +1023,7 @@ public boolean isInstrumentable() { @ExpectError("Class must not be private to generate a wrapper.") @GenerateWrapper - private static class ErrorNode2 extends Node implements InstrumentableNode { + private static final class ErrorNode2 extends Node implements InstrumentableNode { public WrapperNode createWrapper(ProbeNode probe) { return null; diff --git a/truffle/src/com.oracle.truffle.api.instrumentation.test/src/com/oracle/truffle/api/instrumentation/test/InstrumentationNoExceptionsTest.java b/truffle/src/com.oracle.truffle.api.instrumentation.test/src/com/oracle/truffle/api/instrumentation/test/InstrumentationNoExceptionsTest.java index 1f9d6bebf032..512e994c74cc 100644 --- a/truffle/src/com.oracle.truffle.api.instrumentation.test/src/com/oracle/truffle/api/instrumentation/test/InstrumentationNoExceptionsTest.java +++ b/truffle/src/com.oracle.truffle.api.instrumentation.test/src/com/oracle/truffle/api/instrumentation/test/InstrumentationNoExceptionsTest.java @@ -440,7 +440,7 @@ public void onReturnExceptional(EventContext ctx, VirtualFrame frame, Throwable } @SuppressWarnings("serial") - private static class MyInstrumentException extends RuntimeException { + private static final class MyInstrumentException extends RuntimeException { } } diff --git a/truffle/src/com.oracle.truffle.api.instrumentation.test/src/com/oracle/truffle/api/instrumentation/test/InstrumentationTest.java b/truffle/src/com.oracle.truffle.api.instrumentation.test/src/com/oracle/truffle/api/instrumentation/test/InstrumentationTest.java index 233de683eb16..cac3897c0906 100644 --- a/truffle/src/com.oracle.truffle.api.instrumentation.test/src/com/oracle/truffle/api/instrumentation/test/InstrumentationTest.java +++ b/truffle/src/com.oracle.truffle.api.instrumentation.test/src/com/oracle/truffle/api/instrumentation/test/InstrumentationTest.java @@ -367,7 +367,7 @@ public void testLanguageInstrumentationAndExceptions() throws IOException { } @SuppressWarnings("serial") - private static class MyLanguageException extends RuntimeException { + private static final class MyLanguageException extends RuntimeException { } @@ -1384,7 +1384,7 @@ public void testUsedTagNotRequired1() throws IOException { @Registration(id = "testUsedTagNotRequired1", services = Object.class) public static class TestUsedTagNotRequired1 extends TruffleInstrument { - private static class Foobar { + private static final class Foobar { } diff --git a/truffle/src/com.oracle.truffle.api.instrumentation.test/src/com/oracle/truffle/api/instrumentation/test/InstrumentationTestLanguage.java b/truffle/src/com.oracle.truffle.api.instrumentation.test/src/com/oracle/truffle/api/instrumentation/test/InstrumentationTestLanguage.java index 7bc0a6880e42..dcb3c21af026 100644 --- a/truffle/src/com.oracle.truffle.api.instrumentation.test/src/com/oracle/truffle/api/instrumentation/test/InstrumentationTestLanguage.java +++ b/truffle/src/com.oracle.truffle.api.instrumentation.test/src/com/oracle/truffle/api/instrumentation/test/InstrumentationTestLanguage.java @@ -3780,7 +3780,7 @@ Object getMetaObject() { } - private static class StringBuilderWrapper { + private static final class StringBuilderWrapper { private final StringBuilder delegate = new StringBuilder(); @TruffleBoundary @@ -3857,7 +3857,7 @@ static InstrumentContext get(Node node) { return REFERENCE.get(node); } - private static class WeakSet extends AbstractSet { + private static final class WeakSet extends AbstractSet { private final Map map = new WeakHashMap<>(); diff --git a/truffle/src/com.oracle.truffle.api.instrumentation.test/src/com/oracle/truffle/api/instrumentation/test/SourceListenerTest.java b/truffle/src/com.oracle.truffle.api.instrumentation.test/src/com/oracle/truffle/api/instrumentation/test/SourceListenerTest.java index b77b6c49f1b6..64ef7cb6433f 100644 --- a/truffle/src/com.oracle.truffle.api.instrumentation.test/src/com/oracle/truffle/api/instrumentation/test/SourceListenerTest.java +++ b/truffle/src/com.oracle.truffle.api.instrumentation.test/src/com/oracle/truffle/api/instrumentation/test/SourceListenerTest.java @@ -393,7 +393,7 @@ public void testLoadSourceException() throws IOException { } } - private static class TestLoadSourceExceptionClass extends RuntimeException { + private static final class TestLoadSourceExceptionClass extends RuntimeException { private static final long serialVersionUID = 1L; diff --git a/truffle/src/com.oracle.truffle.api.instrumentation.test/src/com/oracle/truffle/api/instrumentation/test/SourceSectionListenerTest.java b/truffle/src/com.oracle.truffle.api.instrumentation.test/src/com/oracle/truffle/api/instrumentation/test/SourceSectionListenerTest.java index eada11ae12d2..f383d66efce2 100644 --- a/truffle/src/com.oracle.truffle.api.instrumentation.test/src/com/oracle/truffle/api/instrumentation/test/SourceSectionListenerTest.java +++ b/truffle/src/com.oracle.truffle.api.instrumentation.test/src/com/oracle/truffle/api/instrumentation/test/SourceSectionListenerTest.java @@ -373,7 +373,7 @@ public void onReturnExceptional(EventContext c, VirtualFrame frame, Throwable ex } }; - private static class TestLoadSourceSectionExceptionClass extends RuntimeException { + private static final class TestLoadSourceSectionExceptionClass extends RuntimeException { private static final long serialVersionUID = 1L; diff --git a/truffle/src/com.oracle.truffle.api.instrumentation.test/src/com/oracle/truffle/api/instrumentation/test/TagsTest.java b/truffle/src/com.oracle.truffle.api.instrumentation.test/src/com/oracle/truffle/api/instrumentation/test/TagsTest.java index f48fadcd27b1..9d22576d9bb4 100644 --- a/truffle/src/com.oracle.truffle.api.instrumentation.test/src/com/oracle/truffle/api/instrumentation/test/TagsTest.java +++ b/truffle/src/com.oracle.truffle.api.instrumentation.test/src/com/oracle/truffle/api/instrumentation/test/TagsTest.java @@ -82,12 +82,12 @@ public class TagsTest { - private static class MyTag extends Tag { + private static final class MyTag extends Tag { } @Tag.Identifier("MyTagWithIdentifier") - private static class MyTagWithIdentifier extends Tag { + private static final class MyTagWithIdentifier extends Tag { } diff --git a/truffle/src/com.oracle.truffle.api.instrumentation.test/src/com/oracle/truffle/api/instrumentation/test/VariablesScopeTest.java b/truffle/src/com.oracle.truffle.api.instrumentation.test/src/com/oracle/truffle/api/instrumentation/test/VariablesScopeTest.java index 0870a80d28a1..3e128687ad07 100644 --- a/truffle/src/com.oracle.truffle.api.instrumentation.test/src/com/oracle/truffle/api/instrumentation/test/VariablesScopeTest.java +++ b/truffle/src/com.oracle.truffle.api.instrumentation.test/src/com/oracle/truffle/api/instrumentation/test/VariablesScopeTest.java @@ -194,7 +194,7 @@ private static boolean isNull(Object object) { return INTEROP.isNull(object); } - private static class ILScopeTester implements TestScopeInstrument.Tester { + private static final class ILScopeTester implements TestScopeInstrument.Tester { public void doTestScope(TruffleInstrument.Env env, Node node, VirtualFrame frame, boolean nodeEnter) throws Exception { assertTrue(NodeLibrary.getUncached().hasScope(node, null)); @@ -261,7 +261,7 @@ private static void doTestTopScope(TruffleInstrument.Env env) throws Unsupported } } - private static class DefaultScopeTester implements TestScopeInstrument.Tester { + private static final class DefaultScopeTester implements TestScopeInstrument.Tester { private final StringBuilder visitedLocations = new StringBuilder(); @@ -620,7 +620,7 @@ final Object getScope(Frame frame, @SuppressWarnings("unused") boolean nodeEnter } } - private static class CustomScopeTester implements TestScopeInstrument.Tester { + private static final class CustomScopeTester implements TestScopeInstrument.Tester { @Override public void doTestScope(TruffleInstrument.Env env, Node node, VirtualFrame frame, boolean nodeEnter) { diff --git a/truffle/src/com.oracle.truffle.api.instrumentation.test/src/com/oracle/truffle/api/instrumentation/test/examples/DebuggerExample.java b/truffle/src/com.oracle.truffle.api.instrumentation.test/src/com/oracle/truffle/api/instrumentation/test/examples/DebuggerExample.java index 3dd99eb0535d..00d571bc80c4 100644 --- a/truffle/src/com.oracle.truffle.api.instrumentation.test/src/com/oracle/truffle/api/instrumentation/test/examples/DebuggerExample.java +++ b/truffle/src/com.oracle.truffle.api.instrumentation.test/src/com/oracle/truffle/api/instrumentation/test/examples/DebuggerExample.java @@ -172,7 +172,7 @@ public void onReturnExceptional(EventContext context, VirtualFrame frame, Throwa } } - private class Stepping implements ExecutionEventListener { + private final class Stepping implements ExecutionEventListener { public void onEnter(EventContext context, VirtualFrame frame) { ontStatementStep(context); diff --git a/truffle/src/com.oracle.truffle.api.instrumentation/src/com/oracle/truffle/api/instrumentation/AllocationReporter.java b/truffle/src/com.oracle.truffle.api.instrumentation/src/com/oracle/truffle/api/instrumentation/AllocationReporter.java index f01f61faa000..acda7a690da5 100644 --- a/truffle/src/com.oracle.truffle.api.instrumentation/src/com/oracle/truffle/api/instrumentation/AllocationReporter.java +++ b/truffle/src/com.oracle.truffle.api.instrumentation/src/com/oracle/truffle/api/instrumentation/AllocationReporter.java @@ -418,7 +418,7 @@ private static Object createComplexObject() { return null; } - private static class MyTruffleObject { + private static final class MyTruffleObject { } } diff --git a/truffle/src/com.oracle.truffle.api.instrumentation/src/com/oracle/truffle/api/instrumentation/InstrumentationHandler.java b/truffle/src/com.oracle.truffle.api.instrumentation/src/com/oracle/truffle/api/instrumentation/InstrumentationHandler.java index 2e492d2006f8..aa9a398d3386 100644 --- a/truffle/src/com.oracle.truffle.api.instrumentation/src/com/oracle/truffle/api/instrumentation/InstrumentationHandler.java +++ b/truffle/src/com.oracle.truffle.api.instrumentation/src/com/oracle/truffle/api/instrumentation/InstrumentationHandler.java @@ -1689,7 +1689,7 @@ protected void postVisitNotifications(Set> providedTags, SourceSection * visitorBuilder.buildVisitor(); * */ - private class VisitorBuilder { + private final class VisitorBuilder { List operations = new ArrayList<>(); boolean shouldMaterializeSyntaxNodes; diff --git a/truffle/src/com.oracle.truffle.api.library.test/src/com/oracle/truffle/api/library/test/ExportLibraryTest.java b/truffle/src/com.oracle.truffle.api.library.test/src/com/oracle/truffle/api/library/test/ExportLibraryTest.java index aa754b936856..0ae0ebe8638c 100644 --- a/truffle/src/com.oracle.truffle.api.library.test/src/com/oracle/truffle/api/library/test/ExportLibraryTest.java +++ b/truffle/src/com.oracle.truffle.api.library.test/src/com/oracle/truffle/api/library/test/ExportLibraryTest.java @@ -181,10 +181,10 @@ static class ExportsTestObjectError1 { @ExportLibrary(ExportLibraryTestLibrary.class) @ExpectError("The exported type must not be private. Increase visibility to resolve this.") - private static class ExportsTestObjectError2 { + private static final class ExportsTestObjectError2 { @SuppressWarnings("static-method") @ExportMessage - final Object m0() { + Object m0() { return null; } } @@ -213,7 +213,7 @@ private Object m0(@SuppressWarnings("unused") @Cached("null") Object foo) { static class ExportsTestObjectError5 { @ExpectError("Exported message node class must not be private.") @ExportMessage - private static class M0 { + private static final class M0 { } } diff --git a/truffle/src/com.oracle.truffle.api.library.test/src/com/oracle/truffle/api/library/test/ExportMethodTest.java b/truffle/src/com.oracle.truffle.api.library.test/src/com/oracle/truffle/api/library/test/ExportMethodTest.java index 2c1a22237095..0deead504285 100644 --- a/truffle/src/com.oracle.truffle.api.library.test/src/com/oracle/truffle/api/library/test/ExportMethodTest.java +++ b/truffle/src/com.oracle.truffle.api.library.test/src/com/oracle/truffle/api/library/test/ExportMethodTest.java @@ -153,11 +153,11 @@ public void test() { assertEquals("foo", getUncached(ExportsTestLibrary1.class, o).foo(o, 42)); } - private static class TestSubInterface implements TestInterface { + private static final class TestSubInterface implements TestInterface { } - private static class TestSubClass extends TestClass { + private static final class TestSubClass extends TestClass { } diff --git a/truffle/src/com.oracle.truffle.api.library.test/src/com/oracle/truffle/api/library/test/ExportNodeTest.java b/truffle/src/com.oracle.truffle.api.library.test/src/com/oracle/truffle/api/library/test/ExportNodeTest.java index 456bc0e99a17..20c9e0959545 100644 --- a/truffle/src/com.oracle.truffle.api.library.test/src/com/oracle/truffle/api/library/test/ExportNodeTest.java +++ b/truffle/src/com.oracle.truffle.api.library.test/src/com/oracle/truffle/api/library/test/ExportNodeTest.java @@ -551,7 +551,7 @@ static class TestObjectError3 { @ExportMessage @ExpectError("Exported message node class must not be private.") - private static class Foo { + private static final class Foo { static Foo create() { return null; diff --git a/truffle/src/com.oracle.truffle.api.staticobject.test/src/com/oracle/truffle/api/staticobject/test/VisibilityTest.java b/truffle/src/com.oracle.truffle.api.staticobject.test/src/com/oracle/truffle/api/staticobject/test/VisibilityTest.java index f43cd4ce3c97..bdb3907cbcd3 100644 --- a/truffle/src/com.oracle.truffle.api.staticobject.test/src/com/oracle/truffle/api/staticobject/test/VisibilityTest.java +++ b/truffle/src/com.oracle.truffle.api.staticobject.test/src/com/oracle/truffle/api/staticobject/test/VisibilityTest.java @@ -46,7 +46,7 @@ static Class getPrivateClass() { return PrivateClass.class; } - private static class PrivateClass { + private static final class PrivateClass { } } diff --git a/truffle/src/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/host/PrimitiveRawArrayInteropTest.java b/truffle/src/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/host/PrimitiveRawArrayInteropTest.java index 9692f0f5dc0d..edbf2925b212 100644 --- a/truffle/src/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/host/PrimitiveRawArrayInteropTest.java +++ b/truffle/src/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/host/PrimitiveRawArrayInteropTest.java @@ -288,7 +288,7 @@ private static void assertSum(String msg, double expected, List clazz) throws InitializationError { * As of JDK9, Truffle API is deployed in a module (possibly the unnamed module) so to retrieve * the class file bytes for separate class loading requires using module API. */ - private static class JDK9TestClassLoader extends ClassLoader { + private static final class JDK9TestClassLoader extends ClassLoader { @Override public Class loadClass(String name) throws ClassNotFoundException { diff --git a/truffle/src/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/nodes/EncapsulatedNodeTest.java b/truffle/src/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/nodes/EncapsulatedNodeTest.java index e1093fe183c8..6579237e373a 100644 --- a/truffle/src/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/nodes/EncapsulatedNodeTest.java +++ b/truffle/src/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/nodes/EncapsulatedNodeTest.java @@ -293,7 +293,7 @@ private static List captureStackLazily() { } @SuppressWarnings("serial") - private static class GetStackTraceException extends AbstractTruffleException { + private static final class GetStackTraceException extends AbstractTruffleException { } @TruffleBoundary diff --git a/truffle/src/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/nodes/NodeUtilTest.java b/truffle/src/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/nodes/NodeUtilTest.java index a6ecd86f2f70..e7a576da0396 100644 --- a/truffle/src/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/nodes/NodeUtilTest.java +++ b/truffle/src/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/nodes/NodeUtilTest.java @@ -86,7 +86,7 @@ public void testAssertNotAdopted() { }); } - private static class NotAdoptableNode extends Node { + private static final class NotAdoptableNode extends Node { @Override public boolean isAdoptable() { return false; diff --git a/truffle/src/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/nodes/SafeReplaceTest.java b/truffle/src/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/nodes/SafeReplaceTest.java index 727fb2befe21..76ed4b5c4d2d 100644 --- a/truffle/src/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/nodes/SafeReplaceTest.java +++ b/truffle/src/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/nodes/SafeReplaceTest.java @@ -93,7 +93,7 @@ public void testIncorrectReplacement() { assertFalse(oldChild.isSafelyReplaceableBy(wrongTypeNewChild)); } - private static class TestNode extends Node { + private static final class TestNode extends Node { private int executed; @@ -121,7 +121,7 @@ public Object execute(VirtualFrame frame) { } } - private static class WrongTestNode extends Node { + private static final class WrongTestNode extends Node { } } diff --git a/truffle/src/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/polyglot/ByteSequenceTest.java b/truffle/src/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/polyglot/ByteSequenceTest.java index 3ee2a11994c3..ad47a4d1a65e 100644 --- a/truffle/src/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/polyglot/ByteSequenceTest.java +++ b/truffle/src/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/polyglot/ByteSequenceTest.java @@ -55,7 +55,7 @@ public class ByteSequenceTest { - private static class ByteSequenceImpl implements ByteSequence { + private static final class ByteSequenceImpl implements ByteSequence { public int length() { return 4; diff --git a/truffle/src/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/polyglot/GR43906Test.java b/truffle/src/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/polyglot/GR43906Test.java index 097417a1b8b8..f9ff4c20fee0 100644 --- a/truffle/src/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/polyglot/GR43906Test.java +++ b/truffle/src/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/polyglot/GR43906Test.java @@ -75,7 +75,7 @@ protected Object execute(RootNode node, Env env, Object[] contextArguments, Obje } } - private static class DummyOutputStream extends OutputStream { + private static final class DummyOutputStream extends OutputStream { private int i = 0; private int length = 0; diff --git a/truffle/src/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/polyglot/MessageTransportTest.java b/truffle/src/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/polyglot/MessageTransportTest.java index eedce6042460..73678d8e23b1 100644 --- a/truffle/src/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/polyglot/MessageTransportTest.java +++ b/truffle/src/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/polyglot/MessageTransportTest.java @@ -204,7 +204,7 @@ private enum MessageKind { CLOSE } - private static class MessageHandlerVerifier implements MessageEndpoint { + private static final class MessageHandlerVerifier implements MessageEndpoint { private MessageKind expectedKind; private String expectedText; diff --git a/truffle/src/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/polyglot/ProcessBuilderTest.java b/truffle/src/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/polyglot/ProcessBuilderTest.java index 57f2da868067..8232cdbb1408 100644 --- a/truffle/src/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/polyglot/ProcessBuilderTest.java +++ b/truffle/src/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/polyglot/ProcessBuilderTest.java @@ -555,7 +555,7 @@ private static Map pairsAsMap(String... keyValuePairs) { return map; } - private static class MockProcessHandler implements ProcessHandler { + private static final class MockProcessHandler implements ProcessHandler { private ProcessCommand lastCommand; diff --git a/truffle/src/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/polyglot/ProxySPITest.java b/truffle/src/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/polyglot/ProxySPITest.java index 09d19b06a6aa..375c853b52cd 100644 --- a/truffle/src/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/polyglot/ProxySPITest.java +++ b/truffle/src/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/polyglot/ProxySPITest.java @@ -820,7 +820,7 @@ static class TestError extends RuntimeException { } @SuppressWarnings("deprecation") - private static class AllProxy implements ProxyArray, ProxyObject, ProxyNativeObject, ProxyExecutable, ProxyInstantiable { + private static final class AllProxy implements ProxyArray, ProxyObject, ProxyNativeObject, ProxyExecutable, ProxyInstantiable { public Object execute(Value... t) { throw new TestError(); diff --git a/truffle/src/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/polyglot/ValueAPITest.java b/truffle/src/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/polyglot/ValueAPITest.java index 23c569cfc15e..9aa6380a9170 100644 --- a/truffle/src/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/polyglot/ValueAPITest.java +++ b/truffle/src/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/polyglot/ValueAPITest.java @@ -1041,7 +1041,7 @@ private static void objectCoercionTest(Object value, Class expectedType, } } - private static class DummyList extends DummyCollection implements List { + private static final class DummyList extends DummyCollection implements List { public boolean addAll(int index, Collection c) { return values.addAll(index, c); @@ -1150,13 +1150,13 @@ public Object coerce(T value, Consumer o) { } - public static class EmptyObject { + public static final class EmptyObject { } - private static class PrivateObject { + private static final class PrivateObject { } - private static class FieldAccess { + private static final class FieldAccess { @SuppressWarnings("unused") public EmptyObject member; } @@ -1332,7 +1332,7 @@ public long getSize() { } - private static class MembersAndExecutable extends Members implements ProxyObject, ProxyExecutable { + private static final class MembersAndExecutable extends Members implements ProxyObject, ProxyExecutable { Object executableResult; @@ -1341,7 +1341,7 @@ public Object execute(Value... arguments) { } } - private static class MembersAndInstantiable extends Members implements ProxyObject, ProxyInstantiable { + private static final class MembersAndInstantiable extends Members implements ProxyObject, ProxyInstantiable { Object instantiableResult; @@ -1351,7 +1351,7 @@ public Object newInstance(Value... arguments) { } - private static class MembersAndArrayAndExecutable extends MembersAndArray implements ProxyArray, ProxyObject, ProxyExecutable { + private static final class MembersAndArrayAndExecutable extends MembersAndArray implements ProxyArray, ProxyObject, ProxyExecutable { Object executableResult; @@ -1361,7 +1361,7 @@ public Object execute(Value... arguments) { } - private static class MembersAndArrayAndInstantiable extends MembersAndArray implements ProxyArray, ProxyObject, ProxyInstantiable { + private static final class MembersAndArrayAndInstantiable extends MembersAndArray implements ProxyArray, ProxyObject, ProxyInstantiable { Object instantiableResult; @@ -1371,7 +1371,7 @@ public Object newInstance(Value... arguments) { } - private static class MembersAndArrayAndExecutableAndInstantiable extends MembersAndArray implements ProxyArray, ProxyObject, ProxyInstantiable, ProxyExecutable { + private static final class MembersAndArrayAndExecutableAndInstantiable extends MembersAndArray implements ProxyArray, ProxyObject, ProxyInstantiable, ProxyExecutable { Object executableResult; Object instantiableResult; @@ -1386,7 +1386,7 @@ public Object newInstance(Value... arguments) { } - private static class Executable implements ProxyExecutable { + private static final class Executable implements ProxyExecutable { Object executableResult; @@ -1591,7 +1591,7 @@ public void testPrimitiveCoercionErrors() { } - private static class EmptyProxy implements org.graalvm.polyglot.proxy.Proxy { + private static final class EmptyProxy implements org.graalvm.polyglot.proxy.Proxy { @Override public String toString() { diff --git a/truffle/src/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/polyglot/ValueHostConversionTest.java b/truffle/src/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/polyglot/ValueHostConversionTest.java index 8a1e74b456de..920b7a8840a7 100644 --- a/truffle/src/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/polyglot/ValueHostConversionTest.java +++ b/truffle/src/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/polyglot/ValueHostConversionTest.java @@ -198,7 +198,7 @@ public interface SupplierExtension extends Supplier { Integer get(); } - private class SuplierExtensionImpl implements SupplierExtension { + private final class SuplierExtensionImpl implements SupplierExtension { @Override public Integer get() { return 42; diff --git a/truffle/src/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/profiles/ExactClassValueProfileTest.java b/truffle/src/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/profiles/ExactClassValueProfileTest.java index 6787698e18f3..a4f9ca4c854a 100644 --- a/truffle/src/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/profiles/ExactClassValueProfileTest.java +++ b/truffle/src/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/profiles/ExactClassValueProfileTest.java @@ -61,7 +61,7 @@ public class ExactClassValueProfileTest extends AbstractProfileTest { private static class TestBaseClass { } - private static class TestSubClass extends TestBaseClass { + private static final class TestSubClass extends TestBaseClass { } @BeforeClass diff --git a/truffle/src/com.oracle.truffle.api/src/com/oracle/truffle/api/impl/Accessor.java b/truffle/src/com.oracle.truffle.api/src/com/oracle/truffle/api/impl/Accessor.java index 660a04485110..328a19fadd32 100644 --- a/truffle/src/com.oracle.truffle.api/src/com/oracle/truffle/api/impl/Accessor.java +++ b/truffle/src/com.oracle.truffle.api/src/com/oracle/truffle/api/impl/Accessor.java @@ -1462,7 +1462,7 @@ public final void startOSRFrameTransfer(FrameWithoutBoxing target) { // A separate class to break the cycle such that Accessor can fully initialize // before ...Accessor classes static initializers run, which call methods from Accessor. - private static class Constants { + private static final class Constants { private static final Accessor.LanguageSupport LANGUAGE; private static final Accessor.NodeSupport NODES; diff --git a/truffle/src/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/java/ElementUtils.java b/truffle/src/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/java/ElementUtils.java index 8c37d6579b8c..e3e3585995a6 100644 --- a/truffle/src/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/java/ElementUtils.java +++ b/truffle/src/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/java/ElementUtils.java @@ -1303,7 +1303,7 @@ public static Object unboxAnnotationValue(AnnotationValue value) { return value.accept(new AnnotationValueVisitorImpl(), null); } - private static class AnnotationValueVisitorImpl extends AbstractAnnotationValueVisitor8 { + private static final class AnnotationValueVisitorImpl extends AbstractAnnotationValueVisitor8 { @Override public Object visitBoolean(boolean b, Void p) { diff --git a/truffle/src/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/java/transform/OrganizedImports.java b/truffle/src/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/java/transform/OrganizedImports.java index cdfa0e84eb37..0d8918758974 100644 --- a/truffle/src/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/java/transform/OrganizedImports.java +++ b/truffle/src/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/java/transform/OrganizedImports.java @@ -497,7 +497,7 @@ public void visitImport(CodeImport e, Void p) { } - private class ImportTypeReferenceVisitor extends TypeReferenceVisitor { + private final class ImportTypeReferenceVisitor extends TypeReferenceVisitor { @Override public void visitStaticFieldReference(Element enclosedType, TypeMirror type, String elementName) { diff --git a/truffle/src/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/parser/NodeParser.java b/truffle/src/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/parser/NodeParser.java index 56e5e7af0561..2be7d62384c2 100644 --- a/truffle/src/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/parser/NodeParser.java +++ b/truffle/src/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/parser/NodeParser.java @@ -4263,7 +4263,7 @@ private static boolean isRecursiveType(NodeData node, TypeElement parameterType) private final Map nodeDataCache = new HashMap<>(); - private static class FactoryMethodCacheKey { + private static final class FactoryMethodCacheKey { } private List parseNodeFactoryMethods(TypeMirror nodeType) { @@ -4911,7 +4911,7 @@ public int hashCode() { return hashCode; } - private static class DSLExpressionHash implements DSLExpressionVisitor { + private static final class DSLExpressionHash implements DSLExpressionVisitor { private int hash = 1; public void visitCast(Cast binary) { diff --git a/truffle/src/com.oracle.truffle.nfi.backend.libffi/src/com/oracle/truffle/nfi/backend/libffi/LibFFIContext.java b/truffle/src/com.oracle.truffle.nfi.backend.libffi/src/com/oracle/truffle/nfi/backend/libffi/LibFFIContext.java index cfeb45172957..aed5dc57b90c 100644 --- a/truffle/src/com.oracle.truffle.nfi.backend.libffi/src/com/oracle/truffle/nfi/backend/libffi/LibFFIContext.java +++ b/truffle/src/com.oracle.truffle.nfi.backend.libffi/src/com/oracle/truffle/nfi/backend/libffi/LibFFIContext.java @@ -113,7 +113,7 @@ public void destroy() { } } - private class NativeEnvSupplier implements Supplier { + private final class NativeEnvSupplier implements Supplier { @Override public NativeEnv get() { diff --git a/truffle/src/com.oracle.truffle.nfi.test/src/com/oracle/truffle/nfi/test/WrappedPrimitiveNFITest.java b/truffle/src/com.oracle.truffle.nfi.test/src/com/oracle/truffle/nfi/test/WrappedPrimitiveNFITest.java index fb5ffed1c36b..13db97ae1bdb 100644 --- a/truffle/src/com.oracle.truffle.nfi.test/src/com/oracle/truffle/nfi/test/WrappedPrimitiveNFITest.java +++ b/truffle/src/com.oracle.truffle.nfi.test/src/com/oracle/truffle/nfi/test/WrappedPrimitiveNFITest.java @@ -59,7 +59,7 @@ @Parameterized.UseParametersRunnerFactory(TruffleRunner.ParametersFactory.class) public class WrappedPrimitiveNFITest extends NFITest { - private static class TestObject implements TruffleObject { + private static final class TestObject implements TruffleObject { } private static final Object[] ARGUMENTS = { diff --git a/truffle/src/com.oracle.truffle.polyglot/src/com/oracle/truffle/polyglot/PolyglotLanguageContext.java b/truffle/src/com.oracle.truffle.polyglot/src/com/oracle/truffle/polyglot/PolyglotLanguageContext.java index bff7d5f507f4..2126c8a91ede 100644 --- a/truffle/src/com.oracle.truffle.polyglot/src/com/oracle/truffle/polyglot/PolyglotLanguageContext.java +++ b/truffle/src/com.oracle.truffle.polyglot/src/com/oracle/truffle/polyglot/PolyglotLanguageContext.java @@ -1094,7 +1094,7 @@ public String toString() { return "PolyglotLanguageContext [language=" + language + ", initialized=" + (env != null) + "]"; } - private class PolyglotUncaughtExceptionHandler implements Thread.UncaughtExceptionHandler { + private final class PolyglotUncaughtExceptionHandler implements Thread.UncaughtExceptionHandler { @SuppressWarnings({"unused", "try"}) @Override diff --git a/truffle/src/com.oracle.truffle.sl.test/src/com/oracle/truffle/sl/test/SLInstrumentTest.java b/truffle/src/com.oracle.truffle.sl.test/src/com/oracle/truffle/sl/test/SLInstrumentTest.java index 31eb86c1bb73..a04bc42fbaf8 100644 --- a/truffle/src/com.oracle.truffle.sl.test/src/com/oracle/truffle/sl/test/SLInstrumentTest.java +++ b/truffle/src/com.oracle.truffle.sl.test/src/com/oracle/truffle/sl/test/SLInstrumentTest.java @@ -660,7 +660,7 @@ public int read() throws IOException { assertFalse(redoIO.beforePop); } - private static class RuntimeInterruptedException extends AbstractTruffleException { + private static final class RuntimeInterruptedException extends AbstractTruffleException { private static final long serialVersionUID = -4735601164894088571L; } diff --git a/truffle/src/com.oracle.truffle.sl.test/src/com/oracle/truffle/sl/test/SLInteropObjectTest.java b/truffle/src/com.oracle.truffle.sl.test/src/com/oracle/truffle/sl/test/SLInteropObjectTest.java index 3f86b6d54309..dc63363c7f74 100644 --- a/truffle/src/com.oracle.truffle.sl.test/src/com/oracle/truffle/sl/test/SLInteropObjectTest.java +++ b/truffle/src/com.oracle.truffle.sl.test/src/com/oracle/truffle/sl/test/SLInteropObjectTest.java @@ -100,7 +100,7 @@ public void testNewForeign() { Assert.assertEquals(20, ret.asLong()); } - private static class TestType implements ProxyInstantiable { + private static final class TestType implements ProxyInstantiable { @Override public Object newInstance(Value... arguments) { @@ -109,7 +109,7 @@ public Object newInstance(Value... arguments) { } - private static class TestObject implements ProxyObject { + private static final class TestObject implements ProxyObject { private long value; diff --git a/truffle/src/com.oracle.truffle.sl/src/com/oracle/truffle/sl/parser/SLBaseParser.java b/truffle/src/com.oracle.truffle.sl/src/com/oracle/truffle/sl/parser/SLBaseParser.java index 06591120aa38..49ed5b627c92 100644 --- a/truffle/src/com.oracle.truffle.sl/src/com/oracle/truffle/sl/parser/SLBaseParser.java +++ b/truffle/src/com.oracle.truffle.sl/src/com/oracle/truffle/sl/parser/SLBaseParser.java @@ -133,7 +133,7 @@ protected TruffleString asTruffleString(Token literalToken, boolean removeQuotes // ------------------------------- locals handling -------------------------- - private static class FindLocalsVisitor extends SimpleLanguageBaseVisitor { + private static final class FindLocalsVisitor extends SimpleLanguageBaseVisitor { boolean entered = false; List results = new ArrayList<>(); diff --git a/truffle/src/com.oracle.truffle.sl/src/com/oracle/truffle/sl/parser/SLNodeParser.java b/truffle/src/com.oracle.truffle.sl/src/com/oracle/truffle/sl/parser/SLNodeParser.java index ff71591cc0cd..7cca3ed910f9 100644 --- a/truffle/src/com.oracle.truffle.sl/src/com/oracle/truffle/sl/parser/SLNodeParser.java +++ b/truffle/src/com.oracle.truffle.sl/src/com/oracle/truffle/sl/parser/SLNodeParser.java @@ -192,7 +192,7 @@ private SLStringLiteralNode createString(Token name, boolean removeQuotes) { return node; } - private class SLStatementVisitor extends SimpleLanguageBaseVisitor { + private final class SLStatementVisitor extends SimpleLanguageBaseVisitor { @Override public SLStatementNode visitBlock(BlockContext ctx) { List newLocals = enterBlock(ctx); @@ -326,7 +326,7 @@ public SLStatementNode visitChildren(RuleNode arg0) { } } - private class SLExpressionVisitor extends SimpleLanguageBaseVisitor { + private final class SLExpressionVisitor extends SimpleLanguageBaseVisitor { @Override public SLExpressionNode visitExpression(ExpressionContext ctx) { return createBinary(ctx.logic_term(), ctx.OP_OR()); diff --git a/truffle/src/com.oracle.truffle.tck.instrumentation/src/com/oracle/truffle/tck/instrumentation/VerifierInstrument.java b/truffle/src/com.oracle.truffle.tck.instrumentation/src/com/oracle/truffle/tck/instrumentation/VerifierInstrument.java index 41a7ff7a32fd..f4aecf0e0116 100644 --- a/truffle/src/com.oracle.truffle.tck.instrumentation/src/com/oracle/truffle/tck/instrumentation/VerifierInstrument.java +++ b/truffle/src/com.oracle.truffle.tck.instrumentation/src/com/oracle/truffle/tck/instrumentation/VerifierInstrument.java @@ -232,7 +232,7 @@ private void verify(final Object result) { } } - private static class NodePropertyChecker implements ExecutionEventListener { + private static final class NodePropertyChecker implements ExecutionEventListener { public void onEnter(EventContext context, VirtualFrame frame) { Node instrumentedNode = context.getInstrumentedNode(); @@ -254,7 +254,7 @@ public void onReturnExceptional(EventContext context, VirtualFrame frame, Throwa } } - private static class RootFrameChecker implements ExecutionEventListener { + private static final class RootFrameChecker implements ExecutionEventListener { @Override public void onEnter(EventContext context, VirtualFrame frame) { @@ -298,7 +298,7 @@ public void onReturnExceptional(EventContext context, VirtualFrame frame, Throwa } } - private static class LibraryChecker implements ExecutionEventNodeFactory { + private static final class LibraryChecker implements ExecutionEventNodeFactory { @Override public ExecutionEventNode create(EventContext context) { diff --git a/truffle/src/com.oracle.truffle.tck.tests/src/com/oracle/truffle/tck/tests/InlineExecutionTest.java b/truffle/src/com.oracle.truffle.tck.tests/src/com/oracle/truffle/tck/tests/InlineExecutionTest.java index d4a2a6eef79b..dd0cbbdc8aff 100644 --- a/truffle/src/com.oracle.truffle.tck.tests/src/com/oracle/truffle/tck/tests/InlineExecutionTest.java +++ b/truffle/src/com.oracle.truffle.tck.tests/src/com/oracle/truffle/tck/tests/InlineExecutionTest.java @@ -145,7 +145,7 @@ public void testInline() throws Exception { } } - private class TestResultVerifier implements InlineVerifier.ResultVerifier { + private final class TestResultVerifier implements InlineVerifier.ResultVerifier { Exception exception; diff --git a/visualizer/IdealGraphVisualizer/Data/src/main/java/jdk/graal/compiler/graphio/parsing/BinaryReader.java b/visualizer/IdealGraphVisualizer/Data/src/main/java/jdk/graal/compiler/graphio/parsing/BinaryReader.java index 7b8881c43a1d..983d3c7beed3 100644 --- a/visualizer/IdealGraphVisualizer/Data/src/main/java/jdk/graal/compiler/graphio/parsing/BinaryReader.java +++ b/visualizer/IdealGraphVisualizer/Data/src/main/java/jdk/graal/compiler/graphio/parsing/BinaryReader.java @@ -103,7 +103,7 @@ public class BinaryReader implements GraphParser, ModelControl { private final Builder builder; - private static class ErrorReporter { + private static final class ErrorReporter { /** * Accumulates names of objects as they are parsed out of stream Used to report context for * irrecoverable errors which happen during reading BGV stream. @@ -184,7 +184,7 @@ public void reportLoadingError(String message, Builder builder) { } } - private static class ContextStrings { + private static final class ContextStrings { private static String propertyGraph(Object s) { return String.format("Property %s graph", s); } diff --git a/visualizer/IdealGraphVisualizer/Data/src/main/java/jdk/graal/compiler/graphio/parsing/ModelBuilder.java b/visualizer/IdealGraphVisualizer/Data/src/main/java/jdk/graal/compiler/graphio/parsing/ModelBuilder.java index c8df87e9c062..d539c0bdcea6 100644 --- a/visualizer/IdealGraphVisualizer/Data/src/main/java/jdk/graal/compiler/graphio/parsing/ModelBuilder.java +++ b/visualizer/IdealGraphVisualizer/Data/src/main/java/jdk/graal/compiler/graphio/parsing/ModelBuilder.java @@ -137,7 +137,7 @@ public int hashCode() { } } - private static class ErrorMessages { + private static final class ErrorMessages { public static String edgeStartNodeNotExists(String label, int node) { return String.format("Start node for edge %s does not exist: %d", label, node); } diff --git a/visualizer/IdealGraphVisualizer/Data/src/main/java/jdk/graal/compiler/graphio/parsing/model/Properties.java b/visualizer/IdealGraphVisualizer/Data/src/main/java/jdk/graal/compiler/graphio/parsing/model/Properties.java index b25c90c1a26d..73e5a1ff50ea 100644 --- a/visualizer/IdealGraphVisualizer/Data/src/main/java/jdk/graal/compiler/graphio/parsing/model/Properties.java +++ b/visualizer/IdealGraphVisualizer/Data/src/main/java/jdk/graal/compiler/graphio/parsing/model/Properties.java @@ -208,7 +208,7 @@ , TProp> void addFrom(TSource source, } } - private class ArrayPropertiesIterator implements Iterator> { + private final class ArrayPropertiesIterator implements Iterator> { int index; @Override @@ -575,7 +575,7 @@ public int hashCode() { } } - private static class PropertyCache { + private static final class PropertyCache { static final WeakHashMap> immutableCache = new WeakHashMap<>(); static synchronized SharedProperties intern(Properties properties) { diff --git a/vm/mx.vm/suite.py b/vm/mx.vm/suite.py index 4394f6ad43f7..78e5516f526b 100644 --- a/vm/mx.vm/suite.py +++ b/vm/mx.vm/suite.py @@ -88,7 +88,7 @@ "sourceDirs" : ["src"], "javaCompliance" : "17+", "license" : "GPLv2-CPE", - "checkstyleVersion" : "10.7.0", + "checkstyleVersion" : "10.21.0", "dependencies": [ "sdk:LAUNCHER_COMMON", "sdk:POLYGLOT", diff --git a/wasm/mx.wasm/suite.py b/wasm/mx.wasm/suite.py index 9fd5ba692afd..9a44cd1cd765 100644 --- a/wasm/mx.wasm/suite.py +++ b/wasm/mx.wasm/suite.py @@ -88,7 +88,7 @@ "requires": [ "jdk.unsupported", # sun.misc.Unsafe ], - "checkstyleVersion" : "10.7.0", + "checkstyleVersion" : "10.21.0", "javaCompliance" : "17+", "annotationProcessors" : ["truffle:TRUFFLE_DSL_PROCESSOR"], "workingSets" : "WebAssembly", diff --git a/wasm/src/org.graalvm.wasm.test/src/org/graalvm/wasm/test/AbstractBinarySuite.java b/wasm/src/org.graalvm.wasm.test/src/org/graalvm/wasm/test/AbstractBinarySuite.java index 7bd5fcbe7fff..9472fea99cc8 100644 --- a/wasm/src/org.graalvm.wasm.test/src/org/graalvm/wasm/test/AbstractBinarySuite.java +++ b/wasm/src/org.graalvm.wasm.test/src/org/graalvm/wasm/test/AbstractBinarySuite.java @@ -99,7 +99,7 @@ private static byte getByte(String hexString) { return Byte.parseByte(hexString, 16); } - private static class BinaryTypes { + private static final class BinaryTypes { private final List paramEntries = new ArrayList<>(); private final List resultEntries = new ArrayList<>(); @@ -132,7 +132,7 @@ private byte[] generateTypeSection() { } } - private static class BinaryTables { + private static final class BinaryTables { private final ByteArrayList tables = new ByteArrayList(); private void add(byte initSize, byte maxSize, byte elemType) { @@ -158,7 +158,7 @@ private byte[] generateTableSection() { } } - private static class BinaryMemories { + private static final class BinaryMemories { private final ByteArrayList memories = new ByteArrayList(); private void add(byte initSize, byte maxSize) { @@ -182,7 +182,7 @@ private byte[] generateMemorySection() { } } - private static class BinaryFunctions { + private static final class BinaryFunctions { private final ByteArrayList types = new ByteArrayList(); private final List localEntries = new ArrayList<>(); private final List codeEntries = new ArrayList<>(); @@ -230,7 +230,7 @@ private byte[] generateCodeSection() { } } - private static class BinaryExports { + private static final class BinaryExports { private final ByteArrayList types = new ByteArrayList(); private final ByteArrayList indices = new ByteArrayList(); private final List names = new ArrayList<>(); @@ -260,7 +260,7 @@ private byte[] generateExportSection() { } } - private static class BinaryElements { + private static final class BinaryElements { private final List elementEntries = new ArrayList<>(); private void add(byte[] elements) { @@ -282,7 +282,7 @@ private byte[] generateElementSection() { } } - private static class BinaryDatas { + private static final class BinaryDatas { private final List dataEntries = new ArrayList<>(); private void add(byte[] data) { @@ -312,7 +312,7 @@ private byte[] generateDataSection() { } } - private static class BinaryGlobals { + private static final class BinaryGlobals { private final ByteArrayList mutabilities = new ByteArrayList(); private final ByteArrayList valueTypes = new ByteArrayList(); private final List expressions = new ArrayList<>(); @@ -340,7 +340,7 @@ private byte[] generateGlobalSection() { } } - private static class BinaryCustomSections { + private static final class BinaryCustomSections { private final List names = new ArrayList<>(); private final List sections = new ArrayList<>(); diff --git a/wasm/src/org.graalvm.wasm.test/src/org/graalvm/wasm/test/suites/wasi/WasiOptionsSuite.java b/wasm/src/org.graalvm.wasm.test/src/org/graalvm/wasm/test/suites/wasi/WasiOptionsSuite.java index 85bf1c52f31b..273135f170b9 100644 --- a/wasm/src/org.graalvm.wasm.test/src/org/graalvm/wasm/test/suites/wasi/WasiOptionsSuite.java +++ b/wasm/src/org.graalvm.wasm.test/src/org/graalvm/wasm/test/suites/wasi/WasiOptionsSuite.java @@ -97,7 +97,7 @@ public static String[][] dirs() { }; } - private static class TestFileSystem implements FileSystem { + private static final class TestFileSystem implements FileSystem { @Override public Path parsePath(URI uri) { diff --git a/wasm/src/org.graalvm.wasm/src/org/graalvm/wasm/WasmInstantiator.java b/wasm/src/org.graalvm.wasm/src/org/graalvm/wasm/WasmInstantiator.java index e00cfe146092..acf8addce4d4 100644 --- a/wasm/src/org.graalvm.wasm/src/org/graalvm/wasm/WasmInstantiator.java +++ b/wasm/src/org.graalvm.wasm/src/org/graalvm/wasm/WasmInstantiator.java @@ -77,7 +77,7 @@ public class WasmInstantiator { private static final int MIN_DEFAULT_STACK_SIZE = 1_000_000; private static final int MAX_DEFAULT_ASYNC_STACK_SIZE = 10_000_000; - private static class ParsingExceptionHandler implements Thread.UncaughtExceptionHandler { + private static final class ParsingExceptionHandler implements Thread.UncaughtExceptionHandler { private Throwable parsingException = null; @Override diff --git a/wasm/src/org.graalvm.wasm/src/org/graalvm/wasm/debugging/encoding/DataEncoding.java b/wasm/src/org.graalvm.wasm/src/org/graalvm/wasm/debugging/encoding/DataEncoding.java index 6e0f598168a9..fadd478e85af 100644 --- a/wasm/src/org.graalvm.wasm/src/org/graalvm/wasm/debugging/encoding/DataEncoding.java +++ b/wasm/src/org.graalvm.wasm/src/org/graalvm/wasm/debugging/encoding/DataEncoding.java @@ -241,7 +241,7 @@ public static int fromForm(int form) { }; } - private static class Forms { + private static final class Forms { private static final int ADDR = 0x01; private static final int BLOCK2 = 0x03; private static final int BLOCK4 = 0x04;