SignatureVisitor throws incosistent exceptions
org.objectweb.asm.util.CheckSignatureAdapter throws inconsistent exceptions. For example, visitClassBound throws IllegalStateException:
@Override public SignatureVisitor visitClassBound() { if (type == TYPE_SIGNATURE || !VISIT_CLASS_BOUND_STATES.contains(state)) { throw new IllegalStateException(); } state = State.BOUND; return new CheckSignatureAdapter( TYPE_SIGNATURE, signatureVisitor == null ? null : signatureVisitor.visitClassBound()); }
Meanwhile, visitInterfaceBound throws IllegalArgumentException:
@Override public SignatureVisitor visitInterfaceBound() { if (type == TYPE_SIGNATURE || !VISIT_INTERFACE_BOUND_STATES.contains(state)) { throw new IllegalArgumentException(); } return new CheckSignatureAdapter( TYPE_SIGNATURE, signatureVisitor == null ? null : signatureVisitor.visitInterfaceBound()); }
The above method is strange to throw IllegalArgumentException, in that it has no argument.