RFR: 8191441: (Process) add Readers and Writer access to java.lang.Process streams
Roger Riggs
rriggs at openjdk.java.net
Thu May 20 20:50:32 UTC 2021
On Thu, 20 May 2021 20:42:35 GMT, Naoto Sato <naoto at openjdk.org> wrote:
>> Methods are added to java.lang.Process to read and write characters and lines from and to a spawned Process.
>> The Charset used to encode and decode characters to bytes can be specified or use the
>> operating system native encoding as is available from the "native.encoding" system property.
>
> test/jdk/java/lang/ProcessBuilder/ReaderWriterTest.java line 64:
>
>> 62: return new Object[][] {
>> 63: {"UTF-8"},
>> 64: {"ISO8859-1"},
>
> `ISO8859-1` may not be available on all underlying OSes.
Is there a safe subset?
I haven't seen a failure yet, if/when it occurs, we make an exception or narrow the test to known systems.
> test/jdk/java/lang/ProcessBuilder/ReaderWriterTest.java line 111:
>
>> 109: @Test(dataProvider = "CharsetCases", enabled = true)
>> 110: void testCase(String nativeEncoding) throws IOException {
>> 111: String osName = System.getProperty("os.name").toLowerCase(Locale.ROOT);
>
> Not used anywhere else.
Right, dead code now without host dependencies.
> test/jdk/java/lang/ProcessBuilder/ReaderWriterTest.java line 122:
>
>> 120: "ReaderWriterTest$ChildWithCharset");
>> 121: var env = pb.environment();
>> 122: env.put("LANG", "en_US." + cleanCSName);
>
> Does this work on Windows?
Should be removed, the tests work because they set sun.stdout/stderr.encoding.
-------------
PR: https://git.openjdk.java.net/jdk/pull/4134
More information about the core-libs-dev
mailing list