Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8285517: System.getenv() returns unexpected value if environment variable has non ASCII character #8378

Closed
wants to merge 9 commits into from

Conversation

takiguc
Copy link

@takiguc takiguc commented Apr 24, 2022

On JDK19 with Linux ja_JP.eucjp locale,
System.getenv() returns unexpected value if environment variable has Japanese EUC characters.
It seems this issue happens because of JEP 400.
Arguments for ProcessBuilder have same kind of issue.


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed (1 review required, with at least 1 reviewer)

Issue

  • JDK-8285517: System.getenv() returns unexpected value if environment variable has non ASCII character

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/8378/head:pull/8378
$ git checkout pull/8378

Update a local copy of the PR:
$ git checkout pull/8378
$ git pull https://git.openjdk.java.net/jdk pull/8378/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 8378

View PR using the GUI difftool:
$ git pr show -t 8378

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/8378.diff

@bridgekeeper
Copy link

bridgekeeper bot commented Apr 24, 2022

👋 Welcome back itakiguchi! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk openjdk bot added the rfr Pull request is ready for review label Apr 24, 2022
@openjdk
Copy link

openjdk bot commented Apr 24, 2022

@takiguc The following label will be automatically applied to this pull request:

  • core-libs

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the core-libs core-libs-dev@openjdk.org label Apr 24, 2022
@mlbridge
Copy link

mlbridge bot commented Apr 24, 2022

Copy link
Member

@naotoj naotoj left a comment

Choose a reason for hiding this comment

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

Thanks for fixing the issue.
As to the test, it has lots of redundancy, and too complicated to me. Can you simplify the test?

