Skip to content

Commit 19ea6a3

Browse files
committed
style fix
1 parent 112ed9f commit 19ea6a3

File tree

86 files changed

+313
-376
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+313
-376
lines changed

compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/api/test/ModuleSupport.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -39,7 +39,6 @@
3939
import java.util.Set;
4040

4141
import jdk.graal.compiler.debug.DebugOptions;
42-
4342
import jdk.internal.module.Modules;
4443

4544
public class ModuleSupport {
@@ -110,7 +109,7 @@ public static List<String> getJRTGraalClassNames() throws IOException {
110109

111110
Path top = fs.getPath("/modules/");
112111
Files.find(top, Integer.MAX_VALUE,
113-
(path, attrs) -> attrs.isRegularFile()).forEach(p -> {
112+
(_, attrs) -> attrs.isRegularFile()).forEach(p -> {
114113
int nameCount = p.getNameCount();
115114
if (nameCount > 2) {
116115
String base = p.getName(nameCount - 1).toString();

compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/core/amd64/test/AMD64MatchRuleTest.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2015, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,9 @@
2626

2727
import static org.junit.Assume.assumeTrue;
2828

29+
import org.junit.Before;
30+
import org.junit.Test;
31+
2932
import jdk.graal.compiler.core.common.cfg.BasicBlock;
3033
import jdk.graal.compiler.core.test.MatchRuleTest;
3134
import jdk.graal.compiler.lir.LIR;
@@ -37,9 +40,6 @@
3740
import jdk.graal.compiler.lir.amd64.AMD64ControlFlow.CmpConstBranchOp;
3841
import jdk.graal.compiler.lir.amd64.AMD64ControlFlow.CmpDataBranchOp;
3942
import jdk.graal.compiler.lir.amd64.AMD64Unary;
40-
import org.junit.Before;
41-
import org.junit.Test;
42-
4343
import jdk.vm.ci.amd64.AMD64;
4444
import jdk.vm.ci.amd64.AMD64Kind;
4545

@@ -103,7 +103,7 @@ public void testVolatileExtension() {
103103
boolean found = false;
104104
for (LIRInstruction ins : lir.getLIRforBlock(lir.getControlFlowGraph().getBlocks()[lir.codeEmittingOrder()[0]])) {
105105
if (ins instanceof AMD64Unary.MemoryOp) {
106-
ins.visitEachOutput((value, mode, flags) -> assertTrue(value.getPlatformKind().toString(), value.getPlatformKind().equals(AMD64Kind.QWORD)));
106+
ins.visitEachOutput((value, _, _) -> assertTrue(value.getPlatformKind().toString(), value.getPlatformKind().equals(AMD64Kind.QWORD)));
107107
assertFalse("MemoryOp expected only once in first block", found);
108108
found = true;
109109
}
@@ -209,7 +209,7 @@ public void testVolatileExtensionDifferentBlocks() {
209209
boolean found = false;
210210
for (LIRInstruction ins : lir.getLIRforBlock(lir.getControlFlowGraph().getBlocks()[lir.codeEmittingOrder()[0]])) {
211211
if (ins instanceof AMD64Unary.MemoryOp) {
212-
ins.visitEachOutput((value, mode, flags) -> assertTrue(value.getPlatformKind().toString(), value.getPlatformKind().equals(AMD64Kind.QWORD)));
212+
ins.visitEachOutput((value, _, _) -> assertTrue(value.getPlatformKind().toString(), value.getPlatformKind().equals(AMD64Kind.QWORD)));
213213
assertFalse("MemoryOp expected only once in first block", found);
214214
found = true;
215215
}

compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/core/test/BytecodeDisassemblerTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2023, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -58,7 +58,7 @@ private static List<Class<?>> gatherClasses() throws IOException {
5858
FileSystem fs = FileSystems.newFileSystem(URI.create("jrt:/"), Collections.emptyMap());
5959
Path top = fs.getPath("/modules/");
6060
Files.find(top, Integer.MAX_VALUE,
61-
(path, attrs) -> attrs.isRegularFile()).forEach(p -> {
61+
(_, attrs) -> attrs.isRegularFile()).forEach(p -> {
6262
int nameCount = p.getNameCount();
6363
if (nameCount > 2) {
6464
String base = p.getName(nameCount - 1).toString();

compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/core/test/CheckGraalInvariants.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2014, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -383,7 +383,7 @@ public static void runTest(InvariantsTool tool) {
383383
ResolvedJavaMethod method = metaAccess.lookupJavaMethod(m);
384384
try (DebugContext debug = new Builder(options).build()) {
385385
StructuredGraph graph = new StructuredGraph.Builder(options, debug, AllowAssumptions.YES).method(method).build();
386-
try (DebugCloseable s = debug.disableIntercept(); DebugContext.Scope ds = debug.scope("CheckingGraph", graph, method)) {
386+
try (DebugCloseable _ = debug.disableIntercept(); DebugContext.Scope _ = debug.scope("CheckingGraph", graph, method)) {
387387
graphBuilderSuite.apply(graph, context);
388388
// update phi stamps
389389
graph.getNodes().filter(PhiNode.class).forEach(PhiNode::inferStamp);
@@ -437,7 +437,7 @@ public static void runTest(InvariantsTool tool) {
437437
try (DebugContext debug = new Builder(options).build()) {
438438
boolean isSubstitution = method.getAnnotation(Snippet.class) != null;
439439
StructuredGraph graph = new StructuredGraph.Builder(options, debug).method(method).setIsSubstitution(isSubstitution).build();
440-
try (DebugCloseable s = debug.disableIntercept(); DebugContext.Scope ds = debug.scope("CheckingGraph", graph, method)) {
440+
try (DebugCloseable _ = debug.disableIntercept(); DebugContext.Scope _ = debug.scope("CheckingGraph", graph, method)) {
441441
checkMethod(method);
442442
graphBuilderSuite.apply(graph, context);
443443
// update phi stamps

compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/core/test/CompilationWatchDogTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -140,7 +140,7 @@ public void onStuckCompilation(CompilationWatchDog watchDog, Thread watched, Com
140140
CompilationWatchDog watch = CompilationWatchDog.watch(compilation, options, false, longCompilationHandler, null);
141141
try (CompilationWatchDog watchScope = watch) {
142142
event("start compiling");
143-
try (TTY.Filter f = new TTY.Filter()) {
143+
try (TTY.Filter _ = new TTY.Filter()) {
144144
return super.getCode(installedCodeOwner, graph, forceCompile, installAsDefault, options);
145145
}
146146
} finally {

compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/core/test/ConditionalEliminationTestBase.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2015, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -69,7 +69,7 @@ protected void testConditionalElimination(String snippet, String referenceSnippe
6969
CoreProviders context = getProviders();
7070
CanonicalizerPhase canonicalizer1 = createCanonicalizerPhase();
7171
CanonicalizerPhase canonicalizer = createCanonicalizerPhase();
72-
try (DebugContext.Scope scope = debug.scope("ConditionalEliminationTest", graph)) {
72+
try (DebugContext.Scope _ = debug.scope("ConditionalEliminationTest", graph)) {
7373
prepareGraph(graph, canonicalizer1, context, applyLowering);
7474
new IterativeConditionalEliminationPhase(canonicalizer, true).apply(graph, context);
7575
canonicalizer.apply(graph, context);
@@ -78,7 +78,7 @@ protected void testConditionalElimination(String snippet, String referenceSnippe
7878
debug.handle(t);
7979
}
8080
StructuredGraph referenceGraph = parseEager(referenceSnippet, AllowAssumptions.YES);
81-
try (DebugContext.Scope scope = debug.scope("ConditionalEliminationTest.ReferenceGraph", referenceGraph)) {
81+
try (DebugContext.Scope _ = debug.scope("ConditionalEliminationTest.ReferenceGraph", referenceGraph)) {
8282
prepareGraph(referenceGraph, canonicalizer, context, applyLowering);
8383
if (applyConditionalEliminationOnReference) {
8484
new ConditionalEliminationPhase(canonicalizer, true).apply(referenceGraph, context);

compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/core/test/DegeneratedLoopsTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2011, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -80,7 +80,7 @@ private static void test() {
8080
@SuppressWarnings("try")
8181
private void test(final String snippet) {
8282
DebugContext debug = getDebugContext();
83-
try (DebugContext.Scope s = debug.scope("DegeneratedLoopsTest", new DebugDumpScope(snippet))) {
83+
try (DebugContext.Scope _ = debug.scope("DegeneratedLoopsTest", new DebugDumpScope(snippet))) {
8484
StructuredGraph graph = parseEager(snippet, AllowAssumptions.YES);
8585
HighTierContext context = getDefaultHighTierContext();
8686
createInliningPhase().apply(graph, context);

compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/core/test/DumpPathTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2017, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -67,7 +67,7 @@ public void testDump() throws Exception {
6767
overrides.put(GraalCompilerOptions.DumpHeapAfter, "<compilation>:Schedule");
6868
overrides.put(DebugOptions.MethodFilter, null);
6969

70-
try (AutoCloseable c = new TTY.Filter()) {
70+
try (AutoCloseable _ = new TTY.Filter()) {
7171
// Generate dump files.
7272
test(new OptionValues(getInitialOptions(), overrides), "snippet");
7373
}

compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/core/test/FinalizableSubclassTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2013, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2013, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -78,7 +78,7 @@ private StructuredGraph parseAndProcess(Class<?> cl, AllowAssumptions allowAssum
7878
OptionValues options = getInitialOptions();
7979
DebugContext debug = getDebugContext(options, null, javaMethod);
8080
StructuredGraph graph = new StructuredGraph.Builder(options, debug, allowAssumptions).method(javaMethod).build();
81-
try (DebugContext.Scope s = debug.scope("FinalizableSubclassTest", graph)) {
81+
try (DebugContext.Scope _ = debug.scope("FinalizableSubclassTest", graph)) {
8282
GraphBuilderConfiguration conf = GraphBuilderConfiguration.getSnippetDefault(getDefaultGraphBuilderPlugins());
8383
new TestGraphBuilderPhase.Instance(getProviders(), conf, OptimisticOptimizations.ALL, null).apply(graph);
8484

compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/core/test/FindUniqueDefaultMethodTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2014, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -140,7 +140,7 @@ private void testConstantReturn(String name, Object value) {
140140
@SuppressWarnings("try")
141141
protected StructuredGraph buildGraph(final String snippet) {
142142
DebugContext debug = getDebugContext();
143-
try (DebugContext.Scope s = debug.scope("InstanceOfTest", getMetaAccess().lookupJavaMethod(getMethod(snippet)))) {
143+
try (DebugContext.Scope _ = debug.scope("InstanceOfTest", getMetaAccess().lookupJavaMethod(getMethod(snippet)))) {
144144
StructuredGraph graph = parseEager(snippet, AllowAssumptions.YES, debug);
145145
compile(graph.method(), graph);
146146
debug.dump(DebugContext.BASIC_LEVEL, graph, snippet);

compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/core/test/FloatingReadTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2011, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -63,7 +63,7 @@ public void test1() {
6363
@SuppressWarnings("try")
6464
private void test(final String snippet) {
6565
DebugContext debug = getDebugContext();
66-
try (DebugContext.Scope s = debug.scope("FloatingReadTest", new DebugDumpScope(snippet))) {
66+
try (DebugContext.Scope _ = debug.scope("FloatingReadTest", new DebugDumpScope(snippet))) {
6767

6868
StructuredGraph graph = parseEager(snippet, AllowAssumptions.YES);
6969
CoreProviders context = getProviders();

compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/core/test/GraalCompilerTest.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2011, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -539,7 +539,7 @@ protected void assertEquals(StructuredGraph expected,
539539
String mismatchString = compareGraphStrings(expected, expectedString, actual, actualString);
540540

541541
// Open a scope so that `expected` and `actual` are dumped if DumpOnError=true
542-
try (DebugContext.Scope scope = addGraphsToDebugContext ? debug.scope("GraphEqualsTest", expected, actual) : null) {
542+
try (DebugContext.Scope _ = addGraphsToDebugContext ? debug.scope("GraphEqualsTest", expected, actual) : null) {
543543
if (!excludeVirtual && getNodeCountExcludingUnusedConstants(expected) != getNodeCountExcludingUnusedConstants(actual)) {
544544
debug.dump(DebugContext.BASIC_LEVEL, expected, "Node count not matching - expected");
545545
debug.dump(DebugContext.BASIC_LEVEL, actual, "Node count not matching - actual");
@@ -1157,12 +1157,12 @@ protected InstalledCode getCode(final ResolvedJavaMethod installedCodeOwner, Str
11571157
StructuredGraph graphToCompile = graph == null ? parseForCompile(installedCodeOwner, id, options) : graph;
11581158
DebugContext debug = graphToCompile.getDebug();
11591159

1160-
try (AllocSpy spy = AllocSpy.open(installedCodeOwner); DebugContext.Scope ds = debug.scope("Compiling", graph)) {
1160+
try (AllocSpy _ = AllocSpy.open(installedCodeOwner); DebugContext.Scope _ = debug.scope("Compiling", graph)) {
11611161
CompilationPrinter printer = CompilationPrinter.begin(options, id, installedCodeOwner, INVOCATION_ENTRY_BCI);
11621162
CompilationResult compResult = compile(installedCodeOwner, graphToCompile, new CompilationResult(graphToCompile.compilationId()), id, options);
11631163

1164-
try (DebugContext.Scope s = debug.scope("CodeInstall", getCodeCache(), installedCodeOwner, compResult);
1165-
DebugContext.Activation a = debug.activate()) {
1164+
try (DebugContext.Scope _ = debug.scope("CodeInstall", getCodeCache(), installedCodeOwner, compResult);
1165+
DebugContext.Activation _ = debug.activate()) {
11661166
try {
11671167
if (installAsDefault) {
11681168
installedCode = addDefaultMethod(debug, installedCodeOwner, compResult);
@@ -1306,7 +1306,7 @@ protected CompilationResult compile(ResolvedJavaMethod installedCodeOwner, Struc
13061306
StructuredGraph graphToCompile = graph == null ? parseForCompile(installedCodeOwner, compilationId, options) : graph;
13071307
lastCompiledGraph = graphToCompile;
13081308
DebugContext debug = graphToCompile.getDebug();
1309-
try (DebugContext.Scope s = debug.scope("Compile", graphToCompile)) {
1309+
try (DebugContext.Scope _ = debug.scope("Compile", graphToCompile)) {
13101310
assert options != null;
13111311

13121312
Suites suites = createSuites(options);
@@ -1343,7 +1343,7 @@ protected StructuredGraph getFinalGraph(ResolvedJavaMethod method, OptionValues
13431343
@SuppressWarnings("try")
13441344
protected void applyFrontEnd(StructuredGraph graph) {
13451345
DebugContext debug = graph.getDebug();
1346-
try (DebugContext.Scope s = debug.scope("FrontEnd", graph)) {
1346+
try (DebugContext.Scope _ = debug.scope("FrontEnd", graph)) {
13471347
GraalCompiler.emitFrontEnd(getProviders(), getBackend(), graph, getDefaultGraphBuilderSuite(), getOptimisticOptimizations(), graph.getProfilingInfo(), createSuites(graph.getOptions()));
13481348
} catch (Throwable e) {
13491349
throw debug.handle(e);
@@ -1604,7 +1604,7 @@ protected StructuredGraph parse(StructuredGraph.Builder builder, PhaseSuite<High
16041604
assert javaMethod.getAnnotation(Test.class) == null : "shouldn't parse method with @Test annotation: " + javaMethod;
16051605
StructuredGraph graph = builder.build();
16061606
DebugContext debug = graph.getDebug();
1607-
try (DebugContext.Scope ds = debug.scope("Parsing", javaMethod, graph)) {
1607+
try (DebugContext.Scope _ = debug.scope("Parsing", javaMethod, graph)) {
16081608
graphBuilderSuite.apply(graph, getDefaultHighTierContext());
16091609
Object[] args = getArgumentToBind();
16101610
if (args != null) {

compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/core/test/GraphDumpingTest.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2021, 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2021, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -63,18 +63,16 @@ public void snippet02(int i) {
6363
sideEffect = i;
6464
}
6565

66-
@SuppressWarnings("try")
6766
@Test
6867
public void testDump() throws IOException {
69-
try (TTY.Filter suppressTTY = new TTY.Filter(); TemporaryDirectory temp = new TemporaryDirectory("GraphDumpingTest")) {
68+
try (TTY.Filter _ = new TTY.Filter(); TemporaryDirectory temp = new TemporaryDirectory("GraphDumpingTest")) {
7069
compileWithDumping("snippet01", temp);
7170
}
7271
}
7372

74-
@SuppressWarnings("try")
7573
@Test
7674
public void testInvalidNodeProperties() throws IOException {
77-
try (TTY.Filter suppressTTY = new TTY.Filter(); TemporaryDirectory temp = new TemporaryDirectory("GraphDumpingTest")) {
75+
try (TTY.Filter _ = new TTY.Filter(); TemporaryDirectory temp = new TemporaryDirectory("GraphDumpingTest")) {
7876
StructuredGraph graph = compileWithDumping("snippet02", temp);
7977

8078
// introduce an invalid node with broken properties

0 commit comments

Comments
 (0)