summaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
authorShigeru Chiba <chibash@users.noreply.github.com>2019-12-23 22:58:38 +0900
committerGitHub <noreply@github.com>2019-12-23 22:58:38 +0900
commitafe124ffa5794c881c212fb1ebec51a554d0e332 (patch)
treef46a969c89a15bd38dc81f92b90449d5e72dd54c /src/main
parent9f1f605c12aa2b7d5deb45daaa1412f50c109562 (diff)
parent4f8e274703e5cf45febb69510df9f86a8846f1f5 (diff)
downloadjavassist-afe124ffa5794c881c212fb1ebec51a554d0e332.tar.gz
javassist-afe124ffa5794c881c212fb1ebec51a554d0e332.zip
Merge pull request #294 from junwen12221/master
Supports parsing 'byte[] a = new byte[]{};'. Only parsing is supported. Javassist reports a not-supported error.
Diffstat (limited to 'src/main')
-rw-r--r--src/main/javassist/compiler/Parser.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/main/javassist/compiler/Parser.java b/src/main/javassist/compiler/Parser.java
index c67d49ec..5290450c 100644
--- a/src/main/javassist/compiler/Parser.java
+++ b/src/main/javassist/compiler/Parser.java
@@ -681,6 +681,10 @@ public final class Parser implements TokenId {
throws CompileError
{
lex.get(); // '{'
+ if(lex.lookAhead() == '}'){
+ lex.get();
+ return new ArrayInit(new IntConst(0,TokenId.IntConstant));
+ }
ASTree expr = parseExpression(tbl);
ArrayInit init = new ArrayInit(expr);
while (lex.lookAhead() == ',') {