From d191c482b1bf2cdf4bfc41d8d909e9de04aa9040 Mon Sep 17 00:00:00 2001 From: JFLex GitHub CI Date: Wed, 1 Jan 2025 22:25:35 +0000 Subject: [PATCH] Pseudo-Merge b820ca9 Update generated array style (#1111) commit b820ca937d6b78d5b8383a3ecea533e5ee863f72 Author: Kurt Alfred Kluever AuthorDate: Wed Jan 1 17:24:42 2025 -0500 Commit: GitHub CommitDate: Thu Jan 2 09:24:42 2025 +1100 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. Updated from --- java/jflex/skeleton.default | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/java/jflex/skeleton.default b/java/jflex/skeleton.default index c48a5501a..64798f706 100644 --- a/java/jflex/skeleton.default +++ b/java/jflex/skeleton.default @@ -19,7 +19,7 @@ * Error messages for {@link #ZZ_UNKNOWN_ERROR}, {@link #ZZ_NO_MATCH}, and * {@link #ZZ_PUSHBACK_2BIG} respectively. */ - private static final String ZZ_ERROR_MSG[] = { + private static final String[] ZZ_ERROR_MSG = { "Unknown internal scanner error", "Error: could not match input", "Error: pushback value was too large" @@ -39,7 +39,7 @@ * This buffer contains the current text to be matched and is the source of the {@link #yytext()} * string. */ - private char zzBuffer[] = new char[Math.min(ZZ_BUFFERSIZE, zzMaxBufferLen())]; + private char[] zzBuffer = new char[Math.min(ZZ_BUFFERSIZE, zzMaxBufferLen())]; /** Text position at the last accepting state. */ private int zzMarkedPos; @@ -97,7 +97,7 @@ /* is the buffer big enough? */ if (zzCurrentPos >= zzBuffer.length - zzFinalHighSurrogate && zzCanGrow()) { /* if not, and it can grow: blow it up */ - char newBuffer[] = new char[Math.min(zzBuffer.length * 2, zzMaxBufferLen())]; + char[] newBuffer = new char[Math.min(zzBuffer.length * 2, zzMaxBufferLen())]; System.arraycopy(zzBuffer, 0, newBuffer, 0, zzBuffer.length); zzBuffer = newBuffer; zzEndRead += zzFinalHighSurrogate;