Skip to content

Commit 23ab4e1

Browse files
committed
[GR-45370] JDK 21 is LTS, remove JDK 17
PullRequest: truffleruby/3895
2 parents 00c67fc + d922087 commit 23ab4e1

File tree

514 files changed

+974
-902
lines changed

Some content is hidden

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

514 files changed

+974
-902
lines changed

ci.jsonnet

Lines changed: 117 additions & 112 deletions
Large diffs are not rendered by default.

mx.truffleruby/mx_truffleruby.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import pipes
1313
from os.path import join, exists, basename
1414
import shutil
15+
import sys
1516

1617
import mx
1718
import mx_gate
@@ -227,7 +228,7 @@ def ruby_spotbugs(args):
227228
spotbugsArgs = ['-textui', '-low', '-longBugCodes', '-include', filters]
228229
if mx.is_interactive():
229230
spotbugsArgs.append('-progress')
230-
mx_spotbugs.spotbugs(args, spotbugsArgs)
231+
sys.exit(mx_spotbugs.spotbugs(args, spotbugsArgs))
231232

232233
def verify_ci(args):
233234
"""Verify CI configuration"""

mx.truffleruby/spotbugs-filters.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
<Bug pattern="RC_REF_COMPARISON_BAD_PRACTICE_BOOLEAN" />
2525
<Bug pattern="BX_UNBOXING_IMMEDIATELY_REBOXED" /> <!-- used as a way to assert the type -->
2626
<Bug pattern="PZLA_PREFER_ZERO_LENGTH_ARRAYS" />
27+
<Bug pattern="ES_COMPARING_PARAMETER_STRING_WITH_EQ" />
28+
<Bug pattern="ES_COMPARING_STRINGS_WITH_EQ" />
2729
</Or>
2830
</Not>
2931
</Match>

src/launcher/java/org/truffleruby/launcher/RubyLauncher.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
import java.io.PrintStream;
1313
import java.io.IOException;
14+
import java.nio.charset.StandardCharsets;
1415
import java.util.ArrayList;
1516
import java.util.Arrays;
1617
import java.util.Collections;
@@ -195,7 +196,7 @@ protected boolean runLauncherAction() {
195196
.redirectOutput(Redirect.INHERIT) // set the output of the pager to the terminal and not a pipe
196197
.redirectError(Redirect.INHERIT) // set the error of the pager to the terminal and not a pipe
197198
.start();
198-
PrintStream out = new PrintStream(process.getOutputStream());
199+
PrintStream out = new PrintStream(process.getOutputStream(), false, StandardCharsets.UTF_8);
199200

200201
setOutput(out);
201202
boolean code = super.runLauncherAction();

src/main/java/org/truffleruby/RubyContext.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797
import com.oracle.truffle.api.source.Source;
9898
import sun.misc.SignalHandler;
9999

100-
public class RubyContext {
100+
public final class RubyContext {
101101

102102
private final RubyLanguage language;
103103
@CompilationFinal private TruffleLanguage.Env env;
@@ -528,7 +528,7 @@ private void dispose() {
528528
RubyLanguage.LOGGER.info(
529529
"Total VALUE object to native conversions: " + getValueWrapperManager().totalHandleAllocations());
530530
}
531-
valueWrapperManager.freeAllBlocksInMap(language);
531+
valueWrapperManager.freeAllBlocksInMap();
532532
}
533533

534534
public boolean isPreInitializing() {

src/main/java/org/truffleruby/RubyFileTypeDetector.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
import com.oracle.truffle.api.TruffleFile;
2727

28-
public class RubyFileTypeDetector implements TruffleFile.FileTypeDetector {
28+
public final class RubyFileTypeDetector implements TruffleFile.FileTypeDetector {
2929

3030
private static final String[] KNOWN_RUBY_FILES = new String[]{ "Gemfile", "Rakefile" };
3131
private static final String[] KNOWN_RUBY_SUFFIXES = new String[]{ ".rb", ".rake", ".gemspec" };

src/main/java/org/truffleruby/RubyLanguage.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ private RubyThread getOrCreateForeignThread(RubyContext context, Thread thread)
256256
public Thread cleanerThread = null;
257257
@CompilationFinal public Cleaner cleaner = null;
258258

259-
public volatile ValueWrapperManager.HandleBlockWeakReference[] handleBlockSharedMap = new ValueWrapperManager.HandleBlockWeakReference[0];
259+
@SuppressFBWarnings("VO_VOLATILE_REFERENCE_TO_ARRAY") public volatile ValueWrapperManager.HandleBlockWeakReference[] handleBlockSharedMap = new ValueWrapperManager.HandleBlockWeakReference[0];
260260
public final ValueWrapperManager.HandleBlockAllocator handleBlockAllocator = new ValueWrapperManager.HandleBlockAllocator();
261261

262262
@CompilationFinal public LanguageOptions options;

src/main/java/org/truffleruby/algorithms/Randomizer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
***** END LICENSE BLOCK *****/
2727
package org.truffleruby.algorithms;
2828

29-
public class Randomizer {
29+
public final class Randomizer {
3030

3131
private static final int N = 624;
3232
private static final int M = 397;

src/main/java/org/truffleruby/aot/ParserCache.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
import com.oracle.truffle.api.TruffleOptions;
3030

31-
public class ParserCache {
31+
public final class ParserCache {
3232

3333
public static final Map<String, RootParseNode> INSTANCE;
3434

src/main/java/org/truffleruby/builtins/CoreMethodNodeManager.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
import com.oracle.truffle.api.TruffleOptions;
5555
import com.oracle.truffle.api.dsl.NodeFactory;
5656

57-
public class CoreMethodNodeManager {
57+
public final class CoreMethodNodeManager {
5858

5959
private final RubyContext context;
6060
private final RubyLanguage language;
@@ -509,7 +509,7 @@ public static NodeFactory<? extends RubyBaseNode> loadNodeFactory(String nodeFac
509509
return (NodeFactory<? extends RubyBaseNode>) instance;
510510
}
511511

512-
public static class MethodDetails {
512+
public static final class MethodDetails {
513513

514514
private final String moduleName;
515515
private final CoreMethod methodAnnotation;

0 commit comments

Comments
 (0)