From 4f8e274703e5cf45febb69510df9f86a8846f1f5 Mon Sep 17 00:00:00 2001 From: cjw Date: Thu, 5 Dec 2019 21:15:55 +0800 Subject: [PATCH] Support parsing 'byte[] a = new byte[]{};' --- src/main/javassist/compiler/Parser.java | 4 ++++ 1 file changed, 4 insertions(+) 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() == ',') { -- 2.39.5