From 9e1b19e22e5884335d2f4d36b15728d5546c64f1 Mon Sep 17 00:00:00 2001 From: shifujun Date: Fri, 8 Dec 2023 21:36:45 +0800 Subject: [PATCH] Remove DUP check in TransformNewClass DUP usually come after NEW, but not necessary. #453 --- src/main/javassist/convert/TransformNewClass.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/main/javassist/convert/TransformNewClass.java b/src/main/javassist/convert/TransformNewClass.java index 83f2a0cc..56738a10 100644 --- a/src/main/javassist/convert/TransformNewClass.java +++ b/src/main/javassist/convert/TransformNewClass.java @@ -56,9 +56,6 @@ final public class TransformNewClass extends Transformer { if (c == NEW) { index = iterator.u16bitAt(pos + 1); if (cp.getClassInfo(index).equals(classname)) { - if (iterator.byteAt(pos + 3) != DUP) - throw new CannotCompileException( - "NEW followed by no DUP was found"); if (newClassIndex == 0) newClassIndex = cp.addClassInfo(newClassName); -- 2.39.5