Skip to content

Commit

Permalink
8320781: Fix whitespace in j.l.Double and j.u.z.ZipInputStream @snippets
Browse files Browse the repository at this point in the history


Reviewed-by: lancea, bpb, darcy, jpai
  • Loading branch information
eirbjo authored and jaikiran committed Nov 28, 2023
1 parent a5ccd3b commit 99f870c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/java.base/share/classes/java/lang/Double.java
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@
*
* {@snippet lang="java" :
* double d = 0.0;
* while(d != 1.0) { // Surprising infinite loop
* while (d != 1.0) { // Surprising infinite loop
* d += 0.1; // Sum never _exactly_ equals 1.0
* }
* }
Expand All @@ -325,7 +325,7 @@
*
* {@snippet lang="java" :
* double d = 0.0;
* for(int i = 0; i < 10; i++) {
* for (int i = 0; i < 10; i++) {
* d += 0.1;
* } // Value of d is equal to Math.nextDown(1.0).
* }
Expand All @@ -335,7 +335,7 @@
*
* {@snippet lang="java" :
* double d = 0.0;
* while(d <= 1.0) {
* while (d <= 1.0) {
* d += 0.1;
* } // Value of d approximately 1.0999999999999999
* }
Expand Down
4 changes: 2 additions & 2 deletions src/java.base/share/classes/java/util/zip/ZipInputStream.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@
* {@code ZipInputStream} read methods such
* as {@link #read(byte[], int, int) read} or {@link #readAllBytes() readAllBytes()}.
* For example:
* {@snippet :
* {@snippet lang="java" :
* Path jar = Path.of("foo.jar");
* try (InputStream is = Files.newInputStream(jar);
* ZipInputStream zis = new ZipInputStream(is)) {
* ZipEntry ze;
* while((ze= zis.getNextEntry()) != null) {
* while ((ze = zis.getNextEntry()) != null) {
* var bytes = zis.readAllBytes();
* System.out.printf("Entry: %s, bytes read: %s%n", ze.getName(),
* bytes.length);
Expand Down

1 comment on commit 99f870c

@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.