mbien commented on code in PR #9436:
URL: https://github.com/apache/netbeans/pull/9436#discussion_r3407852769
##########
enterprise/web.beans/src/org/netbeans/modules/web/beans/impl/model/EnableBeansFilter.java:
##########
@@ -473,36 +502,27 @@ private void checkFinalMethods( TypeElement typeElement,
continue;
}
if ( hasModifier(overloaded, Modifier.FINAL)){
- types.remove(typeElement);
elements.remove( typeElement );
return;
}
}
}
- private DeclaredType getDeclaredType( TypeMirror type ){
- if ( type instanceof DeclaredType && type.getKind()!= TypeKind.ERROR){
- return (DeclaredType)type;
- }
- if ( type instanceof TypeVariable ){
- TypeMirror upperBound = ((TypeVariable)type).getUpperBound();
- return getDeclaredType( upperBound );
- }
- else if ( type instanceof WildcardType ){
- TypeMirror extendsBound = ((WildcardType)type).getExtendsBound();
- return getDeclaredType( extendsBound );
- }
- return null;
+ private DeclaredType getDeclaredType(TypeMirror type) {
+ return switch (type) {
+ case DeclaredType dt when type.getKind() != TypeKind.ERROR ->
+ dt;
+ case TypeVariable tv ->
+ getDeclaredType(tv.getUpperBound());
+ case WildcardType wt ->
+ getDeclaredType(wt.getExtendsBound());
+ default ->
+ null;
+ };
}
Review Comment:
nitpick: if you want you can keep those cases in one line. The formatter has
currently no working setting for it unfortunately.
(https://github.com/apache/netbeans/issues/7326)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists