Skip to content

Commit b820ca9

Browse files
authored
Update generated array style (#1111)
C-style array declarations (e.g. `Foo foos[]`) is discouraged by the JLS. Java style (e.g., `Foo[] foos`) should be preferred.
1 parent 4c942c5 commit b820ca9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

jflex/src/main/resources/jflex/skeleton.default

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
* Error messages for {@link #ZZ_UNKNOWN_ERROR}, {@link #ZZ_NO_MATCH}, and
2020
* {@link #ZZ_PUSHBACK_2BIG} respectively.
2121
*/
22-
private static final String ZZ_ERROR_MSG[] = {
22+
private static final String[] ZZ_ERROR_MSG = {
2323
"Unknown internal scanner error",
2424
"Error: could not match input",
2525
"Error: pushback value was too large"
@@ -39,7 +39,7 @@
3939
* This buffer contains the current text to be matched and is the source of the {@link #yytext()}
4040
* string.
4141
*/
42-
private char zzBuffer[] = new char[Math.min(ZZ_BUFFERSIZE, zzMaxBufferLen())];
42+
private char[] zzBuffer = new char[Math.min(ZZ_BUFFERSIZE, zzMaxBufferLen())];
4343

4444
/** Text position at the last accepting state. */
4545
private int zzMarkedPos;
@@ -97,7 +97,7 @@
9797
/* is the buffer big enough? */
9898
if (zzCurrentPos >= zzBuffer.length - zzFinalHighSurrogate && zzCanGrow()) {
9999
/* if not, and it can grow: blow it up */
100-
char newBuffer[] = new char[Math.min(zzBuffer.length * 2, zzMaxBufferLen())];
100+
char[] newBuffer = new char[Math.min(zzBuffer.length * 2, zzMaxBufferLen())];
101101
System.arraycopy(zzBuffer, 0, newBuffer, 0, zzBuffer.length);
102102
zzBuffer = newBuffer;
103103
zzEndRead += zzFinalHighSurrogate;

0 commit comments

Comments
 (0)