Skip to content

Commit

Permalink
Remove DUP check in TransformNewClass
Browse files Browse the repository at this point in the history
DUP usually come after NEW, but not necessary.

#453
  • Loading branch information
shifujun committed Dec 8, 2023
1 parent 1582943 commit 9e1b19e
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions src/main/javassist/convert/TransformNewClass.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,6 @@ public int transform(CtClass clazz, int pos, CodeIterator iterator,
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);
Expand Down

0 comments on commit 9e1b19e

Please sign in to comment.