From 11517e577ddf2c968545ca76174ab8d1b6ade345 Mon Sep 17 00:00:00 2001 From: Doug Simon Date: Tue, 4 Jan 2022 16:40:50 +0100 Subject: [PATCH 1/4] fix issue with SpeculationGroupReason id allocation --- .../serviceprovider/SpeculationReasonGroup.java | 9 +++++++-- .../svm/graal/hotspot/libgraal/LibGraalFeature.java | 13 +++++++++++++ 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/compiler/src/org.graalvm.compiler.serviceprovider/src/org/graalvm/compiler/serviceprovider/SpeculationReasonGroup.java b/compiler/src/org.graalvm.compiler.serviceprovider/src/org/graalvm/compiler/serviceprovider/SpeculationReasonGroup.java index 60715974ac60..46e19e9d7d1f 100644 --- a/compiler/src/org.graalvm.compiler.serviceprovider/src/org/graalvm/compiler/serviceprovider/SpeculationReasonGroup.java +++ b/compiler/src/org.graalvm.compiler.serviceprovider/src/org/graalvm/compiler/serviceprovider/SpeculationReasonGroup.java @@ -46,10 +46,15 @@ public final class SpeculationReasonGroup { private static final AtomicInteger nextId = new AtomicInteger(1); /** - * Creates speculation group whose context will always match {@code signature}. + * Creates a speculation group whose context will always match {@code signature}. + * + * This constructor is deleted in libgraal to ensure group ids are allocated during build time. + * Without this invariant, it would possible for 2 different groups to have the same id if the + * groups are allocated in different libgraal isolates (since static variables are + * isolate-local). */ public SpeculationReasonGroup(String name, Class... signature) { - this.id = nextId.get(); + this.id = nextId.getAndIncrement(); this.name = name; this.signature = signature; for (Class c : signature) { diff --git a/substratevm/src/com.oracle.svm.graal.hotspot.libgraal/src/com/oracle/svm/graal/hotspot/libgraal/LibGraalFeature.java b/substratevm/src/com.oracle.svm.graal.hotspot.libgraal/src/com/oracle/svm/graal/hotspot/libgraal/LibGraalFeature.java index 53285bc91485..df8931db730d 100644 --- a/substratevm/src/com.oracle.svm.graal.hotspot.libgraal/src/com/oracle/svm/graal/hotspot/libgraal/LibGraalFeature.java +++ b/substratevm/src/com.oracle.svm.graal.hotspot.libgraal/src/com/oracle/svm/graal/hotspot/libgraal/LibGraalFeature.java @@ -87,6 +87,7 @@ import org.graalvm.compiler.phases.util.Providers; import org.graalvm.compiler.serviceprovider.GraalServices; import org.graalvm.compiler.serviceprovider.IsolateUtil; +import org.graalvm.compiler.serviceprovider.SpeculationReasonGroup; import org.graalvm.compiler.truffle.common.TruffleCompilerRuntime; import org.graalvm.compiler.truffle.compiler.PartialEvaluatorConfiguration; import org.graalvm.compiler.truffle.compiler.TruffleCompilerBase; @@ -602,6 +603,18 @@ static Object convertUnknownValue(Object object) { static native Annotation[] getMethodAnnotationsInternal(ResolvedJavaMethod javaMethod); } +@TargetClass(value = SpeculationReasonGroup.class, onlyWith = LibGraalFeature.IsEnabled.class) +final class Target_org_graalvm_compiler_serviceprovider_SpeculationReasonGroup { + + /** + * Delete this constructor to ensure {@link SpeculationReasonGroup} ids are in the libgraal + * image and thus global across all libgraal isolates. + */ + @Delete + @TargetElement(name = TargetElement.CONSTRUCTOR_NAME) + native void constructor(String name, Class... signature); +} + /** * {@link HotSpotConstantReflectionProvider#forObject} can only be used to wrap compiler objects so * interpose to return a {@link SnippetObjectConstant}. From b2bacda028beec41e42cb4c304fc6fc08c47b301 Mon Sep 17 00:00:00 2001 From: Christian Wimmer Date: Fri, 7 Jan 2022 12:12:54 -0800 Subject: [PATCH 2/4] Unify and simplify checkstyle definitions --- substratevm/mx.substratevm/suite.py | 36 +-- .../.checkstyle_checks.xml | 267 ----------------- .../elf/dwarf/DwarfARangesSectionImpl.java | 2 +- .../elf/dwarf/DwarfAbbrevSectionImpl.java | 2 +- .../objectfile/elf/dwarf/DwarfDebugInfo.java | 2 +- .../elf/dwarf/DwarfFrameSectionImpl.java | 2 +- .../dwarf/DwarfFrameSectionImplAArch64.java | 2 +- .../dwarf/DwarfFrameSectionImplX86_64.java | 2 +- .../elf/dwarf/DwarfInfoSectionImpl.java | 2 +- .../elf/dwarf/DwarfLineSectionImpl.java | 2 +- .../elf/dwarf/DwarfSectionImpl.java | 2 +- .../elf/dwarf/DwarfStrSectionImpl.java | 2 +- .../.checkstyle_checks.xml | 49 +-- .../.checkstyle_checks.xml | 248 --------------- .../AArch64ArrayIndexOfForeignCalls.java | 4 +- .../.checkstyle_checks.xml | 12 +- .../svm/hosted/SubstitutionReportFeature.java | 2 +- ...stantAnnotationMarkerSubstitutionType.java | 2 +- .../hosted/image/sources/SourceManager.java | 9 +- .../.checkstyle_checks.xml | 271 ----------------- .../.checkstyle_checks.xml | 283 ------------------ .../polyglot/nativeapi/PolyglotNativeAPI.java | 2 + .../PolyglotNativeAPIEntryPoints.java | 2 + 23 files changed, 44 insertions(+), 1163 deletions(-) delete mode 100644 substratevm/src/com.oracle.graal.pointsto/.checkstyle_checks.xml delete mode 100644 substratevm/src/com.oracle.svm.driver/.checkstyle_checks.xml delete mode 100644 substratevm/src/com.oracle.svm.truffle/.checkstyle_checks.xml delete mode 100644 substratevm/src/org.graalvm.polyglot.nativeapi/.checkstyle_checks.xml diff --git a/substratevm/mx.substratevm/suite.py b/substratevm/mx.substratevm/suite.py index 48059f90c1ec..fb2fccfb6cfc 100644 --- a/substratevm/mx.substratevm/suite.py +++ b/substratevm/mx.substratevm/suite.py @@ -387,9 +387,8 @@ "dependencies": [ "com.oracle.svm.common", ], - "checkstyle": "com.oracle.graal.pointsto", + "checkstyle": "com.oracle.svm.core", "javaCompliance": "11+", - "checkstyleVersion" : "8.36.1", "annotationProcessors": [ "compiler:GRAAL_PROCESSOR", ], @@ -647,8 +646,7 @@ "requires" : [ "jdk.management", ], - "checkstyle": "com.oracle.svm.driver", - "checkstyleVersion" : "8.36.1", + "checkstyle": "com.oracle.svm.hosted", "workingSets": "SVM", "annotationProcessors": [ "compiler:GRAAL_PROCESSOR", @@ -772,7 +770,7 @@ "subDir": "src", "sourceDirs" : ["src"], "dependencies" : ["com.oracle.svm.core"], - "checkstyle" : "com.oracle.svm.truffle", + "checkstyle" : "com.oracle.svm.hosted", "javaCompliance": "11+", "annotationProcessors" : [ "compiler:GRAAL_PROCESSOR", @@ -852,7 +850,7 @@ "requires" : [ "jdk.unsupported", ], - "checkstyle": "com.oracle.svm.truffle", + "checkstyle": "com.oracle.svm.core", "javaCompliance": "11+", "annotationProcessors": [ "compiler:GRAAL_PROCESSOR", @@ -866,7 +864,7 @@ "dependencies": [ "com.oracle.svm.core", ], - "checkstyle": "com.oracle.svm.truffle", + "checkstyle": "com.oracle.svm.core", "javaCompliance": "11+", "annotationProcessors": [ "compiler:GRAAL_PROCESSOR", @@ -883,9 +881,8 @@ "requires" : [ "jdk.unsupported", ], - "checkstyle": "com.oracle.svm.truffle", + "checkstyle": "com.oracle.svm.hosted", "javaCompliance": "11+", - "checkstyleVersion" : "8.36.1", "annotationProcessors": [ "compiler:GRAAL_PROCESSOR", ], @@ -901,7 +898,7 @@ "requires": [ "jdk.unsupported", # workaround to make TRUFFLE_DSL_PROCESSOR work with ECJ ], - "checkstyle": "com.oracle.svm.truffle", + "checkstyle": "com.oracle.svm.hosted", "javaCompliance": "11+", "annotationProcessors": [ "truffle:TRUFFLE_DSL_PROCESSOR", @@ -916,7 +913,7 @@ "com.oracle.svm.truffle.nfi", "com.oracle.svm.core.posix", ], - "checkstyle": "com.oracle.svm.truffle", + "checkstyle": "com.oracle.svm.hosted", "javaCompliance": "11+", "annotationProcessors": [ "truffle:TRUFFLE_DSL_PROCESSOR", @@ -931,7 +928,7 @@ "com.oracle.svm.truffle.nfi", "com.oracle.svm.core.windows", ], - "checkstyle": "com.oracle.svm.truffle", + "checkstyle": "com.oracle.svm.hosted", "javaCompliance": "11+", "annotationProcessors": [ "truffle:TRUFFLE_DSL_PROCESSOR", @@ -945,7 +942,7 @@ "generatedDependencies": [ "com.oracle.svm.graal", ], - "checkstyle": "com.oracle.svm.truffle", + "checkstyle": "com.oracle.svm.core", "javaCompliance": "11+", "annotationProcessors": [ "compiler:GRAAL_PROCESSOR", @@ -964,8 +961,7 @@ "sdk:GRAAL_SDK", "com.oracle.svm.hosted", ], - "checkstyle": "org.graalvm.polyglot.nativeapi", - "checkstyleVersion" : "8.36.1", + "checkstyle": "com.oracle.svm.core", "javaCompliance": "11+", "annotationProcessors" : [ "compiler:GRAAL_PROCESSOR", @@ -1003,7 +999,7 @@ "dependencies": [ "com.oracle.svm.core", ], - "checkstyle": "com.oracle.svm.driver", + "checkstyle": "com.oracle.svm.hosted", "workingSets": "SVM", "annotationProcessors": [ ], @@ -1019,7 +1015,7 @@ "dependencies": [ "com.oracle.svm.jni", ], - "checkstyle": "com.oracle.svm.driver", + "checkstyle": "com.oracle.svm.hosted", "workingSets": "SVM", "annotationProcessors": [ "compiler:GRAAL_PROCESSOR", @@ -1039,7 +1035,7 @@ "com.oracle.svm.configure", "com.oracle.svm.driver", ], - "checkstyle": "com.oracle.svm.driver", + "checkstyle": "com.oracle.svm.hosted", "workingSets": "SVM", "annotationProcessors": [ "compiler:GRAAL_PROCESSOR", @@ -1057,7 +1053,7 @@ "dependencies": [ "JVMTI_AGENT_BASE", ], - "checkstyle": "com.oracle.svm.driver", + "checkstyle": "com.oracle.svm.hosted", "workingSets": "SVM", "annotationProcessors": [ "compiler:GRAAL_PROCESSOR", @@ -1075,7 +1071,7 @@ "requires" : [ "jdk.unsupported", ], - "checkstyle" : "com.oracle.svm.truffle", + "checkstyle" : "com.oracle.svm.hosted", "workingSets": "SVM", "annotationProcessors": [ "compiler:GRAAL_PROCESSOR", diff --git a/substratevm/src/com.oracle.graal.pointsto/.checkstyle_checks.xml b/substratevm/src/com.oracle.graal.pointsto/.checkstyle_checks.xml deleted file mode 100644 index a3c7cbc42970..000000000000 --- a/substratevm/src/com.oracle.graal.pointsto/.checkstyle_checks.xml +++ /dev/null @@ -1,267 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/substratevm/src/com.oracle.objectfile/src/com/oracle/objectfile/elf/dwarf/DwarfARangesSectionImpl.java b/substratevm/src/com.oracle.objectfile/src/com/oracle/objectfile/elf/dwarf/DwarfARangesSectionImpl.java index e24cda20f423..3956ef8502fc 100644 --- a/substratevm/src/com.oracle.objectfile/src/com/oracle/objectfile/elf/dwarf/DwarfARangesSectionImpl.java +++ b/substratevm/src/com.oracle.objectfile/src/com/oracle/objectfile/elf/dwarf/DwarfARangesSectionImpl.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2020, 2020, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2020, Red Hat Inc. All rights reserved. + * Copyright (c) 2020, 2020, Red Hat Inc. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/substratevm/src/com.oracle.objectfile/src/com/oracle/objectfile/elf/dwarf/DwarfAbbrevSectionImpl.java b/substratevm/src/com.oracle.objectfile/src/com/oracle/objectfile/elf/dwarf/DwarfAbbrevSectionImpl.java index e8ab5db09050..90a4460cb2f9 100644 --- a/substratevm/src/com.oracle.objectfile/src/com/oracle/objectfile/elf/dwarf/DwarfAbbrevSectionImpl.java +++ b/substratevm/src/com.oracle.objectfile/src/com/oracle/objectfile/elf/dwarf/DwarfAbbrevSectionImpl.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2020, 2020, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2020, Red Hat Inc. All rights reserved. + * Copyright (c) 2020, 2020, Red Hat Inc. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/substratevm/src/com.oracle.objectfile/src/com/oracle/objectfile/elf/dwarf/DwarfDebugInfo.java b/substratevm/src/com.oracle.objectfile/src/com/oracle/objectfile/elf/dwarf/DwarfDebugInfo.java index 9adc3617678a..f7239746df04 100644 --- a/substratevm/src/com.oracle.objectfile/src/com/oracle/objectfile/elf/dwarf/DwarfDebugInfo.java +++ b/substratevm/src/com.oracle.objectfile/src/com/oracle/objectfile/elf/dwarf/DwarfDebugInfo.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2020, 2020, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2020, Red Hat Inc. All rights reserved. + * Copyright (c) 2020, 2020, Red Hat Inc. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/substratevm/src/com.oracle.objectfile/src/com/oracle/objectfile/elf/dwarf/DwarfFrameSectionImpl.java b/substratevm/src/com.oracle.objectfile/src/com/oracle/objectfile/elf/dwarf/DwarfFrameSectionImpl.java index 877c850a544f..c43296534a2b 100644 --- a/substratevm/src/com.oracle.objectfile/src/com/oracle/objectfile/elf/dwarf/DwarfFrameSectionImpl.java +++ b/substratevm/src/com.oracle.objectfile/src/com/oracle/objectfile/elf/dwarf/DwarfFrameSectionImpl.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2020, 2020, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2020, Red Hat Inc. All rights reserved. + * Copyright (c) 2020, 2020, Red Hat Inc. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/substratevm/src/com.oracle.objectfile/src/com/oracle/objectfile/elf/dwarf/DwarfFrameSectionImplAArch64.java b/substratevm/src/com.oracle.objectfile/src/com/oracle/objectfile/elf/dwarf/DwarfFrameSectionImplAArch64.java index 06eeeadfaa0a..73dc13e94239 100644 --- a/substratevm/src/com.oracle.objectfile/src/com/oracle/objectfile/elf/dwarf/DwarfFrameSectionImplAArch64.java +++ b/substratevm/src/com.oracle.objectfile/src/com/oracle/objectfile/elf/dwarf/DwarfFrameSectionImplAArch64.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2020, 2020, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2020, Red Hat Inc. All rights reserved. + * Copyright (c) 2020, 2020, Red Hat Inc. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/substratevm/src/com.oracle.objectfile/src/com/oracle/objectfile/elf/dwarf/DwarfFrameSectionImplX86_64.java b/substratevm/src/com.oracle.objectfile/src/com/oracle/objectfile/elf/dwarf/DwarfFrameSectionImplX86_64.java index 11743185335d..c5f58a93a0fd 100644 --- a/substratevm/src/com.oracle.objectfile/src/com/oracle/objectfile/elf/dwarf/DwarfFrameSectionImplX86_64.java +++ b/substratevm/src/com.oracle.objectfile/src/com/oracle/objectfile/elf/dwarf/DwarfFrameSectionImplX86_64.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2020, 2020, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2020, Red Hat Inc. All rights reserved. + * Copyright (c) 2020, 2020, Red Hat Inc. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/substratevm/src/com.oracle.objectfile/src/com/oracle/objectfile/elf/dwarf/DwarfInfoSectionImpl.java b/substratevm/src/com.oracle.objectfile/src/com/oracle/objectfile/elf/dwarf/DwarfInfoSectionImpl.java index 9a93f68fd374..2d32a9fa79e3 100644 --- a/substratevm/src/com.oracle.objectfile/src/com/oracle/objectfile/elf/dwarf/DwarfInfoSectionImpl.java +++ b/substratevm/src/com.oracle.objectfile/src/com/oracle/objectfile/elf/dwarf/DwarfInfoSectionImpl.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2020, 2020, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2020, Red Hat Inc. All rights reserved. + * Copyright (c) 2020, 2020, Red Hat Inc. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/substratevm/src/com.oracle.objectfile/src/com/oracle/objectfile/elf/dwarf/DwarfLineSectionImpl.java b/substratevm/src/com.oracle.objectfile/src/com/oracle/objectfile/elf/dwarf/DwarfLineSectionImpl.java index bbd2479796ef..c7792db05541 100644 --- a/substratevm/src/com.oracle.objectfile/src/com/oracle/objectfile/elf/dwarf/DwarfLineSectionImpl.java +++ b/substratevm/src/com.oracle.objectfile/src/com/oracle/objectfile/elf/dwarf/DwarfLineSectionImpl.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2020, 2020, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2020, Red Hat Inc. All rights reserved. + * Copyright (c) 2020, 2020, Red Hat Inc. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/substratevm/src/com.oracle.objectfile/src/com/oracle/objectfile/elf/dwarf/DwarfSectionImpl.java b/substratevm/src/com.oracle.objectfile/src/com/oracle/objectfile/elf/dwarf/DwarfSectionImpl.java index be41d243acfa..20310ef6666e 100644 --- a/substratevm/src/com.oracle.objectfile/src/com/oracle/objectfile/elf/dwarf/DwarfSectionImpl.java +++ b/substratevm/src/com.oracle.objectfile/src/com/oracle/objectfile/elf/dwarf/DwarfSectionImpl.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2020, 2020, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2020, Red Hat Inc. All rights reserved. + * Copyright (c) 2020, 2020, Red Hat Inc. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/substratevm/src/com.oracle.objectfile/src/com/oracle/objectfile/elf/dwarf/DwarfStrSectionImpl.java b/substratevm/src/com.oracle.objectfile/src/com/oracle/objectfile/elf/dwarf/DwarfStrSectionImpl.java index 18d9849abbef..7756f35495b0 100644 --- a/substratevm/src/com.oracle.objectfile/src/com/oracle/objectfile/elf/dwarf/DwarfStrSectionImpl.java +++ b/substratevm/src/com.oracle.objectfile/src/com/oracle/objectfile/elf/dwarf/DwarfStrSectionImpl.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2020, 2020, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2020, Red Hat Inc. All rights reserved. + * Copyright (c) 2020, 2020, Red Hat Inc. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/substratevm/src/com.oracle.svm.core/.checkstyle_checks.xml b/substratevm/src/com.oracle.svm.core/.checkstyle_checks.xml index 96f9c786de8a..4f29bae26e21 100644 --- a/substratevm/src/com.oracle.svm.core/.checkstyle_checks.xml +++ b/substratevm/src/com.oracle.svm.core/.checkstyle_checks.xml @@ -1,13 +1,6 @@ - - @@ -90,8 +83,8 @@ - - + + @@ -186,44 +179,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/substratevm/src/com.oracle.svm.driver/.checkstyle_checks.xml b/substratevm/src/com.oracle.svm.driver/.checkstyle_checks.xml deleted file mode 100644 index 5a999abbf0bb..000000000000 --- a/substratevm/src/com.oracle.svm.driver/.checkstyle_checks.xml +++ /dev/null @@ -1,248 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/substratevm/src/com.oracle.svm.graal/src/com/oracle/svm/graal/AArch64ArrayIndexOfForeignCalls.java b/substratevm/src/com.oracle.svm.graal/src/com/oracle/svm/graal/AArch64ArrayIndexOfForeignCalls.java index b625741d044f..e96cfbf26516 100644 --- a/substratevm/src/com.oracle.svm.graal/src/com/oracle/svm/graal/AArch64ArrayIndexOfForeignCalls.java +++ b/substratevm/src/com.oracle.svm.graal/src/com/oracle/svm/graal/AArch64ArrayIndexOfForeignCalls.java @@ -1,6 +1,6 @@ /* - * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2021, Arm Limited. All rights reserved. + * Copyright (c) 2021, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2021, Arm Limited. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/substratevm/src/com.oracle.svm.hosted/.checkstyle_checks.xml b/substratevm/src/com.oracle.svm.hosted/.checkstyle_checks.xml index add8b74487e2..d05cf955ff22 100644 --- a/substratevm/src/com.oracle.svm.hosted/.checkstyle_checks.xml +++ b/substratevm/src/com.oracle.svm.hosted/.checkstyle_checks.xml @@ -1,16 +1,10 @@ - - + @@ -223,8 +217,8 @@ - - + + 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 0fcfc866c73c..f8c24dc87c11 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 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2021, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/annotation/ConstantAnnotationMarkerSubstitutionType.java b/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/annotation/ConstantAnnotationMarkerSubstitutionType.java index a684606fa4d9..f45f92dcc341 100644 --- a/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/annotation/ConstantAnnotationMarkerSubstitutionType.java +++ b/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/annotation/ConstantAnnotationMarkerSubstitutionType.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/image/sources/SourceManager.java b/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/image/sources/SourceManager.java index 167501d0f9b4..644e3ff4fedd 100644 --- a/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/image/sources/SourceManager.java +++ b/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/image/sources/SourceManager.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2020, 2020, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2020, Red Hat Inc. All rights reserved. + * Copyright (c) 2020, 2020, Red Hat Inc. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,13 +26,14 @@ package com.oracle.svm.hosted.image.sources; -import jdk.vm.ci.meta.ResolvedJavaType; -import org.graalvm.compiler.debug.DebugContext; - import java.nio.file.Path; import java.nio.file.Paths; import java.util.HashMap; +import org.graalvm.compiler.debug.DebugContext; + +import jdk.vm.ci.meta.ResolvedJavaType; + /** * A singleton class responsible for locating source files for classes included in a native image * and copying them into the local sources. diff --git a/substratevm/src/com.oracle.svm.truffle/.checkstyle_checks.xml b/substratevm/src/com.oracle.svm.truffle/.checkstyle_checks.xml deleted file mode 100644 index 48a33283b214..000000000000 --- a/substratevm/src/com.oracle.svm.truffle/.checkstyle_checks.xml +++ /dev/null @@ -1,271 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/substratevm/src/org.graalvm.polyglot.nativeapi/.checkstyle_checks.xml b/substratevm/src/org.graalvm.polyglot.nativeapi/.checkstyle_checks.xml deleted file mode 100644 index ae172f8f76c2..000000000000 --- a/substratevm/src/org.graalvm.polyglot.nativeapi/.checkstyle_checks.xml +++ /dev/null @@ -1,283 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/substratevm/src/org.graalvm.polyglot.nativeapi/src/org/graalvm/polyglot/nativeapi/PolyglotNativeAPI.java b/substratevm/src/org.graalvm.polyglot.nativeapi/src/org/graalvm/polyglot/nativeapi/PolyglotNativeAPI.java index c48b15321432..4a27701e1048 100644 --- a/substratevm/src/org.graalvm.polyglot.nativeapi/src/org/graalvm/polyglot/nativeapi/PolyglotNativeAPI.java +++ b/substratevm/src/org.graalvm.polyglot.nativeapi/src/org/graalvm/polyglot/nativeapi/PolyglotNativeAPI.java @@ -105,6 +105,8 @@ import com.oracle.svm.core.threadlocal.FastThreadLocalFactory; import com.oracle.svm.core.threadlocal.FastThreadLocalObject; +// Checkstyle: stop method name check + @SuppressWarnings("unused") @CHeader(value = PolyglotAPIHeader.class) public final class PolyglotNativeAPI { diff --git a/substratevm/src/org.graalvm.polyglot.nativeapi/src/org/graalvm/polyglot/nativeapi/PolyglotNativeAPIEntryPoints.java b/substratevm/src/org.graalvm.polyglot.nativeapi/src/org/graalvm/polyglot/nativeapi/PolyglotNativeAPIEntryPoints.java index 36f0bdbdf7ca..fd580c9f32c4 100644 --- a/substratevm/src/org.graalvm.polyglot.nativeapi/src/org/graalvm/polyglot/nativeapi/PolyglotNativeAPIEntryPoints.java +++ b/substratevm/src/org.graalvm.polyglot.nativeapi/src/org/graalvm/polyglot/nativeapi/PolyglotNativeAPIEntryPoints.java @@ -50,6 +50,8 @@ import com.oracle.svm.core.c.function.CEntryPointOptions.NoPrologue; import com.oracle.svm.core.c.function.CEntryPointOptions.UnchangedNameTransformation; +// Checkstyle: stop method name check + @CHeader(PolyglotIsolateHeader.class) public final class PolyglotNativeAPIEntryPoints { private static final String UNINTERRUPTIBLE_REASON = "Unsafe state in case of failure"; From d63c6958f923dadcaa162503fae90994785c4c4c Mon Sep 17 00:00:00 2001 From: Christian Wimmer Date: Fri, 7 Jan 2022 19:43:23 -0800 Subject: [PATCH 3/4] Remove unnecessary Checkstyle comments --- .../graal/pointsto/util/AnalysisError.java | 2 -- .../src/com/oracle/objectfile/ObjectFile.java | 2 -- .../svm/common/option/CommonOptionParser.java | 2 -- .../CompleteGarbageCollectorMXBean.java | 2 -- .../IncrementalGarbageCollectorMXBean.java | 2 -- .../RuntimeImageHeapChunkWriter.java | 2 -- .../svm/core/graal/llvm/LLVMGenerator.java | 2 -- .../replacements/LLVMGraphBuilderPlugins.java | 4 ---- .../core/jdk17/RecordSupportJDK17OrLater.java | 2 -- .../jdk17/SealedClassSupportJDK17OrLater.java | 7 +++--- .../Target_java_lang_Module_JDK17OrLater.java | 1 - .../core/windows/WindowsVMLockSupport.java | 2 -- .../com/oracle/svm/core/FallbackExecutor.java | 4 ---- .../svm/core/InvalidMethodPointerHandler.java | 2 -- .../svm/core/IsolateListenerSupport.java | 2 -- .../com/oracle/svm/core/JavaMainWrapper.java | 2 -- .../SubstrateAnnotationInvocationHandler.java | 2 -- .../oracle/svm/core/SubstrateDiagnostics.java | 4 ---- .../com/oracle/svm/core/SubstrateUtil.java | 6 +---- .../src/com/oracle/svm/core/VMInspection.java | 4 ---- .../allocationprofile/AllocationCounter.java | 2 -- .../core/annotate/RecomputeFieldValue.java | 2 -- .../svm/core/annotate/Uninterruptible.java | 2 -- .../oracle/svm/core/c/NonmovableArrays.java | 2 -- .../core/c/function/CEntryPointErrors.java | 4 ---- .../com/oracle/svm/core/c/libc/LibCBase.java | 4 ---- .../ClassInitializationInfo.java | 3 --- .../oracle/svm/core/code/CodeInfoDecoder.java | 2 -- .../core/configure/ConfigurationParser.java | 2 -- .../configure/ProxyConfigurationParser.java | 2 -- .../ReflectionConfigurationParser.java | 4 ---- .../oracle/svm/core/deopt/Deoptimizer.java | 2 -- .../core/deopt/SubstrateSpeculationLog.java | 2 -- .../SharedConstantReflectionProvider.java | 2 -- .../graal/snippets/CEntryPointSnippets.java | 4 ---- .../graal/snippets/SubstrateTemplates.java | 2 -- .../svm/core/handles/ObjectHandlesImpl.java | 2 -- .../svm/core/heap/AbstractMemoryMXBean.java | 3 --- .../src/com/oracle/svm/core/heap/GCCause.java | 3 +-- .../svm/core/heap/ReferenceInternals.java | 4 ---- .../heap/Target_java_lang_ref_Reference.java | 2 -- .../svm/core/hub/AnnotatedSuperInfo.java | 2 -- .../svm/core/hub/AnnotationTypeSupport.java | 2 -- .../com/oracle/svm/core/hub/DynamicHub.java | 2 -- .../svm/core/hub/DynamicHubCompanion.java | 2 -- .../com/oracle/svm/core/hub/GenericInfo.java | 2 -- .../core/hub/SunReflectTypeSubstitutions.java | 2 -- .../image/DisallowedImageHeapObjects.java | 4 ---- .../svm/core/invoke/MethodHandleUtils.java | 2 -- .../Target_java_lang_invoke_MemberName.java | 8 +++---- .../svm/core/jdk/CalendarSubstitutions.java | 2 -- .../core/jdk/FileSystemProviderSupport.java | 2 -- .../svm/core/jdk/JNIRegistrationUtil.java | 2 -- .../com/oracle/svm/core/jdk/JRTSupport.java | 2 -- .../svm/core/jdk/JavaNetSubstitutions.java | 4 ---- .../com/oracle/svm/core/jdk/ModuleUtil.java | 1 - .../oracle/svm/core/jdk/NashornSupport.java | 2 -- .../core/jdk/Package_jdk_internal_access.java | 2 -- .../svm/core/jdk/ProtectionDomainSupport.java | 2 -- .../oracle/svm/core/jdk/RandomAccessors.java | 2 -- .../oracle/svm/core/jdk/RecordSupport.java | 2 -- .../svm/core/jdk/SealedClassSupport.java | 5 ++--- .../svm/core/jdk/SecurityProvidersFilter.java | 2 -- .../svm/core/jdk/SecuritySubstitutions.java | 13 ----------- .../svm/core/jdk/SunMiscSubstitutions.java | 2 -- .../svm/core/jdk/SystemPropertiesSupport.java | 2 -- ...et_java_security_AccessControlContext.java | 2 -- .../jdk/Target_java_util_ServiceLoader.java | 2 -- ...get_java_util_logging_SimpleFormatter.java | 2 -- ...et_sun_security_ssl_TrustStoreManager.java | 2 -- .../svm/core/jdk/TimeZoneSubstitutions.java | 2 -- .../svm/core/jdk/UninterruptibleUtils.java | 2 -- .../oracle/svm/core/jdk/VarHandleFeature.java | 4 ---- ...ContentSubstitutedLocalizationSupport.java | 11 +++++----- .../OptimizedLocalizationSupport.java | 12 +++++----- .../localization/bundles/DelayedBundle.java | 1 - ...ale_provider_JRELocaleProviderAdapter.java | 2 -- ...leProviderAdapter_OptimizedLocaleMode.java | 13 +++++------ ..._util_locale_provider_LocaleResources.java | 11 +++++----- ...rviceProviderPool_OptimizedLocaleMode.java | 2 -- .../Target_sun_util_resources_Bundles.java | 4 ---- ...stResourceBundle_SubstituteLoadLookup.java | 9 ++++---- ...stResourceBundle_SubstituteLoadLookup.java | 13 +++++------ .../jdk/management/ManagementFeature.java | 2 -- .../jdk/management/ManagementSupport.java | 5 ----- .../SubstrateClassLoadingMXBean.java | 2 -- .../SubstrateCompilationMXBean.java | 2 -- .../SubstrateOperatingSystemMXBean.java | 2 -- .../management/SubstrateRuntimeMXBean.java | 2 -- .../jdk/management/SubstrateThreadMXBean.java | 3 --- .../core/jdk/proxy/DynamicProxyRegistry.java | 2 -- .../core/jdk/proxy/ProxySubstitutions.java | 2 -- .../NativeImageResourceFileSystem.java | 2 -- .../resources/NativeImageResourcePath.java | 2 -- .../oracle/svm/core/jni/JNIRuntimeAccess.java | 2 -- .../monitor/MultiThreadedMonitorSupport.java | 11 +++++----- .../core/option/SubstrateOptionsParser.java | 4 ---- .../core/reflect/MethodMetadataDecoder.java | 2 -- .../reflect/ReflectionAccessorHolder.java | 2 -- .../reflect/SubstrateConstructorAccessor.java | 2 -- .../core/reflect/SubstrateMethodAccessor.java | 2 -- .../svm/core/snippets/ImplicitExceptions.java | 2 -- .../svm/core/snippets/SnippetRuntime.java | 2 -- .../oracle/svm/core/thread/JavaThreads.java | 8 +------ .../svm/core/thread/JavaThreadsFeature.java | 1 - .../oracle/svm/core/thread/SpinLockUtils.java | 2 -- .../oracle/svm/core/thread/ThreadData.java | 2 -- .../core/thread/ThreadListenerSupport.java | 2 -- .../core/threadlocal/VMThreadLocalInfo.java | 2 -- .../src/com/oracle/svm/core/util/Counter.java | 2 -- .../svm/core/util/LazyFinalReference.java | 2 -- .../com/oracle/svm/core/util/UserError.java | 6 ----- ...latedSpeculationLogEncodingNativeTest.java | 4 ---- .../IsolatedSpeculationLogEncodingTest.java | 19 ++++++---------- .../oracle/svm/graal/GraalSubstitutions.java | 6 +++-- .../oracle/svm/hosted/BootLoaderSupport.java | 4 ---- .../svm/hosted/ClassPredefinitionFeature.java | 2 -- .../svm/hosted/SecurityServicesFeature.java | 4 ---- .../code/CFunctionPointerCallStubMethod.java | 2 -- .../hosted/code/NonBytecodeStaticMethod.java | 2 -- .../hosted/jdk/JNIRegistrationJavaNet.java | 5 ++--- .../jdk/localization/LocalizationFeature.java | 7 ------ .../hosted/substitute/AnnotatedMethod.java | 2 -- .../oracle/svm/jfr/JfrEventSubstitution.java | 4 ---- .../oracle/svm/jfr/JfrEventWriterAccess.java | 1 - .../src/com/oracle/svm/jfr/JfrFeature.java | 4 ---- .../com/oracle/svm/jfr/JfrRecorderThread.java | 2 -- .../oracle/svm/jfr/JfrSerializerSupport.java | 2 -- .../src/com/oracle/svm/jfr/SubstrateJVM.java | 4 +--- .../svm/jfr/Target_jdk_jfr_internal_JVM.java | 1 - .../Target_jdk_jfr_internal_Repository.java | 1 - .../svm/jfr/traceid/JfrTraceIdEpoch.java | 2 -- .../svm/jni/JNIGeneratedMethodSupport.java | 2 -- .../svm/jni/access/JNIAccessFeature.java | 4 ---- .../svm/jni/access/JNIAccessibleField.java | 2 -- .../svm/jni/access/JNIAccessibleMethod.java | 2 -- .../access/JNIAccessibleMethodDescriptor.java | 2 -- .../jni/access/JNIReflectionDictionary.java | 2 -- .../svm/jni/functions/JNIFunctions.java | 2 -- .../jni/hosted/JNICallTrampolineMethod.java | 2 -- .../jni/hosted/JNIJavaCallWrapperMethod.java | 2 -- .../hosted/JNINativeCallWrapperMethod.java | 2 -- .../com/oracle/svm/junit/SVMJUnitRunner.java | 4 +--- ...get_org_junit_runners_model_TestClass.java | 2 -- .../methodhandles/MethodHandleFeature.java | 4 ---- .../MethodHandleIntrinsicImpl.java | 2 -- ...get_java_lang_invoke_ClassSpecializer.java | 4 ---- .../Target_java_lang_invoke_MethodHandle.java | 4 ---- ..._java_lang_invoke_MethodHandleNatives.java | 4 ---- ...arget_java_lang_invoke_MethodTypeForm.java | 4 ---- .../svm/polyglot/scala/ScalaFeature.java | 3 --- .../hosted/ExecutableAccessorComputer.java | 2 -- .../reflect/hosted/FieldOffsetComputer.java | 2 -- .../svm/reflect/hosted/MethodMetadata.java | 2 -- .../hosted/MethodMetadataEncoderImpl.java | 2 -- .../reflect/hosted/ReflectionDataBuilder.java | 6 +---- .../svm/reflect/hosted/ReflectionFeature.java | 2 -- .../reflect/hosted/ReflectionGraphKit.java | 2 -- .../hosted/ReflectionObjectReplacer.java | 2 -- .../hosted/ReflectiveInvokeMethod.java | 2 -- .../reflect/proxy/DynamicProxySupport.java | 2 -- .../serialize/SerializationSupport.java | 2 -- .../hosted/SerializationFeature.java | 4 ---- .../target/MethodMetadataDecoderImpl.java | 2 -- .../target/MethodMetadataEncoding.java | 2 -- ...et_java_lang_reflect_AccessibleObject.java | 3 --- .../Target_java_lang_reflect_Constructor.java | 2 -- .../Target_java_lang_reflect_Executable.java | 4 ---- .../Target_java_lang_reflect_Field.java | 2 -- .../Target_java_lang_reflect_Method.java | 2 -- .../Target_java_lang_reflect_Parameter.java | 2 -- ...arget_java_lang_reflect_ReflectAccess.java | 2 -- ...t_jdk_internal_misc_Unsafe_Reflection.java | 2 -- ...get_jdk_internal_reflect_ConstantPool.java | 2 -- ...n_reflect_annotation_AnnotationParser.java | 2 -- ...flect_annotation_TypeAnnotationParser.java | 2 -- .../src/com/oracle/svm/test/ArraySetTest.java | 2 -- .../oracle/svm/test/SecurityServiceTest.java | 2 -- .../src/com/oracle/svm/test/jfr/LocalJFR.java | 2 -- .../test/proxy/CustomInvocationHandler.java | 2 -- .../svm/test/proxy/ProxyExceptionTest.java | 6 ++--- .../Target_hello_Hello_DefaultGreeter.java | 2 -- .../nfi/posix/PosixTruffleNFIFeature.java | 1 - .../svm/truffle/nfi/NativeObjectReplacer.java | 4 +--- .../svm/truffle/tck/PermissionsFeature.java | 2 -- .../svm/truffle/TruffleBaseFeature.java | 22 ------------------- .../oracle/svm/truffle/TruffleFeature.java | 2 -- .../truffle/api/SubstrateTruffleRuntime.java | 2 -- .../com/oracle/svm/util/ReflectionUtil.java | 2 -- .../nativeapi/PolyglotNativeAPIFeature.java | 4 ---- 190 files changed, 66 insertions(+), 539 deletions(-) diff --git a/substratevm/src/com.oracle.graal.pointsto/src/com/oracle/graal/pointsto/util/AnalysisError.java b/substratevm/src/com.oracle.graal.pointsto/src/com/oracle/graal/pointsto/util/AnalysisError.java index 8d59e33cd5a3..0a29add6747a 100644 --- a/substratevm/src/com.oracle.graal.pointsto/src/com/oracle/graal/pointsto/util/AnalysisError.java +++ b/substratevm/src/com.oracle.graal.pointsto/src/com/oracle/graal/pointsto/util/AnalysisError.java @@ -169,9 +169,7 @@ public static void guarantee(boolean condition) { public static void guarantee(boolean condition, String format, Object... args) { if (!condition) { - // Checkstyle: stop throw new AnalysisError(String.format(format, args)); - // Checkstyle: resume } } diff --git a/substratevm/src/com.oracle.objectfile/src/com/oracle/objectfile/ObjectFile.java b/substratevm/src/com.oracle.objectfile/src/com/oracle/objectfile/ObjectFile.java index 4bf21afddb05..28396f7289c3 100644 --- a/substratevm/src/com.oracle.objectfile/src/com/oracle/objectfile/ObjectFile.java +++ b/substratevm/src/com.oracle.objectfile/src/com/oracle/objectfile/ObjectFile.java @@ -24,8 +24,6 @@ */ package com.oracle.objectfile; -// Checkstyle: allow reflection - import java.io.IOException; import java.lang.reflect.Field; import java.lang.reflect.Method; diff --git a/substratevm/src/com.oracle.svm.common/src/com/oracle/svm/common/option/CommonOptionParser.java b/substratevm/src/com.oracle.svm.common/src/com/oracle/svm/common/option/CommonOptionParser.java index da7ce747b990..34c68b905833 100644 --- a/substratevm/src/com.oracle.svm.common/src/com/oracle/svm/common/option/CommonOptionParser.java +++ b/substratevm/src/com.oracle.svm.common/src/com/oracle/svm/common/option/CommonOptionParser.java @@ -26,8 +26,6 @@ package com.oracle.svm.common.option; -// Checkstyle: allow reflection - import java.io.PrintStream; import java.util.ArrayList; import java.util.Arrays; diff --git a/substratevm/src/com.oracle.svm.core.genscavenge/src/com/oracle/svm/core/genscavenge/CompleteGarbageCollectorMXBean.java b/substratevm/src/com.oracle.svm.core.genscavenge/src/com/oracle/svm/core/genscavenge/CompleteGarbageCollectorMXBean.java index 165369811d82..3515aab4fb29 100644 --- a/substratevm/src/com.oracle.svm.core.genscavenge/src/com/oracle/svm/core/genscavenge/CompleteGarbageCollectorMXBean.java +++ b/substratevm/src/com.oracle.svm.core.genscavenge/src/com/oracle/svm/core/genscavenge/CompleteGarbageCollectorMXBean.java @@ -24,7 +24,6 @@ */ package com.oracle.svm.core.genscavenge; -//Checkstyle: stop import java.lang.management.ManagementFactory; import javax.management.MBeanNotificationInfo; @@ -40,7 +39,6 @@ import com.sun.management.GcInfo; import sun.management.Util; -//Checkstyle: resume public final class CompleteGarbageCollectorMXBean implements com.sun.management.GarbageCollectorMXBean, NotificationEmitter { diff --git a/substratevm/src/com.oracle.svm.core.genscavenge/src/com/oracle/svm/core/genscavenge/IncrementalGarbageCollectorMXBean.java b/substratevm/src/com.oracle.svm.core.genscavenge/src/com/oracle/svm/core/genscavenge/IncrementalGarbageCollectorMXBean.java index a0c76da4fdbc..7c08b40086b3 100644 --- a/substratevm/src/com.oracle.svm.core.genscavenge/src/com/oracle/svm/core/genscavenge/IncrementalGarbageCollectorMXBean.java +++ b/substratevm/src/com.oracle.svm.core.genscavenge/src/com/oracle/svm/core/genscavenge/IncrementalGarbageCollectorMXBean.java @@ -24,7 +24,6 @@ */ package com.oracle.svm.core.genscavenge; -//Checkstyle: stop import java.lang.management.ManagementFactory; import javax.management.MBeanNotificationInfo; @@ -40,7 +39,6 @@ import com.sun.management.GcInfo; import sun.management.Util; -//Checkstyle: resume public final class IncrementalGarbageCollectorMXBean implements com.sun.management.GarbageCollectorMXBean, NotificationEmitter { diff --git a/substratevm/src/com.oracle.svm.core.genscavenge/src/com/oracle/svm/core/genscavenge/RuntimeImageHeapChunkWriter.java b/substratevm/src/com.oracle.svm.core.genscavenge/src/com/oracle/svm/core/genscavenge/RuntimeImageHeapChunkWriter.java index eb824170cd26..1893f634e44c 100644 --- a/substratevm/src/com.oracle.svm.core.genscavenge/src/com/oracle/svm/core/genscavenge/RuntimeImageHeapChunkWriter.java +++ b/substratevm/src/com.oracle.svm.core.genscavenge/src/com/oracle/svm/core/genscavenge/RuntimeImageHeapChunkWriter.java @@ -34,9 +34,7 @@ import com.oracle.svm.core.genscavenge.remset.RememberedSet; import com.oracle.svm.core.image.ImageHeapObject; -// Checkstyle: stop import sun.nio.ch.DirectBuffer; -// Checkstyle: resume /** Chunk writer that uses the same methods as memory management during image runtime. */ public class RuntimeImageHeapChunkWriter implements ImageHeapChunkWriter { diff --git a/substratevm/src/com.oracle.svm.core.graal.llvm/src/com/oracle/svm/core/graal/llvm/LLVMGenerator.java b/substratevm/src/com.oracle.svm.core.graal.llvm/src/com/oracle/svm/core/graal/llvm/LLVMGenerator.java index 2f17f407d9cf..9c85fa7bce62 100644 --- a/substratevm/src/com.oracle.svm.core.graal.llvm/src/com/oracle/svm/core/graal/llvm/LLVMGenerator.java +++ b/substratevm/src/com.oracle.svm.core.graal.llvm/src/com/oracle/svm/core/graal/llvm/LLVMGenerator.java @@ -2030,9 +2030,7 @@ private static int initDataCacheLineFlushSize() { return 0; } try { - // Checkstyle: stop Class c = Class.forName("jdk.internal.misc.UnsafeConstants"); - // Checkstyle: resume return ReflectionUtil.readStaticField(c, "DATA_CACHE_LINE_FLUSH_SIZE"); } catch (ClassNotFoundException e) { throw new GraalError(e, "Expected UnsafeConstants.DATA_CACHE_LINE_FLUSH_SIZE to exist and be readable"); diff --git a/substratevm/src/com.oracle.svm.core.graal.llvm/src/com/oracle/svm/core/graal/llvm/replacements/LLVMGraphBuilderPlugins.java b/substratevm/src/com.oracle.svm.core.graal.llvm/src/com/oracle/svm/core/graal/llvm/replacements/LLVMGraphBuilderPlugins.java index bf81249df7a1..24d00f66ac80 100644 --- a/substratevm/src/com.oracle.svm.core.graal.llvm/src/com/oracle/svm/core/graal/llvm/replacements/LLVMGraphBuilderPlugins.java +++ b/substratevm/src/com.oracle.svm.core.graal.llvm/src/com/oracle/svm/core/graal/llvm/replacements/LLVMGraphBuilderPlugins.java @@ -24,8 +24,6 @@ */ package com.oracle.svm.core.graal.llvm.replacements; -// Checkstyle: stop - import java.lang.reflect.Type; import java.util.Arrays; @@ -52,8 +50,6 @@ import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.ResolvedJavaMethod; -// Checkstyle: resume - public class LLVMGraphBuilderPlugins implements TargetGraphBuilderPlugins { @Override diff --git a/substratevm/src/com.oracle.svm.core.jdk17/src/com/oracle/svm/core/jdk17/RecordSupportJDK17OrLater.java b/substratevm/src/com.oracle.svm.core.jdk17/src/com/oracle/svm/core/jdk17/RecordSupportJDK17OrLater.java index 4a38a60ba77e..2dbd07eff7fd 100644 --- a/substratevm/src/com.oracle.svm.core.jdk17/src/com/oracle/svm/core/jdk17/RecordSupportJDK17OrLater.java +++ b/substratevm/src/com.oracle.svm.core.jdk17/src/com/oracle/svm/core/jdk17/RecordSupportJDK17OrLater.java @@ -24,8 +24,6 @@ */ package com.oracle.svm.core.jdk17; -// Checkstyle: allow reflection - import java.lang.reflect.Constructor; import java.lang.reflect.Method; import java.lang.reflect.RecordComponent; diff --git a/substratevm/src/com.oracle.svm.core.jdk17/src/com/oracle/svm/core/jdk17/SealedClassSupportJDK17OrLater.java b/substratevm/src/com.oracle.svm.core.jdk17/src/com/oracle/svm/core/jdk17/SealedClassSupportJDK17OrLater.java index 63a0c4f87b18..b1650d926bd2 100644 --- a/substratevm/src/com.oracle.svm.core.jdk17/src/com/oracle/svm/core/jdk17/SealedClassSupportJDK17OrLater.java +++ b/substratevm/src/com.oracle.svm.core.jdk17/src/com/oracle/svm/core/jdk17/SealedClassSupportJDK17OrLater.java @@ -24,14 +24,13 @@ */ package com.oracle.svm.core.jdk17; -// Checkstyle: allow reflection - -import com.oracle.svm.core.annotate.AutomaticFeature; -import com.oracle.svm.core.jdk.SealedClassSupport; import org.graalvm.compiler.serviceprovider.JavaVersionUtil; import org.graalvm.nativeimage.ImageSingletons; import org.graalvm.nativeimage.hosted.Feature; +import com.oracle.svm.core.annotate.AutomaticFeature; +import com.oracle.svm.core.jdk.SealedClassSupport; + final class SealedClassSupportJDK17OrLater extends SealedClassSupport { @Override diff --git a/substratevm/src/com.oracle.svm.core.jdk17/src/com/oracle/svm/core/jdk17/Target_java_lang_Module_JDK17OrLater.java b/substratevm/src/com.oracle.svm.core.jdk17/src/com/oracle/svm/core/jdk17/Target_java_lang_Module_JDK17OrLater.java index f8a5088d0a00..7287502f7845 100644 --- a/substratevm/src/com.oracle.svm.core.jdk17/src/com/oracle/svm/core/jdk17/Target_java_lang_Module_JDK17OrLater.java +++ b/substratevm/src/com.oracle.svm.core.jdk17/src/com/oracle/svm/core/jdk17/Target_java_lang_Module_JDK17OrLater.java @@ -38,7 +38,6 @@ @TargetClass(value = java.lang.Module.class, onlyWith = JDK17OrLater.class) public final class Target_java_lang_Module_JDK17OrLater { - // Checkstyle: allow synchronization @Substitute private static void defineModule0(Module module, boolean isOpen, String version, String location, Object[] pns) { if (Arrays.stream(pns).anyMatch(Objects::isNull)) { diff --git a/substratevm/src/com.oracle.svm.core.windows/src/com/oracle/svm/core/windows/WindowsVMLockSupport.java b/substratevm/src/com.oracle.svm.core.windows/src/com/oracle/svm/core/windows/WindowsVMLockSupport.java index e2fefc723da1..0b0fe3d5eb6c 100644 --- a/substratevm/src/com.oracle.svm.core.windows/src/com/oracle/svm/core/windows/WindowsVMLockSupport.java +++ b/substratevm/src/com.oracle.svm.core.windows/src/com/oracle/svm/core/windows/WindowsVMLockSupport.java @@ -58,8 +58,6 @@ import jdk.vm.ci.meta.JavaKind; -//Checkstyle: stop - /** * Support of {@link VMMutex} and {@link VMCondition} in multi-threaded environments. Locking is * implemented via Windows locking primitives. diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/FallbackExecutor.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/FallbackExecutor.java index dbc17e30029f..decc55655884 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/FallbackExecutor.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/FallbackExecutor.java @@ -98,9 +98,7 @@ public static void main(String[] args) { command.add(Options.FallbackExecutorMainClass.getValue()); command.addAll(Arrays.asList(args)); if (System.getenv("FALLBACK_EXECUTOR_VERBOSE") != null) { - // Checkstyle: stop System.out.println("Exec: " + String.join(" ", command)); - // Checkstyle: resume } ProcessProperties.exec(javaExecutable, command.toArray(new String[0])); } @@ -137,9 +135,7 @@ private static Path getJavaExecutable() { } private static void showError(String s) { - // Checkstyle: stop System.err.println("Error: " + s); - // Checkstyle: resume System.exit(1); } } diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/InvalidMethodPointerHandler.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/InvalidMethodPointerHandler.java index 704245d51ccb..77d8ddda7f47 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/InvalidMethodPointerHandler.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/InvalidMethodPointerHandler.java @@ -24,8 +24,6 @@ */ package com.oracle.svm.core; -// Checkstyle: allow reflection - import static com.oracle.svm.core.annotate.RestrictHeapAccess.Access.NO_ALLOCATION; import java.lang.reflect.Method; diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/IsolateListenerSupport.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/IsolateListenerSupport.java index ba05502e3135..ed4c2d76447b 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/IsolateListenerSupport.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/IsolateListenerSupport.java @@ -42,7 +42,6 @@ public IsolateListenerSupport() { listeners = new IsolateListener[0]; } - // Checkstyle: allow synchronization. @Platforms(Platform.HOSTED_ONLY.class) public synchronized void register(IsolateListener listener) { assert listener != null; @@ -50,7 +49,6 @@ public synchronized void register(IsolateListener listener) { listeners = Arrays.copyOf(listeners, oldLength + 1); listeners[oldLength] = listener; } - // Checkstyle: disallow synchronization. @Fold public static IsolateListenerSupport singleton() { 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 1d28332b8f28..62918583a13c 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 @@ -24,8 +24,6 @@ */ package com.oracle.svm.core; -//Checkstyle: allow reflection - import java.lang.invoke.MethodHandle; import java.lang.invoke.MethodHandles; import java.lang.reflect.Method; diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/SubstrateAnnotationInvocationHandler.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/SubstrateAnnotationInvocationHandler.java index 94fd57435272..704e97144019 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/SubstrateAnnotationInvocationHandler.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/SubstrateAnnotationInvocationHandler.java @@ -24,8 +24,6 @@ */ package com.oracle.svm.core; -// Checkstyle: allow reflection - import java.lang.reflect.InvocationHandler; import java.lang.reflect.Method; 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 761dbc862ba1..afa912ee0a48 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 @@ -931,14 +931,12 @@ public static class DiagnosticThunkRegistry { private int[] initialInvocationCount; @Fold - /* Checkstyle: allow synchronization. */ public static synchronized DiagnosticThunkRegistry singleton() { if (!ImageSingletons.contains(DiagnosticThunkRegistry.class)) { ImageSingletons.add(DiagnosticThunkRegistry.class, new DiagnosticThunkRegistry()); } return ImageSingletons.lookup(DiagnosticThunkRegistry.class); } - /* Checkstyle: disallow synchronization. */ @Platforms(Platform.HOSTED_ONLY.class) DiagnosticThunkRegistry() { @@ -955,7 +953,6 @@ public static synchronized DiagnosticThunkRegistry singleton() { * Register a diagnostic thunk to be called after a segfault. */ @Platforms(Platform.HOSTED_ONLY.class) - /* Checkstyle: allow synchronization. */ public synchronized void register(DiagnosticThunk diagnosticThunk) { diagnosticThunks = Arrays.copyOf(diagnosticThunks, diagnosticThunks.length + 1); diagnosticThunks[diagnosticThunks.length - 1] = diagnosticThunk; @@ -963,7 +960,6 @@ public synchronized void register(DiagnosticThunk diagnosticThunk) { initialInvocationCount = Arrays.copyOf(initialInvocationCount, initialInvocationCount.length + 1); initialInvocationCount[initialInvocationCount.length - 1] = 1; } - /* Checkstyle: disallow synchronization. */ @Fold int size() { diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/SubstrateUtil.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/SubstrateUtil.java index 6f49d3678fad..ac4556622a94 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/SubstrateUtil.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/SubstrateUtil.java @@ -24,8 +24,6 @@ */ package com.oracle.svm.core; -// Checkstyle: allow reflection - import java.io.FileDescriptor; import java.io.FileOutputStream; import java.lang.reflect.Constructor; @@ -38,7 +36,6 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; -import com.oracle.svm.util.StringUtil; import org.graalvm.compiler.graph.Node.NodeIntrinsic; import org.graalvm.compiler.java.LambdaUtils; import org.graalvm.compiler.nodes.BreakpointNode; @@ -61,6 +58,7 @@ import com.oracle.svm.core.log.Log; import com.oracle.svm.core.util.VMError; import com.oracle.svm.util.ReflectionUtil; +import com.oracle.svm.util.StringUtil; import jdk.vm.ci.meta.ResolvedJavaMethod; import jdk.vm.ci.services.Services; @@ -359,9 +357,7 @@ public static String mangleName(String methodName) { out.append("__"); } else { out.append('_'); - // Checkstyle: stop out.append(String.format("%04x", (int) c)); - // Checkstyle: resume } } String mangled = out.toString(); diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/VMInspection.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/VMInspection.java index b636b1e4b111..58bd22799152 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/VMInspection.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/VMInspection.java @@ -24,8 +24,6 @@ */ package com.oracle.svm.core; -//Checkstyle: stop - import java.io.IOException; import java.text.DateFormat; import java.text.SimpleDateFormat; @@ -55,8 +53,6 @@ import sun.misc.Signal; import sun.misc.SignalHandler; -//Checkstyle: resume - @AutomaticFeature public class VMInspection implements Feature { diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/allocationprofile/AllocationCounter.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/allocationprofile/AllocationCounter.java index 406041032a9c..a329da0033dc 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/allocationprofile/AllocationCounter.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/allocationprofile/AllocationCounter.java @@ -24,8 +24,6 @@ */ package com.oracle.svm.core.allocationprofile; -// Checkstyle: allow reflection - import java.lang.reflect.Field; import org.graalvm.nativeimage.Platform; diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/annotate/RecomputeFieldValue.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/annotate/RecomputeFieldValue.java index ac7ef69749c5..e6434c46a4ec 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/annotate/RecomputeFieldValue.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/annotate/RecomputeFieldValue.java @@ -24,8 +24,6 @@ */ package com.oracle.svm.core.annotate; -// Checkstyle: allow reflection - import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/annotate/Uninterruptible.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/annotate/Uninterruptible.java index 51fcdb450709..85728d1bca11 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/annotate/Uninterruptible.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/annotate/Uninterruptible.java @@ -24,8 +24,6 @@ */ package com.oracle.svm.core.annotate; -// Checkstyle: allow reflection - import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/c/NonmovableArrays.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/c/NonmovableArrays.java index 42f2b6a4734c..f16d79800ee3 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/c/NonmovableArrays.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/c/NonmovableArrays.java @@ -24,8 +24,6 @@ */ package com.oracle.svm.core.c; -// Checkstyle: allow reflection - import java.lang.reflect.Array; import java.nio.ByteBuffer; import java.util.Arrays; diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/c/function/CEntryPointErrors.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/c/function/CEntryPointErrors.java index b033b9e23b91..f32a45dceb36 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/c/function/CEntryPointErrors.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/c/function/CEntryPointErrors.java @@ -24,8 +24,6 @@ */ package com.oracle.svm.core.c.function; -// Checkstyle: stop - import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; @@ -37,8 +35,6 @@ import com.oracle.svm.core.util.VMError; -// Checkstyle: resume - /** * Errors returned by {@link CEntryPointActions} and {@link CEntryPointNativeFunctions} and their * implementation, including snippets and foreign function calls. These are non-API, with the diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/c/libc/LibCBase.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/c/libc/LibCBase.java index de9b4da82f9b..6aaf8b5acc24 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/c/libc/LibCBase.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/c/libc/LibCBase.java @@ -24,8 +24,6 @@ */ package com.oracle.svm.core.c.libc; -// Checkstyle: stop - import java.lang.reflect.AnnotatedElement; import java.lang.reflect.Method; import java.util.Arrays; @@ -37,8 +35,6 @@ import org.graalvm.nativeimage.Platforms; import org.graalvm.util.GuardedAnnotationAccess; -// Checkstyle: resume - public interface LibCBase { @Platforms(Platform.HOSTED_ONLY.class) diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/classinitialization/ClassInitializationInfo.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/classinitialization/ClassInitializationInfo.java index a69c0c4f9bb3..f83090fc3283 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/classinitialization/ClassInitializationInfo.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/classinitialization/ClassInitializationInfo.java @@ -24,8 +24,6 @@ */ package com.oracle.svm.core.classinitialization; -// Checkstyle: stop - import java.util.concurrent.locks.Condition; import java.util.concurrent.locks.ReentrantLock; @@ -42,7 +40,6 @@ import com.oracle.svm.core.util.VMError; import sun.misc.Unsafe; -// Checkstyle: resume /** * Information about the runtime class initialization state of a {@link DynamicHub class}, and 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 5cbe41e8aeba..46bf80d1a8b7 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 @@ -24,8 +24,6 @@ */ package com.oracle.svm.core.code; -// Checkstyle: allow reflection - import static com.oracle.svm.core.util.VMError.shouldNotReachHere; import org.graalvm.compiler.api.replacements.Fold; diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/configure/ConfigurationParser.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/configure/ConfigurationParser.java index bde2876a617a..75e7791e5c2f 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/configure/ConfigurationParser.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/configure/ConfigurationParser.java @@ -100,9 +100,7 @@ protected void warnOrFail(String message) { if (strictConfiguration) { throw new JSONParserException(message); } else { - // Checkstyle: stop System.err.println("Warning: " + message); - // Checkstyle: resume } } diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/configure/ProxyConfigurationParser.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/configure/ProxyConfigurationParser.java index 8d0d409ff478..bb1ce4912412 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/configure/ProxyConfigurationParser.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/configure/ProxyConfigurationParser.java @@ -38,8 +38,6 @@ import com.oracle.svm.core.util.json.JSONParser; import com.oracle.svm.core.util.json.JSONParserException; -// Checkstyle: allow reflection - /** * Parses JSON describing lists of interfaces and register them in the {@link DynamicProxyRegistry}. */ diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/configure/ReflectionConfigurationParser.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/configure/ReflectionConfigurationParser.java index 872214ad2d6d..61a4c37a04d9 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/configure/ReflectionConfigurationParser.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/configure/ReflectionConfigurationParser.java @@ -39,8 +39,6 @@ import com.oracle.svm.core.util.json.JSONParser; import com.oracle.svm.core.util.json.JSONParserException; -// Checkstyle: allow reflection - /** * Parses JSON describing classes, methods and fields and delegates their registration to a * {@link ReflectionConfigurationParserDelegate}. @@ -289,7 +287,6 @@ private void handleError(String message) { } private void handleError(String msg, Throwable cause) { - // Checkstyle: stop String message = msg; if (cause != null) { message += " Reason: " + formatError(cause) + '.'; @@ -299,6 +296,5 @@ private void handleError(String msg, Throwable cause) { } else { throw new JSONParserException(message + " To allow unresolvable reflection configuration, use option --allow-incomplete-classpath"); } - // Checkstyle: resume } } diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/deopt/Deoptimizer.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/deopt/Deoptimizer.java index a340c1d5cffb..26b948274b78 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/deopt/Deoptimizer.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/deopt/Deoptimizer.java @@ -24,8 +24,6 @@ */ package com.oracle.svm.core.deopt; -// Checkstyle: allow reflection - import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/deopt/SubstrateSpeculationLog.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/deopt/SubstrateSpeculationLog.java index 422257e6bb1b..9a4cd050a44e 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/deopt/SubstrateSpeculationLog.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/deopt/SubstrateSpeculationLog.java @@ -33,8 +33,6 @@ import jdk.vm.ci.meta.JavaConstant; import jdk.vm.ci.meta.SpeculationLog; -// Checkstyle: allow synchronization - public class SubstrateSpeculationLog implements SpeculationLog { public static final class SubstrateSpeculation extends Speculation { diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/graal/meta/SharedConstantReflectionProvider.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/graal/meta/SharedConstantReflectionProvider.java index 70d6318c8d0b..7b6772070106 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/graal/meta/SharedConstantReflectionProvider.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/graal/meta/SharedConstantReflectionProvider.java @@ -24,8 +24,6 @@ */ package com.oracle.svm.core.graal.meta; -//Checkstyle: allow reflection - import static com.oracle.svm.core.util.VMError.shouldNotReachHere; import java.lang.reflect.Array; diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/graal/snippets/CEntryPointSnippets.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/graal/snippets/CEntryPointSnippets.java index f13d17813d94..abddbfb01f62 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/graal/snippets/CEntryPointSnippets.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/graal/snippets/CEntryPointSnippets.java @@ -104,9 +104,7 @@ import com.oracle.svm.core.thread.VMThreads.SafepointBehavior; import com.oracle.svm.core.util.VMError; -// Checkstyle: stop import sun.misc.Unsafe; -// Checkstyle: resume /** * Snippets for calling from C to Java. See {@link CEntryPointActions} and @@ -323,9 +321,7 @@ private static int initializeIsolate(CEntryPointCreateIsolateParameters paramete try { RuntimeSupport.executeInitializationHooks(); } catch (Throwable t) { - // Checkstyle: stop (printStackTrace below is going to write to System.err too) System.err.println("Uncaught exception while running initialization hooks:"); - // Checkstyle: resume t.printStackTrace(); return CEntryPointErrors.ISOLATE_INITIALIZATION_FAILED; } diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/graal/snippets/SubstrateTemplates.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/graal/snippets/SubstrateTemplates.java index 324699007248..7df7cafcf92e 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/graal/snippets/SubstrateTemplates.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/graal/snippets/SubstrateTemplates.java @@ -24,8 +24,6 @@ */ package com.oracle.svm.core.graal.snippets; -//Checkstyle: allow reflection - import java.lang.reflect.Field; import java.util.ArrayList; import java.util.List; diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/handles/ObjectHandlesImpl.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/handles/ObjectHandlesImpl.java index 61dce4eb3510..9cf9706e3af7 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/handles/ObjectHandlesImpl.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/handles/ObjectHandlesImpl.java @@ -33,9 +33,7 @@ import org.graalvm.word.WordBase; import org.graalvm.word.WordFactory; -//Checkstyle: stop import sun.misc.Unsafe; -// Checkstyle: resume /** * This class implements {@link ObjectHandle word}-sized integer handles that refer to Java objects. diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/heap/AbstractMemoryMXBean.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/heap/AbstractMemoryMXBean.java index 8b994ebdfc2c..bc31ffe3f9c1 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/heap/AbstractMemoryMXBean.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/heap/AbstractMemoryMXBean.java @@ -24,8 +24,6 @@ */ package com.oracle.svm.core.heap; -//Checkstyle: stop - import java.lang.management.ManagementFactory; import java.lang.management.MemoryMXBean; import java.lang.management.MemoryUsage; @@ -49,7 +47,6 @@ import com.oracle.svm.core.code.RuntimeCodeInfoMemory; import sun.management.Util; -//Checkstyle: resume public abstract class AbstractMemoryMXBean implements MemoryMXBean, NotificationEmitter { protected static final long UNDEFINED_MEMORY_USAGE = -1L; diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/heap/GCCause.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/heap/GCCause.java index e7cd0da30b20..3afe7c31a838 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/heap/GCCause.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/heap/GCCause.java @@ -53,7 +53,6 @@ public class GCCause { @Platforms(Platform.HOSTED_ONLY.class) protected GCCause(String name, int id) { - /* Checkstyle: allow synchronization. */ this.id = id; this.name = name; addGCCauseMapping(); @@ -61,7 +60,7 @@ protected GCCause(String name, int id) { @Platforms(Platform.HOSTED_ONLY.class) private void addGCCauseMapping() { - synchronized (HostedGCCauseList) { /* Checkstyle: disallow synchronization. */ + synchronized (HostedGCCauseList) { while (HostedGCCauseList.size() <= id) { HostedGCCauseList.add(null); } diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/heap/ReferenceInternals.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/heap/ReferenceInternals.java index 3f9a2bbed20e..f9e1dc9357ce 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/heap/ReferenceInternals.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/heap/ReferenceInternals.java @@ -140,8 +140,6 @@ public static boolean hasQueue(Reference instance) { * We duplicate the JDK 11 reference processing code here so we can also use it with JDK 8. */ - // Checkstyle: allow synchronization - private static final Object processPendingLock = new Object(); private static boolean processPendingActive = false; @@ -232,8 +230,6 @@ public static boolean waitForReferenceProcessing() throws InterruptedException { } } - // Checkstyle: disallow synchronization - public static long getSoftReferenceClock() { return Target_java_lang_ref_SoftReference.clock; } diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/heap/Target_java_lang_ref_Reference.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/heap/Target_java_lang_ref_Reference.java index cb3a141880cb..95a4fac764be 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/heap/Target_java_lang_ref_Reference.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/heap/Target_java_lang_ref_Reference.java @@ -24,8 +24,6 @@ */ package com.oracle.svm.core.heap; -//Checkstyle: allow reflection - import java.lang.ref.PhantomReference; import java.lang.ref.Reference; import java.lang.reflect.Field; diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/hub/AnnotatedSuperInfo.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/hub/AnnotatedSuperInfo.java index ebf6ede9117c..5b4ac68dbce8 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/hub/AnnotatedSuperInfo.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/hub/AnnotatedSuperInfo.java @@ -24,8 +24,6 @@ */ package com.oracle.svm.core.hub; -//Checkstyle: allow reflection - import java.lang.reflect.AnnotatedType; import org.graalvm.nativeimage.Platform; diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/hub/AnnotationTypeSupport.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/hub/AnnotationTypeSupport.java index 063257212b10..62755948bffa 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/hub/AnnotationTypeSupport.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/hub/AnnotationTypeSupport.java @@ -35,9 +35,7 @@ import com.oracle.svm.core.annotate.Substitute; import com.oracle.svm.core.annotate.TargetClass; -// Checkstyle: stop import sun.reflect.annotation.AnnotationType; -// Checkstyle: start public class AnnotationTypeSupport { private Map, AnnotationType> annotationTypeMap = new HashMap<>(); 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 9fc0e2d3b424..eec38cbe90ce 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 @@ -24,8 +24,6 @@ */ package com.oracle.svm.core.hub; -//Checkstyle: allow reflection - import java.io.InputStream; import java.io.Serializable; import java.lang.annotation.Annotation; diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/hub/DynamicHubCompanion.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/hub/DynamicHubCompanion.java index 13fad05a6c4a..42594d0c45a1 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/hub/DynamicHubCompanion.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/hub/DynamicHubCompanion.java @@ -24,8 +24,6 @@ */ package com.oracle.svm.core.hub; -// Checkstyle: allow reflection - import java.lang.reflect.Constructor; import java.lang.reflect.Executable; import java.lang.reflect.Method; diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/hub/GenericInfo.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/hub/GenericInfo.java index f573536202d7..21c9a2c86488 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/hub/GenericInfo.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/hub/GenericInfo.java @@ -24,8 +24,6 @@ */ package com.oracle.svm.core.hub; -//Checkstyle: allow reflection - import java.lang.reflect.Type; import java.lang.reflect.TypeVariable; import java.util.Arrays; diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/hub/SunReflectTypeSubstitutions.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/hub/SunReflectTypeSubstitutions.java index 4673584d08f1..b2718e845248 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/hub/SunReflectTypeSubstitutions.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/hub/SunReflectTypeSubstitutions.java @@ -24,8 +24,6 @@ */ package com.oracle.svm.core.hub; -//Checkstyle: allow reflection - import java.lang.annotation.Annotation; import java.lang.reflect.AnnotatedType; import java.lang.reflect.GenericDeclaration; diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/image/DisallowedImageHeapObjects.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/image/DisallowedImageHeapObjects.java index 733e7ab6a90d..011207d65fa4 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/image/DisallowedImageHeapObjects.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/image/DisallowedImageHeapObjects.java @@ -24,8 +24,6 @@ */ package com.oracle.svm.core.image; -// Checkstyle: allow reflection - import java.io.FileDescriptor; import java.lang.reflect.Field; import java.nio.Buffer; @@ -50,13 +48,11 @@ public interface DisallowedObjectReporter { private static final Class CANCELLABLE_CLASS; static { - // Checkstyle: stop try { CANCELLABLE_CLASS = Class.forName("sun.nio.fs.Cancellable"); } catch (ClassNotFoundException ex) { throw VMError.shouldNotReachHere(ex); } - // Checkstyle: resume } public static void check(Object obj, DisallowedObjectReporter reporter) { diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/invoke/MethodHandleUtils.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/invoke/MethodHandleUtils.java index c310474994d7..7adac691262f 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/invoke/MethodHandleUtils.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/invoke/MethodHandleUtils.java @@ -30,9 +30,7 @@ import com.oracle.svm.core.annotate.AlwaysInline; -// Checkstyle: stop import sun.invoke.util.Wrapper; -// Checkstyle: resume public class MethodHandleUtils { public static Object cast(Object obj, Class type) { diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/invoke/Target_java_lang_invoke_MemberName.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/invoke/Target_java_lang_invoke_MemberName.java index cf60dc60cd41..a2e5f26f26eb 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/invoke/Target_java_lang_invoke_MemberName.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/invoke/Target_java_lang_invoke_MemberName.java @@ -24,17 +24,15 @@ */ package com.oracle.svm.core.invoke; +import java.lang.invoke.MethodType; +import java.lang.reflect.Member; + import com.oracle.svm.core.annotate.Alias; import com.oracle.svm.core.annotate.Inject; import com.oracle.svm.core.annotate.RecomputeFieldValue; import com.oracle.svm.core.annotate.Substitute; import com.oracle.svm.core.annotate.TargetClass; -import java.lang.invoke.MethodType; -// Checkstyle: stop -import java.lang.reflect.Member; -// Checkstyle: resume - @TargetClass(className = "java.lang.invoke.MemberName") public final class Target_java_lang_invoke_MemberName { @Inject @RecomputeFieldValue(kind = RecomputeFieldValue.Kind.Reset)// diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/CalendarSubstitutions.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/CalendarSubstitutions.java index 4ad4d3de37ea..fc74067d63f5 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/CalendarSubstitutions.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/CalendarSubstitutions.java @@ -24,8 +24,6 @@ */ package com.oracle.svm.core.jdk; -// Checkstyle: allow reflection - import java.util.Calendar; import java.util.GregorianCalendar; import java.util.Locale; diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/FileSystemProviderSupport.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/FileSystemProviderSupport.java index 1d1f6e0d3124..2544bd3c4f7e 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/FileSystemProviderSupport.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/FileSystemProviderSupport.java @@ -293,8 +293,6 @@ static void setRootDirectory(Target_sun_nio_fs_UnixFileSystem that, Target_sun_n that.injectedRootDirectory = value; } - // Checkstyle: allow synchronization - private static synchronized void reinitialize(Target_sun_nio_fs_UnixFileSystem that) { if (that.needsReinitialization != NeedsReinitializationProvider.STATUS_NEEDS_REINITIALIZATION) { /* Field initialized is volatile, so double-checked locking is OK. */ diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/JNIRegistrationUtil.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/JNIRegistrationUtil.java index db1650910b58..af0e6c0a1a20 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/JNIRegistrationUtil.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/JNIRegistrationUtil.java @@ -24,8 +24,6 @@ */ package com.oracle.svm.core.jdk; -/* Checkstyle: allow reflection */ - import java.lang.reflect.Constructor; import java.lang.reflect.Field; import java.lang.reflect.Method; diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/JRTSupport.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/JRTSupport.java index ba9d1c75aeab..6c38fa42ee9a 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/JRTSupport.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/JRTSupport.java @@ -99,14 +99,12 @@ final class Target_jdk_internal_module_SystemModuleFinders_SystemImage_JRTEnable static Object reader() { Target_jdk_internal_jimage_ImageReader_JRTEnabled localRef = READER; if (localRef == null) { - /* Checkstyle: allow synchronization. */ synchronized (Target_jdk_internal_module_SystemModuleFinders_SystemImage_JRTEnabled.class) { localRef = READER; if (localRef == null) { READER = localRef = Target_jdk_internal_jimage_ImageReaderFactory_JRTEnabled.getImageReader(); } } - /* Checkstyle: disallow synchronization. */ } return localRef; } diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/JavaNetSubstitutions.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/JavaNetSubstitutions.java index fc9f96349adc..28ae331e178e 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/JavaNetSubstitutions.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/JavaNetSubstitutions.java @@ -24,8 +24,6 @@ */ package com.oracle.svm.core.jdk; -// Checkstyle: allow reflection - import java.net.MalformedURLException; import java.net.URL; import java.net.URLConnection; @@ -176,9 +174,7 @@ public void duringSetup(DuringSetupAccess access) { } private static void printWarning(String warningMessage) { - // Checkstyle: stop System.out.println(warningMessage); - // Checkstyle: resume} } } diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/ModuleUtil.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/ModuleUtil.java index 50473981899a..95a43562a665 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/ModuleUtil.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/ModuleUtil.java @@ -132,7 +132,6 @@ public static boolean bootLayerContainsModule(String name) { return ModuleLayer.boot().modules().stream().anyMatch(m -> m.getName().equals(name)); } - // Checkstyle: allow synchronization public static void defineModule(Module module, boolean isOpen, List pns) { if (Objects.isNull(module)) { throw new NullPointerException("Null module object"); diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/NashornSupport.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/NashornSupport.java index 400e4723c1f2..6d6850da6fd7 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/NashornSupport.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/NashornSupport.java @@ -38,9 +38,7 @@ static class NashornAvailable implements BooleanSupplier { @Override public boolean getAsBoolean() { try { - // Checkstyle: stop Class.forName(CLASSFILTER_NAME); - // Checkstyle: resume return true; } catch (ClassNotFoundException e) { return false; diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/Package_jdk_internal_access.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/Package_jdk_internal_access.java index 38710c994f71..ae1a2325b796 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/Package_jdk_internal_access.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/Package_jdk_internal_access.java @@ -40,9 +40,7 @@ public String apply(TargetClass annotation) { if (JavaVersionUtil.JAVA_SPEC == 11) { try { String name = "jdk.internal.misc." + annotation.className(); - // Checkstyle: stop Class.forName(name); - // Checkstyle: resume return name; } catch (ClassNotFoundException e) { return "jdk.internal.access." + annotation.className(); diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/ProtectionDomainSupport.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/ProtectionDomainSupport.java index 36689b1176d7..541c86bab45b 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/ProtectionDomainSupport.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/ProtectionDomainSupport.java @@ -24,8 +24,6 @@ */ package com.oracle.svm.core.jdk; -// Checkstyle: allow reflection - import java.io.File; import java.net.MalformedURLException; import java.net.URL; diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/RandomAccessors.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/RandomAccessors.java index 5ca522dff913..eac5b488756e 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/RandomAccessors.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/RandomAccessors.java @@ -58,7 +58,6 @@ protected AtomicLong getOrInitializeSeeder() { return result; } - // Checkstyle: allow synchronization private synchronized AtomicLong initialize() { AtomicLong result = seeder; if (result != null) { @@ -85,7 +84,6 @@ private synchronized AtomicLong initialize() { return result; } - // Checkstyle: disallow synchronization abstract long mix64(long l); } diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/RecordSupport.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/RecordSupport.java index 7e984ef46823..5629f1a37684 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/RecordSupport.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/RecordSupport.java @@ -24,8 +24,6 @@ */ package com.oracle.svm.core.jdk; -// Checkstyle: allow reflection - import java.lang.reflect.Constructor; import java.lang.reflect.Method; diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/SealedClassSupport.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/SealedClassSupport.java index b1b3d452cfee..84a9292bbb9f 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/SealedClassSupport.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/SealedClassSupport.java @@ -24,15 +24,14 @@ */ package com.oracle.svm.core.jdk; -// Checkstyle: allow reflection - -import com.oracle.svm.core.annotate.AutomaticFeature; import org.graalvm.compiler.serviceprovider.JavaVersionUtil; import org.graalvm.nativeimage.ImageSingletons; import org.graalvm.nativeimage.Platform; import org.graalvm.nativeimage.Platforms; import org.graalvm.nativeimage.hosted.Feature; +import com.oracle.svm.core.annotate.AutomaticFeature; + /** * Abstracts the information about sealed classes, which are not available in Java 11 and Java 8. * This class provides all information about sealed classes without exposing any JDK types and diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/SecurityProvidersFilter.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/SecurityProvidersFilter.java index 5ce3d5c32a7d..8a3e18b8f779 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/SecurityProvidersFilter.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/SecurityProvidersFilter.java @@ -26,9 +26,7 @@ import org.graalvm.nativeimage.ImageSingletons; -// Checkstyle: stop import sun.security.jca.ProviderList; -// Checkstyle: resume public interface SecurityProvidersFilter { diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/SecuritySubstitutions.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/SecuritySubstitutions.java index 99ad039c99b5..03c931b8c9bf 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/SecuritySubstitutions.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/SecuritySubstitutions.java @@ -24,8 +24,6 @@ */ package com.oracle.svm.core.jdk; -// Checkstyle: stop - import static com.oracle.svm.core.snippets.KnownIntrinsics.readCallerStackPointer; import java.lang.reflect.Constructor; @@ -72,10 +70,6 @@ import sun.security.jca.ProviderList; import sun.security.util.SecurityConstants; -// Checkstyle: resume - -// Checkstyle: allow reflection - /* * All security checks are disabled. */ @@ -263,9 +257,7 @@ public RecomputeFieldValue.ValueAvailability valueAvailability() { @Override public Object compute(MetaAccessProvider metaAccess, ResolvedJavaField original, ResolvedJavaField annotated, Object receiver) { try { - // Checkstyle: stop do not use dynamic class loading Class serviceKey = Class.forName("java.security.Provider$ServiceKey"); - // Checkstyle: resume Constructor constructor = ReflectionUtil.lookupConstructor(serviceKey, String.class, String.class, boolean.class); return constructor.newInstance("", "", false); } catch (InstantiationException | IllegalAccessException | InvocationTargetException | ClassNotFoundException e) { @@ -440,10 +432,7 @@ static SecureRandom get() { return result; } - // Checkstyle: stop private static synchronized SecureRandom initializeOnce() { - // Checkstyle: resume - SecureRandom result = RANDOM; if (result != null) { /* Double-checked locking is OK because INSTANCE is volatile. */ @@ -501,9 +490,7 @@ final class PlatformHasClass implements Predicate { public boolean test(String className) { try { @SuppressWarnings({"unused"}) - /* { Allow use of `Class.forName`. Checkstyle: stop. */ final Class classForName = Class.forName(className); - /* } Allow use of `Class.forName`. Checkstyle: resume. */ return true; } catch (ClassNotFoundException cnfe) { return false; diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/SunMiscSubstitutions.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/SunMiscSubstitutions.java index 0d81b9f28002..699b4312f90c 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/SunMiscSubstitutions.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/SunMiscSubstitutions.java @@ -24,8 +24,6 @@ */ package com.oracle.svm.core.jdk; -// Checkstyle: allow reflection - import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/SystemPropertiesSupport.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/SystemPropertiesSupport.java index b0fb89278598..b93af2b7a5a6 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/SystemPropertiesSupport.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/SystemPropertiesSupport.java @@ -215,11 +215,9 @@ private void initializeLazyValue(String key) { */ String value = lazyRuntimeValues.get(key).get(); if (properties.putIfAbsent(key, value) == null) { - // Checkstyle: stop synchronized (savedProperties) { savedProperties.put(key, value); } - // Checkstyle: resume } } } diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/Target_java_security_AccessControlContext.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/Target_java_security_AccessControlContext.java index d91fa738bff7..e07768dcb98f 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/Target_java_security_AccessControlContext.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/Target_java_security_AccessControlContext.java @@ -24,8 +24,6 @@ */ package com.oracle.svm.core.jdk; -// Checkstyle: allow reflection - import org.graalvm.compiler.api.replacements.Fold; import com.oracle.svm.core.annotate.Alias; diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/Target_java_util_ServiceLoader.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/Target_java_util_ServiceLoader.java index f21d43eac2bd..6fc97073eca5 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/Target_java_util_ServiceLoader.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/Target_java_util_ServiceLoader.java @@ -25,8 +25,6 @@ package com.oracle.svm.core.jdk; -// Checkstyle: allow reflection - import java.lang.reflect.Constructor; import java.security.AccessControlContext; import java.util.HashSet; diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/Target_java_util_logging_SimpleFormatter.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/Target_java_util_logging_SimpleFormatter.java index 53f684fcdb7e..57fb9f12ab41 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/Target_java_util_logging_SimpleFormatter.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/Target_java_util_logging_SimpleFormatter.java @@ -24,8 +24,6 @@ */ package com.oracle.svm.core.jdk; -//Checkstyle: allow reflection - import java.util.logging.LogManager; import com.oracle.svm.core.annotate.Alias; diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/Target_sun_security_ssl_TrustStoreManager.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/Target_sun_security_ssl_TrustStoreManager.java index d378cc521382..7a7eff8263af 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/Target_sun_security_ssl_TrustStoreManager.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/Target_sun_security_ssl_TrustStoreManager.java @@ -42,9 +42,7 @@ import com.oracle.svm.core.util.VMError; import com.oracle.svm.util.ReflectionUtil; -// Checkstyle: stop import sun.security.ssl.SSLLogger; -// Checkstyle: resume /** * Root certificates in native image are fixed/embedded into the image, at image build time, based diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/TimeZoneSubstitutions.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/TimeZoneSubstitutions.java index a0e36a24c317..b544c13589ed 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/TimeZoneSubstitutions.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/TimeZoneSubstitutions.java @@ -143,10 +143,8 @@ protected void onValueUpdate(EconomicMap, Object> values, String ol }; private static void printWarning() { - // Checkstyle: stop System.err.println("-H:IncludeAllTimeZones and -H:IncludeTimeZones are now deprecated. Native-image includes all timezones" + " by default."); - // Checkstyle: resume } } diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/UninterruptibleUtils.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/UninterruptibleUtils.java index 6b6c6215268c..ebb2ee7a1b5e 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/UninterruptibleUtils.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/UninterruptibleUtils.java @@ -34,9 +34,7 @@ import com.oracle.svm.core.annotate.Uninterruptible; import com.oracle.svm.core.util.VMError; -// Checkstyle: stop import sun.misc.Unsafe; -// Checkstyle: resume /** * Annotated replacements to be called from uninterruptible code for methods whose source I do not diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/VarHandleFeature.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/VarHandleFeature.java index 4d3cf9887a97..0286a78b2651 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/VarHandleFeature.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/VarHandleFeature.java @@ -24,8 +24,6 @@ */ package com.oracle.svm.core.jdk; -//Checkstyle: allow reflection - import static com.oracle.svm.core.util.VMError.guarantee; import java.lang.reflect.Field; @@ -113,14 +111,12 @@ public class VarHandleFeature implements Feature { public void afterRegistration(AfterRegistrationAccess access) { try { for (String typeName : new String[]{"Booleans", "Bytes", "Chars", "Doubles", "Floats", "Ints", "Longs", "Shorts", OBJECT_SUFFIX}) { - // Checkstyle: stop buildInfo(false, "receiverType", Class.forName("java.lang.invoke.VarHandle" + typeName + "$FieldInstanceReadOnly"), Class.forName("java.lang.invoke.VarHandle" + typeName + "$FieldInstanceReadWrite")); buildInfo(true, "base", Class.forName("java.lang.invoke.VarHandle" + typeName + "$FieldStaticReadOnly"), Class.forName("java.lang.invoke.VarHandle" + typeName + "$FieldStaticReadWrite")); - // Checkstyle: resume } } catch (ClassNotFoundException ex) { throw VMError.shouldNotReachHere(ex); diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/localization/BundleContentSubstitutedLocalizationSupport.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/localization/BundleContentSubstitutedLocalizationSupport.java index c0cadd4bbfa2..00664939b719 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/localization/BundleContentSubstitutedLocalizationSupport.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/localization/BundleContentSubstitutedLocalizationSupport.java @@ -37,20 +37,19 @@ import java.util.regex.Pattern; import java.util.regex.PatternSyntaxException; +import org.graalvm.compiler.debug.GraalError; +import org.graalvm.nativeimage.Platform; +import org.graalvm.nativeimage.Platforms; + import com.oracle.svm.core.jdk.localization.bundles.DelayedBundle; import com.oracle.svm.core.jdk.localization.bundles.ExtractedBundle; import com.oracle.svm.core.jdk.localization.bundles.StoredBundle; import com.oracle.svm.core.jdk.localization.compression.GzipBundleCompression; -import com.oracle.svm.core.util.UserError; import com.oracle.svm.core.jdk.localization.compression.utils.BundleSerializationUtils; -import org.graalvm.compiler.debug.GraalError; +import com.oracle.svm.core.util.UserError; -// Checkstyle: stop -import org.graalvm.nativeimage.Platform; -import org.graalvm.nativeimage.Platforms; import sun.util.resources.OpenListResourceBundle; import sun.util.resources.ParallelListResourceBundle; -// Checkstyle: resume public class BundleContentSubstitutedLocalizationSupport extends LocalizationSupport { diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/localization/OptimizedLocalizationSupport.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/localization/OptimizedLocalizationSupport.java index 91af206cb7f1..91187cdc9bd8 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/localization/OptimizedLocalizationSupport.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/localization/OptimizedLocalizationSupport.java @@ -24,11 +24,6 @@ */ package com.oracle.svm.core.jdk.localization; -import com.oracle.svm.core.util.UserError; -import com.oracle.svm.util.ReflectionUtil; -import org.graalvm.collections.Pair; - -//Checkstyle: allow reflection import java.lang.reflect.Field; import java.nio.charset.Charset; import java.util.HashMap; @@ -39,11 +34,14 @@ import java.util.Set; import java.util.spi.LocaleServiceProvider; -//Checkstyle: stop +import org.graalvm.collections.Pair; import org.graalvm.nativeimage.Platform; import org.graalvm.nativeimage.Platforms; + +import com.oracle.svm.core.util.UserError; +import com.oracle.svm.util.ReflectionUtil; + import sun.util.locale.provider.LocaleProviderAdapter; -//Checkstyle: resume public class OptimizedLocalizationSupport extends LocalizationSupport { public final Map, Locale>, LocaleProviderAdapter> adaptersByClass = new HashMap<>(); diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/localization/bundles/DelayedBundle.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/localization/bundles/DelayedBundle.java index d490d8284853..d6361d1c537b 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/localization/bundles/DelayedBundle.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/localization/bundles/DelayedBundle.java @@ -24,7 +24,6 @@ */ package com.oracle.svm.core.jdk.localization.bundles; -//Checkstyle: allow reflection import java.lang.reflect.Method; import java.util.HashMap; import java.util.Map; diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/localization/substitutions/Target_sun_util_locale_provider_JRELocaleProviderAdapter.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/localization/substitutions/Target_sun_util_locale_provider_JRELocaleProviderAdapter.java index e30578f20fe6..aa02db0c8c6c 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/localization/substitutions/Target_sun_util_locale_provider_JRELocaleProviderAdapter.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/localization/substitutions/Target_sun_util_locale_provider_JRELocaleProviderAdapter.java @@ -37,10 +37,8 @@ import com.oracle.svm.core.annotate.TargetClass; import com.oracle.svm.core.jdk.localization.LocalizationSupport; -// Checkstyle: stop import sun.util.locale.provider.JRELocaleProviderAdapter; import sun.util.locale.provider.LocaleResources; -// Checkstyle: resume @TargetClass(JRELocaleProviderAdapter.class) final class Target_sun_util_locale_provider_JRELocaleProviderAdapter { diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/localization/substitutions/Target_sun_util_locale_provider_LocaleProviderAdapter_OptimizedLocaleMode.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/localization/substitutions/Target_sun_util_locale_provider_LocaleProviderAdapter_OptimizedLocaleMode.java index 76854d4bf550..85c85e000edb 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/localization/substitutions/Target_sun_util_locale_provider_LocaleProviderAdapter_OptimizedLocaleMode.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/localization/substitutions/Target_sun_util_locale_provider_LocaleProviderAdapter_OptimizedLocaleMode.java @@ -24,21 +24,20 @@ */ package com.oracle.svm.core.jdk.localization.substitutions; +import java.util.Locale; +import java.util.spi.LocaleServiceProvider; + +import org.graalvm.collections.Pair; +import org.graalvm.nativeimage.ImageSingletons; + import com.oracle.svm.core.annotate.Substitute; import com.oracle.svm.core.annotate.TargetClass; import com.oracle.svm.core.jdk.localization.LocalizationSupport; import com.oracle.svm.core.jdk.localization.OptimizedLocalizationSupport; import com.oracle.svm.core.jdk.localization.substitutions.modes.OptimizedLocaleMode; import com.oracle.svm.core.util.VMError; -import org.graalvm.collections.Pair; -import org.graalvm.nativeimage.ImageSingletons; -// Checkstyle: stop import sun.util.locale.provider.LocaleProviderAdapter; -// Checkstyle: resume - -import java.util.Locale; -import java.util.spi.LocaleServiceProvider; @TargetClass(value = sun.util.locale.provider.LocaleProviderAdapter.class, onlyWith = OptimizedLocaleMode.class) final class Target_sun_util_locale_provider_LocaleProviderAdapter_OptimizedLocaleMode { diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/localization/substitutions/Target_sun_util_locale_provider_LocaleResources.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/localization/substitutions/Target_sun_util_locale_provider_LocaleResources.java index 316f0b2c913a..86e8bf9d10c2 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/localization/substitutions/Target_sun_util_locale_provider_LocaleResources.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/localization/substitutions/Target_sun_util_locale_provider_LocaleResources.java @@ -24,16 +24,15 @@ */ package com.oracle.svm.core.jdk.localization.substitutions; +import java.lang.ref.ReferenceQueue; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentMap; + import com.oracle.svm.core.annotate.Alias; import com.oracle.svm.core.annotate.RecomputeFieldValue; import com.oracle.svm.core.annotate.TargetClass; -// Checkstyle: stop -import sun.util.locale.provider.LocaleResources; -// Checkstyle: resume -import java.lang.ref.ReferenceQueue; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.ConcurrentMap; +import sun.util.locale.provider.LocaleResources; @TargetClass(LocaleResources.class) final class Target_sun_util_locale_provider_LocaleResources { diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/localization/substitutions/Target_sun_util_locale_provider_LocaleServiceProviderPool_OptimizedLocaleMode.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/localization/substitutions/Target_sun_util_locale_provider_LocaleServiceProviderPool_OptimizedLocaleMode.java index d31e5cbbf2d1..2829d35128d4 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/localization/substitutions/Target_sun_util_locale_provider_LocaleServiceProviderPool_OptimizedLocaleMode.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/localization/substitutions/Target_sun_util_locale_provider_LocaleServiceProviderPool_OptimizedLocaleMode.java @@ -38,9 +38,7 @@ import com.oracle.svm.core.jdk.localization.substitutions.modes.OptimizedLocaleMode; import com.oracle.svm.core.util.VMError; -// Checkstyle: stop import sun.util.locale.provider.LocaleServiceProviderPool; -// Checkstyle: resume @Substitute @TargetClass(value = sun.util.locale.provider.LocaleServiceProviderPool.class, onlyWith = OptimizedLocaleMode.class) diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/localization/substitutions/Target_sun_util_resources_Bundles.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/localization/substitutions/Target_sun_util_resources_Bundles.java index 9712a0b06884..eb85216b565c 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/localization/substitutions/Target_sun_util_resources_Bundles.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/localization/substitutions/Target_sun_util_resources_Bundles.java @@ -24,8 +24,6 @@ */ package com.oracle.svm.core.jdk.localization.substitutions; -// Checkstyle: stop - import java.util.Locale; import java.util.ResourceBundle; import java.util.concurrent.ConcurrentHashMap; @@ -43,8 +41,6 @@ import sun.util.resources.Bundles.Strategy; -// Checkstyle: resume - @TargetClass(value = sun.util.resources.Bundles.class) @SuppressWarnings({"unused"}) final class Target_sun_util_resources_Bundles { diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/localization/substitutions/Target_sun_util_resources_OpenListResourceBundle_SubstituteLoadLookup.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/localization/substitutions/Target_sun_util_resources_OpenListResourceBundle_SubstituteLoadLookup.java index d75be3e43425..7ca2a208241b 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/localization/substitutions/Target_sun_util_resources_OpenListResourceBundle_SubstituteLoadLookup.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/localization/substitutions/Target_sun_util_resources_OpenListResourceBundle_SubstituteLoadLookup.java @@ -24,16 +24,15 @@ */ package com.oracle.svm.core.jdk.localization.substitutions; +import java.util.Map; + +import org.graalvm.nativeimage.ImageSingletons; + import com.oracle.svm.core.annotate.Alias; import com.oracle.svm.core.annotate.Substitute; import com.oracle.svm.core.annotate.TargetClass; import com.oracle.svm.core.jdk.localization.LocalizationSupport; import com.oracle.svm.core.jdk.localization.substitutions.modes.SubstituteLoadLookup; -import org.graalvm.nativeimage.ImageSingletons; - -import java.util.Map; - -//Checkstyle: allow synchronization @TargetClass(value = sun.util.resources.OpenListResourceBundle.class, onlyWith = SubstituteLoadLookup.class) @SuppressWarnings({"static-method"}) diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/localization/substitutions/Target_sun_util_resources_ParallelListResourceBundle_SubstituteLoadLookup.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/localization/substitutions/Target_sun_util_resources_ParallelListResourceBundle_SubstituteLoadLookup.java index d9853cf84a3b..ea49b2811ab9 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/localization/substitutions/Target_sun_util_resources_ParallelListResourceBundle_SubstituteLoadLookup.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/localization/substitutions/Target_sun_util_resources_ParallelListResourceBundle_SubstituteLoadLookup.java @@ -24,22 +24,19 @@ */ package com.oracle.svm.core.jdk.localization.substitutions; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentMap; + +import org.graalvm.nativeimage.ImageSingletons; + import com.oracle.svm.core.annotate.Alias; import com.oracle.svm.core.annotate.Substitute; import com.oracle.svm.core.annotate.TargetClass; import com.oracle.svm.core.jdk.localization.LocalizationSupport; import com.oracle.svm.core.jdk.localization.substitutions.modes.SubstituteLoadLookup; import com.oracle.svm.core.util.VMError; -import org.graalvm.nativeimage.ImageSingletons; -//Checkstyle: stop import sun.util.resources.OpenListResourceBundle; -//Checkstyle: resume - -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.ConcurrentMap; - -//Checkstyle: allow synchronization @TargetClass(value = sun.util.resources.ParallelListResourceBundle.class, onlyWith = SubstituteLoadLookup.class) @SuppressWarnings({"unused", "static-method"}) diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/management/ManagementFeature.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/management/ManagementFeature.java index e829bbb29b79..814c911a90bd 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/management/ManagementFeature.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/management/ManagementFeature.java @@ -24,8 +24,6 @@ */ package com.oracle.svm.core.jdk.management; -// Checkstyle: allow reflection - import java.lang.management.ClassLoadingMXBean; import java.lang.management.CompilationMXBean; import java.lang.management.GarbageCollectorMXBean; diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/management/ManagementSupport.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/management/ManagementSupport.java index 5383dcf77488..07bd12ccd2ec 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/management/ManagementSupport.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/management/ManagementSupport.java @@ -24,8 +24,6 @@ */ package com.oracle.svm.core.jdk.management; -// Checkstyle: stop - import java.lang.management.ManagementFactory; import java.lang.management.PlatformManagedObject; import java.util.ArrayList; @@ -56,9 +54,6 @@ import com.oracle.svm.core.util.UserError; import com.sun.jmx.mbeanserver.MXBeanLookup; -// Checkstyle: resume -// Checkstyle: allow synchronization - /** * This class provides the SVM support implementation for the MXBean that provide VM introspection, * which is accessible in the JDK via {@link ManagementFactory}. There are two mostly independent diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/management/SubstrateClassLoadingMXBean.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/management/SubstrateClassLoadingMXBean.java index ec695b6f8e9a..614c12c05f3b 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/management/SubstrateClassLoadingMXBean.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/management/SubstrateClassLoadingMXBean.java @@ -24,7 +24,6 @@ */ package com.oracle.svm.core.jdk.management; -//Checkstyle: stop import java.lang.management.ClassLoadingMXBean; import java.lang.management.ManagementFactory; @@ -34,7 +33,6 @@ import org.graalvm.nativeimage.Platforms; import sun.management.Util; -//Checkstyle: resume class SubstrateClassLoadingMXBean implements ClassLoadingMXBean { diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/management/SubstrateCompilationMXBean.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/management/SubstrateCompilationMXBean.java index f4ab905655d4..5f22e27e4457 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/management/SubstrateCompilationMXBean.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/management/SubstrateCompilationMXBean.java @@ -24,7 +24,6 @@ */ package com.oracle.svm.core.jdk.management; -//Checkstyle: stop import java.lang.management.CompilationMXBean; import java.lang.management.ManagementFactory; @@ -34,7 +33,6 @@ import org.graalvm.nativeimage.Platforms; import sun.management.Util; -//Checkstyle: resume class SubstrateCompilationMXBean implements CompilationMXBean { diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/management/SubstrateOperatingSystemMXBean.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/management/SubstrateOperatingSystemMXBean.java index c6a53cd86459..94cd58acdb5a 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/management/SubstrateOperatingSystemMXBean.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/management/SubstrateOperatingSystemMXBean.java @@ -35,9 +35,7 @@ import com.oracle.svm.core.heap.PhysicalMemory; import com.oracle.svm.core.util.VMError; -//Checkstyle: stop import sun.management.Util; -//Checkstyle: resume public abstract class SubstrateOperatingSystemMXBean extends SubstrateOperatingSystemMXBeanBase implements com.sun.management.OperatingSystemMXBean { diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/management/SubstrateRuntimeMXBean.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/management/SubstrateRuntimeMXBean.java index 79adc29b2e23..0cbb698fb320 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/management/SubstrateRuntimeMXBean.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/management/SubstrateRuntimeMXBean.java @@ -24,7 +24,6 @@ */ package com.oracle.svm.core.jdk.management; -//Checkstyle: stop import java.lang.management.ManagementFactory; import java.lang.management.RuntimeMXBean; import java.net.InetAddress; @@ -48,7 +47,6 @@ import com.oracle.svm.core.jdk.RuntimeSupport; import sun.management.Util; -//Checkstyle: resume final class SubstrateRuntimeMXBean implements RuntimeMXBean { diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/management/SubstrateThreadMXBean.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/management/SubstrateThreadMXBean.java index 636d645d2fa3..b9839b460edc 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/management/SubstrateThreadMXBean.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/management/SubstrateThreadMXBean.java @@ -24,8 +24,6 @@ */ package com.oracle.svm.core.jdk.management; -//Checkstyle: stop - import java.lang.management.ManagementFactory; import java.lang.management.ThreadInfo; @@ -40,7 +38,6 @@ import com.oracle.svm.core.util.VMError; import sun.management.Util; -//Checkstyle: resume final class SubstrateThreadMXBean implements com.sun.management.ThreadMXBean { diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/proxy/DynamicProxyRegistry.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/proxy/DynamicProxyRegistry.java index 535fe30914d7..584052322fe5 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/proxy/DynamicProxyRegistry.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/proxy/DynamicProxyRegistry.java @@ -24,8 +24,6 @@ */ package com.oracle.svm.core.jdk.proxy; -// Checkstyle: allow reflection - import org.graalvm.nativeimage.Platform; import org.graalvm.nativeimage.Platforms; diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/proxy/ProxySubstitutions.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/proxy/ProxySubstitutions.java index 4236eba2a490..695d211e8cbe 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/proxy/ProxySubstitutions.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/proxy/ProxySubstitutions.java @@ -24,8 +24,6 @@ */ package com.oracle.svm.core.jdk.proxy; -// Checkstyle: allow reflection - import java.lang.reflect.Constructor; import java.lang.reflect.InvocationHandler; import java.lang.reflect.Modifier; diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/resources/NativeImageResourceFileSystem.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/resources/NativeImageResourceFileSystem.java index 28c2a4918abc..1ca80cf2b389 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/resources/NativeImageResourceFileSystem.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/resources/NativeImageResourceFileSystem.java @@ -1192,7 +1192,6 @@ private class EntryOutputStream extends FilterOutputStream { this.e = Objects.requireNonNull(e, "Entry is null!"); } - // Checkstyle: stop @Override public synchronized void write(int b) throws IOException { out.write(b); @@ -1218,6 +1217,5 @@ public synchronized void close() throws IOException { super.close(); update(e); } - // Checkstyle: resume } } diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/resources/NativeImageResourcePath.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/resources/NativeImageResourcePath.java index e908ee4278c5..f7291c2d818b 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/resources/NativeImageResourcePath.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/resources/NativeImageResourcePath.java @@ -122,13 +122,11 @@ private void initOffsets() { } } - // Checkstyle: stop synchronized (this) { if (offsets == null) { offsets = result; } } - // Checkstyle: resume } } diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jni/JNIRuntimeAccess.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jni/JNIRuntimeAccess.java index 7a573e8ace68..f8d4ad346c2f 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jni/JNIRuntimeAccess.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jni/JNIRuntimeAccess.java @@ -24,8 +24,6 @@ */ package com.oracle.svm.core.jni; -// Checkstyle: allow reflection - import java.lang.reflect.Executable; import java.lang.reflect.Field; diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/monitor/MultiThreadedMonitorSupport.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/monitor/MultiThreadedMonitorSupport.java index 605c55f2f6e6..10a7811c78f0 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/monitor/MultiThreadedMonitorSupport.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/monitor/MultiThreadedMonitorSupport.java @@ -24,8 +24,6 @@ */ package com.oracle.svm.core.monitor; -//Checkstyle: stop - import java.lang.ref.ReferenceQueue; import java.util.Collections; import java.util.HashSet; @@ -69,8 +67,6 @@ import sun.misc.Unsafe; -//Checkstyle resume - /** * Implementation of synchronized-related operations. *

@@ -195,9 +191,11 @@ protected static void onMonitorUnlocked() { */ static final ConditionObject MONITOR_WITHOUT_CONDITION = (ConditionObject) new ReentrantLock().newCondition(); + // Checkstyle: stop /** Substituted in {@link Target_com_oracle_svm_core_monitor_MultiThreadedMonitorSupport} */ private static long SYNC_MONITOR_CONDITION_FIELD_OFFSET = -1; private static long SYNC_STATE_FIELD_OFFSET = -1; + // Checkstyle: resume /** * Secondary storage for monitor slots. Synchronized to prevent concurrent access and @@ -260,7 +258,8 @@ private static void slowPathMonitorEnter(Object obj) { } } - protected static final String NO_LONGER_UNINTERRUPTIBLE = "The monitor snippet slow path is uninterruptible to avoid stack overflow errors being thrown. Now the yellow zone is enabled and we are no longer uninterruptible, and allocation is allowed again too"; + protected static final String NO_LONGER_UNINTERRUPTIBLE = "The monitor snippet slow path is uninterruptible to avoid stack overflow errors being thrown. " + + "Now the yellow zone is enabled and we are no longer uninterruptible, and allocation is allowed again too"; @RestrictHeapAccess(reason = NO_LONGER_UNINTERRUPTIBLE, access = Access.UNRESTRICTED) @Override @@ -595,6 +594,7 @@ final class Target_java_util_concurrent_locks_ReentrantLock_NonfairSync { volatile Target_java_util_concurrent_locks_AbstractQueuedSynchronizer_ConditionObject objectMonitorCondition; } +// Checkstyle: stop @TargetClass(MultiThreadedMonitorSupport.class) final class Target_com_oracle_svm_core_monitor_MultiThreadedMonitorSupport { @Alias @RecomputeFieldValue(kind = RecomputeFieldValue.Kind.FieldOffset, name = "objectMonitorCondition", declClass = Target_java_util_concurrent_locks_ReentrantLock_NonfairSync.class) // @@ -625,3 +625,4 @@ final class Target_java_util_concurrent_locks_AbstractQueuedSynchronizer_Conditi @TargetClass(value = ReferenceQueue.class, innerClass = "Lock") final class Target_java_lang_ref_ReferenceQueue_Lock { } +// Checkstyle: resume diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/option/SubstrateOptionsParser.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/option/SubstrateOptionsParser.java index b5463bd8b71c..226e7205d3a0 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/option/SubstrateOptionsParser.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/option/SubstrateOptionsParser.java @@ -24,8 +24,6 @@ */ package com.oracle.svm.core.option; -// Checkstyle: allow reflection - import java.io.PrintStream; import java.lang.reflect.Field; import java.util.Arrays; @@ -109,9 +107,7 @@ public static boolean parseHostedOption(String optionPrefix, EconomicMap getMessages() { * preprocessed} before being sent to {@link String#format(String, Object...)} */ public static UserException abort(String format, Object... args) { - // Checkstyle: stop throw new UserException(String.format(format, formatArguments(args))); - // Checkstyle: resume } /** @@ -83,9 +81,7 @@ public static UserException abort(String format, Object... args) { * preprocessed} before being sent to {@link String#format(String, Object...)} */ public static UserException abort(Throwable cause, String format, Object... args) { - // Checkstyle: stop throw ((UserException) new UserException(String.format(format, formatArguments(args))).initCause(cause)); - // Checkstyle: resume } /** @@ -97,9 +93,7 @@ public static UserException abort(Throwable cause, String format, Object... args */ public static void guarantee(boolean condition, String format, Object... args) { if (!condition) { - // Checkstyle: stop throw UserError.abort(format, args); - // Checkstyle: resume } } diff --git a/substratevm/src/com.oracle.svm.graal.test/src/com/oracle/svm/graal/test/IsolatedSpeculationLogEncodingNativeTest.java b/substratevm/src/com.oracle.svm.graal.test/src/com/oracle/svm/graal/test/IsolatedSpeculationLogEncodingNativeTest.java index 27d74aaa3f35..564d6cc5684b 100644 --- a/substratevm/src/com.oracle.svm.graal.test/src/com/oracle/svm/graal/test/IsolatedSpeculationLogEncodingNativeTest.java +++ b/substratevm/src/com.oracle.svm.graal.test/src/com/oracle/svm/graal/test/IsolatedSpeculationLogEncodingNativeTest.java @@ -25,8 +25,6 @@ */ package com.oracle.svm.graal.test; -// Checkstyle: allow reflection - import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; @@ -47,9 +45,7 @@ public void testEncodeAsByteArray() throws NoSuchMethodException, InvocationTarg final int groupId = 1234; final Object[] context = {'a', null, "Hello World!", Byte.MAX_VALUE, Short.MAX_VALUE, Long.MAX_VALUE, Integer.MAX_VALUE, Double.MAX_VALUE, Float.MAX_VALUE}; - // Checkstyle: stop final Class encodedSpeculationReasonClass = Class.forName("jdk.vm.ci.meta.EncodedSpeculationReason"); - // Checkstyle: resume Constructor encodedSpeculationReasonConstructor = encodedSpeculationReasonClass.getDeclaredConstructor(Integer.TYPE, String.class, Object[].class); SpeculationLog.SpeculationReason encodedReason = (SpeculationLog.SpeculationReason) encodedSpeculationReasonConstructor.newInstance(groupId, "testGroup", context); diff --git a/substratevm/src/com.oracle.svm.graal.test/src/com/oracle/svm/graal/test/IsolatedSpeculationLogEncodingTest.java b/substratevm/src/com.oracle.svm.graal.test/src/com/oracle/svm/graal/test/IsolatedSpeculationLogEncodingTest.java index 5e0c0373213c..4594e76818be 100644 --- a/substratevm/src/com.oracle.svm.graal.test/src/com/oracle/svm/graal/test/IsolatedSpeculationLogEncodingTest.java +++ b/substratevm/src/com.oracle.svm.graal.test/src/com/oracle/svm/graal/test/IsolatedSpeculationLogEncodingTest.java @@ -25,14 +25,6 @@ */ package com.oracle.svm.graal.test; -// Checkstyle: allow reflection - -import com.oracle.svm.graal.isolated.IsolatedSpeculationLog; -import org.junit.Test; -import org.junit.Assert; - -import jdk.vm.ci.meta.SpeculationLog; - import java.lang.reflect.Constructor; import java.lang.reflect.InvocationHandler; import java.lang.reflect.InvocationTargetException; @@ -40,6 +32,13 @@ import java.lang.reflect.Proxy; import java.util.function.Supplier; +import org.junit.Assert; +import org.junit.Test; + +import com.oracle.svm.graal.isolated.IsolatedSpeculationLog; + +import jdk.vm.ci.meta.SpeculationLog; + public class IsolatedSpeculationLogEncodingTest { private static final Class SRE_CLASS; private static final String SRE_CLASS_NAME = "jdk.vm.ci.meta.SpeculationLog$SpeculationReasonEncoding"; @@ -51,10 +50,8 @@ public class IsolatedSpeculationLogEncodingTest { Class sreClass = null; Class isolatedSreClass = null; try { - // Checkstyle: stop sreClass = Class.forName(SRE_CLASS_NAME); isolatedSreClass = Class.forName(ISOLATED_SRE_CLASS_NAME); - // Checkstyle: resume } catch (ClassNotFoundException e) { Assert.fail("failed to get classes"); } @@ -79,9 +76,7 @@ public class IsolatedSpeculationLogEncodingTest { public void testEncodeAsByteArray() throws NoSuchMethodException, InvocationTargetException, IllegalAccessException, ClassNotFoundException, InstantiationException { final int groupId = 1234; final Object[] context = {'a', null, "Hello World!", Byte.MAX_VALUE, Short.MAX_VALUE, Long.MAX_VALUE, Integer.MAX_VALUE, Double.MAX_VALUE, Float.MAX_VALUE}; - // Checkstyle: stop final Class encodedSpeculationReasonClass = Class.forName("jdk.vm.ci.meta.EncodedSpeculationReason"); - // Checkstyle: resume Constructor encodedSpeculationReasonConstructor = encodedSpeculationReasonClass.getDeclaredConstructor(Integer.TYPE, String.class, Object[].class); SpeculationLog.SpeculationReason reason = (SpeculationLog.SpeculationReason) encodedSpeculationReasonConstructor.newInstance(groupId, "testGroup", context); diff --git a/substratevm/src/com.oracle.svm.graal/src/com/oracle/svm/graal/GraalSubstitutions.java b/substratevm/src/com.oracle.svm.graal/src/com/oracle/svm/graal/GraalSubstitutions.java index c6fa91410cba..9330fa223554 100644 --- a/substratevm/src/com.oracle.svm.graal/src/com/oracle/svm/graal/GraalSubstitutions.java +++ b/substratevm/src/com.oracle.svm.graal/src/com/oracle/svm/graal/GraalSubstitutions.java @@ -85,8 +85,6 @@ import jdk.vm.ci.meta.ResolvedJavaField; import jdk.vm.ci.meta.ResolvedJavaMethod; -// Checkstyle: stop - @TargetClass(value = org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugins.class, onlyWith = GraalFeature.IsEnabledAndNotLibgraal.class) final class Target_org_graalvm_compiler_nodes_graphbuilderconf_InvocationPlugins { @@ -148,7 +146,9 @@ public RecomputeFieldValue.ValueAvailability valueAvailability() { @Override public Object compute(MetaAccessProvider metaAccess, ResolvedJavaField original, ResolvedJavaField annotated, Object receiver) { for (Class c : DebugContext.class.getDeclaredClasses()) { + // Checkstyle: allow Class.getSimpleName if (c.getSimpleName().equals("Immutable")) { + // Checkstyle: disallow Class.getSimpleName Object[] cache = ReflectionUtil.readStaticField(c, "CACHE"); Object[] clearedCache = cache.clone(); for (int i = 0; i < clearedCache.length; i++) { @@ -193,8 +193,10 @@ public Object compute(MetaAccessProvider metaAccess, ResolvedJavaField original, @TargetClass(value = TimeSource.class, onlyWith = GraalFeature.IsEnabled.class) final class Target_org_graalvm_compiler_debug_TimeSource { + // Checkstyle: stop @Alias @RecomputeFieldValue(kind = FromAlias)// private static boolean USING_THREAD_CPU_TIME = false; + // Checkstyle: resume } @TargetClass(value = org.graalvm.compiler.debug.TTY.class, onlyWith = GraalFeature.IsEnabledAndNotLibgraal.class) diff --git a/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/BootLoaderSupport.java b/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/BootLoaderSupport.java index 004aa9e835bf..160351a4ef25 100644 --- a/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/BootLoaderSupport.java +++ b/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/BootLoaderSupport.java @@ -24,8 +24,6 @@ */ package com.oracle.svm.hosted; -// Checkstyle: allow reflection - import java.lang.reflect.Method; import com.oracle.svm.core.util.VMError; @@ -39,9 +37,7 @@ public class BootLoaderSupport { public static ClassLoader getBootLoader() { Class classLoadersClass; try { - // Checkstyle: stop classLoadersClass = Class.forName("jdk.internal.loader.ClassLoaders"); - // Checkstyle: resume Method method = ReflectionUtil.lookupMethod(classLoadersClass, "bootLoader"); Object r = method.invoke(null); return (ClassLoader) r; 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 b01b811b0673..30c2aafadb29 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 @@ -25,8 +25,6 @@ */ package com.oracle.svm.hosted; -// Checkstyle: allow reflection - import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; diff --git a/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/SecurityServicesFeature.java b/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/SecurityServicesFeature.java index 51e216e54c3e..7315f108dad2 100644 --- a/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/SecurityServicesFeature.java +++ b/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/SecurityServicesFeature.java @@ -24,8 +24,6 @@ */ package com.oracle.svm.hosted; -// Checkstyle: allow reflection - import static com.oracle.svm.hosted.SecurityServicesFeature.SecurityServicesPrinter.dedent; import static com.oracle.svm.hosted.SecurityServicesFeature.SecurityServicesPrinter.indent; @@ -872,9 +870,7 @@ static class SecurityServicesPrinter { SecurityServicesPrinter() { File reportFile = reportFile(SubstrateOptions.reportsPath()); - // Checkstyle: stop System.out.println("# Printing security services automatic registration to: " + reportFile); - // Checkstyle: resume try { writer = new PrintWriter(new FileWriter(reportFile)); } catch (IOException e) { diff --git a/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/code/CFunctionPointerCallStubMethod.java b/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/code/CFunctionPointerCallStubMethod.java index e52f6db4ab1a..b1fd768d498e 100644 --- a/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/code/CFunctionPointerCallStubMethod.java +++ b/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/code/CFunctionPointerCallStubMethod.java @@ -44,8 +44,6 @@ import jdk.vm.ci.meta.ResolvedJavaType; import jdk.vm.ci.meta.Signature; -// Checkstyle: allow reflection - /** * A stub for calling native code generated from a method annotated with * {@link InvokeCFunctionPointer}. diff --git a/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/code/NonBytecodeStaticMethod.java b/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/code/NonBytecodeStaticMethod.java index 76720f32cf76..0559851bf26f 100644 --- a/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/code/NonBytecodeStaticMethod.java +++ b/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/code/NonBytecodeStaticMethod.java @@ -24,8 +24,6 @@ */ package com.oracle.svm.hosted.code; -// Checkstyle: allow reflection - import java.lang.annotation.Annotation; import java.lang.reflect.Modifier; import java.lang.reflect.Type; diff --git a/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/jdk/JNIRegistrationJavaNet.java b/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/jdk/JNIRegistrationJavaNet.java index 3c6c1bd6bac3..993df4b68813 100644 --- a/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/jdk/JNIRegistrationJavaNet.java +++ b/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/jdk/JNIRegistrationJavaNet.java @@ -25,6 +25,7 @@ package com.oracle.svm.hosted.jdk; import java.lang.reflect.Field; +import java.lang.reflect.Modifier; import java.net.DatagramPacket; import java.net.InetAddress; import java.net.Proxy; @@ -227,9 +228,7 @@ private static void registerDatagramPacketInit(DuringAnalysisAccess a) { private static void registerDatagramSocketCheckOldImpl(DuringAnalysisAccess a) { a.registerSubtypeReachabilityHandler((access, clazz) -> { - // Checkstyle: stop - if (!java.lang.reflect.Modifier.isAbstract(clazz.getModifiers())) { - // Checkstyle: resume + if (!Modifier.isAbstract(clazz.getModifiers())) { RuntimeReflection.register(method(access, clazz.getName(), "peekData", DatagramPacket.class)); } }, clazz(a, "java.net.DatagramSocketImpl")); diff --git a/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/jdk/localization/LocalizationFeature.java b/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/jdk/localization/LocalizationFeature.java index b2a67f54d248..c484ff387b77 100644 --- a/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/jdk/localization/LocalizationFeature.java +++ b/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/jdk/localization/LocalizationFeature.java @@ -24,8 +24,6 @@ */ package com.oracle.svm.hosted.jdk.localization; -// Checkstyle: stop - import java.lang.reflect.Field; import java.nio.charset.Charset; import java.nio.charset.IllegalCharsetNameException; @@ -92,7 +90,6 @@ import sun.util.locale.provider.LocaleProviderAdapter; import sun.util.locale.provider.ResourceBundleBasedAdapter; import sun.util.resources.LocaleData; -// Checkstyle: resume /** * LocalizationFeature is the core class of SVM localization support. It contains all the options @@ -520,9 +517,7 @@ public void prepareBundle(String baseName, Collection wantedLocales) { String errorMessage = "The bundle named: " + baseName + ", has not been found. " + "If the bundle is part of a module, verify the bundle name is a fully qualified class name. Otherwise " + "verify the bundle path is accessible in the classpath."; - // Checkstyle: stop System.out.println(errorMessage); - // Checkstyle: resume } } @@ -569,9 +564,7 @@ private static ResourceBundle getParent(ResourceBundle bundle) { @Platforms(Platform.HOSTED_ONLY.class) protected void trace(String msg) { if (trace) { - // Checkstyle: stop System.out.println(msg); - // Checkstyle: resume } } } diff --git a/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/substitute/AnnotatedMethod.java b/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/substitute/AnnotatedMethod.java index 524faf946f30..450b0934a4d0 100644 --- a/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/substitute/AnnotatedMethod.java +++ b/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/substitute/AnnotatedMethod.java @@ -179,11 +179,9 @@ public ConstantPool getConstantPool() { private Annotation[] getAnnotationsImpl(Function src) { // Collect all but @AnnotateOriginal from annotated - // Checkstyle: stop Map result = Arrays.stream(src.apply(annotated))// .filter(annotation -> !annotation.getClass().equals(AnnotateOriginal.class))// .collect(Collectors.toMap(annotation -> annotation.getClass(), Function.identity())); - // Checkstyle: resume // Add remaining missing ones from original for (Annotation annotation : src.apply(original)) { result.putIfAbsent(annotation.getClass(), annotation); diff --git a/substratevm/src/com.oracle.svm.jfr/src/com/oracle/svm/jfr/JfrEventSubstitution.java b/substratevm/src/com.oracle.svm.jfr/src/com/oracle/svm/jfr/JfrEventSubstitution.java index a35219bb1864..7af6f0b2263c 100644 --- a/substratevm/src/com.oracle.svm.jfr/src/com/oracle/svm/jfr/JfrEventSubstitution.java +++ b/substratevm/src/com.oracle.svm.jfr/src/com/oracle/svm/jfr/JfrEventSubstitution.java @@ -24,8 +24,6 @@ */ package com.oracle.svm.jfr; -//Checkstyle: allow reflection - import java.lang.reflect.Field; import java.lang.reflect.Method; import java.lang.reflect.Modifier; @@ -180,9 +178,7 @@ private static void setPublicModifier(ResolvedJavaMethod m) { metaspaceMethodM.setAccessible(true); long metaspaceMethod = (Long) metaspaceMethodM.invoke(m); VMError.guarantee(metaspaceMethod != 0); - // Checkstyle: stop Class hotSpotVMConfigC = Class.forName("jdk.vm.ci.hotspot.HotSpotVMConfig"); - // Checkstyle: resume Method configM = hotSpotVMConfigC.getDeclaredMethod("config"); configM.setAccessible(true); Field methodAccessFlagsOffsetF = hotSpotVMConfigC.getDeclaredField("methodAccessFlagsOffset"); diff --git a/substratevm/src/com.oracle.svm.jfr/src/com/oracle/svm/jfr/JfrEventWriterAccess.java b/substratevm/src/com.oracle.svm.jfr/src/com/oracle/svm/jfr/JfrEventWriterAccess.java index dcafac1cb334..63625348db20 100644 --- a/substratevm/src/com.oracle.svm.jfr/src/com/oracle/svm/jfr/JfrEventWriterAccess.java +++ b/substratevm/src/com.oracle.svm.jfr/src/com/oracle/svm/jfr/JfrEventWriterAccess.java @@ -24,7 +24,6 @@ */ package com.oracle.svm.jfr; -//Checkstyle: allow reflection import java.lang.reflect.Field; import org.graalvm.compiler.serviceprovider.GraalUnsafeAccess; diff --git a/substratevm/src/com.oracle.svm.jfr/src/com/oracle/svm/jfr/JfrFeature.java b/substratevm/src/com.oracle.svm.jfr/src/com/oracle/svm/jfr/JfrFeature.java index d07f5ace5454..2ac9a66df568 100644 --- a/substratevm/src/com.oracle.svm.jfr/src/com/oracle/svm/jfr/JfrFeature.java +++ b/substratevm/src/com.oracle.svm.jfr/src/com/oracle/svm/jfr/JfrFeature.java @@ -24,8 +24,6 @@ */ package com.oracle.svm.jfr; -//Checkstyle: allow reflection - import java.lang.reflect.Field; import java.util.Collection; import java.util.Collections; @@ -131,10 +129,8 @@ public boolean isInConfiguration(IsInConfigurationAccess access) { } boolean runtimeEnabled = VMInspectionOptions.AllowVMInspection.getValue(); if (hostedEnabled && !runtimeEnabled) { - // Checkstyle: stop System.err.println("Warning: When FlightRecoder is used to profile the image generator, it is also automatically enabled in the native image at run time. " + "This can affect the measurements because it can can make the image larger and image build time longer."); - // Checkstyle: resume runtimeEnabled = true; } return runtimeEnabled && systemSupported; diff --git a/substratevm/src/com.oracle.svm.jfr/src/com/oracle/svm/jfr/JfrRecorderThread.java b/substratevm/src/com.oracle.svm.jfr/src/com/oracle/svm/jfr/JfrRecorderThread.java index 179fa8e0782d..fb8dbc2ecf4b 100644 --- a/substratevm/src/com.oracle.svm.jfr/src/com/oracle/svm/jfr/JfrRecorderThread.java +++ b/substratevm/src/com.oracle.svm.jfr/src/com/oracle/svm/jfr/JfrRecorderThread.java @@ -99,11 +99,9 @@ private void persistBuffers(JfrChunkWriter chunkWriter) { if (isFullEnough(buffer)) { boolean shouldNotify = persistBuffer(chunkWriter, buffer); if (shouldNotify) { - // Checkstyle: stop synchronized (Target_jdk_jfr_internal_JVM.FILE_DELTA_CHANGE) { Target_jdk_jfr_internal_JVM.FILE_DELTA_CHANGE.notifyAll(); } - // Checkstyle: resume } } } diff --git a/substratevm/src/com.oracle.svm.jfr/src/com/oracle/svm/jfr/JfrSerializerSupport.java b/substratevm/src/com.oracle.svm.jfr/src/com/oracle/svm/jfr/JfrSerializerSupport.java index 47e8f9676b2d..a9c66eca227a 100644 --- a/substratevm/src/com.oracle.svm.jfr/src/com/oracle/svm/jfr/JfrSerializerSupport.java +++ b/substratevm/src/com.oracle.svm.jfr/src/com/oracle/svm/jfr/JfrSerializerSupport.java @@ -42,7 +42,6 @@ public JfrSerializerSupport() { serializers = new JfrConstantPool[0]; } - // Checkstyle: allow synchronization. @Platforms(Platform.HOSTED_ONLY.class) public synchronized void register(JfrConstantPool serializer) { assert serializer != null; @@ -51,7 +50,6 @@ public synchronized void register(JfrConstantPool serializer) { serializers = Arrays.copyOf(serializers, oldLength + 1); serializers[oldLength] = serializer; } - // Checkstyle: disallow synchronization. @Fold public static JfrSerializerSupport get() { diff --git a/substratevm/src/com.oracle.svm.jfr/src/com/oracle/svm/jfr/SubstrateJVM.java b/substratevm/src/com.oracle.svm.jfr/src/com/oracle/svm/jfr/SubstrateJVM.java index bf3145b50023..45f51ac3de67 100644 --- a/substratevm/src/com.oracle.svm.jfr/src/com/oracle/svm/jfr/SubstrateJVM.java +++ b/substratevm/src/com.oracle.svm.jfr/src/com/oracle/svm/jfr/SubstrateJVM.java @@ -24,12 +24,9 @@ */ package com.oracle.svm.jfr; -//Checkstyle: allow reflection - import java.lang.reflect.Field; import java.util.List; -import com.oracle.svm.core.thread.ThreadListener; import org.graalvm.compiler.api.replacements.Fold; import org.graalvm.compiler.core.common.NumUtil; import org.graalvm.nativeimage.ImageSingletons; @@ -41,6 +38,7 @@ import com.oracle.svm.core.annotate.Uninterruptible; import com.oracle.svm.core.thread.JavaVMOperation; +import com.oracle.svm.core.thread.ThreadListener; import com.oracle.svm.core.util.VMError; import com.oracle.svm.jfr.logging.JfrLogging; diff --git a/substratevm/src/com.oracle.svm.jfr/src/com/oracle/svm/jfr/Target_jdk_jfr_internal_JVM.java b/substratevm/src/com.oracle.svm.jfr/src/com/oracle/svm/jfr/Target_jdk_jfr_internal_JVM.java index 48d3bbcb4d27..759bb6d0ad05 100644 --- a/substratevm/src/com.oracle.svm.jfr/src/com/oracle/svm/jfr/Target_jdk_jfr_internal_JVM.java +++ b/substratevm/src/com.oracle.svm.jfr/src/com/oracle/svm/jfr/Target_jdk_jfr_internal_JVM.java @@ -45,7 +45,6 @@ import jdk.jfr.internal.LogTag; import jdk.jfr.internal.handlers.EventHandler; -// Checkstyle: allow synchronization. @SuppressWarnings({"static-method", "unused"}) @TargetClass(value = jdk.jfr.internal.JVM.class, onlyWith = JfrEnabled.class) public final class Target_jdk_jfr_internal_JVM { diff --git a/substratevm/src/com.oracle.svm.jfr/src/com/oracle/svm/jfr/Target_jdk_jfr_internal_Repository.java b/substratevm/src/com.oracle.svm.jfr/src/com/oracle/svm/jfr/Target_jdk_jfr_internal_Repository.java index a1606b7581ba..d31971c83ca2 100644 --- a/substratevm/src/com.oracle.svm.jfr/src/com/oracle/svm/jfr/Target_jdk_jfr_internal_Repository.java +++ b/substratevm/src/com.oracle.svm.jfr/src/com/oracle/svm/jfr/Target_jdk_jfr_internal_Repository.java @@ -31,7 +31,6 @@ import jdk.jfr.internal.SecuritySupport.SafePath; -// Checkstyle: allow synchronization. @TargetClass(value = jdk.jfr.internal.Repository.class, onlyWith = JfrEnabled.class) public final class Target_jdk_jfr_internal_Repository { @Alias private SafePath baseLocation; diff --git a/substratevm/src/com.oracle.svm.jfr/src/com/oracle/svm/jfr/traceid/JfrTraceIdEpoch.java b/substratevm/src/com.oracle.svm.jfr/src/com/oracle/svm/jfr/traceid/JfrTraceIdEpoch.java index ff76ed270456..53d75bfbb941 100644 --- a/substratevm/src/com.oracle.svm.jfr/src/com/oracle/svm/jfr/traceid/JfrTraceIdEpoch.java +++ b/substratevm/src/com.oracle.svm.jfr/src/com/oracle/svm/jfr/traceid/JfrTraceIdEpoch.java @@ -25,8 +25,6 @@ package com.oracle.svm.jfr.traceid; -//Checkstyle: allow reflection - import java.lang.reflect.Field; import org.graalvm.compiler.api.replacements.Fold; diff --git a/substratevm/src/com.oracle.svm.jni/src/com/oracle/svm/jni/JNIGeneratedMethodSupport.java b/substratevm/src/com.oracle.svm.jni/src/com/oracle/svm/jni/JNIGeneratedMethodSupport.java index a7aadd85f3fe..08de0c1a5722 100644 --- a/substratevm/src/com.oracle.svm.jni/src/com/oracle/svm/jni/JNIGeneratedMethodSupport.java +++ b/substratevm/src/com.oracle.svm.jni/src/com/oracle/svm/jni/JNIGeneratedMethodSupport.java @@ -24,8 +24,6 @@ */ package com.oracle.svm.jni; -// Checkstyle: allow reflection - import java.lang.reflect.Array; import org.graalvm.compiler.serviceprovider.GraalUnsafeAccess; diff --git a/substratevm/src/com.oracle.svm.jni/src/com/oracle/svm/jni/access/JNIAccessFeature.java b/substratevm/src/com.oracle.svm.jni/src/com/oracle/svm/jni/access/JNIAccessFeature.java index 433d14283a67..d9886685dce4 100644 --- a/substratevm/src/com.oracle.svm.jni/src/com/oracle/svm/jni/access/JNIAccessFeature.java +++ b/substratevm/src/com.oracle.svm.jni/src/com/oracle/svm/jni/access/JNIAccessFeature.java @@ -24,8 +24,6 @@ */ package com.oracle.svm.jni.access; -// Checkstyle: allow reflection - import java.lang.reflect.Executable; import java.lang.reflect.Field; import java.lang.reflect.Modifier; @@ -215,11 +213,9 @@ public JNINativeLinkage makeLinkage(String declaringClass, String name, String d JNINativeLinkage key = new JNINativeLinkage(declaringClass, name, descriptor); - // Checkstyle: stop if (JNIAccessFeature.Options.PrintJNIMethods.getValue()) { System.out.println("Creating a new JNINativeLinkage: " + key.toString()); } - // Checkstyle: resume return nativeLinkages.computeIfAbsent(key, linkage -> { newLinkages.put(linkage, linkage); diff --git a/substratevm/src/com.oracle.svm.jni/src/com/oracle/svm/jni/access/JNIAccessibleField.java b/substratevm/src/com.oracle.svm.jni/src/com/oracle/svm/jni/access/JNIAccessibleField.java index 4ea9ef27b088..b85e7756af29 100644 --- a/substratevm/src/com.oracle.svm.jni/src/com/oracle/svm/jni/access/JNIAccessibleField.java +++ b/substratevm/src/com.oracle.svm.jni/src/com/oracle/svm/jni/access/JNIAccessibleField.java @@ -24,8 +24,6 @@ */ package com.oracle.svm.jni.access; -// Checkstyle: allow reflection - import java.lang.reflect.Field; import java.lang.reflect.Modifier; diff --git a/substratevm/src/com.oracle.svm.jni/src/com/oracle/svm/jni/access/JNIAccessibleMethod.java b/substratevm/src/com.oracle.svm.jni/src/com/oracle/svm/jni/access/JNIAccessibleMethod.java index 6432120d797d..de0b1b902bf3 100644 --- a/substratevm/src/com.oracle.svm.jni/src/com/oracle/svm/jni/access/JNIAccessibleMethod.java +++ b/substratevm/src/com.oracle.svm.jni/src/com/oracle/svm/jni/access/JNIAccessibleMethod.java @@ -24,8 +24,6 @@ */ package com.oracle.svm.jni.access; -// Checkstyle: allow reflection - import java.lang.reflect.Modifier; import org.graalvm.nativeimage.Platform.HOSTED_ONLY; diff --git a/substratevm/src/com.oracle.svm.jni/src/com/oracle/svm/jni/access/JNIAccessibleMethodDescriptor.java b/substratevm/src/com.oracle.svm.jni/src/com/oracle/svm/jni/access/JNIAccessibleMethodDescriptor.java index 109834b19485..03a83d5c87df 100644 --- a/substratevm/src/com.oracle.svm.jni/src/com/oracle/svm/jni/access/JNIAccessibleMethodDescriptor.java +++ b/substratevm/src/com.oracle.svm.jni/src/com/oracle/svm/jni/access/JNIAccessibleMethodDescriptor.java @@ -24,8 +24,6 @@ */ package com.oracle.svm.jni.access; -// Checkstyle: allow reflection - import java.lang.reflect.Constructor; import java.lang.reflect.Executable; import java.lang.reflect.Method; diff --git a/substratevm/src/com.oracle.svm.jni/src/com/oracle/svm/jni/access/JNIReflectionDictionary.java b/substratevm/src/com.oracle.svm.jni/src/com/oracle/svm/jni/access/JNIReflectionDictionary.java index e09288ec28dd..129209b2bfbe 100644 --- a/substratevm/src/com.oracle.svm.jni/src/com/oracle/svm/jni/access/JNIReflectionDictionary.java +++ b/substratevm/src/com.oracle.svm.jni/src/com/oracle/svm/jni/access/JNIReflectionDictionary.java @@ -52,8 +52,6 @@ import jdk.vm.ci.meta.JavaType; import jdk.vm.ci.meta.Signature; -// Checkstyle: allow reflection - /** * Provides JNI access to predetermined classes, methods and fields at runtime. */ diff --git a/substratevm/src/com.oracle.svm.jni/src/com/oracle/svm/jni/functions/JNIFunctions.java b/substratevm/src/com.oracle.svm.jni/src/com/oracle/svm/jni/functions/JNIFunctions.java index 5b873fcda758..8cf059244f06 100644 --- a/substratevm/src/com.oracle.svm.jni/src/com/oracle/svm/jni/functions/JNIFunctions.java +++ b/substratevm/src/com.oracle.svm.jni/src/com/oracle/svm/jni/functions/JNIFunctions.java @@ -24,8 +24,6 @@ */ package com.oracle.svm.jni.functions; -// Checkstyle: allow reflection - import static com.oracle.svm.core.annotate.RestrictHeapAccess.Access.NO_ALLOCATION; import java.lang.reflect.Array; diff --git a/substratevm/src/com.oracle.svm.jni/src/com/oracle/svm/jni/hosted/JNICallTrampolineMethod.java b/substratevm/src/com.oracle.svm.jni/src/com/oracle/svm/jni/hosted/JNICallTrampolineMethod.java index 2b9f45dc36c4..3f56b06582ba 100644 --- a/substratevm/src/com.oracle.svm.jni/src/com/oracle/svm/jni/hosted/JNICallTrampolineMethod.java +++ b/substratevm/src/com.oracle.svm.jni/src/com/oracle/svm/jni/hosted/JNICallTrampolineMethod.java @@ -24,8 +24,6 @@ */ package com.oracle.svm.jni.hosted; -// Checkstyle: allow reflection - import java.lang.reflect.Modifier; import java.util.ArrayList; import java.util.List; diff --git a/substratevm/src/com.oracle.svm.jni/src/com/oracle/svm/jni/hosted/JNIJavaCallWrapperMethod.java b/substratevm/src/com.oracle.svm.jni/src/com/oracle/svm/jni/hosted/JNIJavaCallWrapperMethod.java index 378d7e23a191..461bde2ff962 100644 --- a/substratevm/src/com.oracle.svm.jni/src/com/oracle/svm/jni/hosted/JNIJavaCallWrapperMethod.java +++ b/substratevm/src/com.oracle.svm.jni/src/com/oracle/svm/jni/hosted/JNIJavaCallWrapperMethod.java @@ -24,8 +24,6 @@ */ package com.oracle.svm.jni.hosted; -// Checkstyle: allow reflection - import java.lang.reflect.Executable; import java.lang.reflect.Modifier; import java.util.ArrayList; diff --git a/substratevm/src/com.oracle.svm.jni/src/com/oracle/svm/jni/hosted/JNINativeCallWrapperMethod.java b/substratevm/src/com.oracle.svm.jni/src/com/oracle/svm/jni/hosted/JNINativeCallWrapperMethod.java index f7d58d95bba2..88de511cfa03 100644 --- a/substratevm/src/com.oracle.svm.jni/src/com/oracle/svm/jni/hosted/JNINativeCallWrapperMethod.java +++ b/substratevm/src/com.oracle.svm.jni/src/com/oracle/svm/jni/hosted/JNINativeCallWrapperMethod.java @@ -24,8 +24,6 @@ */ package com.oracle.svm.jni.hosted; -// Checkstyle: allow reflection - import java.lang.reflect.Modifier; import java.util.ArrayList; import java.util.List; diff --git a/substratevm/src/com.oracle.svm.junit/src/com/oracle/svm/junit/SVMJUnitRunner.java b/substratevm/src/com.oracle.svm.junit/src/com/oracle/svm/junit/SVMJUnitRunner.java index d2aca9a16b2c..cd2b6c46c2b4 100644 --- a/substratevm/src/com.oracle.svm.junit/src/com/oracle/svm/junit/SVMJUnitRunner.java +++ b/substratevm/src/com.oracle.svm.junit/src/com/oracle/svm/junit/SVMJUnitRunner.java @@ -26,9 +26,9 @@ import java.io.BufferedReader; import java.io.FileReader; -import java.util.List; import java.text.SimpleDateFormat; import java.util.Date; +import java.util.List; import java.util.Random; import org.graalvm.compiler.options.Option; @@ -93,9 +93,7 @@ protected Class resolveClass(String name) throws ClassNotFoundException { StringBuilder msg = new StringBuilder("Warning: The test configuration file specified via ").append(testFileOption) .append(" contains missing classes. Test execution will fail at run time. ") .append("Missing classes in configuration file: ").append(missingClassesStr); - // Checkstyle: stop System.out.println(msg); - // Checkstyle: resume } } diff --git a/substratevm/src/com.oracle.svm.junit/src/com/oracle/svm/junit/Target_org_junit_runners_model_TestClass.java b/substratevm/src/com.oracle.svm.junit/src/com/oracle/svm/junit/Target_org_junit_runners_model_TestClass.java index f6c3d3b9052e..74f67f797f3c 100644 --- a/substratevm/src/com.oracle.svm.junit/src/com/oracle/svm/junit/Target_org_junit_runners_model_TestClass.java +++ b/substratevm/src/com.oracle.svm.junit/src/com/oracle/svm/junit/Target_org_junit_runners_model_TestClass.java @@ -24,8 +24,6 @@ */ package com.oracle.svm.junit; -// Checkstyle: allow reflection - import java.lang.reflect.Constructor; import org.graalvm.nativeimage.hosted.RuntimeReflection; diff --git a/substratevm/src/com.oracle.svm.methodhandles/src/com/oracle/svm/methodhandles/MethodHandleFeature.java b/substratevm/src/com.oracle.svm.methodhandles/src/com/oracle/svm/methodhandles/MethodHandleFeature.java index e9dc18585181..9e4b69f193cb 100644 --- a/substratevm/src/com.oracle.svm.methodhandles/src/com/oracle/svm/methodhandles/MethodHandleFeature.java +++ b/substratevm/src/com.oracle.svm.methodhandles/src/com/oracle/svm/methodhandles/MethodHandleFeature.java @@ -27,12 +27,10 @@ import java.lang.invoke.CallSite; import java.lang.invoke.MethodHandle; import java.lang.invoke.MethodType; -// Checkstyle: stop import java.lang.reflect.Array; import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; -// Checkstyle: resume import java.util.Iterator; import java.util.Set; import java.util.concurrent.ConcurrentHashMap; @@ -47,10 +45,8 @@ import com.oracle.svm.core.util.VMError; import com.oracle.svm.util.ReflectionUtil; -// Checkstyle: stop import sun.invoke.util.ValueConversions; import sun.invoke.util.Wrapper; -// Checkstyle: resume /** * Method handles are implemented in Native Image through reflection. A method handle can have one diff --git a/substratevm/src/com.oracle.svm.methodhandles/src/com/oracle/svm/methodhandles/MethodHandleIntrinsicImpl.java b/substratevm/src/com.oracle.svm.methodhandles/src/com/oracle/svm/methodhandles/MethodHandleIntrinsicImpl.java index 84149d9c59f6..83c19ac25889 100644 --- a/substratevm/src/com.oracle.svm.methodhandles/src/com/oracle/svm/methodhandles/MethodHandleIntrinsicImpl.java +++ b/substratevm/src/com.oracle.svm.methodhandles/src/com/oracle/svm/methodhandles/MethodHandleIntrinsicImpl.java @@ -27,10 +27,8 @@ import static com.oracle.svm.core.util.VMError.shouldNotReachHere; import java.lang.invoke.MethodType; -// Checkstyle: stop import java.lang.reflect.Field; import java.lang.reflect.Modifier; -// Checkstyle: allow import java.util.Arrays; import java.util.HashSet; import java.util.Map; diff --git a/substratevm/src/com.oracle.svm.methodhandles/src/com/oracle/svm/methodhandles/Target_java_lang_invoke_ClassSpecializer.java b/substratevm/src/com.oracle.svm.methodhandles/src/com/oracle/svm/methodhandles/Target_java_lang_invoke_ClassSpecializer.java index 253828d97c6c..e19cf757578e 100644 --- a/substratevm/src/com.oracle.svm.methodhandles/src/com/oracle/svm/methodhandles/Target_java_lang_invoke_ClassSpecializer.java +++ b/substratevm/src/com.oracle.svm.methodhandles/src/com/oracle/svm/methodhandles/Target_java_lang_invoke_ClassSpecializer.java @@ -66,17 +66,13 @@ Target_java_lang_invoke_ClassSpecializer_SpeciesData loadSpecies(Target_java_lan if (Target_java_lang_invoke_MethodHandleStatics.TRACE_RESOLVE) { // Used by jlink species pregeneration plugin, see // jdk.tools.jlink.internal.plugins.GenerateJLIClassesPlugin - // Checkstyle: stop System.out.println("[SPECIES_RESOLVE] " + className + " (generated)"); - // Checkstyle: resume } // This operation causes a lot of churn: linkSpeciesDataToCode(speciesData, speciesCode); } catch (Error ex) { if (Target_java_lang_invoke_MethodHandleStatics.TRACE_RESOLVE) { - // Checkstyle: stop System.out.println("[SPECIES_RESOLVE] " + className + " (Error #2)"); - // Checkstyle: resume } // We can get here if there is a race condition loading a class. // Or maybe we are out of resources. Back out of the CHM.get and retry. diff --git a/substratevm/src/com.oracle.svm.methodhandles/src/com/oracle/svm/methodhandles/Target_java_lang_invoke_MethodHandle.java b/substratevm/src/com.oracle.svm.methodhandles/src/com/oracle/svm/methodhandles/Target_java_lang_invoke_MethodHandle.java index 9cf5d5c1334c..aa8d10cdbdf7 100644 --- a/substratevm/src/com.oracle.svm.methodhandles/src/com/oracle/svm/methodhandles/Target_java_lang_invoke_MethodHandle.java +++ b/substratevm/src/com.oracle.svm.methodhandles/src/com/oracle/svm/methodhandles/Target_java_lang_invoke_MethodHandle.java @@ -26,13 +26,11 @@ import java.lang.invoke.MethodHandle; import java.lang.invoke.MethodType; -// Checkstyle: stop import java.lang.reflect.Constructor; import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.lang.reflect.Modifier; -// Checkstyle: resume import java.util.Arrays; import com.oracle.svm.core.SubstrateUtil; @@ -48,10 +46,8 @@ import com.oracle.svm.reflect.target.Target_java_lang_reflect_Method; import com.oracle.svm.reflect.target.Target_jdk_internal_reflect_MethodAccessor; -// Checkstyle: stop import sun.invoke.util.ValueConversions; import sun.invoke.util.Wrapper; -// Checkstyle: resume @TargetClass(className = "java.lang.invoke.MethodHandle") final class Target_java_lang_invoke_MethodHandle { diff --git a/substratevm/src/com.oracle.svm.methodhandles/src/com/oracle/svm/methodhandles/Target_java_lang_invoke_MethodHandleNatives.java b/substratevm/src/com.oracle.svm.methodhandles/src/com/oracle/svm/methodhandles/Target_java_lang_invoke_MethodHandleNatives.java index 35e22ce90cf4..c5bfef833642 100644 --- a/substratevm/src/com.oracle.svm.methodhandles/src/com/oracle/svm/methodhandles/Target_java_lang_invoke_MethodHandleNatives.java +++ b/substratevm/src/com.oracle.svm.methodhandles/src/com/oracle/svm/methodhandles/Target_java_lang_invoke_MethodHandleNatives.java @@ -30,14 +30,12 @@ import java.lang.invoke.CallSite; import java.lang.invoke.MethodHandle; -// Checkstyle: stop import java.lang.reflect.Constructor; import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Member; import java.lang.reflect.Method; import java.lang.reflect.Modifier; -// Checkstyle: resume import org.graalvm.compiler.debug.GraalError; import org.graalvm.compiler.serviceprovider.JavaVersionUtil; @@ -56,9 +54,7 @@ import com.oracle.svm.core.jdk.JDK17OrLater; import com.oracle.svm.reflect.target.Target_java_lang_reflect_Field; -// Checkstyle: stop import sun.invoke.util.VerifyAccess; -// Checkstyle: resume /** * Native Image implementation of the parts of the JDK method handles engine implemented in C++. We diff --git a/substratevm/src/com.oracle.svm.methodhandles/src/com/oracle/svm/methodhandles/Target_java_lang_invoke_MethodTypeForm.java b/substratevm/src/com.oracle.svm.methodhandles/src/com/oracle/svm/methodhandles/Target_java_lang_invoke_MethodTypeForm.java index 901891399b59..23ea4be57bae 100644 --- a/substratevm/src/com.oracle.svm.methodhandles/src/com/oracle/svm/methodhandles/Target_java_lang_invoke_MethodTypeForm.java +++ b/substratevm/src/com.oracle.svm.methodhandles/src/com/oracle/svm/methodhandles/Target_java_lang_invoke_MethodTypeForm.java @@ -24,8 +24,6 @@ */ package com.oracle.svm.methodhandles; -// Checkstyle: stop - import java.lang.ref.SoftReference; import com.oracle.svm.core.annotate.Alias; @@ -34,8 +32,6 @@ import com.oracle.svm.core.annotate.RecomputeFieldValue.NewEmptyArrayTransformer; import com.oracle.svm.core.annotate.TargetClass; -// Checkstyle: resume - @TargetClass(className = "java.lang.invoke.MethodTypeForm") final class Target_java_lang_invoke_MethodTypeForm { diff --git a/substratevm/src/com.oracle.svm.polyglot/src/com/oracle/svm/polyglot/scala/ScalaFeature.java b/substratevm/src/com.oracle.svm.polyglot/src/com/oracle/svm/polyglot/scala/ScalaFeature.java index 30e83cf26b5b..981ca6ff563b 100644 --- a/substratevm/src/com.oracle.svm.polyglot/src/com/oracle/svm/polyglot/scala/ScalaFeature.java +++ b/substratevm/src/com.oracle.svm.polyglot/src/com/oracle/svm/polyglot/scala/ScalaFeature.java @@ -24,8 +24,6 @@ */ package com.oracle.svm.polyglot.scala; -// Checkstyle: stop - import java.lang.reflect.Field; import java.lang.reflect.Method; import java.util.Arrays; @@ -44,7 +42,6 @@ import com.oracle.svm.core.util.UserError; import com.oracle.svm.hosted.FeatureImpl.BeforeAnalysisAccessImpl; -// Checkstyle: resume @AutomaticFeature public class ScalaFeature implements GraalFeature { diff --git a/substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/hosted/ExecutableAccessorComputer.java b/substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/hosted/ExecutableAccessorComputer.java index 80f0e381007b..e3681a6b78ea 100644 --- a/substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/hosted/ExecutableAccessorComputer.java +++ b/substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/hosted/ExecutableAccessorComputer.java @@ -24,8 +24,6 @@ */ package com.oracle.svm.reflect.hosted; -// Checkstyle: allow reflection - import java.lang.reflect.Executable; import org.graalvm.nativeimage.ImageSingletons; diff --git a/substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/hosted/FieldOffsetComputer.java b/substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/hosted/FieldOffsetComputer.java index 68f5b7b79228..85bd6ec6ac3c 100644 --- a/substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/hosted/FieldOffsetComputer.java +++ b/substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/hosted/FieldOffsetComputer.java @@ -24,8 +24,6 @@ */ package com.oracle.svm.reflect.hosted; -// Checkstyle: allow reflection - import java.lang.reflect.Field; import com.oracle.svm.core.annotate.RecomputeFieldValue; diff --git a/substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/hosted/MethodMetadata.java b/substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/hosted/MethodMetadata.java index d1a294bb2783..da61ae7c6f93 100644 --- a/substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/hosted/MethodMetadata.java +++ b/substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/hosted/MethodMetadata.java @@ -24,8 +24,6 @@ */ package com.oracle.svm.reflect.hosted; -// Checkstyle: allow reflection - import java.lang.annotation.Annotation; import org.graalvm.nativeimage.ImageSingletons; diff --git a/substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/hosted/MethodMetadataEncoderImpl.java b/substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/hosted/MethodMetadataEncoderImpl.java index 80d526fce5d4..276a118393d9 100644 --- a/substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/hosted/MethodMetadataEncoderImpl.java +++ b/substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/hosted/MethodMetadataEncoderImpl.java @@ -24,8 +24,6 @@ */ package com.oracle.svm.reflect.hosted; -// Checkstyle: allow reflection - import java.lang.annotation.Annotation; import java.lang.reflect.AnnotatedElement; import java.lang.reflect.Constructor; diff --git a/substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/hosted/ReflectionDataBuilder.java b/substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/hosted/ReflectionDataBuilder.java index 36455d524d25..0386f04eda0e 100644 --- a/substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/hosted/ReflectionDataBuilder.java +++ b/substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/hosted/ReflectionDataBuilder.java @@ -24,8 +24,6 @@ */ package com.oracle.svm.reflect.hosted; -//Checkstyle: allow reflection - import java.lang.annotation.Annotation; import java.lang.reflect.AnnotatedElement; import java.lang.reflect.Constructor; @@ -51,7 +49,6 @@ import java.util.function.Predicate; import java.util.stream.Collectors; -import com.oracle.svm.core.jdk.SealedClassSupport; import org.graalvm.compiler.debug.GraalError; import org.graalvm.nativeimage.ImageSingletons; import org.graalvm.nativeimage.hosted.Feature.DuringAnalysisAccess; @@ -67,6 +64,7 @@ import com.oracle.svm.core.hub.ClassForNameSupport; import com.oracle.svm.core.hub.DynamicHub; import com.oracle.svm.core.jdk.RecordSupport; +import com.oracle.svm.core.jdk.SealedClassSupport; import com.oracle.svm.core.jdk.proxy.DynamicProxyRegistry; import com.oracle.svm.core.util.UserError; import com.oracle.svm.core.util.VMError; @@ -618,9 +616,7 @@ private static void reportLinkingErrors(Class clazz, List errors) } String messages = errors.stream().map(e -> e.getClass().getTypeName() + ": " + e.getMessage()) .distinct().collect(Collectors.joining(", ")); - // Checkstyle: stop System.out.println("Warning: Could not register complete reflection metadata for " + clazz.getTypeName() + ". Reason(s): " + messages); - // Checkstyle: resume } protected void afterAnalysis() { diff --git a/substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/hosted/ReflectionFeature.java b/substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/hosted/ReflectionFeature.java index 7415cb1cb516..3c92f9444e20 100644 --- a/substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/hosted/ReflectionFeature.java +++ b/substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/hosted/ReflectionFeature.java @@ -24,8 +24,6 @@ */ package com.oracle.svm.reflect.hosted; -// Checkstyle: allow reflection - import java.lang.invoke.MethodHandle; import java.lang.reflect.Executable; import java.lang.reflect.Field; diff --git a/substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/hosted/ReflectionGraphKit.java b/substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/hosted/ReflectionGraphKit.java index 6c679620abdd..f5575c2ba0cb 100644 --- a/substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/hosted/ReflectionGraphKit.java +++ b/substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/hosted/ReflectionGraphKit.java @@ -24,8 +24,6 @@ */ package com.oracle.svm.reflect.hosted; -// Checkstyle: allow reflection - import java.lang.reflect.Constructor; import java.lang.reflect.Executable; import java.lang.reflect.InvocationTargetException; diff --git a/substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/hosted/ReflectionObjectReplacer.java b/substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/hosted/ReflectionObjectReplacer.java index 0458ed3c755a..8fabaf6b61ee 100644 --- a/substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/hosted/ReflectionObjectReplacer.java +++ b/substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/hosted/ReflectionObjectReplacer.java @@ -24,8 +24,6 @@ */ package com.oracle.svm.reflect.hosted; -//Checkstyle: allow reflection - import java.lang.reflect.AccessibleObject; import java.lang.reflect.Executable; import java.lang.reflect.Field; diff --git a/substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/hosted/ReflectiveInvokeMethod.java b/substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/hosted/ReflectiveInvokeMethod.java index 457183385bdb..bc1deb865815 100644 --- a/substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/hosted/ReflectiveInvokeMethod.java +++ b/substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/hosted/ReflectiveInvokeMethod.java @@ -24,8 +24,6 @@ */ package com.oracle.svm.reflect.hosted; -// Checkstyle: allow reflection - import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_0; import static org.graalvm.compiler.nodeinfo.NodeSize.SIZE_0; diff --git a/substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/proxy/DynamicProxySupport.java b/substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/proxy/DynamicProxySupport.java index 45767b80586b..0038bd48f8f4 100644 --- a/substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/proxy/DynamicProxySupport.java +++ b/substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/proxy/DynamicProxySupport.java @@ -24,8 +24,6 @@ */ package com.oracle.svm.reflect.proxy; -// Checkstyle: allow reflection - import java.lang.reflect.InvocationHandler; import java.util.Arrays; import java.util.Map; diff --git a/substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/serialize/SerializationSupport.java b/substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/serialize/SerializationSupport.java index cf33577a2ad9..e306c5c9ba0c 100644 --- a/substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/serialize/SerializationSupport.java +++ b/substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/serialize/SerializationSupport.java @@ -26,10 +26,8 @@ package com.oracle.svm.reflect.serialize; import java.io.Serializable; -// Checkstyle: stop import java.lang.reflect.Constructor; import java.lang.reflect.Modifier; -// Checkstyle: resume import java.util.Map; import java.util.Objects; import java.util.concurrent.ConcurrentHashMap; diff --git a/substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/serialize/hosted/SerializationFeature.java b/substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/serialize/hosted/SerializationFeature.java index c47ce387f6bb..84206f23b04e 100644 --- a/substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/serialize/hosted/SerializationFeature.java +++ b/substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/serialize/hosted/SerializationFeature.java @@ -25,8 +25,6 @@ */ package com.oracle.svm.reflect.serialize.hosted; -// Checkstyle: allow reflection - import static com.oracle.svm.reflect.serialize.hosted.SerializationFeature.println; import java.io.Externalizable; @@ -123,9 +121,7 @@ public void beforeCompilation(BeforeCompilationAccess access) { } static void println(String str) { - // Checkstyle: stop System.out.println(str); - // Checkstyle: resume } } diff --git a/substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/target/MethodMetadataDecoderImpl.java b/substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/target/MethodMetadataDecoderImpl.java index 66fb20da6bca..d140c440f1e2 100644 --- a/substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/target/MethodMetadataDecoderImpl.java +++ b/substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/target/MethodMetadataDecoderImpl.java @@ -24,8 +24,6 @@ */ package com.oracle.svm.reflect.target; -// Checkstyle: allow reflection - import java.lang.reflect.Array; import java.lang.reflect.Executable; import java.util.ArrayList; diff --git a/substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/target/MethodMetadataEncoding.java b/substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/target/MethodMetadataEncoding.java index e67b880f796a..f5945a6e2989 100644 --- a/substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/target/MethodMetadataEncoding.java +++ b/substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/target/MethodMetadataEncoding.java @@ -24,8 +24,6 @@ */ package com.oracle.svm.reflect.target; -// Checkstyle: allow reflection - import org.graalvm.nativeimage.Platform; import org.graalvm.nativeimage.Platforms; diff --git a/substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/target/Target_java_lang_reflect_AccessibleObject.java b/substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/target/Target_java_lang_reflect_AccessibleObject.java index c075366d4b5e..e988e4f00540 100644 --- a/substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/target/Target_java_lang_reflect_AccessibleObject.java +++ b/substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/target/Target_java_lang_reflect_AccessibleObject.java @@ -24,10 +24,7 @@ */ package com.oracle.svm.reflect.target; -// Checkstyle: stop - import java.lang.reflect.AccessibleObject; -// Checkstyle: resume import com.oracle.svm.core.annotate.Alias; import com.oracle.svm.core.annotate.RecomputeFieldValue; diff --git a/substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/target/Target_java_lang_reflect_Constructor.java b/substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/target/Target_java_lang_reflect_Constructor.java index 30f8f1b59675..4527c1b7ac15 100644 --- a/substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/target/Target_java_lang_reflect_Constructor.java +++ b/substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/target/Target_java_lang_reflect_Constructor.java @@ -24,8 +24,6 @@ */ package com.oracle.svm.reflect.target; -// Checkstyle: allow reflection - import static com.oracle.svm.core.annotate.TargetElement.CONSTRUCTOR_NAME; import java.lang.annotation.Annotation; diff --git a/substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/target/Target_java_lang_reflect_Executable.java b/substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/target/Target_java_lang_reflect_Executable.java index ee835a2a9a79..d9345e90d191 100644 --- a/substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/target/Target_java_lang_reflect_Executable.java +++ b/substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/target/Target_java_lang_reflect_Executable.java @@ -24,8 +24,6 @@ */ package com.oracle.svm.reflect.target; -// Checkstyle: allow reflection - import java.lang.annotation.Annotation; import java.lang.reflect.AnnotatedElement; import java.lang.reflect.AnnotatedType; @@ -128,7 +126,6 @@ Map, Annotation> declaredAnnotations() { if (!MethodMetadataDecoderImpl.hasQueriedMethods()) { throw VMError.shouldNotReachHere(); } - // Checkstyle: stop synchronized (this) { if ((declAnnos = declaredAnnotations) == null) { Target_java_lang_reflect_Executable holder = ReflectionHelper.getHolder(this); @@ -139,7 +136,6 @@ Map, Annotation> declaredAnnotations() { declaredAnnotations = declAnnos; } } - // Checkstyle: resume } return declAnnos; } diff --git a/substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/target/Target_java_lang_reflect_Field.java b/substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/target/Target_java_lang_reflect_Field.java index 7d7ba64dc7da..7df97126af7e 100644 --- a/substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/target/Target_java_lang_reflect_Field.java +++ b/substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/target/Target_java_lang_reflect_Field.java @@ -24,8 +24,6 @@ */ package com.oracle.svm.reflect.target; -// Checkstyle: allow reflection - import java.lang.annotation.Annotation; import java.lang.reflect.AnnotatedType; import java.lang.reflect.Field; diff --git a/substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/target/Target_java_lang_reflect_Method.java b/substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/target/Target_java_lang_reflect_Method.java index d988a72df061..6163dfe0e6e9 100644 --- a/substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/target/Target_java_lang_reflect_Method.java +++ b/substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/target/Target_java_lang_reflect_Method.java @@ -24,8 +24,6 @@ */ package com.oracle.svm.reflect.target; -// Checkstyle: allow reflection - import static com.oracle.svm.core.annotate.TargetElement.CONSTRUCTOR_NAME; import java.lang.annotation.Annotation; diff --git a/substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/target/Target_java_lang_reflect_Parameter.java b/substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/target/Target_java_lang_reflect_Parameter.java index cc74d34a0c13..d4483747a870 100644 --- a/substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/target/Target_java_lang_reflect_Parameter.java +++ b/substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/target/Target_java_lang_reflect_Parameter.java @@ -24,8 +24,6 @@ */ package com.oracle.svm.reflect.target; -// Checkstyle: allow reflection - import java.lang.reflect.Parameter; import com.oracle.svm.core.annotate.Alias; diff --git a/substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/target/Target_java_lang_reflect_ReflectAccess.java b/substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/target/Target_java_lang_reflect_ReflectAccess.java index f03f6666b6b2..a240a6c7d8cb 100644 --- a/substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/target/Target_java_lang_reflect_ReflectAccess.java +++ b/substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/target/Target_java_lang_reflect_ReflectAccess.java @@ -24,8 +24,6 @@ */ package com.oracle.svm.reflect.target; -// Checkstyle: allow reflection - import com.oracle.svm.core.SubstrateUtil; import com.oracle.svm.core.annotate.Substitute; import com.oracle.svm.core.annotate.TargetClass; diff --git a/substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/target/Target_jdk_internal_misc_Unsafe_Reflection.java b/substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/target/Target_jdk_internal_misc_Unsafe_Reflection.java index e9583fa2bdbe..9b7eb71c316a 100644 --- a/substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/target/Target_jdk_internal_misc_Unsafe_Reflection.java +++ b/substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/target/Target_jdk_internal_misc_Unsafe_Reflection.java @@ -25,8 +25,6 @@ package com.oracle.svm.reflect.target; -// Checkstyle: allow reflection - import java.lang.reflect.Field; import com.oracle.svm.core.StaticFieldsSupport; diff --git a/substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/target/Target_jdk_internal_reflect_ConstantPool.java b/substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/target/Target_jdk_internal_reflect_ConstantPool.java index 8af00942d70c..722282ca1dcb 100644 --- a/substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/target/Target_jdk_internal_reflect_ConstantPool.java +++ b/substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/target/Target_jdk_internal_reflect_ConstantPool.java @@ -24,8 +24,6 @@ */ package com.oracle.svm.reflect.target; -// Checkstyle: allow reflection - import static com.oracle.svm.core.util.VMError.unimplemented; import java.lang.reflect.Field; diff --git a/substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/target/Target_sun_reflect_annotation_AnnotationParser.java b/substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/target/Target_sun_reflect_annotation_AnnotationParser.java index ce03cc41600b..9032338213bd 100644 --- a/substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/target/Target_sun_reflect_annotation_AnnotationParser.java +++ b/substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/target/Target_sun_reflect_annotation_AnnotationParser.java @@ -24,8 +24,6 @@ */ package com.oracle.svm.reflect.target; -// Checkstyle: allow reflection - import java.lang.annotation.Annotation; import java.lang.annotation.AnnotationFormatError; import java.lang.annotation.RetentionPolicy; diff --git a/substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/target/Target_sun_reflect_annotation_TypeAnnotationParser.java b/substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/target/Target_sun_reflect_annotation_TypeAnnotationParser.java index a7917c830787..432d09b858e5 100644 --- a/substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/target/Target_sun_reflect_annotation_TypeAnnotationParser.java +++ b/substratevm/src/com.oracle.svm.reflect/src/com/oracle/svm/reflect/target/Target_sun_reflect_annotation_TypeAnnotationParser.java @@ -24,8 +24,6 @@ */ package com.oracle.svm.reflect.target; -// Checkstyle: allow reflection - import java.lang.reflect.AnnotatedElement; import java.lang.reflect.AnnotatedType; import java.lang.reflect.Type; diff --git a/substratevm/src/com.oracle.svm.test/src/com/oracle/svm/test/ArraySetTest.java b/substratevm/src/com.oracle.svm.test/src/com/oracle/svm/test/ArraySetTest.java index 2d57909ed8a6..7f62c0b5065c 100644 --- a/substratevm/src/com.oracle.svm.test/src/com/oracle/svm/test/ArraySetTest.java +++ b/substratevm/src/com.oracle.svm.test/src/com/oracle/svm/test/ArraySetTest.java @@ -24,8 +24,6 @@ */ package com.oracle.svm.test; -// Checkstyle: allow reflection - import java.lang.reflect.Array; import org.junit.Assert; diff --git a/substratevm/src/com.oracle.svm.test/src/com/oracle/svm/test/SecurityServiceTest.java b/substratevm/src/com.oracle.svm.test/src/com/oracle/svm/test/SecurityServiceTest.java index 8856e14bba47..b2ab9d8a011c 100644 --- a/substratevm/src/com.oracle.svm.test/src/com/oracle/svm/test/SecurityServiceTest.java +++ b/substratevm/src/com.oracle.svm.test/src/com/oracle/svm/test/SecurityServiceTest.java @@ -35,10 +35,8 @@ import org.junit.Assert; import org.junit.Test; -// Checkstyle: stop import sun.security.jca.GetInstance; -// Checkstyle: resume /** * Tests the {@code SecurityServicesFeature}. */ diff --git a/substratevm/src/com.oracle.svm.test/src/com/oracle/svm/test/jfr/LocalJFR.java b/substratevm/src/com.oracle.svm.test/src/com/oracle/svm/test/jfr/LocalJFR.java index 0b34188d7f43..0ad133a7717f 100644 --- a/substratevm/src/com.oracle.svm.test/src/com/oracle/svm/test/jfr/LocalJFR.java +++ b/substratevm/src/com.oracle.svm.test/src/com/oracle/svm/test/jfr/LocalJFR.java @@ -67,9 +67,7 @@ public void endRecording(Recording recording) { public void cleanupRecording(Recording recording) throws IOException { String debugRecording = System.getenv("DEBUG_RECORDING"); if (debugRecording != null && !"false".equals(debugRecording)) { - // Checkstyle: stop System.out.println("Recording: " + recording.getDestination()); - // Checkstyle: resume } else { Files.deleteIfExists(recording.getDestination()); } diff --git a/substratevm/src/com.oracle.svm.test/src/com/oracle/svm/test/proxy/CustomInvocationHandler.java b/substratevm/src/com.oracle.svm.test/src/com/oracle/svm/test/proxy/CustomInvocationHandler.java index d64b9e950f9e..2efbf7d0be5a 100644 --- a/substratevm/src/com.oracle.svm.test/src/com/oracle/svm/test/proxy/CustomInvocationHandler.java +++ b/substratevm/src/com.oracle.svm.test/src/com/oracle/svm/test/proxy/CustomInvocationHandler.java @@ -25,10 +25,8 @@ package com.oracle.svm.test.proxy; -// Checkstyle: stop import java.lang.reflect.InvocationHandler; import java.lang.reflect.Method; -// Checkstyle: resume public class CustomInvocationHandler implements InvocationHandler { @Override diff --git a/substratevm/src/com.oracle.svm.test/src/com/oracle/svm/test/proxy/ProxyExceptionTest.java b/substratevm/src/com.oracle.svm.test/src/com/oracle/svm/test/proxy/ProxyExceptionTest.java index e5a33b371bff..1f1fc829bc36 100644 --- a/substratevm/src/com.oracle.svm.test/src/com/oracle/svm/test/proxy/ProxyExceptionTest.java +++ b/substratevm/src/com.oracle.svm.test/src/com/oracle/svm/test/proxy/ProxyExceptionTest.java @@ -25,11 +25,9 @@ package com.oracle.svm.test.proxy; -import org.junit.Test; - -// Checkstyle: stop import java.lang.reflect.Proxy; -// Checkstyle: resume + +import org.junit.Test; public class ProxyExceptionTest { diff --git a/substratevm/src/com.oracle.svm.test/src/hello/Target_hello_Hello_DefaultGreeter.java b/substratevm/src/com.oracle.svm.test/src/hello/Target_hello_Hello_DefaultGreeter.java index 3ae0d2cc9dd5..4149a746115f 100644 --- a/substratevm/src/com.oracle.svm.test/src/hello/Target_hello_Hello_DefaultGreeter.java +++ b/substratevm/src/com.oracle.svm.test/src/hello/Target_hello_Hello_DefaultGreeter.java @@ -64,8 +64,6 @@ private static void staticInlineGreet() { @NeverInline("For testing purposes") private static void nestedGreet() { - // Checkstyle: stop System.out.println("Hello, substituted world!"); - // Checkstyle: resume } } diff --git a/substratevm/src/com.oracle.svm.truffle.nfi.posix/src/com/oracle/svm/truffle/nfi/posix/PosixTruffleNFIFeature.java b/substratevm/src/com.oracle.svm.truffle.nfi.posix/src/com/oracle/svm/truffle/nfi/posix/PosixTruffleNFIFeature.java index 51f23a72306a..b1a3f08f8b92 100644 --- a/substratevm/src/com.oracle.svm.truffle.nfi.posix/src/com/oracle/svm/truffle/nfi/posix/PosixTruffleNFIFeature.java +++ b/substratevm/src/com.oracle.svm.truffle.nfi.posix/src/com/oracle/svm/truffle/nfi/posix/PosixTruffleNFIFeature.java @@ -114,7 +114,6 @@ private static PointerBase loadLibraryInNamespace(long nativeContext, String nam // Double-checked locking on the NFI context instance. long namespaceId = context.isolatedNamespaceId; if (namespaceId == 0) { - // Checkstyle: allow synchronization synchronized (context) { namespaceId = context.isolatedNamespaceId; if (namespaceId == 0) { diff --git a/substratevm/src/com.oracle.svm.truffle.nfi/src/com/oracle/svm/truffle/nfi/NativeObjectReplacer.java b/substratevm/src/com.oracle.svm.truffle.nfi/src/com/oracle/svm/truffle/nfi/NativeObjectReplacer.java index ac6e8aeff0cf..de26237b6a0c 100644 --- a/substratevm/src/com.oracle.svm.truffle.nfi/src/com/oracle/svm/truffle/nfi/NativeObjectReplacer.java +++ b/substratevm/src/com.oracle.svm.truffle.nfi/src/com/oracle/svm/truffle/nfi/NativeObjectReplacer.java @@ -24,8 +24,7 @@ */ package com.oracle.svm.truffle.nfi; -//Checkstyle: allow reflection - +import java.lang.reflect.Field; import java.util.IdentityHashMap; import java.util.function.Function; @@ -34,7 +33,6 @@ import com.oracle.graal.pointsto.constraints.UnsupportedFeatureException; import com.oracle.svm.core.util.VMError; import com.oracle.svm.util.ClassUtil; -import java.lang.reflect.Field; /** * Fields that contain native pointers can not be part of the image heap, because the native diff --git a/substratevm/src/com.oracle.svm.truffle.tck/src/com/oracle/svm/truffle/tck/PermissionsFeature.java b/substratevm/src/com.oracle.svm.truffle.tck/src/com/oracle/svm/truffle/tck/PermissionsFeature.java index b152ad747b6a..a5e5b70a182f 100644 --- a/substratevm/src/com.oracle.svm.truffle.tck/src/com/oracle/svm/truffle/tck/PermissionsFeature.java +++ b/substratevm/src/com.oracle.svm.truffle.tck/src/com/oracle/svm/truffle/tck/PermissionsFeature.java @@ -242,9 +242,7 @@ public void afterAnalysis(AfterAnalysisAccess access) { private static Class loadClassOrFail(String className) { try { - // Checkstyle: stop return Class.forName(className); - // Checkstyle: resume } catch (ClassNotFoundException e) { throw JVMCIError.shouldNotReachHere(e); } 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 689f005c6f55..1206dac4b2fe 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 @@ -24,8 +24,6 @@ */ package com.oracle.svm.truffle; -//Checkstyle: allow reflection - import static com.oracle.svm.core.util.VMError.shouldNotReachHere; import java.lang.annotation.Annotation; @@ -129,9 +127,7 @@ public boolean getAsBoolean() { public static final class IsCreateProcessDisabled implements BooleanSupplier { static boolean query() { try { - // Checkstyle: stop Class clazz = Class.forName("com.oracle.truffle.polyglot.PolyglotEngineImpl"); - // Checkstyle: resume final boolean allowCreateProcess = ReflectionUtil.readField(clazz, "ALLOW_CREATE_PROCESS", null); return !allowCreateProcess; } catch (ReflectiveOperationException e) { @@ -147,13 +143,11 @@ public boolean getAsBoolean() { } } - // Checkstyle: stop private ClassLoader imageClassLoader; private AnalysisMetaAccess metaAccess; private GraalObjectReplacer graalObjectReplacer; private final Set> registeredClasses = new HashSet<>(); private boolean profilingEnabled; - // Checkstyle: resume private static void initializeTruffleReflectively(ClassLoader imageClassLoader) { invokeStaticMethod("com.oracle.truffle.api.impl.Accessor", "getTVMCI", Collections.emptyList()); @@ -174,9 +168,7 @@ public static void removeTruffleLanguage(String mimeType) { static T invokeStaticMethod(String className, String methodName, Collection> parameterTypes, Object... args) { try { - // Checkstyle: stop Class clazz = Class.forName(className); - // Checkstyle: resume Method method = ReflectionUtil.lookupMethod(clazz, methodName, parameterTypes.toArray(new Class[0])); return (T) method.invoke(null, args); } catch (ReflectiveOperationException e) { @@ -555,9 +547,7 @@ private static void generate(Class storageSuperClass, Class factoryInterfa BeforeAnalysisAccess access) { try { validateClasses(storageSuperClass, factoryInterface); - // Checkstyle: stop do not use ClassLoader objects ClassLoader generatorCL = getGeneratorClassLoader(factoryInterface); - // Checkstyle: resume getGetShapeGenerator(generatorCL, storageSuperClass, factoryInterface); } catch (ReflectiveOperationException e) { if (e instanceof InvocationTargetException && e.getCause() instanceof IllegalArgumentException) { @@ -572,7 +562,6 @@ private static void validateClasses(Class storageSuperClass, Class factory VALIDATE_CLASSES.invoke(null, storageSuperClass, factoryInterface); } - // Checkstyle: stop do not use ClassLoader objects private static ClassLoader getGeneratorClassLoader(Class factoryInterface) throws ReflectiveOperationException { ClassLoader cl = CLASS_LOADERS.get(factoryInterface); if (cl == null) { @@ -584,7 +573,6 @@ private static ClassLoader getGeneratorClassLoader(Class factoryInterface) th } return cl; } - // Checkstyle: resume /* * Triggers shape generation. @@ -594,7 +582,6 @@ private static void getGetShapeGenerator(ClassLoader generatorCL, Class stora GET_SHAPE_GENERATOR.invoke(null, null, generatorCL, storageSuperClass, factoryInterface, storageClassName); } - // Checkstyle: stop do not use dynamic class loading private static Class loadClass(String name) { try { return Class.forName(name); @@ -602,7 +589,6 @@ private static Class loadClass(String name) { throw VMError.shouldNotReachHere(e); } } - // Checkstyle: resume } } @@ -648,9 +634,7 @@ public static final class OffsetTransformer implements RecomputeFieldValue.Custo private static final Method GET_PROPERTY_TYPE; static { - // Checkstyle: stop GET_PROPERTY_TYPE = ReflectionUtil.lookupMethod(StaticProperty.class, "getPropertyType"); - // Checkstyle: resume } @Override @@ -674,9 +658,7 @@ public Object transform(MetaAccessProvider metaAccess, ResolvedJavaField origina Class propertyType; try { - // Checkstyle: stop propertyType = (Class) GET_PROPERTY_TYPE.invoke(receiverStaticProperty); - // Checkstyle: resume } catch (IllegalAccessException | InvocationTargetException e) { throw VMError.shouldNotReachHere(e); } @@ -722,13 +704,11 @@ public static final class OffsetTransformer implements RecomputeFieldValue.Custo private static final Class SHAPE_GENERATOR; static { - // Checkstyle: stop try { SHAPE_GENERATOR = Class.forName("com.oracle.truffle.api.staticobject.ArrayBasedShapeGenerator"); } catch (ClassNotFoundException e) { throw VMError.shouldNotReachHere(e); } - // Checkstyle: resume } @Override @@ -769,8 +749,6 @@ public Object transform(MetaAccessProvider metaAccess, ResolvedJavaField origina int shapeOffset; } -// Checkstyle: stop - /* * If allowProcess() is disabled at build time, then we ensure that ProcessBuilder is not reachable. * The main purpose of this is to test that ProcessBuilder is not part of the image when building diff --git a/substratevm/src/com.oracle.svm.truffle/src/com/oracle/svm/truffle/TruffleFeature.java b/substratevm/src/com.oracle.svm.truffle/src/com/oracle/svm/truffle/TruffleFeature.java index e604eeffa13f..3d18cbcacd01 100644 --- a/substratevm/src/com.oracle.svm.truffle/src/com/oracle/svm/truffle/TruffleFeature.java +++ b/substratevm/src/com.oracle.svm.truffle/src/com/oracle/svm/truffle/TruffleFeature.java @@ -25,8 +25,6 @@ package com.oracle.svm.truffle; -//Checkstyle: allow reflection - import static org.graalvm.compiler.java.BytecodeParserOptions.InlineDuringParsingMaxDepth; import static org.graalvm.compiler.nodes.graphbuilderconf.InlineInvokePlugin.InlineInfo.createStandardInlineInfo; diff --git a/substratevm/src/com.oracle.svm.truffle/src/com/oracle/svm/truffle/api/SubstrateTruffleRuntime.java b/substratevm/src/com.oracle.svm.truffle/src/com/oracle/svm/truffle/api/SubstrateTruffleRuntime.java index 3873f774e353..f4220043ea54 100644 --- a/substratevm/src/com.oracle.svm.truffle/src/com/oracle/svm/truffle/api/SubstrateTruffleRuntime.java +++ b/substratevm/src/com.oracle.svm.truffle/src/com/oracle/svm/truffle/api/SubstrateTruffleRuntime.java @@ -231,14 +231,12 @@ public OptimizedCallTarget createOptimizedCallTarget(OptimizedCallTarget source, private void ensureInitializedAtRuntime(OptimizedCallTarget callTarget) { if (!SubstrateUtil.HOSTED && !initialized) { - // Checkstyle: stop synchronized (this) { if (!initialized) { initializeAtRuntime(callTarget); initialized = true; } } - // Checkstyle: resume } } diff --git a/substratevm/src/com.oracle.svm.util/src/com/oracle/svm/util/ReflectionUtil.java b/substratevm/src/com.oracle.svm.util/src/com/oracle/svm/util/ReflectionUtil.java index 8b40bf12d983..092a745c2929 100644 --- a/substratevm/src/com.oracle.svm.util/src/com/oracle/svm/util/ReflectionUtil.java +++ b/substratevm/src/com.oracle.svm.util/src/com/oracle/svm/util/ReflectionUtil.java @@ -24,8 +24,6 @@ */ package com.oracle.svm.util; -// Checkstyle: allow reflection - import java.lang.reflect.Constructor; import java.lang.reflect.Field; import java.lang.reflect.Method; diff --git a/substratevm/src/org.graalvm.polyglot.nativeapi/src/org/graalvm/polyglot/nativeapi/PolyglotNativeAPIFeature.java b/substratevm/src/org.graalvm.polyglot.nativeapi/src/org/graalvm/polyglot/nativeapi/PolyglotNativeAPIFeature.java index 5fadabe1e27c..b7a65d588c14 100644 --- a/substratevm/src/org.graalvm.polyglot.nativeapi/src/org/graalvm/polyglot/nativeapi/PolyglotNativeAPIFeature.java +++ b/substratevm/src/org.graalvm.polyglot.nativeapi/src/org/graalvm/polyglot/nativeapi/PolyglotNativeAPIFeature.java @@ -69,19 +69,15 @@ public void afterImageWrite(AfterImageWriteAccess access) { // on Darwin, change the `id` install name String id = System.getProperty("org.graalvm.polyglot.install_name_id"); if (id == null) { - // Checkstyle: stop This is Hosted-only code String msg = String.format("Warning: no id passed through `org.graalvm.polyglot.install_name_id`:" + "\n%s might include its absolute path as id (see man install_name_tool)", imagePath); System.err.println(msg); - // Checkstyle: resume } else { List command = Arrays.asList("install_name_tool", "-id", id, imagePath.toString()); try { int exitCode = FileUtils.executeCommand(command); if (exitCode != 0) { - // Checkstyle: stop This is Hosted-only code System.err.printf("Failed to set `id` install name. install_name_tool exited with code %d%n", exitCode); - // Checkstyle: resume } } catch (IOException e) { throw new RuntimeException(e); From 8f452044d2560bc2ad1a953f20a246595cbc3344 Mon Sep 17 00:00:00 2001 From: Christian Wimmer Date: Fri, 7 Jan 2022 13:04:21 -0800 Subject: [PATCH 4/4] Remove unnecessary @formatter comments --- .../graal/pointsto/meta/AnalysisField.java | 32 ------------ .../oracle/objectfile/elf/ELFObjectFile.java | 16 +++--- .../objectfile/macho/MachOObjectFile.java | 49 ++++++------------- .../macho/MachORelocationElement.java | 8 ++- .../macho/MachOUserDefinedSection.java | 4 +- .../objectfile/pecoff/PECoffMachine.java | 7 +-- .../oracle/svm/core/genscavenge/HeapImpl.java | 2 - .../core/genscavenge/ObjectHeaderImpl.java | 19 +++---- .../com/oracle/svm/core/SubstrateUtil.java | 4 +- .../svm/core/jdk/JavaAWTSubstitutions.java | 6 +-- .../hotspot/libgraal/LibGraalFeature.java | 12 ++--- .../src/com/oracle/svm/jni/JNIJavaVMList.java | 3 +- 12 files changed, 45 insertions(+), 117 deletions(-) diff --git a/substratevm/src/com.oracle.graal.pointsto/src/com/oracle/graal/pointsto/meta/AnalysisField.java b/substratevm/src/com.oracle.graal.pointsto/src/com/oracle/graal/pointsto/meta/AnalysisField.java index f0d11729a2be..215cca5093e5 100644 --- a/substratevm/src/com.oracle.graal.pointsto/src/com/oracle/graal/pointsto/meta/AnalysisField.java +++ b/substratevm/src/com.oracle.graal.pointsto/src/com/oracle/graal/pointsto/meta/AnalysisField.java @@ -208,38 +208,6 @@ public TypeState getInstanceFieldTypeState() { return interceptTypeState(instanceFieldFlow.getState()); } - // @formatter:off -// public TypeState getInstanceFieldTypeState() { -// if (instanceFieldTypeState == null) { -// -// /* Collect the types of all instance field flows. */ -// HashSet fieldTypes = new HashSet<>(); -// boolean fieldCanBeNull = false; -// -// fieldCanBeNull = collectInstanceFieldTypes(getDeclaringClass(), fieldTypes); -// instanceFieldTypeState = TypeState.forExactTypes(null, new ArrayList<>(fieldTypes), fieldCanBeNull); -// -// } -// return instanceFieldTypeState; -// } - -// private boolean collectInstanceFieldTypes(AnalysisType type, HashSet fieldTypes) { -// boolean fieldCanBeNull = false; -// -// TypeFlow fieldFlow = type.getAbstractObject().getInstanceFieldFlow(null, this, false); -// if (fieldFlow != null) { -// TypeState mergedState = fieldFlow.getState(); -// mergedState.typesIterator().forEachRemaining(fieldTypes::add); -// fieldCanBeNull |= mergedState.canBeNull(); -// } -// -// for (AnalysisType subClass : type.subTypes) { -// fieldCanBeNull |= collectInstanceFieldTypes(subClass, fieldTypes); -// } -// return fieldCanBeNull; -// } - //@formatter:on - public FieldTypeFlow getInitialInstanceFieldFlow() { return initialInstanceFieldFlow; } diff --git a/substratevm/src/com.oracle.objectfile/src/com/oracle/objectfile/elf/ELFObjectFile.java b/substratevm/src/com.oracle.objectfile/src/com/oracle/objectfile/elf/ELFObjectFile.java index 2c64a93825c0..c48115c3c024 100644 --- a/substratevm/src/com.oracle.objectfile/src/com/oracle/objectfile/elf/ELFObjectFile.java +++ b/substratevm/src/com.oracle.objectfile/src/com/oracle/objectfile/elf/ELFObjectFile.java @@ -880,15 +880,13 @@ public String toString() { if (isNullEntry()) { return "SHT NULL Entry"; } - //@formatter:off - return new StringBuilder("SHT Entry: "). - append(String.format("\n %s", type)). - append(String.format("\n flags %#x", flags)). - append(String.format("\n virtual address %#x", virtualAddress)). - append(String.format("\n offset %#x (%1$d), size %d", fileOffset, sectionSize)). - append(String.format("\n link %#x, info %#x, align %#x, entry size %#x (%4$d)", link, info, addrAlign, entrySize)). - append("\n").toString(); - //@formatter:on + return new StringBuilder("SHT Entry: ") + .append(String.format("\n %s", type)) + .append(String.format("\n flags %#x", flags)) + .append(String.format("\n virtual address %#x", virtualAddress)) + .append(String.format("\n offset %#x (%1$d), size %d", fileOffset, sectionSize)) + .append(String.format("\n link %#x, info %#x, align %#x, entry size %#x (%4$d)", link, info, addrAlign, entrySize)) + .append("\n").toString(); } public boolean isNullEntry() { 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 f453c86bbdec..a66a0f80ddb3 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 @@ -42,6 +42,9 @@ import java.util.stream.Collectors; import java.util.stream.Stream; +import org.graalvm.nativeimage.ImageSingletons; +import org.graalvm.nativeimage.Platform; + import com.oracle.objectfile.BasicProgbitsSectionImpl; import com.oracle.objectfile.BuildDependency; import com.oracle.objectfile.ElementImpl; @@ -52,8 +55,6 @@ import com.oracle.objectfile.SymbolTable; import com.oracle.objectfile.io.AssemblyBuffer; import com.oracle.objectfile.io.OutputAssembler; -import org.graalvm.nativeimage.ImageSingletons; -import org.graalvm.nativeimage.Platform; /** * Models a Mach-O relocatable object file. @@ -1280,28 +1281,12 @@ private int overapproximateSize() { return size; } - //@formatter:off -// @Override -// public int getOrDecideSize(Map alreadyDecided, int sizeHint) { -// /* -// * HACK HACK HACK: since the content is ULEB128 variable-length-encoded, we need to -// * compute our content before we can compute our size. BUT this gives us cyclic build -// * dependencies because of Mach-O's messed-up segment structure (FIXME: find out exactly -// * what is creating the cycles). So we overapproximate our size based on the biggest -// * function-to-function offset we think is likely. -// */ -// return overapproximateSize(); -// } - //@formatter:on - - //@formatter:off @Override public int getOrDecideSize(java.util.Map alreadyDecided, int sizeHint) { Object decidedContent = alreadyDecided.get(this).getDecidedValue(LayoutDecision.Kind.CONTENT); assert decidedContent != null; return ((byte[]) decidedContent).length; } - //@formatter:on @Override public Iterable getDependencies(Map decisions) { @@ -1520,8 +1505,7 @@ public long value() { public abstract class MachOSection extends ObjectFile.Section { - // @formatter:off - /* We have no fields except type & flags! Mach-O section64 struct's fields are + /*- We have no fields except type & flags! Mach-O section64 struct's fields are * modelled as follows: * sectname: in the ObjectFile's element name map * segname: explicitly if relocatable file, else in the ObjectFile's segments list @@ -1534,7 +1518,6 @@ public abstract class MachOSection extends ObjectFile.Section { * flags: we DO have this one * reserved1, reserved2: saved for a "symbol stub section" subclass, if we need it */ - // @formatter:on SectionType type; EnumSet flags; @@ -2019,20 +2002,18 @@ protected void writePayload(OutputAssembler db, final Map CrashAtIsFatal = new RuntimeOptionKey<>(false); @Option(help = "The fully qualified name of a no-arg, void, static method to be invoked " + - "in HotSpot from libgraal when the libgraal isolate is being shutdown." + - "This option exists for the purpose of testing callbacks in this context.") - static final RuntimeOptionKey OnShutdownCallback = new RuntimeOptionKey<>(null); - // @formatter:on + "in HotSpot from libgraal when the libgraal isolate is being shutdown." + + "This option exists for the purpose of testing callbacks in this context.") // + static final RuntimeOptionKey OnShutdownCallback = new RuntimeOptionKey<>(null); } public final class LibGraalFeature implements com.oracle.svm.core.graal.GraalFeature { diff --git a/substratevm/src/com.oracle.svm.jni/src/com/oracle/svm/jni/JNIJavaVMList.java b/substratevm/src/com.oracle.svm.jni/src/com/oracle/svm/jni/JNIJavaVMList.java index 95250278efef..fdfda6682732 100644 --- a/substratevm/src/com.oracle.svm.jni/src/com/oracle/svm/jni/JNIJavaVMList.java +++ b/substratevm/src/com.oracle.svm.jni/src/com/oracle/svm/jni/JNIJavaVMList.java @@ -49,7 +49,7 @@ * never shrinks. */ public class JNIJavaVMList { - /* @formatter:off + /*- * * HEAD --> +------------------------+ * | capacity: UnsignedWord | @@ -62,7 +62,6 @@ public class JNIJavaVMList { * | ... | * | next | --> null * +----------+ - * @formatter:on */ private static final UnsignedWord INITIAL_CAPACITY = unsigned(8);