Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
asm
asm
Commits
2db00c46
Commit
2db00c46
authored
Jan 16, 2021
by
Eric Bruneton
Browse files
Use consistent exceptions in visitLabel.
parent
3f9be5ef
Pipeline
#10689
passed with stage
in 7 minutes and 54 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
asm-util/src/main/java/org/objectweb/asm/util/CheckMethodAdapter.java
View file @
2db00c46
...
...
@@ -784,7 +784,7 @@ public class CheckMethodAdapter extends MethodVisitor {
checkVisitMaxsNotCalled
();
checkLabel
(
label
,
false
,
"label"
);
if
(
labelInsnIndices
.
get
(
label
)
!=
null
)
{
throw
new
Illegal
Argument
Exception
(
"Already visited label"
);
throw
new
Illegal
State
Exception
(
"Already visited label"
);
}
labelInsnIndices
.
put
(
label
,
insnCount
);
super
.
visitLabel
(
label
);
...
...
asm-util/src/test/java/org/objectweb/asm/util/CheckMethodAdapterTest.java
View file @
2db00c46
...
...
@@ -595,7 +595,7 @@ public class CheckMethodAdapterTest extends AsmTest implements Opcodes {
Executable
visitLabel
=
()
->
checkMethodAdapter
.
visitLabel
(
label
);
Exception
exception
=
assertThrows
(
Illegal
Argument
Exception
.
class
,
visitLabel
);
Exception
exception
=
assertThrows
(
Illegal
State
Exception
.
class
,
visitLabel
);
assertEquals
(
"Already visited label"
,
exception
.
getMessage
());
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment