diff --git a/src/main/java/com/mebigfatguy/fbcontrib/detect/IncorrectInternalClassUse.java b/src/main/java/com/mebigfatguy/fbcontrib/detect/IncorrectInternalClassUse.java index 65417058..f5c8b3d3 100755 --- a/src/main/java/com/mebigfatguy/fbcontrib/detect/IncorrectInternalClassUse.java +++ b/src/main/java/com/mebigfatguy/fbcontrib/detect/IncorrectInternalClassUse.java @@ -20,6 +20,7 @@ import java.util.Set; +import org.apache.bcel.Constants; import org.apache.bcel.classfile.Constant; import org.apache.bcel.classfile.ConstantClass; import org.apache.bcel.classfile.ConstantPool; @@ -101,7 +102,14 @@ public void visitClassContext(ClassContext context) { if (!isInternal(cls.getClassName())) { ConstantPool pool = cls.getConstantPool(); int numItems = pool.getLength(); + + byte lastTag = Constants.CONSTANT_Class; for (int i = 1; i < numItems; i++) { + if (lastTag == Constants.CONSTANT_Double || lastTag == Constants.CONSTANT_Long) { + lastTag = Constants.CONSTANT_Class; + continue; + } + Constant c = pool.getConstant(i); if (c instanceof ConstantClass) { String clsName = ((ConstantClass) c).getBytes(pool); @@ -111,6 +119,7 @@ public void visitClassContext(ClassContext context) { .addClass(cls).addString(clsName)); } } + lastTag = c.getTag(); } } }