Skip to content

Commit

Permalink
8301569: jmod list option and jimage list --help not interpreted corr…
Browse files Browse the repository at this point in the history
…ectly on turkish locale

Reviewed-by: mchung, naoto, jpai
  • Loading branch information
Glavo authored and jaikiran committed Jun 29, 2023
1 parent 8f5a384 commit 6f58ab2
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/jdk.jlink/share/classes/jdk/tools/jimage/JImageTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ int run(String[] args) {
String[] remaining = args;
try {
command = args[0];
options.task = Enum.valueOf(Task.class, args[0].toUpperCase(Locale.ENGLISH));
options.task = Enum.valueOf(Task.class, args[0].toUpperCase(Locale.ROOT));
remaining = args.length > 1 ? Arrays.copyOfRange(args, 1, args.length)
: new String[0];
} catch (IllegalArgumentException ex) {
Expand Down Expand Up @@ -212,7 +212,7 @@ int run(String[] args) {
} else {
try {
log.println(TASK_HELPER.getMessage("main.usage." +
options.task.toString().toLowerCase()));
options.task.toString().toLowerCase(Locale.ROOT)));
} catch (MissingResourceException ex) {
throw TASK_HELPER.newBadArgs("err.not.a.task", command);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -810,7 +810,7 @@ private Archive newArchive(String module, Path path) {

try (Stream<Archive.Entry> entries = modularJarArchive.entries()) {
boolean hasSignatures = entries.anyMatch((entry) -> {
String name = entry.name().toUpperCase(Locale.ENGLISH);
String name = entry.name().toUpperCase(Locale.ROOT);

return name.startsWith("META-INF/") && name.indexOf('/', 9) == -1 && (
name.endsWith(".SF") ||
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2019, 2023, 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
Expand All @@ -25,6 +25,7 @@

package jdk.tools.jlink.internal.plugins;

import java.util.Locale;
import java.util.Map;
import jdk.internal.classfile.Classfile;
import jdk.internal.classfile.ClassTransform;
Expand Down Expand Up @@ -70,7 +71,7 @@ protected VersionPropsPlugin(String field, String option) {
* @param field The name of the java.lang.VersionProps field to be redefined
*/
protected VersionPropsPlugin(String field) {
this(field, field.toLowerCase().replace('_', '-'));
this(field, field.toLowerCase(Locale.ROOT).replace('_', '-'));
}

@Override
Expand Down
4 changes: 2 additions & 2 deletions src/jdk.jlink/share/classes/jdk/tools/jmod/JmodTask.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2023, 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
Expand Down Expand Up @@ -1471,7 +1471,7 @@ private void handleOptions(String[] args) {
throw new CommandException("err.missing.mode").showUsage(true);
String verb = words.get(0);
try {
options.mode = Enum.valueOf(Mode.class, verb.toUpperCase());
options.mode = Enum.valueOf(Mode.class, verb.toUpperCase(Locale.ROOT));
} catch (IllegalArgumentException e) {
throw new CommandException("err.invalid.mode", verb).showUsage(true);
}
Expand Down

1 comment on commit 6f58ab2

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.