-
Notifications
You must be signed in to change notification settings - Fork 347
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
Fix #2985 by using proper types. #3026
Conversation
The misc failure is:
|
I've suppressed the warning. The parameter is needed to determine the return type. |
List<String> expressions = | ||
AnnotationUtils.getElementValueArray( | ||
contractAnnotation, "expression", String.class, false); | ||
Boolean annoResult = | ||
AnnotationUtils.getElementValueOrNull( | ||
contractAnnotation, "result", Boolean.class, false); | ||
for (String expr : expressions) { | ||
result.add( | ||
Contract.create(kind, expr, enforcedQualifier, contractAnnotation, annoResult)); | ||
@SuppressWarnings("unchecked") // clazz consistent with enum |
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.
Instead of suppressing this warning and the ErrorProne warning, you could use clazz.cast(...)
instead. Any reason not to do that?
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.
No reason, clazz.cast
is indeed much nicer.
No description provided.