From: cjw Date: Thu, 5 Dec 2019 13:15:55 +0000 (+0800) Subject: Support parsing 'byte[] a = new byte[]{};' X-Git-Tag: rel_3_27_0_ga~2^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=4f8e274703e5cf45febb69510df9f86a8846f1f5;p=javassist.git Support parsing 'byte[] a = new byte[]{};' --- 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() == ',') {