Skip to content

Commit

Permalink
additional checkstyle fixes after rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
wirthi committed Dec 26, 2024
1 parent 3b288a5 commit 7de8f6e
Show file tree
Hide file tree
Showing 38 changed files with 55 additions and 53 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<Object> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ public void testInContextEval() {
}
}

private static class TestContextsListener implements DebugContextsListener {
private static final class TestContextsListener implements DebugContextsListener {

final List<ContextEvent> events = Collections.synchronizedList(new ArrayList<>());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ public void onSuspend(SuspendedEvent event) {
}
}

private static class TestThreadsListener implements DebugThreadsListener {
private static final class TestThreadsListener implements DebugThreadsListener {

final List<ThreadEvent> events = Collections.synchronizedList(new ArrayList<>());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<Source, SourceSection> loadedSections = EconomicMap.create(Equivalence.IDENTITY_WITH_SYSTEM_HASHCODE);
private final EconomicSet<Source> executedSources = EconomicSet.create(Equivalence.IDENTITY_WITH_SYSTEM_HASHCODE);
Expand Down Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1069,7 +1069,7 @@ private static List<DebugStackTraceElement> getAsynchronousStackFrames(DebuggerS
}

// This implementation prevents from calling size()
private class Itr implements Iterator<List<DebugStackTraceElement>> {
private final class Itr implements Iterator<List<DebugStackTraceElement>> {
int cursor = 0;

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ public void testFallback6() {
}

@SuppressWarnings("serial")
private static class FallbackException extends RuntimeException {
private static final class FallbackException extends RuntimeException {
}

@NodeChild("a")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ int do1(int a) {
}
}

private static class Imports2 {
private static final class Imports2 {

}

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

}
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ public void testLanguageInstrumentationAndExceptions() throws IOException {
}

@SuppressWarnings("serial")
private static class MyLanguageException extends RuntimeException {
private static final class MyLanguageException extends RuntimeException {

}

Expand Down Expand Up @@ -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 {

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3780,7 +3780,7 @@ Object getMetaObject() {

}

private static class StringBuilderWrapper {
private static final class StringBuilderWrapper {
private final StringBuilder delegate = new StringBuilder();

@TruffleBoundary
Expand Down Expand Up @@ -3857,7 +3857,7 @@ static InstrumentContext get(Node node) {
return REFERENCE.get(node);
}

private static class WeakSet<T> extends AbstractSet<T> {
private static final class WeakSet<T> extends AbstractSet<T> {

private final Map<T, Void> map = new WeakHashMap<>();

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

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

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

}

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

Expand Down Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ private static Object createComplexObject() {
return null;
}

private static class MyTruffleObject {
private static final class MyTruffleObject {
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1689,7 +1689,7 @@ protected void postVisitNotifications(Set<Class<?>> providedTags, SourceSection
* visitorBuilder.buildVisitor();
* </pre>
*/
private class VisitorBuilder {
private final class VisitorBuilder {
List<VisitOperation> operations = new ArrayList<>();
boolean shouldMaterializeSyntaxNodes;

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

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

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ static Class<?> getPrivateClass() {
return PrivateClass.class;
}

private static class PrivateClass {
private static final class PrivateClass {

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1303,7 +1303,7 @@ public static Object unboxAnnotationValue(AnnotationValue value) {
return value.accept(new AnnotationValueVisitorImpl(), null);
}

private static class AnnotationValueVisitorImpl extends AbstractAnnotationValueVisitor8<Object, Void> {
private static final class AnnotationValueVisitorImpl extends AbstractAnnotationValueVisitor8<Object, Void> {

@Override
public Object visitBoolean(boolean b, Void p) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4263,7 +4263,7 @@ private static boolean isRecursiveType(NodeData node, TypeElement parameterType)

private final Map<String, NodeData> nodeDataCache = new HashMap<>();

private static class FactoryMethodCacheKey {
private static final class FactoryMethodCacheKey {
}

private List<CodeExecutableElement> parseNodeFactoryMethods(TypeMirror nodeType) {
Expand Down Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public void destroy() {
}
}

private class NativeEnvSupplier implements Supplier<NativeEnv> {
private final class NativeEnvSupplier implements Supplier<NativeEnv> {

@Override
public NativeEnv get() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ protected TruffleString asTruffleString(Token literalToken, boolean removeQuotes

// ------------------------------- locals handling --------------------------

private static class FindLocalsVisitor extends SimpleLanguageBaseVisitor<Void> {
private static final class FindLocalsVisitor extends SimpleLanguageBaseVisitor<Void> {
boolean entered = false;
List<Token> results = new ArrayList<>();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ private SLStringLiteralNode createString(Token name, boolean removeQuotes) {
return node;
}

private class SLStatementVisitor extends SimpleLanguageBaseVisitor<SLStatementNode> {
private final class SLStatementVisitor extends SimpleLanguageBaseVisitor<SLStatementNode> {
@Override
public SLStatementNode visitBlock(BlockContext ctx) {
List<TruffleString> newLocals = enterBlock(ctx);
Expand Down Expand Up @@ -326,7 +326,7 @@ public SLStatementNode visitChildren(RuleNode arg0) {
}
}

private class SLExpressionVisitor extends SimpleLanguageBaseVisitor<SLExpressionNode> {
private final class SLExpressionVisitor extends SimpleLanguageBaseVisitor<SLExpressionNode> {
@Override
public SLExpressionNode visitExpression(ExpressionContext ctx) {
return createBinary(ctx.logic_term(), ctx.OP_OR());
Expand Down
Loading

0 comments on commit 7de8f6e

Please sign in to comment.