Commit 2db00c46 authored by Eric Bruneton's avatar Eric Bruneton
Browse files

Use consistent exceptions in visitLabel.

parent 3f9be5ef
Pipeline #10689 passed with stage
in 7 minutes and 54 seconds
......@@ -784,7 +784,7 @@ public class CheckMethodAdapter extends MethodVisitor {
checkVisitMaxsNotCalled();
checkLabel(label, false, "label");
if (labelInsnIndices.get(label) != null) {
throw new IllegalArgumentException("Already visited label");
throw new IllegalStateException("Already visited label");
}
labelInsnIndices.put(label, insnCount);
super.visitLabel(label);
......
......@@ -595,7 +595,7 @@ public class CheckMethodAdapterTest extends AsmTest implements Opcodes {
Executable visitLabel = () -> checkMethodAdapter.visitLabel(label);
Exception exception = assertThrows(IllegalArgumentException.class, visitLabel);
Exception exception = assertThrows(IllegalStateException.class, visitLabel);
assertEquals("Already visited label", exception.getMessage());
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment