Apply suggestions from code review
Co-authored-by: Andreas Dangel <andreas.dangel@adangel.org>
This commit is contained in:
@ -26,18 +26,16 @@ public class PLSQLParser extends JjtreeParserAdapter<ASTInput> {
|
|||||||
// The original casing can be found by looking at the TextDocument for the file.
|
// The original casing can be found by looking at the TextDocument for the file.
|
||||||
|
|
||||||
// NOTE: the size of this array should be greater than the number of tokens in the file.
|
// NOTE: the size of this array should be greater than the number of tokens in the file.
|
||||||
private static final String[] STRING_LITERAL_IMAGES_EXTRA = new String[512];
|
private static final String[] STRING_LITERAL_IMAGES_EXTRA = new String[PLSQLTokenKinds.TOKEN_NAMES.size()];
|
||||||
|
|
||||||
static {
|
static {
|
||||||
int i = 0;
|
for (int i = 0; i < PLSQLTokenKinds.TOKEN_NAMES.size(); i++) {
|
||||||
String image = PLSQLTokenKinds.describe(i);
|
String image = PLSQLTokenKinds.TOKEN_NAMES.get(i);
|
||||||
while (image != null && i < STRING_LITERAL_IMAGES_EXTRA.length) {
|
|
||||||
if (image.startsWith("\"") && image.endsWith("\"")) {
|
if (image.startsWith("\"") && image.endsWith("\"")) {
|
||||||
// a string literal image, remove the quotes
|
// a string literal image, remove the quotes
|
||||||
image = image.substring(1, image.length() - 1);
|
image = image.substring(1, image.length() - 1);
|
||||||
STRING_LITERAL_IMAGES_EXTRA[i] = image;
|
STRING_LITERAL_IMAGES_EXTRA[i] = image;
|
||||||
}
|
}
|
||||||
i++;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user