Skip to content

Commit

Permalink
update to latest checkstyle
Browse files Browse the repository at this point in the history
  • Loading branch information
wirthi committed Jan 6, 2025
1 parent dbcc75e commit aebdca4
Show file tree
Hide file tree
Showing 260 changed files with 420 additions and 404 deletions.
2 changes: 1 addition & 1 deletion common.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion compiler/mx.compiler/suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@
"GRAAL_PROCESSOR"
],
"checkPackagePrefix": "false",
"checkstyleVersion" : "10.7.0",
"checkstyleVersion" : "10.21.0",
"javaCompliance" : "21+",
"workingSets" : "API,Graal",
"jacoco" : "include",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public void testInt() {
test("blackholeIntSnippet", 17);
}

private static class Dummy {
private static final class Dummy {
private int x = 42;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public void testDouble() {
test("opaqueDoubleSnippet");
}

private static class Dummy {
private static final class Dummy {
}

@OpaqueSnippet(expectedReturnNode = ConstantNode.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ public void simplify(Node node, SimplifierTool tool) {
}
}

private static class GraphCostPhase extends TestBasePhase<CoreProviders> {
private static final class GraphCostPhase extends TestBasePhase<CoreProviders> {
private double finalCycles;
private double finalSize;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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;
Expand All @@ -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);
Expand All @@ -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();
Expand All @@ -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);
Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand All @@ -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";
Expand Down Expand Up @@ -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";
Expand All @@ -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);
Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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) {
Expand Down Expand Up @@ -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();
Expand All @@ -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();
Expand All @@ -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) {
Expand Down Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public void testNewArrayInLoop() {
assertTrue(box.inCompiledCode != shouldDeopt);
}

private static class DeoptimizationBox {
private static final class DeoptimizationBox {
volatile boolean inCompiledCode = false;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public void testNPEArray() {
test("testNPEArraySnippet", array);
}

private static class TestClass {
private static final class TestClass {
int field;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ public void testUnexpectedObject() {
});
}

private static class UnknownJavaValue implements JavaValue {
private static final class UnknownJavaValue implements JavaValue {
}

@SuppressWarnings("try")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
Loading

0 comments on commit aebdca4

Please sign in to comment.