In Java 9, why is the output from System.getenv () incomplete in jshell?

I am using Windows 10 and running the version of Java 9 released by Oracle yesterday.

If I open jshell and enter System.out.println (System.getenv ()) , the result will be as expected, as shown at the bottom of the screenshot below.

However, if I just type System.getenv () , there is a large chunk of data missing in the middle of the output. See the start of the screenshot below. This is similar to the jshell function , since the screen shot under the ellipsis (" ... ") at the exit of System.getenv () (in the second field with yellow edges drawn) exactly matches the missing data.

The final part for the CommonProgramFiles environment variable is missing, as is the beginning of the SPRING_HOME environment variable , and there are several other environment variables, such as Path , that are not displayed at all.

enter image description here

(Some of the information in the screenshot was blurred to ensure privacy.)

Does anyone else see the same thing (or not), and does anyone have any suggestions as to why jshell does this ?

+4
source share
1 answer

JShell truncates some string results that are printed in REPL. However, this does not affect console printing.

We see this happening:

import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
List<Integer> x = IntStream.range(0,3000).mapToObj(Integer::valueOf).collect(Collectors.toList());
x

We will see that the same truncation occurs with ellipsis in this release.

:

System.out.println(x);

.


. , , 40 000 ( , , , , ).

/set mode mine normal -command
/set truncation mine 40000
/set feedback mine

, mine, & dagger; (, , , ). . /help /set mode.

40000 . , , . . /help /set truncation.

, . , , , 40 000 .

, .


& dagger; 1000 . /set truncation , /set truncation normal, .

+6

Source: https://habr.com/ru/post/1686253/


All Articles