-
Notifications
You must be signed in to change notification settings - Fork 738
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
VarargsCollectorHandle.asType throws WrongMethodTypeException #4977
Conversation
jenkins test sanity zlinux jdk8,jdk11 |
jenkins test extended plinux jdk8,jdk11 |
collector = (CollectHandle) next.asCollector(arrayType, collectCount); | ||
} catch (IllegalArgumentException iae) { | ||
/*[MSG "K0681", "Failed to build collector"]*/ | ||
throw new WrongMethodTypeException(com.ibm.oti.util.Msg.getString("K0681"), iae); //$NON-NLS-1$ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can the exception be moved to a helper method?
private WrongMethodTypeException throwNewWMTE(IlegalArgumentException iae) {
throw new WrongMethodTypeException(com.ibm.oti.util.Msg.getString("K0681"), iae); //$NON-NLS-1$
}
and the call becomes the code below to make it clear to the reader (and the JIT!) that there is no path past this code:
throw throwNewWMTE(iae);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, PR has been updated accordingly and verified manually that the test passes with this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you push the change again?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, sorry, it should be updated now.
Convert IllegalArgumentException to WrongMethodTypeException within VarargsCollectorHandle.asType(). Signed-off-by: Jason Feng <fengj@ca.ibm.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Previous change passed all the tests. This is a refactoring of the same change so will run a simple compile on it. |
Jenkins compile xlinux jdk8 |
@JasonFengJ9 please create the PR against the 0.13 branch. |
|
VarargsCollectorHandle.asType()
throwsWrongMethodTypeException
Convert
IllegalArgumentException
toWrongMethodTypeException
withinVarargsCollectorHandle.asType()
.This PR passes the test within #4937.
Note: Java doc states that
java.lang.invoke.MethodHandle
can throwsNullPointerException
if newType is anull
reference orWrongMethodTypeException
if the conversion cannot be made. There is noIllegalArgumentException
thrown.It appears there are other cases that
IllegalArgumentException
might be thrown. I would like to leave it as is for now since no test complains or another PR if required.closes: #4937
Reviewer: @pshipton
Signed-off-by: Jason Feng fengj@ca.ibm.com