@@ -142,11 +143,22 @@ static Platform get() {
private static final Platform platform = Platform.get();
private static final LaunchMechanism launchMechanism = platform.launchMechanism();
private static final byte[] helperpath = toCString(StaticProperty.javaHome() + "/lib/jspawnhelper");
private static Charset jnuCharset = null;
Copy link
Member

Choose a reason for hiding this comment

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

Can we simply call jnuCharset() here?

Copy link
Author

Choose a reason for hiding this comment

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

Change jnuCharset to "private static".

String nativeEncoding = System.getProperty("native.encoding");
String fileEncoding = System.getProperty("file.encoding");
Charset cs;
if (nativeEncoding != null && !nativeEncoding.equals(fileEncoding)) {
Copy link
Member

Choose a reason for hiding this comment

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

What's the reason for comparing file.encoding? Does Charset.forName(nativeEncoding, Charset.defaultCharset()) suffice?

Copy link
Author

Choose a reason for hiding this comment

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

Remove file.encoding related code.

final static int maxSize = 4096;

public static void main(String[] args) throws Exception {
ProcessBuilder pb = new ProcessBuilder(javeExe,
Copy link
Member

Choose a reason for hiding this comment

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

Can utilize jdk.test.lib.process.ProcessTools.

Copy link
Author

Choose a reason for hiding this comment

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

Use ProcessTools class.


/*
* @test
* @bug 8285517
Copy link
Member

Choose a reason for hiding this comment

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

If the test should work only on a particular env, should describe here and add @requires tag.

Copy link
Author

Choose a reason for hiding this comment

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

Add "@requires (os.family == "linux")"

Copy link
Member

Choose a reason for hiding this comment

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

Also @modules jdk.charsets should be added so that the test should be immediately ignored if it does not have EUC-JP charset.



final class ProcessEnvironment
{
private static final HashMap<Variable,Value> theEnvironment;
private static final Map<String,String> theUnmodifiableEnvironment;
static final int MIN_NAME_LENGTH = 0;
static final Charset cs = Charset.forName(StaticProperty.nativeEncoding(),
Copy link
Contributor

Choose a reason for hiding this comment

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

cs should have an all-CAPS name to make it clear its a static value throughout the implementation.
And private too.

Copy link
Author

Choose a reason for hiding this comment

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

Change to "private static final"

Class<?> cls = Class.forName("java.lang.ProcessEnvironment");
Method enviorn_mid = cls.getDeclaredMethod("environ");
enviorn_mid.setAccessible(true);
byte[][] environ = (byte[][]) enviorn_mid.invoke(null,
Copy link
Contributor

Choose a reason for hiding this comment

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

typo: "enviorn_mid" -> "environ_mid".

Copy link
Author

Choose a reason for hiding this comment

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

Fix typo

import java.util.StringJoiner;

public class i18nEnvArg {
final static String text = "\u6F22\u5B57";
Copy link
Contributor

Choose a reason for hiding this comment

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

Can this be renamed to indicate it is the string under test? like KANJI_TEXT or EUC_JP_TEXT or similar.

Copy link
Author

Choose a reason for hiding this comment

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

Use EUC_JP_TEXT

environ.put("LANG", "ja_JP.eucjp");
Process p = pb.start();
InputStream is = p.getInputStream();
byte[] ba = new byte[maxSize];
Copy link
Contributor

Choose a reason for hiding this comment

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

You can use InputStream.readAllBytes() here to return a byte buffer.

Its not clear why all the bytes are read? I assume its only for a possible error from the child.

Copy link
Author

Choose a reason for hiding this comment

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

Use InputStream.readAllBytes()

+ "java";
final static int maxSize = 4096;

public static void main(String[] args) throws Exception {
Copy link
Contributor

Choose a reason for hiding this comment

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

There are 3 main()'s in this test; it would be useful to add a comment indicating the purpose of each.

Copy link
Author

Choose a reason for hiding this comment

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

Add comments

bb.put((byte)'=');
bb.put(environ[i+1]);
byte[] envb = Arrays.copyOf(ba, bb.position());
if (Arrays.equals(kanji, envb)) return;
Copy link
Contributor

Choose a reason for hiding this comment

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

It seems odd to exit the loop on the first match.

I think AIX always has environment variables not set by the caller.

Copy link
Author

Choose a reason for hiding this comment

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

On this testing, use 2 environment variables:

  • LANG=ja_JP.eucjp
  • \u6F22\u5B57=\u6F22\u5B57

If the other environment variable is defined, it's printed.

} else if (b >= 0x20 && b <= 0x7F) {
sb.append((char)b);
} else {
sb.append(String.format("\\x%02X", (int)b & 0xFF));
Copy link
Contributor

Choose a reason for hiding this comment

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

The methods of java.util.HexFormat may be useful here.
It seems that the "5C" would fit into this "else" clause and not need a separate statement.

Copy link
Author

Choose a reason for hiding this comment

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

Use HexFormat class

@takiguc
Copy link
Author

takiguc commented May 1, 2022

Hello @naotoj and @RogerRiggs .
I appreciate your comments.
I applied the changes.
Additionally, I put bugid into test/jdk/java/lang/ProcessBuilder/Basic.java

@RogerRiggs
Copy link
Contributor

Can you clarify the use of different charset properties for the ProcessEnvironment vs the CommandLine strings?

They are used to decode or encode strings in the APIs to native functions respectively.
If I understand native.encoding was introduced to reflect the default encoding of file contents, while sun.jnu.encoding is used to encode filenames.

I think I would have expected to see sun.jnu.encoding to be used in all contexts when encoding/decoding strings to the native representations. (Assuming its not required for backward compatibility).

@takiguc
Copy link
Author

takiguc commented May 2, 2022

Hello @RogerRiggs .
You are right. Both case, sun.jnu.encoding should be used.


/*
* @test
* @bug 8285517
Copy link
Member

Choose a reason for hiding this comment

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

Also @modules jdk.charsets should be added so that the test should be immediately ignored if it does not have EUC-JP charset.

.shouldHaveExitValue(0);
}

public static class Start {
Copy link
Member

Choose a reason for hiding this comment

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

Do we need Start class? Can it be merged with the parent to reduce the complexity?

Copy link
Author

Choose a reason for hiding this comment

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

I'm not sure, it expected one...

I created i18nEnvArg.sh for start-up, then add @modules jdk.charsets and remove i18nEnvArg$Start class.

Copy link
Member

Choose a reason for hiding this comment

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

Sorry if my comment was unclear. I meant to not create a shell script (shell scripts in the test are discouraged), but to re-use the main class twice, invoking with different arguments to main(), as both creating a testJvm process (one for eucjp jvm, and the other for Start).

String javeExe = System.getProperty("java.home") +
File.separator +
"bin" +
File.separator +
"java";
ProcessBuilder pb = new ProcessBuilder(javeExe,
"--add-opens=java.base/java.lang=ALL-UNNAMED",
"-classpath",
System.getProperty("java.class.path"),
"i18nEnvArg$Verify",
EUC_JP_TEXT);
Copy link
Member

Choose a reason for hiding this comment

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

Can utilize ProcessTools class.

Copy link
Author

Choose a reason for hiding this comment

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

Use ProcessTools

Class<?> cls = Class.forName("java.lang.ProcessEnvironment");
Method environ_mid = cls.getDeclaredMethod("environ");
environ_mid.setAccessible(true);
byte[][] environ = (byte[][]) environ_mid.invoke(null,
(Object[])null);
Copy link
Member

Choose a reason for hiding this comment

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

I am not sure I like this piece, invoking a package private method of ProcessEnvironment class. Can we simply verify the result of System.getenv(EUC_JP_TEXT)?

Copy link
Author

Choose a reason for hiding this comment

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

I think 3 processes required for this testing.

  1. Start test process on ja_JP.eucjp locale
  2. Set the test data by encoder
  3. Verify the encoded data by decoder

To verify the encoded data, I think I need to check the byte data.

Copy link
Member

Choose a reason for hiding this comment

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

Do we need to verify the intermediate byte encoding? Could we simply compare the text given to environ.put() in Start process and System.getenv() in Verify process match?

Copy link
Author

Choose a reason for hiding this comment

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

Hello @naotoj .
I think if 2nd process' encoder (like UTF-8) and 3rd process' decoder are same encoding, System.getenv() returns expected data.
Actually the testcase checks 3 parts on Verify process:

  1. Expected environment variable is defined or not (it uses System.getenv())
  2. Expected argument is received or not
  3. Expected environment variable is encoded by proper encoding

When I ran this testcase with jdk18.0.1, I got following result:

Unexpected argument was received: \u6F22\u5B57<->\u7FB2\u221A\uFFFD
Unexpected environment variables: \xE6\xBC\xA2\xE5\xAD\x97\x3D\xE6\xBC\xA2\xE5\xAD\x97

It means 1st test was passed, 2nd and 3rd test were failed.
I don't think environment variable issue can be seen without 3rd test.
Please let me know if you find out another way.

Copy link
Contributor

Choose a reason for hiding this comment

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

This part of the test is very brittle; I'm pretty sure it will fail on AIX that adds its own environment variables.
It should not fail if it finds the two entries it expects. It should ignore other entries.

I don't see what value it has over checking the entries from System.getEnv(), please elaborate.

@openjdk openjdk bot removed the rfr Pull request is ready for review label May 3, 2022
@takiguc
Copy link
Author

takiguc commented May 3, 2022

Hello @RogerRiggs and @naotoj .

I put new testcase.
I'm not sure, it's expected one...

During my code changes, SecurityManager related testcases were failed.
I'm not sure I can use System.getProperty("sun.jnu.encoding") or not.
So I put SecurityManager related code.

@openjdk openjdk bot added the rfr Pull request is ready for review label May 4, 2022
@takiguc
Copy link
Author

takiguc commented May 4, 2022

Hello @naotoj .
I removed i18nEnvArg.sh and modified i18nEnvArg.java.
Could you review it again ?

@SuppressWarnings("removal")
String jnuEncoding = AccessController.doPrivileged((PrivilegedAction<String>) ()
-> System.getProperty("sun.jnu.encoding"));
Copy link
Member

Choose a reason for hiding this comment

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

Same here.

@SuppressWarnings("removal")
String jnuEncoding = AccessController.doPrivileged((PrivilegedAction<String>) ()
-> System.getProperty("sun.jnu.encoding"));
Copy link
Member

Choose a reason for hiding this comment

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

No need to issue doPrivileged(), which is deprecated

Copy link
Author

Choose a reason for hiding this comment

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

Hello @naotoj .
If I just use System.getProperty("sun.jnu.encoding"), following testcases were failed.

java/lang/ProcessBuilder/SecurityManagerClinit.java 
java/lang/ProcessHandle/PermissionTest.java 

Please give me your suggestion again.

Copy link
Member

Choose a reason for hiding this comment

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

Ah, OK. Never mind.

Copy link
Contributor

Choose a reason for hiding this comment

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

It might be worthwhile to cache the sun.jnu.encoding property value in jdk/internal/util/StaticProperty.
And perhaps even cache the Charset (not just the string).

var cmds = List.of(
"--add-modules=" + System.getProperty("test.modules"),
"-classpath",
System.getProperty("test.class.path"),
"-Dtest.jdk=" + System.getProperty("test.jdk"),
"-Dtest.class.path=" + System.getProperty("test.class.path"),
"-Dtest.modules=" + System.getProperty("test.modules"),
"i18nEnvArg",
"Start");
pb = ProcessTools.createTestJvm(cmds);
Map<String, String> environ = pb.environment();
environ.clear();
environ.put("LANG", "ja_JP.eucjp");
Copy link
Member

Choose a reason for hiding this comment

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

There are many duplicate pieces of code here and in the else block below. Can you simplify this if statement more?

Copy link
Author

Choose a reason for hiding this comment

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

Modified.
But I'm not sure, it's expected one.

ByteArrayOutputStream baos = new ByteArrayOutputStream();
PrintStream ps = new PrintStream(baos);
Copy link
Member

Choose a reason for hiding this comment

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

Can utilize try-with-resources pattern.

Copy link
Author

Choose a reason for hiding this comment

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

Use shouldNotContain() to find the error message.

Copy link
Member

Choose a reason for hiding this comment

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

I was suggesting try (ByteArrayOutputStream baos = ...) { so that no need to clean them up, but I see you removed them. But I prefer not to use shouldNotContain("ERROR: ") but to check the return value as before.

@takiguc
Copy link
Author

takiguc commented May 6, 2022

Hello @RogerRiggs and @naotoj .
I put sun.jnu.encoding related code into sStaticProperty.java.
Could you review the files again including javadoc comment ?

Charset cs = jnuEncoding != null
? Charset.forName(jnuEncoding, Charset.defaultCharset())
: Charset.defaultCharset();
if (new String(tested.getBytes(cs), cs).equals(tested)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't it always true that the round trip encoding to bytes and back (using the same Charset) to a string is equal()?
And if it is always true, then the if(...) can be removed.

Copy link
Author

Choose a reason for hiding this comment

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

Above code is related to following code:

testEncoding("Latin1", "\u00f1\u00e1");
testEncoding("Unicode", "\u22f1\u11e1");

If Charset.defaultCharset() is UTF-8, this code is not skipped.
I think this code will be skipped on JDK17 on C locale.

byte[] eucjp = "LANG=ja_JP.eucjp".getBytes(cs);
String s = System.getenv(EUC_JP_TEXT);
if (!EUC_JP_TEXT.equals(s)) {
System.err.println("ERROR: getenv() returns unexpected data");
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add the unexpected data s to the output string.

for(char ch : EUC_JP_TEXT.toCharArray()) {
System.err.printf("\\u%04X", (int)ch);
}
System.err.print("<->");
Copy link
Contributor

Choose a reason for hiding this comment

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

This might be clearer if labeled as the actual/incorrect value and on a separate line.

}
if (!EUC_JP_TEXT.equals(args[0])) {
System.err.print("ERROR: Unexpected argument was received: ");
for(char ch : EUC_JP_TEXT.toCharArray()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This is the expected value, the previous "Unexpected" labeling might be mis-understood.

Class<?> cls = Class.forName("java.lang.ProcessEnvironment");
Method environ_mid = cls.getDeclaredMethod("environ");
environ_mid.setAccessible(true);
byte[][] environ = (byte[][]) environ_mid.invoke(null,
(Object[])null);
Copy link
Contributor

Choose a reason for hiding this comment

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

This part of the test is very brittle; I'm pretty sure it will fail on AIX that adds its own environment variables.
It should not fail if it finds the two entries it expects. It should ignore other entries.

I don't see what value it has over checking the entries from System.getEnv(), please elaborate.

jnuCharset = Charset.forName(SUN_JNU_ENCODING, Charset.defaultCharset());
}
Copy link
Member

Choose a reason for hiding this comment

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

I am not sure it is OK to initialize Charset here, as sun_jnu_encoding is initialized in System.initPhase1() and pulling Charset there may cause some init order change. I'd only cache the encoding string here.

Copy link
Contributor

Choose a reason for hiding this comment

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

Note the initialization of sun.jnu.encoding in System.java:2142'ish.
This happens before StaticProperty is initialized; at line 2147.
If the sun.jnu.encoding is not supported (this is before Providers are enabled)
then it is forced to UTF-8.
So it is the case that the encoding is supported by that point.
Note that Charset.isSupported(...) does the full lookup in its implementation.

If it is not supported, the system still comes up using UTF-8 and a warning is printed at line 2282.

Comparing the class initialization order may be a useful thing to cross check.

@takiguc
Copy link
Author

takiguc commented May 7, 2022

Hello @RogerRiggs .
When I executed the new testcase with JDK18.0.1, I got following errors:

ERROR: argument EUC_JP_TEXT is:
  Actual:   \u7FB2\u221A\uFFFD
  Expected: \u6F22\u5B57
ERROR: Variable EUC_JP_TEXT is encoded by:
  Actual:   \xE6\xBC\xA2\xE5\xAD\x97
  Expected: \xB4\xC1\xBB\xFA
ERROR: Value EUC_JP_TEXT is encoded by:
  Actual:   \xE6\xBC\xA2\xE5\xAD\x97
  Expected: \xB4\xC1\xBB\xFA

The new testcase verifies internal byte data for EUC_JP_TEXT environment variable and value.

@takiguc
Copy link
Author

takiguc commented May 8, 2022

I checked internal data

$ cat StaticPropertyVals.java 
import java.lang.reflect.*;

public class StaticPropertyVals {
  public static void main(String[] args) throws Exception {
    Class<?> cls = Class.forName("jdk.internal.util.StaticProperty");
    for (Field fid : cls.getDeclaredFields()) {
      if (Modifier.isStatic(fid.getModifiers())) {
        fid.setAccessible(true);
        System.out.println(fid.getName() + "=" + fid.get(null));
      }
    }
  }
}
$ env LANG=kk_KZ.pt154 LC_ALL=kk_KZ.pt154 java -XshowSettings:properties --add-opens=java.base/jdk.internal.util=ALL-UNNAMED StaticPropertyVals 2>&1 | egrep -i 'encoding|charset'
WARNING: The encoding of the underlying platform's file system is not supported: PT154
    file.encoding = UTF-8
    native.encoding = PT154
    sun.io.unicode.encoding = UnicodeLittle
    sun.jnu.encoding = UTF-8
NATIVE_ENCODING=PT154
FILE_ENCODING=UTF-8
SUN_JNU_ENCODING=UTF-8
jnuCharset=UTF-8
$ 



final class ProcessEnvironment
{
private static final HashMap<Variable,Value> theEnvironment;
private static final Map<String,String> theUnmodifiableEnvironment;
static final int MIN_NAME_LENGTH = 0;
private static final Charset jnuCharset = StaticProperty.jnuCharset();
Copy link
Contributor

Choose a reason for hiding this comment

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

Since the Charset is cached in StaticProperty, I don't think its worthwhile to make a local copy of the same ref.
Just refer to StaticProperty.jnuCharset() where it is needed. (Here and in ProcessImpl)

@takiguc
Copy link
Author

takiguc commented May 13, 2022

Hello @RogerRiggs and @naotoj .
I modified ProcessEnvironment.javaand ProcessImpl.java.
i18nEnvArg.java checks return code instead of string detection.

@@ -241,4 +246,29 @@ public static String fileEncoding() {
public static String javaPropertiesDate() {
return JAVA_PROPERTIES_DATE;
}

/**
* Return the {@code sun.jnu.encoding} system property.
Copy link
Member

Choose a reason for hiding this comment

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

This can be eliminated by changing the@return block tag below to {@return the {@code sun.jnu.encoding} ...}.

Copy link
Author

Choose a reason for hiding this comment

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

Hello @naotoj .
I appreciate your comment.
I'd like to confirm one thing.
I applied following change

    /**
     * {@return the {@code sun.jnu.encoding} system property}
     *
     * <strong>{@link SecurityManager#checkPropertyAccess} is NOT checked
     * in this method. The caller of this method should take care to ensure
     * that the returned property is not made accessible to untrusted code.</strong>
     */

By javadoc command with -html5 option, above part was converted to

Returns the sun.jnu.encoding system property. SecurityManager.checkPropertyAccess(java.lang.String) 
is NOT checked in this method. The caller of this method should take care to ensure that the returned 
property is not made accessible to untrusted code.

The 1st word changed from Return to Returns.
Is it OK ?
And it seems @return is translated to Japanese on Japanese environment.

Copy link
Member

Choose a reason for hiding this comment

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

The 1st word changed from Return to Returns.
Is it OK ?

That's more of plain English to me. Maybe some natives can correct it if needed.

And it seems @return is translated to Japanese on Japanese environment.

Yes. I believe that's what is supposed to work.

}

/**
* Return charset for {@code sun.jnu.encoding} system property.
Copy link
Member

Choose a reason for hiding this comment

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

Same as above. charset can be capitalized and changed to {@code}.

@takiguc
Copy link
Author

takiguc commented May 17, 2022

Hello @naotoj .
To keep consistency, I modified other javadoc texts on StaticProperty.java.
And fix javdoc tag error.

Copy link
Member

@naotoj naotoj left a comment

Choose a reason for hiding this comment

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

Looks good. Thanks for the fix!

@openjdk
Copy link

openjdk bot commented May 17, 2022

@takiguc This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8285517: System.getenv() returns unexpected value if environment variable has non ASCII character

Reviewed-by: naoto, rriggs

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 212 new commits pushed to the master branch:

  • 9f562ef: 8286872: Refactor add/modify notification icon (TrayIcon)
  • b089229: 8271078: jdk/incubator/vector/Float128VectorTests.java failed a subtest
  • 079312c: 8286182: [BACKOUT] x86: Handle integral division overflow during parsing
  • 7b19226: 8267038: Update IANA Language Subtag Registry to Version 2022-03-02
  • e60d8b5: 8253176: Signature.getParameters should specify that it can throw UnsupportedOperationException
  • aa50625: 8286447: [Linux] AWT should start in Headless mode if headful AWT library not installed
  • 655500a: 8286654: Add an optional description accessor on ToolProvider interface
  • ac6a7d7: 8278367: JNI critical region violation in CTextPipe.m:363
  • 83cec4b: 8284273: Early crashes in os::print_context on AArch64
  • fd36f37: 8286797: Guards of constant value false are not permitted
  • ... and 202 more: https://git.openjdk.java.net/jdk/compare/4f5d73f2d411aa6147c5388b024e0d2996378d5a...master

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label May 17, 2022
@takiguc
Copy link
Author

takiguc commented May 18, 2022

Hello @RogerRiggs .
Do you have any comment ?

Copy link
Contributor

@RogerRiggs RogerRiggs left a comment

Choose a reason for hiding this comment

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

Looks fine.
(I don't personally like how {@return looks in the source; but its done now. Usually it is preferred to stick to the style in the file and not mix stylistic changes with functional changes).
Thanks for the updates.

@takiguc
Copy link
Author

takiguc commented May 19, 2022

/integrate

@openjdk
Copy link

openjdk bot commented May 19, 2022

Going to push as commit 890771e.
Since your change was applied there have been 213 commits pushed to the master branch:

  • de74e0e: 8280035: Use Class.isInstance instead of Class.isAssignableFrom where applicable
  • 9f562ef: 8286872: Refactor add/modify notification icon (TrayIcon)
  • b089229: 8271078: jdk/incubator/vector/Float128VectorTests.java failed a subtest
  • 079312c: 8286182: [BACKOUT] x86: Handle integral division overflow during parsing
  • 7b19226: 8267038: Update IANA Language Subtag Registry to Version 2022-03-02
  • e60d8b5: 8253176: Signature.getParameters should specify that it can throw UnsupportedOperationException
  • aa50625: 8286447: [Linux] AWT should start in Headless mode if headful AWT library not installed
  • 655500a: 8286654: Add an optional description accessor on ToolProvider interface
  • ac6a7d7: 8278367: JNI critical region violation in CTextPipe.m:363
  • 83cec4b: 8284273: Early crashes in os::print_context on AArch64
  • ... and 203 more: https://git.openjdk.java.net/jdk/compare/4f5d73f2d411aa6147c5388b024e0d2996378d5a...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label May 19, 2022
@openjdk openjdk bot closed this May 19, 2022
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels May 19, 2022
@openjdk
Copy link

openjdk bot commented May 19, 2022

@takiguc Pushed as commit 890771e.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core-libs core-libs-dev@openjdk.org integrated Pull request has been integrated
3 participants