From 9f714d5eec05594569dd89920353272606622d8a Mon Sep 17 00:00:00 2001 From: Michael Koch Date: Tue, 20 Apr 2004 11:37:41 +0000 Subject: [PATCH] BufferedWriter.java, [...]: Fixed javadocs all over, rename arguments to match javadocs, fixed coding style. 2004-04-20 Michael Koch * java/io/BufferedWriter.java, java/io/ByteArrayInputStream.java, java/io/CharArrayWriter.java, java/io/DataInput.java, java/io/DataInputStream.java, java/io/File.java, java/io/FilterInputStream.java, java/io/InputStream.java, java/io/InputStreamReader.java, java/io/ObjectInputStream.java, java/io/ObjectStreamClass.java, java/io/PipedInputStream.java, java/io/PipedReader.java, java/io/PushbackInputStream.java, java/io/PushbackReader.java, java/io/RandomAccessFile.java, java/io/SerializablePermission.java, java/io/StreamTokenizer.java, java/io/StringWriter.java, java/io/WriteAbortedException.java, java/io/Writer.java: Fixed javadocs all over, rename arguments to match javadocs, fixed coding style. From-SVN: r80897 --- libjava/ChangeLog | 26 +++++++++ libjava/java/io/BufferedWriter.java | 27 ++++----- libjava/java/io/ByteArrayInputStream.java | 26 ++++----- libjava/java/io/CharArrayWriter.java | 4 +- libjava/java/io/DataInput.java | 8 +-- libjava/java/io/DataInputStream.java | 6 +- libjava/java/io/File.java | 65 +++++++++++---------- libjava/java/io/FilterInputStream.java | 18 +++--- libjava/java/io/InputStream.java | 4 +- libjava/java/io/InputStreamReader.java | 29 +++++---- libjava/java/io/ObjectInputStream.java | 16 ++--- libjava/java/io/ObjectStreamClass.java | 22 +++---- libjava/java/io/PipedInputStream.java | 2 +- libjava/java/io/PipedReader.java | 2 +- libjava/java/io/PushbackInputStream.java | 2 +- libjava/java/io/PushbackReader.java | 27 ++++----- libjava/java/io/RandomAccessFile.java | 8 +-- libjava/java/io/SerializablePermission.java | 4 +- libjava/java/io/StreamTokenizer.java | 56 +++++++++--------- libjava/java/io/StringWriter.java | 2 + libjava/java/io/WriteAbortedException.java | 2 +- libjava/java/io/Writer.java | 6 +- 22 files changed, 193 insertions(+), 169 deletions(-) diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 17017de7ae5..db7bf5910a3 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,29 @@ +2004-04-20 Michael Koch + + * java/io/BufferedWriter.java, + java/io/ByteArrayInputStream.java, + java/io/CharArrayWriter.java, + java/io/DataInput.java, + java/io/DataInputStream.java, + java/io/File.java, + java/io/FilterInputStream.java, + java/io/InputStream.java, + java/io/InputStreamReader.java, + java/io/ObjectInputStream.java, + java/io/ObjectStreamClass.java, + java/io/PipedInputStream.java, + java/io/PipedReader.java, + java/io/PushbackInputStream.java, + java/io/PushbackReader.java, + java/io/RandomAccessFile.java, + java/io/SerializablePermission.java, + java/io/StreamTokenizer.java, + java/io/StringWriter.java, + java/io/WriteAbortedException.java, + java/io/Writer.java: + Fixed javadocs all over, rename arguments to match javadocs, + fixed coding style. + 2004-04-20 Ingo Proetel * java/awt/FontMetrics.java: diff --git a/libjava/java/io/BufferedWriter.java b/libjava/java/io/BufferedWriter.java index b35ca6ea390..87236896afb 100644 --- a/libjava/java/io/BufferedWriter.java +++ b/libjava/java/io/BufferedWriter.java @@ -44,18 +44,17 @@ package java.io; */ /** - * This class accumulates chars written in a buffer instead of immediately - * writing the data to the underlying output sink. The chars are instead - * as one large block when the buffer is filled, or when the stream is - * closed or explicitly flushed. This mode operation can provide a more - * efficient mechanism for writing versus doing numerous small unbuffered - * writes. - * - * @author Aaron M. Renn (arenn@urbanophile.com) - * @author Tom Tromey - * @date September 25, 1998 - */ - + * This class accumulates chars written in a buffer instead of immediately + * writing the data to the underlying output sink. The chars are instead + * as one large block when the buffer is filled, or when the stream is + * closed or explicitly flushed. This mode operation can provide a more + * efficient mechanism for writing versus doing numerous small unbuffered + * writes. + * + * @author Aaron M. Renn (arenn@urbanophile.com) + * @author Tom Tromey (tromey@cygnus.com) + * @date September 25, 1998 + */ public class BufferedWriter extends Writer { /** @@ -90,6 +89,8 @@ public class BufferedWriter extends Writer * This method flushes any remaining buffered chars then closes the * underlying output stream. Any further attempts to write to this stream * may throw an exception + * + * @exception IOException If an error occurs. */ public void close () throws IOException { @@ -138,7 +139,7 @@ public class BufferedWriter extends Writer * is filled as a result of this write request, it will be flushed to the * underlying output stream. * - * @param b The char of data to be written, passed as an int + * @param oneChar The char of data to be written, passed as an int * * @exception IOException If an error occurs */ diff --git a/libjava/java/io/ByteArrayInputStream.java b/libjava/java/io/ByteArrayInputStream.java index 6a5f2c61897..45a09a77b5d 100644 --- a/libjava/java/io/ByteArrayInputStream.java +++ b/libjava/java/io/ByteArrayInputStream.java @@ -83,7 +83,7 @@ public class ByteArrayInputStream extends InputStream * bytes supplied to the reader. Please use caution in changing the * contents of the buffer while this stream is open. * - * @param buf The byte array buffer this stream will read from. + * @param buffer The byte array buffer this stream will read from. */ public ByteArrayInputStream(byte[] buffer) { @@ -105,7 +105,7 @@ public class ByteArrayInputStream extends InputStream * bytes supplied to the reader. Please use caution in changing the * contents of the buffer while this stream is open. * - * @param buf The byte array buffer this stream will read from. + * @param buffer The byte array buffer this stream will read from. * @param offset The index into the buffer to start reading bytes from * @param length The number of bytes to read from the buffer */ @@ -146,12 +146,12 @@ public class ByteArrayInputStream extends InputStream * position 0 in the stream. This is in constrast to some other * stream types where there is no default mark position. * - * @param readlimit The number of bytes this stream must remember. + * @param readLimit The number of bytes this stream must remember. * This parameter is ignored. */ - public synchronized void mark(int readAheadLimit) + public synchronized void mark(int readLimit) { - // readAheadLimit is ignored per Java Class Lib. book, p.220. + // readLimit is ignored per Java Class Lib. book, p.220. mark = pos; } @@ -197,19 +197,19 @@ public class ByteArrayInputStream extends InputStream *

* This method does not block. * - * @param buf The array into which the bytes read should be stored. + * @param buffer The array into which the bytes read should be stored. * @param offset The offset into the array to start storing bytes - * @param len The requested number of bytes to read + * @param length The requested number of bytes to read * * @return The actual number of bytes read, or -1 if end of stream. */ - public synchronized int read(byte[] b, int off, int len) + public synchronized int read(byte[] buffer, int offset, int length) { if (pos >= count) return -1; - int numBytes = Math.min(count - pos, len); - System.arraycopy(buf, pos, b, off, numBytes); + int numBytes = Math.min(count - pos, length); + System.arraycopy(buf, pos, buffer, offset, numBytes); pos += numBytes; return numBytes; } @@ -234,17 +234,17 @@ public class ByteArrayInputStream extends InputStream * position the stream at the end of the buffer. The actual number * of bytes skipped is returned. * - * @param num_bytes The requested number of bytes to skip + * @param num The requested number of bytes to skip * * @return The actual number of bytes skipped. */ - public synchronized long skip(long n) + public synchronized long skip(long num) { // Even though the var numBytes is a long, in reality it can never // be larger than an int since the result of subtracting 2 positive // ints will always fit in an int. Since we have to return a long // anyway, numBytes might as well just be a long. - long numBytes = Math.min((long) (count - pos), n < 0 ? 0L : n); + long numBytes = Math.min((long) (count - pos), num < 0 ? 0L : num); pos += numBytes; return numBytes; } diff --git a/libjava/java/io/CharArrayWriter.java b/libjava/java/io/CharArrayWriter.java index e9413f04072..106fd9ee2df 100644 --- a/libjava/java/io/CharArrayWriter.java +++ b/libjava/java/io/CharArrayWriter.java @@ -50,8 +50,8 @@ package java.io; * following two properties: *

*

    - *
  • gnu.java.io.CharArrayWriter.initialBufferSize - *
  • gnu.java.io.CharArrayWriter.bufferIncrementSize + *
  • gnu.java.io.CharArrayWriter.initialBufferSize
  • + *
  • gnu.java.io.CharArrayWriter.bufferIncrementSize
  • *
*

* There is a constructor that specified the initial buffer size and diff --git a/libjava/java/io/DataInput.java b/libjava/java/io/DataInput.java index 2d92006618a..52cd246110d 100644 --- a/libjava/java/io/DataInput.java +++ b/libjava/java/io/DataInput.java @@ -360,7 +360,7 @@ public interface DataInput * patterns which indicate a two byte character encoding, then they would be * converted to a Java char like so: *

- * (char)(((byte1 & 0x1F) << 6) + (byte2 & 0x3F)) + * (char)(((byte1 & 0x1F) << 6) + (byte2 & 0x3F)) *

* If the first byte has a 1110 as its high order bits, then the * character consists of three bytes. The bits that make up the character @@ -375,19 +375,19 @@ public interface DataInput * then they would be converted to a Java char like so: * * - * (char)(((byte1 & 0x0F) << 12) + ((byte2 & 0x3F) + (byte3 & 0x3F)) + * (char)(((byte1 & 0x0F) << 12) + ((byte2 & 0x3F) + (byte3 & 0x3F)) * * * Note that all characters are encoded in the method that requires the * fewest number of bytes with the exception of the character with the - * value of \u0000 which is encoded as two bytes. + * value of \<llll>u0000 which is encoded as two bytes. * This is a modification of the UTF standard used to prevent C language * style NUL values from appearing in the byte stream. *

* This method can read data that was written by an object implementing the * writeUTF() method in DataOutput. * - * @returns The String read + * @return The String read * * @exception EOFException If end of file is reached before reading the * String diff --git a/libjava/java/io/DataInputStream.java b/libjava/java/io/DataInputStream.java index 6b4b1d74ead..b33cbe756ba 100644 --- a/libjava/java/io/DataInputStream.java +++ b/libjava/java/io/DataInputStream.java @@ -277,16 +277,16 @@ public class DataInputStream extends FilterInputStream implements DataInput * buffer * @exception IOException If any other error occurs */ - public final void readFully (byte[] b, int off, int len) throws IOException + public final void readFully (byte[] buf, int offset, int len) throws IOException { while (len > 0) { // in.read will block until some data is available. - int numread = in.read (b, off, len); + int numread = in.read (buf, offset, len); if (numread < 0) throw new EOFException (); len -= numread; - off += numread; + offset += numread; } } diff --git a/libjava/java/io/File.java b/libjava/java/io/File.java index b4951ecc806..53ae529c6fe 100644 --- a/libjava/java/io/File.java +++ b/libjava/java/io/File.java @@ -1,5 +1,6 @@ /* File.java -- Class representing a file on disk - Copyright (C) 1998, 1999, 2000, 2001, 2003 Free Software Foundation, Inc. + Copyright (C) 1998, 1999, 2000, 2001, 2003, 2004 + Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -121,7 +122,7 @@ public class File implements Serializable, Comparable { if (Configuration.INIT_LOAD_LIBRARY) { - System.loadLibrary ("javaio"); + System.loadLibrary("javaio"); } init_native(); @@ -187,7 +188,7 @@ public class File implements Serializable, Comparable * the path of this File object if an only if that file * does not already exist. *

- * A SecurityManagercheckWrite check is done prior + * A SecurityManager.checkWrite check is done prior * to performing this action. * * @return true if the file was created, false if @@ -224,7 +225,7 @@ public class File implements Serializable, Comparable SecurityManager s = System.getSecurityManager(); if (s != null) - s.checkDelete (path); + s.checkDelete(path); return performDelete(); } @@ -244,7 +245,7 @@ public class File implements Serializable, Comparable * @return true if the two objects are equal, * false otherwise. */ - public boolean equals (Object obj) + public boolean equals(Object obj) { if (! (obj instanceof File)) return false; @@ -252,9 +253,9 @@ public class File implements Serializable, Comparable File other = (File) obj; if (caseSensitive) - return path.equals (other.path); + return path.equals(other.path); else - return path.equalsIgnoreCase (other.path); + return path.equalsIgnoreCase(other.path); } /** @@ -277,7 +278,7 @@ public class File implements Serializable, Comparable * * @param name The path name of the file */ - public File (String name) + public File(String name) { path = normalizePath (name); } @@ -354,7 +355,7 @@ public class File implements Serializable, Comparable * @param dirPath The path to the directory the file resides in * @param name The name of the file */ - public File (String dirPath, String name) + public File(String dirPath, String name) { if (name == null) throw new NullPointerException(); @@ -381,7 +382,7 @@ public class File implements Serializable, Comparable * @param directory The directory this file resides in * @param name The name of the file */ - public File (File directory, String name) + public File(File directory, String name) { this (directory == null ? null : directory.path, name); } @@ -448,7 +449,7 @@ public class File implements Serializable, Comparable */ public File getAbsoluteFile() { - return new File (getAbsolutePath()); + return new File(getAbsolutePath()); } /** @@ -479,7 +480,7 @@ public class File implements Serializable, Comparable */ public File getCanonicalFile() throws IOException { - return new File (getCanonicalPath()); + return new File(getCanonicalPath()); } /** @@ -591,7 +592,7 @@ public class File implements Serializable, Comparable public File getParentFile() { String parent = getParent(); - return parent != null ? new File (parent) : null; + return parent != null ? new File(parent) : null; } /** @@ -748,7 +749,7 @@ public class File implements Serializable, Comparable * @exception SecurityException If read access is not allowed to the * directory by the SecurityManager */ - public String[] list (FilenameFilter filter) + public String[] list(FilenameFilter filter) { checkRead(); return (String[]) performList (filter, null, String.class); @@ -826,7 +827,7 @@ public class File implements Serializable, Comparable * * @since 1.2 */ - public File[] listFiles (FilenameFilter filter) + public File[] listFiles(FilenameFilter filter) { checkRead(); return (File[]) performList (filter, null, File.class); @@ -856,7 +857,7 @@ public class File implements Serializable, Comparable * * @since 1.2 */ - public File[] listFiles (FileFilter filter) + public File[] listFiles(FileFilter filter) { checkRead(); return (File[]) performList (null, filter, File.class); @@ -982,8 +983,8 @@ public class File implements Serializable, Comparable * * @since 1.2 */ - public static File createTempFile (String prefix, String suffix, - File directory) + public static File createTempFile(String prefix, String suffix, + File directory) throws IOException { // Grab the system temp directory if necessary @@ -1005,7 +1006,7 @@ public class File implements Serializable, Comparable // Check if prefix is at least 3 characters long if (prefix.length() < 3) - throw new IllegalArgumentException ("Prefix too short: " + prefix); + throw new IllegalArgumentException("Prefix too short: " + prefix); // Set default value of suffix if (suffix == null) @@ -1146,10 +1147,10 @@ public class File implements Serializable, Comparable * this operation * @exception IOException If an error occurs */ - public static File createTempFile (String prefix, String suffix) + public static File createTempFile(String prefix, String suffix) throws IOException { - return createTempFile (prefix, suffix, null); + return createTempFile(prefix, suffix, null); } /** @@ -1168,7 +1169,7 @@ public class File implements Serializable, Comparable * * @since 1.2 */ - public int compareTo (File other) + public int compareTo(File other) { if (caseSensitive) return path.compareTo (other.path); @@ -1197,9 +1198,9 @@ public class File implements Serializable, Comparable * * @since 1.2 */ - public int compareTo (Object obj) + public int compareTo(Object obj) { - return compareTo ((File) obj); + return compareTo((File) obj); } /* @@ -1219,7 +1220,7 @@ public class File implements Serializable, Comparable * @exception SecurityException If write access is not allowed to the * file by the SecurityMananger. */ - public synchronized boolean renameTo (File dest) + public synchronized boolean renameTo(File dest) { SecurityManager s = System.getSecurityManager(); String sname = getName(); @@ -1253,7 +1254,7 @@ public class File implements Serializable, Comparable * * @since 1.2 */ - public boolean setLastModified (long time) + public boolean setLastModified(long time) { if (time < 0) throw new IllegalArgumentException("Negative modification time: " + time); @@ -1268,7 +1269,7 @@ public class File implements Serializable, Comparable SecurityManager s = System.getSecurityManager(); if (s != null) - s.checkWrite (path); + s.checkWrite(path); } private void checkRead() @@ -1277,7 +1278,7 @@ public class File implements Serializable, Comparable SecurityManager s = System.getSecurityManager(); if (s != null) - s.checkRead (path); + s.checkRead(path); } /** @@ -1299,13 +1300,13 @@ public class File implements Serializable, Comparable FileDeleter.add (this); } - private void writeObject (ObjectOutputStream oos) throws IOException + private void writeObject(ObjectOutputStream oos) throws IOException { oos.defaultWriteObject(); - oos.writeChar (separatorChar); + oos.writeChar(separatorChar); } - private void readObject (ObjectInputStream ois) + private void readObject(ObjectInputStream ois) throws ClassNotFoundException, IOException { ois.defaultReadObject(); @@ -1315,7 +1316,7 @@ public class File implements Serializable, Comparable char oldSeparatorChar = ois.readChar(); if (oldSeparatorChar != separatorChar) - path = path.replace (oldSeparatorChar, separatorChar); + path = path.replace(oldSeparatorChar, separatorChar); } } // class File diff --git a/libjava/java/io/FilterInputStream.java b/libjava/java/io/FilterInputStream.java index fe45d33e368..c81259bd25b 100644 --- a/libjava/java/io/FilterInputStream.java +++ b/libjava/java/io/FilterInputStream.java @@ -104,7 +104,7 @@ public class FilterInputStream extends InputStream */ public boolean markSupported() { - return(in.markSupported()); + return in.markSupported(); } /** @@ -126,7 +126,7 @@ public class FilterInputStream extends InputStream */ public int available() throws IOException { - return(in.available()); + return in.available(); } /** @@ -138,9 +138,9 @@ public class FilterInputStream extends InputStream * * @exception IOException If an error occurs */ - public long skip(long num_bytes) throws IOException + public long skip(long numBytes) throws IOException { - return(in.skip(num_bytes)); + return in.skip(numBytes); } /** @@ -152,7 +152,7 @@ public class FilterInputStream extends InputStream */ public int read() throws IOException { - return(in.read()); + return in.read(); } /** @@ -170,7 +170,7 @@ public class FilterInputStream extends InputStream */ public int read(byte[] buf) throws IOException { - return(read(buf, 0, buf.length)); + return read(buf, 0, buf.length); } /** @@ -186,7 +186,7 @@ public class FilterInputStream extends InputStream */ public int read(byte[] buf, int offset, int len) throws IOException { - return(in.read(buf, offset, len)); + return in.read(buf, offset, len); } /** @@ -200,6 +200,4 @@ public class FilterInputStream extends InputStream { in.close(); } - -} // class FilterInputStream - +} diff --git a/libjava/java/io/InputStream.java b/libjava/java/io/InputStream.java index 34068c628bb..610ccf1f177 100644 --- a/libjava/java/io/InputStream.java +++ b/libjava/java/io/InputStream.java @@ -105,7 +105,7 @@ public abstract class InputStream * @param readLimit The number of bytes that can be read before the * mark becomes invalid */ - public void mark(int readlimit) + public void mark(int readLimit) { // Do nothing } @@ -117,7 +117,7 @@ public abstract class InputStream * point. *

* This method always returns false in this class, but - * subclasses can override this method to return true + * subclasses can override this method to return true * if they support mark/reset functionality. * * @return true if mark/reset functionality is diff --git a/libjava/java/io/InputStreamReader.java b/libjava/java/io/InputStreamReader.java index 07be132510b..3ebbb4ec9e4 100644 --- a/libjava/java/io/InputStreamReader.java +++ b/libjava/java/io/InputStreamReader.java @@ -56,18 +56,18 @@ import gnu.gcj.convert.*; * Here is a list of standard encoding names that may be available: *

*

    - *
  • 8859_1 (ISO-8859-1/Latin-1) - *
  • 8859_2 (ISO-8859-2/Latin-2) - *
  • 8859_3 (ISO-8859-3/Latin-3) - *
  • 8859_4 (ISO-8859-4/Latin-4) - *
  • 8859_5 (ISO-8859-5/Latin-5) - *
  • 8859_6 (ISO-8859-6/Latin-6) - *
  • 8859_7 (ISO-8859-7/Latin-7) - *
  • 8859_8 (ISO-8859-8/Latin-8) - *
  • 8859_9 (ISO-8859-9/Latin-9) - *
  • ASCII (7-bit ASCII) - *
  • UTF8 (UCS Transformation Format-8) - *
  • More later + *
  • 8859_1 (ISO-8859-1/Latin-1)
  • + *
  • 8859_2 (ISO-8859-2/Latin-2)
  • + *
  • 8859_3 (ISO-8859-3/Latin-3)
  • + *
  • 8859_4 (ISO-8859-4/Latin-4)
  • + *
  • 8859_5 (ISO-8859-5/Latin-5)
  • + *
  • 8859_6 (ISO-8859-6/Latin-6)
  • + *
  • 8859_7 (ISO-8859-7/Latin-7)
  • + *
  • 8859_8 (ISO-8859-8/Latin-8)
  • + *
  • 8859_9 (ISO-8859-9/Latin-9)
  • + *
  • ASCII (7-bit ASCII)
  • + *
  • UTF8 (UCS Transformation Format-8)
  • + *
  • More later
  • *
*

* It is recommended that applications do not use @@ -170,7 +170,7 @@ public class InputStreamReader extends Reader * by this object. If the stream has been closed, this method is allowed * to return null. * - * @param The current encoding name + * @return The current encoding name */ public String getEncoding() { @@ -296,5 +296,4 @@ public class InputStreamReader extends Reader return count; } } -} // class InputStreamReader - +} diff --git a/libjava/java/io/ObjectInputStream.java b/libjava/java/io/ObjectInputStream.java index 0c5b020bbab..9747699a562 100644 --- a/libjava/java/io/ObjectInputStream.java +++ b/libjava/java/io/ObjectInputStream.java @@ -38,24 +38,20 @@ exception statement from your version. */ package java.io; +import gnu.classpath.Configuration; +import gnu.java.io.ObjectIdentityWrapper; + import java.lang.reflect.Array; +import java.lang.reflect.Field; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; import java.lang.reflect.Modifier; import java.lang.reflect.Proxy; -import java.security.PrivilegedAction; -import java.security.AccessController; import java.util.Arrays; import java.util.Hashtable; import java.util.Vector; -import gnu.java.io.ObjectIdentityWrapper; -import gnu.java.lang.reflect.TypeSignature; -import java.lang.reflect.Field; -import java.lang.reflect.Method; -import java.lang.reflect.InvocationTargetException; - -import gnu.classpath.Configuration; - public class ObjectInputStream extends InputStream implements ObjectInput, ObjectStreamConstants { diff --git a/libjava/java/io/ObjectStreamClass.java b/libjava/java/io/ObjectStreamClass.java index d080f280ba9..ee23f5996b5 100644 --- a/libjava/java/io/ObjectStreamClass.java +++ b/libjava/java/io/ObjectStreamClass.java @@ -104,17 +104,17 @@ public class ObjectStreamClass implements Serializable } } - /** * Returns the name of the class that this * ObjectStreamClass represents. + * + * @return the name of the class. */ public String getName() { return name; } - /** * Returns the class that this ObjectStreamClass * represents. Null could be returned if this @@ -129,24 +129,27 @@ public class ObjectStreamClass implements Serializable return clazz; } - /** * Returns the serial version stream-unique identifier for the class * represented by this ObjectStreamClass. This SUID is * either defined by the class as static final long * serialVersionUID or is calculated as specified in * Javasoft's "Object Serialization Specification" XXX: add reference + * + * @return the serial version UID. */ public long getSerialVersionUID() { return uid; } - - // Returns the serializable (non-static and non-transient) Fields - // of the class represented by this ObjectStreamClass. The Fields - // are sorted by name. - // XXX doc + /** + * Returns the serializable (non-static and non-transient) Fields + * of the class represented by this ObjectStreamClass. The Fields + * are sorted by name. + * + * @return the fields. + */ public ObjectStreamField[] getFields() { ObjectStreamField[] copy = new ObjectStreamField[ fields.length ]; @@ -154,7 +157,6 @@ public class ObjectStreamClass implements Serializable return copy; } - // XXX doc // Can't do binary search since fields is sorted by name and // primitiveness. @@ -166,7 +168,6 @@ public class ObjectStreamClass implements Serializable return null; } - /** * Returns a textual representation of this * ObjectStreamClass object including the name of the @@ -181,7 +182,6 @@ public class ObjectStreamClass implements Serializable return "java.io.ObjectStreamClass< " + name + ", " + uid + " >"; } - // Returns true iff the class that this ObjectStreamClass represents // has the following method: // diff --git a/libjava/java/io/PipedInputStream.java b/libjava/java/io/PipedInputStream.java index bf7730a85c4..91fca676fd9 100644 --- a/libjava/java/io/PipedInputStream.java +++ b/libjava/java/io/PipedInputStream.java @@ -277,7 +277,7 @@ public class PipedInputStream extends InputStream * @param offset The index into the buffer at which to start writing. * @param len The maximum number of bytes to read. * - * @exception IOException If close()/code> was called on this Piped + * @exception IOException If close() was called on this Piped * InputStream. */ public synchronized int read(byte[] buf, int offset, int len) diff --git a/libjava/java/io/PipedReader.java b/libjava/java/io/PipedReader.java index ec135427d09..3991ba94e45 100644 --- a/libjava/java/io/PipedReader.java +++ b/libjava/java/io/PipedReader.java @@ -256,7 +256,7 @@ public class PipedReader extends Reader * @param offset The index into the buffer at which to start writing. * @param len The maximum number of chars to read. * - * @exception IOException If close()/code> was called on this Piped + * @exception IOException If close() was called on this Piped * Reader. */ public int read(char[] buf, int offset, int len) diff --git a/libjava/java/io/PushbackInputStream.java b/libjava/java/io/PushbackInputStream.java index 778babd2c0b..379677d6613 100644 --- a/libjava/java/io/PushbackInputStream.java +++ b/libjava/java/io/PushbackInputStream.java @@ -263,7 +263,7 @@ public class PushbackInputStream extends FilterInputStream /** * This method pushed back bytes from the passed in array into the * pushback buffer. The bytes from b[offset] to - * b[offset + len] are pushed in reverse order so that + * b[offset + len] are pushed in reverse order so that * the next byte read from the stream after this operation will be * b[offset] followed by b[offset + 1], * etc. diff --git a/libjava/java/io/PushbackReader.java b/libjava/java/io/PushbackReader.java index 4b442e52c6f..cc2473a6c34 100644 --- a/libjava/java/io/PushbackReader.java +++ b/libjava/java/io/PushbackReader.java @@ -266,33 +266,34 @@ public class PushbackReader extends FilterReader * of the chars requested, the remaining chars are read from the * underlying stream. * - * @param buf The array into which the chars read should be stored + * @param buffer The array into which the chars read should be stored * @param offset The offset into the array to start storing chars - * @param len The requested number of chars to read + * @param length The requested number of chars to read * * @return The actual number of chars read, or -1 if end of stream. * * @exception IOException If an error occurs. */ - public synchronized int read(char[] b, int offset, int len) throws IOException + public synchronized int read(char[] buffer, int offset, int length) + throws IOException { synchronized (lock) { if (buf == null) throw new IOException("stream closed"); - if (offset < 0 || len < 0 || offset + len > b.length) + if (offset < 0 || length < 0 || offset + length > buffer.length) throw new ArrayIndexOutOfBoundsException(); - int numBytes = Math.min(buf.length - pos, len); + int numBytes = Math.min(buf.length - pos, length); if (numBytes > 0) { - System.arraycopy (buf, pos, b, offset, numBytes); + System.arraycopy (buf, pos, buffer, offset, numBytes); pos += numBytes; return numBytes; } - return super.read(b, offset, len); + return super.read(buffer, offset, length); } } @@ -353,30 +354,30 @@ public class PushbackReader extends FilterReader * If the pushback buffer cannot hold all of the requested chars, an * exception is thrown. * - * @param buf The char array to be pushed back + * @param buffer The char array to be pushed back * @param offset The index into the array where the chars to be push start - * @param len The number of chars to be pushed. + * @param length The number of chars to be pushed. * * @exception IOException If the pushback buffer is full */ - public synchronized void unread(char[] b, int offset, int len) + public synchronized void unread(char[] buffer, int offset, int length) throws IOException { synchronized (lock) { if (buf == null) throw new IOException("stream closed"); - if (pos < len) + if (pos < length) throw new IOException("Pushback buffer is full"); // Note the order that these chars are being added is the opposite // of what would be done if they were added to the buffer one at a time. // See the Java Class Libraries book p. 1397. - System.arraycopy(b, offset, buf, pos - len, len); + System.arraycopy(buffer, offset, buf, pos - length, length); // Don't put this into the arraycopy above, an exception might be thrown // and in that case we don't want to modify pos. - pos -= len; + pos -= length; } } } diff --git a/libjava/java/io/RandomAccessFile.java b/libjava/java/io/RandomAccessFile.java index f79c624755c..c20549c12df 100644 --- a/libjava/java/io/RandomAccessFile.java +++ b/libjava/java/io/RandomAccessFile.java @@ -318,12 +318,12 @@ public class RandomAccessFile implements DataOutput, DataInput * significant byte first (i.e., "big endian") regardless of the native * host byte ordering. *

- * As an example, if byte1 and code{byte2 represent + * As an example, if byte1 and byte2 represent * the first * and second byte read from the stream respectively, they will be * transformed to a char in the following manner: *

- * (char)(((byte1 & 0xFF) << 8) | (byte2 & 0xFF) + * (char)(((byte1 & 0xFF) << 8) | (byte2 & 0xFF) *

* This method can read a char written by an object * implementing the @@ -539,12 +539,12 @@ public class RandomAccessFile implements DataOutput, DataInput * significant byte first (i.e., "big endian") regardless of the native * host byte ordering. *

- * As an example, if byte1 and code{byte2 + * As an example, if byte1 and byte2 * represent the first * and second byte read from the stream respectively, they will be * transformed to a short in the following manner: *

- * (short)(((byte1 & 0xFF) << 8) | (byte2 & 0xFF) + * (short)(((byte1 & 0xFF) << 8) | (byte2 & 0xFF) *

* The value returned is in the range of -32768 to 32767. *

diff --git a/libjava/java/io/SerializablePermission.java b/libjava/java/io/SerializablePermission.java index d27dcf42667..1d2636bc19b 100644 --- a/libjava/java/io/SerializablePermission.java +++ b/libjava/java/io/SerializablePermission.java @@ -48,9 +48,9 @@ import java.security.BasicPermission; * There are currently two allowable permission names for this class: *

    *
  • enableSubclassImplementation - Allows a subclass to - * override the default serialization behavior of objects. + * override the default serialization behavior of objects.
  • *
  • enableSubstitution - Allows substitution of one object - * for another during serialization or deserialization. + * for another during serialization or deserialization.
  • *
* * @see java.security.BasicPermission diff --git a/libjava/java/io/StreamTokenizer.java b/libjava/java/io/StreamTokenizer.java index a77b699ff17..5c777b3723c 100644 --- a/libjava/java/io/StreamTokenizer.java +++ b/libjava/java/io/StreamTokenizer.java @@ -73,12 +73,12 @@ public class StreamTokenizer * The rules are as follows: *
    *
  • For a token consisting of a single ordinary character, this is the - * value of that character. - *
  • For a quoted string, this is the value of the quote character - *
  • For a word, this is TT_WORD - *
  • For a number, this is TT_NUMBER - *
  • For the end of the line, this is TT_EOL - *
  • For the end of the stream, this is TT_EOF + * value of that character.
  • + *
  • For a quoted string, this is the value of the quote character
  • + *
  • For a word, this is TT_WORD
  • + *
  • For a number, this is TT_NUMBER
  • + *
  • For the end of the line, this is TT_EOL
  • + *
  • For the end of the stream, this is TT_EOF
  • *
*/ public int ttype = TT_NONE; @@ -141,13 +141,13 @@ public class StreamTokenizer * following manner: *
    *
  • The values 'A' through 'Z', 'a' through 'z' and 0xA0 through 0xFF - * are initialized as alphabetic - *
  • The values 0x00 through 0x20 are initialized as whitespace - *
  • The values '\'' and '"' are initialized as quote characters - *
  • '/' is a comment character - *
  • Numbers will be parsed - *
  • EOL is not treated as significant - *
  • C and C++ (//) comments are not recognized + * are initialized as alphabetic
  • + *
  • The values 0x00 through 0x20 are initialized as whitespace
  • + *
  • The values '\'' and '"' are initialized as quote characters
  • + *
  • '/' is a comment character
  • + *
  • Numbers will be parsed
  • + *
  • EOL is not treated as significant
  • + *
  • C and C++ (//) comments are not recognized
  • *
* * @param in The Reader to read chars from @@ -251,13 +251,13 @@ public class StreamTokenizer * returns it. It also can set sval or nval * as described below. The parsing strategy is as follows: *
    - *
  • Skip any whitespace characters. + *
  • Skip any whitespace characters.
  • *
  • If a numeric character is encountered, attempt to parse a numeric * value. Leading '-' characters indicate a numeric only if followed by * another non-'-' numeric. The value of the numeric token is terminated * by either the first non-numeric encountered, or the second occurrence of * '-' or '.'. The token type returned is TT_NUMBER and nval - * is set to the value parsed. + * is set to the value parsed.
  • *
  • If an alphabetic character is parsed, all subsequent characters * are read until the first non-alphabetic or non-numeric character is * encountered. The token type returned is TT_WORD and the value parsed @@ -266,10 +266,10 @@ public class StreamTokenizer * sequence terminates a word only if EOL signficance has been turned on. * The start of a comment also terminates a word. Any character with a * non-alphabetic and non-numeric attribute (such as white space, a quote, - * or a commet) are treated as non-alphabetic and terminate the word. + * or a commet) are treated as non-alphabetic and terminate the word.
  • *
  • If a comment character is parsed, then all remaining characters on * the current line are skipped and another token is parsed. Any EOL or - * EOF's encountered are not discarded, but rather terminate the comment. + * EOF's encountered are not discarded, but rather terminate the comment.
  • *
  • If a quote character is parsed, then all characters up to the * second occurrence of the same quote character are parsed into a * String. This String is stored as @@ -280,18 +280,18 @@ public class StreamTokenizer * (carriage return), \" (double quote), \' (single quote), \\ * (backslash), \XXX (octal esacpe)) are converted to the appropriate * char values. Invalid esacape sequences are left in untranslated. - * Unicode characters like ('\ u0000') are not recognized. + * Unicode characters like ('\ u0000') are not recognized.
  • *
  • If the C++ comment sequence "//" is encountered, and the parser * is configured to handle that sequence, then the remainder of the line * is skipped and another token is read exactly as if a character with - * the comment attribute was encountered. + * the comment attribute was encountered.
  • *
  • If the C comment sequence "/*" is encountered, and the parser * is configured to handle that sequence, then all characters up to and * including the comment terminator sequence are discarded and another - * token is parsed. + * token is parsed.
  • *
  • If all cases above are not met, then the character is an ordinary * character that is parsed as a token by itself. The char encountered - * is returned as the token type. + * is returned as the token type.
  • *
* * @return The token type @@ -635,15 +635,15 @@ public class StreamTokenizer * 'x' is determined as follows. *

*

    - *
  • If no token has been read, then 'x' is "NOTHING" and 'n' is 0 - *
  • If ttype is TT_EOF, then 'x' is "EOF" - *
  • If ttype is TT_EOL, then 'x' is "EOL" - *
  • If ttype is TT_WORD, then 'x' is sval + *
  • If no token has been read, then 'x' is "NOTHING" and 'n' is 0
  • + *
  • If ttype is TT_EOF, then 'x' is "EOF"
  • + *
  • If ttype is TT_EOL, then 'x' is "EOL"
  • + *
  • If ttype is TT_WORD, then 'x' is sval
  • *
  • If ttype is TT_NUMBER, then 'x' is "n=strnval" where - * 'strnval' is String.valueOf(nval). + * 'strnval' is String.valueOf(nval).
  • *
  • If ttype is a quote character, then 'x' is - * sval - *
  • For all other cases, 'x' is ttype + * sval
  • + *
  • For all other cases, 'x' is ttype
  • *
*/ public String toString() diff --git a/libjava/java/io/StringWriter.java b/libjava/java/io/StringWriter.java index 660ef166a2e..c5aab8d157c 100644 --- a/libjava/java/io/StringWriter.java +++ b/libjava/java/io/StringWriter.java @@ -60,6 +60,8 @@ public class StringWriter extends Writer /** * This method closes the stream. The contents of the internal buffer * can still be retrieved, but future writes are not guaranteed to work. + * + * @exception IOException If an error orrurs. */ public void close () throws IOException { diff --git a/libjava/java/io/WriteAbortedException.java b/libjava/java/io/WriteAbortedException.java index 0204862ef14..7b683854d3d 100644 --- a/libjava/java/io/WriteAbortedException.java +++ b/libjava/java/io/WriteAbortedException.java @@ -81,7 +81,7 @@ public class WriteAbortedException extends ObjectStreamException /** * This method returns a message indicating what went wrong, in this * format: - * super.getMessage() + (detail == null ? "" : "; " + detail). + * super.getMessage() + (detail == null ? "" : "; " + detail). * * @return the chained message */ diff --git a/libjava/java/io/Writer.java b/libjava/java/io/Writer.java index f3d6eaa7392..60939c8ce99 100644 --- a/libjava/java/io/Writer.java +++ b/libjava/java/io/Writer.java @@ -75,8 +75,8 @@ public abstract class Writer * This method initializes a Writer that will synchronize * on the specified Object. * - * @param obj The Object to use for synchronizing critical - * sections + * @param lock The Object to use for synchronizing critical + * sections */ protected Writer(Object lock) { @@ -157,7 +157,7 @@ public abstract class Writer * * @param str The String whose chars are to be written. * - * @param IOException If an error occurs + * @exception IOException If an error occurs */ public void write(String str) throws IOException {