mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
8300863: Remove C-style array declarations in java.io
Reviewed-by: alanb, rriggs, darcy, iris
This commit is contained in:
parent
2292ce137c
commit
57f2d48e1e
8 changed files with 19 additions and 19 deletions
|
@ -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.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* 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.
|
* 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
|
* The number of valid bytes in the buffer. This value is always
|
||||||
|
|
|
@ -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.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* 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 Writer out;
|
||||||
|
|
||||||
private char cb[];
|
private char[] cb;
|
||||||
private int nChars, nextChar;
|
private int nChars;
|
||||||
|
private int nextChar;
|
||||||
private final int maxChars; // maximum number of buffers chars
|
private final int maxChars; // maximum number of buffers chars
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -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.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* 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
|
* stream; element {@code buf[pos]} is
|
||||||
* the next byte to be read.
|
* 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.
|
* The index of the next character to read from the input stream buffer.
|
||||||
|
|
|
@ -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.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* 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.
|
* The buffer where data is stored.
|
||||||
*/
|
*/
|
||||||
protected byte buf[];
|
protected byte[] buf;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The number of valid bytes in the buffer.
|
* The number of valid bytes in the buffer.
|
||||||
|
|
|
@ -44,7 +44,7 @@ public class CharArrayWriter extends Writer {
|
||||||
/**
|
/**
|
||||||
* The buffer where data is stored.
|
* The buffer where data is stored.
|
||||||
*/
|
*/
|
||||||
protected char buf[];
|
protected char[] buf;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The number of chars in the buffer.
|
* The number of chars in the buffer.
|
||||||
|
|
|
@ -1216,7 +1216,7 @@ public class File
|
||||||
* @see java.nio.file.Files#newDirectoryStream(Path,String)
|
* @see java.nio.file.Files#newDirectoryStream(Path,String)
|
||||||
*/
|
*/
|
||||||
public String[] list(FilenameFilter filter) {
|
public String[] list(FilenameFilter filter) {
|
||||||
String names[] = normalizedList();
|
String[] names = normalizedList();
|
||||||
if ((names == null) || (filter == null)) {
|
if ((names == null) || (filter == null)) {
|
||||||
return names;
|
return names;
|
||||||
}
|
}
|
||||||
|
@ -1309,7 +1309,7 @@ public class File
|
||||||
* @see java.nio.file.Files#newDirectoryStream(Path,String)
|
* @see java.nio.file.Files#newDirectoryStream(Path,String)
|
||||||
*/
|
*/
|
||||||
public File[] listFiles(FilenameFilter filter) {
|
public File[] listFiles(FilenameFilter filter) {
|
||||||
String ss[] = normalizedList();
|
String[] ss = normalizedList();
|
||||||
if (ss == null) return null;
|
if (ss == null) return null;
|
||||||
ArrayList<File> files = new ArrayList<>();
|
ArrayList<File> files = new ArrayList<>();
|
||||||
for (String s : ss)
|
for (String s : ss)
|
||||||
|
@ -1347,7 +1347,7 @@ public class File
|
||||||
* @see java.nio.file.Files#newDirectoryStream(Path,java.nio.file.DirectoryStream.Filter)
|
* @see java.nio.file.Files#newDirectoryStream(Path,java.nio.file.DirectoryStream.Filter)
|
||||||
*/
|
*/
|
||||||
public File[] listFiles(FileFilter filter) {
|
public File[] listFiles(FileFilter filter) {
|
||||||
String ss[] = normalizedList();
|
String[] ss = normalizedList();
|
||||||
if (ss == null) return null;
|
if (ss == null) return null;
|
||||||
ArrayList<File> files = new ArrayList<>();
|
ArrayList<File> files = new ArrayList<>();
|
||||||
for (String s : ss) {
|
for (String s : ss) {
|
||||||
|
|
|
@ -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.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* 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.
|
* 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
|
* The index of the position in the circular buffer at which the
|
||||||
|
@ -100,7 +100,6 @@ public class PipedReader extends Reader {
|
||||||
connect(src);
|
connect(src);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a {@code PipedReader} so
|
* Creates a {@code PipedReader} so
|
||||||
* that it is not yet {@linkplain #connect(java.io.PipedWriter)
|
* that it is not yet {@linkplain #connect(java.io.PipedWriter)
|
||||||
|
|
|
@ -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.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* 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 Reader reader = null;
|
||||||
private InputStream input = 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
|
* 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 slashSlashCommentsP = false;
|
||||||
private boolean slashStarCommentsP = 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_WHITESPACE = 1;
|
||||||
private static final byte CT_DIGIT = 2;
|
private static final byte CT_DIGIT = 2;
|
||||||
private static final byte CT_ALPHA = 4;
|
private static final byte CT_ALPHA = 4;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue