Skip to content

Commit 4525aa3

Browse files
committed
8300867: Fix document issues in java.io
Reviewed-by: alanb, lancea, iris
1 parent a7f035d commit 4525aa3

File tree

6 files changed

+38
-38
lines changed

6 files changed

+38
-38
lines changed

src/java.base/share/classes/java/io/BufferedInputStream.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ private int read1(byte[] b, int off, int len) throws IOException {
342342
*
343343
* </ul> If the first {@code read} on the underlying stream returns
344344
* {@code -1} to indicate end-of-file then this method returns
345-
* {@code -1}. Otherwise this method returns the number of bytes
345+
* {@code -1}. Otherwise, this method returns the number of bytes
346346
* actually read.
347347
*
348348
* <p> Subclasses of this class are encouraged, but not required, to

src/java.base/share/classes/java/io/DeleteOnExitHook.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2005, 2023, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -39,7 +39,7 @@ class DeleteOnExitHook {
3939
static {
4040
// DeleteOnExitHook must be the last shutdown hook to be invoked.
4141
// Application shutdown hooks may add the first file to the
42-
// delete on exit list and cause the DeleteOnExitHook to be
42+
// delete-on-exit list and cause the DeleteOnExitHook to be
4343
// registered during shutdown in progress. So set the
4444
// registerShutdownInProgress parameter to true.
4545
SharedSecrets.getJavaLangAccess()

src/java.base/share/classes/java/io/File.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1994, 2022, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1994, 2023, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -759,7 +759,7 @@ public URI toURI() {
759759
* Tests whether the application can read the file denoted by this
760760
* abstract pathname. On some platforms it may be possible to start the
761761
* Java virtual machine with special privileges that allow it to read
762-
* files that are marked as unreadable. Consequently this method may return
762+
* files that are marked as unreadable. Consequently, this method may return
763763
* {@code true} even though the file does not have read permissions.
764764
*
765765
* @return {@code true} if and only if the file specified by this
@@ -787,7 +787,7 @@ public boolean canRead() {
787787
* Tests whether the application can modify the file denoted by this
788788
* abstract pathname. On some platforms it may be possible to start the
789789
* Java virtual machine with special privileges that allow it to modify
790-
* files that are marked read-only. Consequently this method may return
790+
* files that are marked read-only. Consequently, this method may return
791791
* {@code true} even though the file is marked read-only.
792792
*
793793
* @return {@code true} if and only if the file system actually
@@ -1779,7 +1779,7 @@ public boolean setExecutable(boolean executable) {
17791779
* Tests whether the application can execute the file denoted by this
17801780
* abstract pathname. On some platforms it may be possible to start the
17811781
* Java virtual machine with special privileges that allow it to execute
1782-
* files that are not marked executable. Consequently this method may return
1782+
* files that are not marked executable. Consequently, this method may return
17831783
* {@code true} even though the file does not have execute permissions.
17841784
*
17851785
* @return {@code true} if and only if the abstract pathname exists
@@ -2327,7 +2327,7 @@ private synchronized void writeObject(java.io.ObjectOutputStream s)
23272327
/**
23282328
* readObject is called to restore this filename.
23292329
* The original separator character is read. If it is different
2330-
* than the separator character on this system, then the old separator
2330+
* from the separator character on this system, then the old separator
23312331
* is replaced by the local separator.
23322332
*
23332333
* @param s the {@code ObjectInputStream} from which data is read

src/java.base/share/classes/java/io/ObjectInputStream.java

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1996, 2022, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1996, 2023, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -1093,9 +1093,9 @@ public boolean readBoolean() throws IOException {
10931093
}
10941094

10951095
/**
1096-
* Reads an 8 bit byte.
1096+
* Reads an 8-bit byte.
10971097
*
1098-
* @return the 8 bit byte read.
1098+
* @return the 8-bit byte read.
10991099
* @throws EOFException If end of file is reached.
11001100
* @throws IOException If other I/O error has occurred.
11011101
*/
@@ -1104,9 +1104,9 @@ public byte readByte() throws IOException {
11041104
}
11051105

11061106
/**
1107-
* Reads an unsigned 8 bit byte.
1107+
* Reads an unsigned 8-bit byte.
11081108
*
1109-
* @return the 8 bit byte read.
1109+
* @return the 8-bit byte read.
11101110
* @throws EOFException If end of file is reached.
11111111
* @throws IOException If other I/O error has occurred.
11121112
*/
@@ -1115,9 +1115,9 @@ public int readUnsignedByte() throws IOException {
11151115
}
11161116

11171117
/**
1118-
* Reads a 16 bit char.
1118+
* Reads a 16-bit char.
11191119
*
1120-
* @return the 16 bit char read.
1120+
* @return the 16-bit char read.
11211121
* @throws EOFException If end of file is reached.
11221122
* @throws IOException If other I/O error has occurred.
11231123
*/
@@ -1126,9 +1126,9 @@ public char readChar() throws IOException {
11261126
}
11271127

11281128
/**
1129-
* Reads a 16 bit short.
1129+
* Reads a 16-bit short.
11301130
*
1131-
* @return the 16 bit short read.
1131+
* @return the 16-bit short read.
11321132
* @throws EOFException If end of file is reached.
11331133
* @throws IOException If other I/O error has occurred.
11341134
*/
@@ -1137,9 +1137,9 @@ public short readShort() throws IOException {
11371137
}
11381138

11391139
/**
1140-
* Reads an unsigned 16 bit short.
1140+
* Reads an unsigned 16-bit short.
11411141
*
1142-
* @return the 16 bit short read.
1142+
* @return the 16-bit short read.
11431143
* @throws EOFException If end of file is reached.
11441144
* @throws IOException If other I/O error has occurred.
11451145
*/
@@ -1148,9 +1148,9 @@ public int readUnsignedShort() throws IOException {
11481148
}
11491149

11501150
/**
1151-
* Reads a 32 bit int.
1151+
* Reads a 32-bit int.
11521152
*
1153-
* @return the 32 bit integer read.
1153+
* @return the 32-bit integer read.
11541154
* @throws EOFException If end of file is reached.
11551155
* @throws IOException If other I/O error has occurred.
11561156
*/
@@ -1159,9 +1159,9 @@ public int readInt() throws IOException {
11591159
}
11601160

11611161
/**
1162-
* Reads a 64 bit long.
1162+
* Reads a 64-bit long.
11631163
*
1164-
* @return the read 64 bit long.
1164+
* @return the read 64-bit long.
11651165
* @throws EOFException If end of file is reached.
11661166
* @throws IOException If other I/O error has occurred.
11671167
*/
@@ -1170,9 +1170,9 @@ public long readLong() throws IOException {
11701170
}
11711171

11721172
/**
1173-
* Reads a 32 bit float.
1173+
* Reads a 32-bit float.
11741174
*
1175-
* @return the 32 bit float read.
1175+
* @return the 32-bit float read.
11761176
* @throws EOFException If end of file is reached.
11771177
* @throws IOException If other I/O error has occurred.
11781178
*/
@@ -1181,9 +1181,9 @@ public float readFloat() throws IOException {
11811181
}
11821182

11831183
/**
1184-
* Reads a 64 bit double.
1184+
* Reads a 64-bit double.
11851185
*
1186-
* @return the 64 bit double read.
1186+
* @return the 64-bit double read.
11871187
* @throws EOFException If end of file is reached.
11881188
* @throws IOException If other I/O error has occurred.
11891189
*/

src/java.base/share/classes/java/io/ObjectOutputStream.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1996, 2022, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1996, 2023, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -768,7 +768,7 @@ public void writeBoolean(boolean val) throws IOException {
768768
}
769769

770770
/**
771-
* Writes an 8 bit byte.
771+
* Writes an 8-bit byte.
772772
*
773773
* @param val the byte value to be written
774774
* @throws IOException if I/O errors occur while writing to the underlying
@@ -779,7 +779,7 @@ public void writeByte(int val) throws IOException {
779779
}
780780

781781
/**
782-
* Writes a 16 bit short.
782+
* Writes a 16-bit short.
783783
*
784784
* @param val the short value to be written
785785
* @throws IOException if I/O errors occur while writing to the underlying
@@ -790,7 +790,7 @@ public void writeShort(int val) throws IOException {
790790
}
791791

792792
/**
793-
* Writes a 16 bit char.
793+
* Writes a 16-bit char.
794794
*
795795
* @param val the char value to be written
796796
* @throws IOException if I/O errors occur while writing to the underlying
@@ -801,7 +801,7 @@ public void writeChar(int val) throws IOException {
801801
}
802802

803803
/**
804-
* Writes a 32 bit int.
804+
* Writes a 32-bit int.
805805
*
806806
* @param val the integer value to be written
807807
* @throws IOException if I/O errors occur while writing to the underlying
@@ -812,7 +812,7 @@ public void writeInt(int val) throws IOException {
812812
}
813813

814814
/**
815-
* Writes a 64 bit long.
815+
* Writes a 64-bit long.
816816
*
817817
* @param val the long value to be written
818818
* @throws IOException if I/O errors occur while writing to the underlying
@@ -823,7 +823,7 @@ public void writeLong(long val) throws IOException {
823823
}
824824

825825
/**
826-
* Writes a 32 bit float.
826+
* Writes a 32-bit float.
827827
*
828828
* @param val the float value to be written
829829
* @throws IOException if I/O errors occur while writing to the underlying
@@ -834,7 +834,7 @@ public void writeFloat(float val) throws IOException {
834834
}
835835

836836
/**
837-
* Writes a 64 bit double.
837+
* Writes a 64-bit double.
838838
*
839839
* @param val the double value to be written
840840
* @throws IOException if I/O errors occur while writing to the underlying

src/java.base/share/classes/java/io/ObjectStreamConstants.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1996, 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1996, 2023, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -226,12 +226,12 @@ public interface ObjectStreamConstants {
226226
* A Stream Protocol Version. <p>
227227
*
228228
* This protocol is written by JVM 1.2.
229-
*
229+
* <p>
230230
* Externalizable data is written in block data mode and is
231231
* terminated with TC_ENDBLOCKDATA. Externalizable class descriptor
232232
* flags has SC_BLOCK_DATA enabled. JVM 1.1.6 and greater can
233233
* read this format change.
234-
*
234+
* <p>
235235
* Enables writing a nonSerializable class descriptor into the
236236
* stream. The serialVersionUID of a nonSerializable class is
237237
* set to 0L.

0 commit comments

Comments
 (0)