]> source.dussan.org Git - javassist.git/commitdiff
Remove DUP check in TransformNewClass 467/head
authorshifujun <shifujun@foxmail.com>
Fri, 8 Dec 2023 13:36:45 +0000 (21:36 +0800)
committershifujun <shifujun@foxmail.com>
Fri, 8 Dec 2023 13:36:45 +0000 (21:36 +0800)
DUP usually come after NEW, but not necessary.

#453

src/main/javassist/convert/TransformNewClass.java

index 83f2a0cc7a85b5bb8ed7340a5541fec09fe00c6f..56738a103c9423175f2c9e5e051b5edcdd21daea 100644 (file)
@@ -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);