diff --git a/src/java.base/share/classes/java/io/BufferedOutputStream.java b/src/java.base/share/classes/java/io/BufferedOutputStream.java index 7a703977068..ecc1e8a8a48 100644 --- a/src/java.base/share/classes/java/io/BufferedOutputStream.java +++ b/src/java.base/share/classes/java/io/BufferedOutputStream.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1994, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1994, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -48,7 +48,7 @@ public class BufferedOutputStream extends FilterOutputStream { /** * The internal buffer where data is stored. */ - protected byte buf[]; + protected byte[] buf; /** * The number of valid bytes in the buffer. This value is always diff --git a/src/java.base/share/classes/java/io/BufferedWriter.java b/src/java.base/share/classes/java/io/BufferedWriter.java index daaeb5a6419..4cb958afd74 100644 --- a/src/java.base/share/classes/java/io/BufferedWriter.java +++ b/src/java.base/share/classes/java/io/BufferedWriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -73,8 +73,9 @@ public class BufferedWriter extends Writer { private Writer out; - private char cb[]; - private int nChars, nextChar; + private char[] cb; + private int nChars; + private int nextChar; private final int maxChars; // maximum number of buffers chars /** diff --git a/src/java.base/share/classes/java/io/ByteArrayInputStream.java b/src/java.base/share/classes/java/io/ByteArrayInputStream.java index 221e7666e48..11f207787bd 100644 --- a/src/java.base/share/classes/java/io/ByteArrayInputStream.java +++ b/src/java.base/share/classes/java/io/ByteArrayInputStream.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1994, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1994, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -53,7 +53,7 @@ public class ByteArrayInputStream extends InputStream { * stream; element {@code buf[pos]} is * the next byte to be read. */ - protected byte buf[]; + protected byte[] buf; /** * The index of the next character to read from the input stream buffer. diff --git a/src/java.base/share/classes/java/io/ByteArrayOutputStream.java b/src/java.base/share/classes/java/io/ByteArrayOutputStream.java index f4660cb59e1..1052b057d17 100644 --- a/src/java.base/share/classes/java/io/ByteArrayOutputStream.java +++ b/src/java.base/share/classes/java/io/ByteArrayOutputStream.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1994, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1994, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -51,7 +51,7 @@ public class ByteArrayOutputStream extends OutputStream { /** * The buffer where data is stored. */ - protected byte buf[]; + protected byte[] buf; /** * The number of valid bytes in the buffer. diff --git a/src/java.base/share/classes/java/io/CharArrayWriter.java b/src/java.base/share/classes/java/io/CharArrayWriter.java index 72320eecdfe..0045c242cdf 100644 --- a/src/java.base/share/classes/java/io/CharArrayWriter.java +++ b/src/java.base/share/classes/java/io/CharArrayWriter.java @@ -44,7 +44,7 @@ public class CharArrayWriter extends Writer { /** * The buffer where data is stored. */ - protected char buf[]; + protected char[] buf; /** * The number of chars in the buffer. diff --git a/src/java.base/share/classes/java/io/File.java b/src/java.base/share/classes/java/io/File.java index 857eef0d7c8..0b6167f8c4e 100644 --- a/src/java.base/share/classes/java/io/File.java +++ b/src/java.base/share/classes/java/io/File.java @@ -1216,7 +1216,7 @@ public class File * @see java.nio.file.Files#newDirectoryStream(Path,String) */ public String[] list(FilenameFilter filter) { - String names[] = normalizedList(); + String[] names = normalizedList(); if ((names == null) || (filter == null)) { return names; } @@ -1309,7 +1309,7 @@ public class File * @see java.nio.file.Files#newDirectoryStream(Path,String) */ public File[] listFiles(FilenameFilter filter) { - String ss[] = normalizedList(); + String[] ss = normalizedList(); if (ss == null) return null; ArrayList files = new ArrayList<>(); for (String s : ss) @@ -1347,7 +1347,7 @@ public class File * @see java.nio.file.Files#newDirectoryStream(Path,java.nio.file.DirectoryStream.Filter) */ public File[] listFiles(FileFilter filter) { - String ss[] = normalizedList(); + String[] ss = normalizedList(); if (ss == null) return null; ArrayList files = new ArrayList<>(); for (String s : ss) { diff --git a/src/java.base/share/classes/java/io/PipedReader.java b/src/java.base/share/classes/java/io/PipedReader.java index ea85089e0fa..fe4cee4ee12 100644 --- a/src/java.base/share/classes/java/io/PipedReader.java +++ b/src/java.base/share/classes/java/io/PipedReader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -54,7 +54,7 @@ public class PipedReader extends Reader { /** * The circular buffer into which incoming data is placed. */ - char buffer[]; + char[] buffer; /** * The index of the position in the circular buffer at which the @@ -100,7 +100,6 @@ public class PipedReader extends Reader { connect(src); } - /** * Creates a {@code PipedReader} so * that it is not yet {@linkplain #connect(java.io.PipedWriter) diff --git a/src/java.base/share/classes/java/io/StreamTokenizer.java b/src/java.base/share/classes/java/io/StreamTokenizer.java index 5567b532104..e2812ff8787 100644 --- a/src/java.base/share/classes/java/io/StreamTokenizer.java +++ b/src/java.base/share/classes/java/io/StreamTokenizer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -68,7 +68,7 @@ public class StreamTokenizer { private Reader reader = null; private InputStream input = null; - private char buf[] = new char[20]; + private char[] buf = new char[20]; /** * The next character to be considered by the nextToken method. May also @@ -91,7 +91,7 @@ public class StreamTokenizer { private boolean slashSlashCommentsP = false; private boolean slashStarCommentsP = false; - private byte ctype[] = new byte[256]; + private final byte[] ctype = new byte[256]; private static final byte CT_WHITESPACE = 1; private static final byte CT_DIGIT = 2; private static final byte CT_ALPHA = 4;