NicolaIsotta commented on code in PR #9625:
URL: https://github.com/apache/netbeans/pull/9625#discussion_r4075862958


##########
enterprise/web.jsf/src/org/netbeans/modules/web/jsf/impl/metamodel/ComponentImpl.java:
##########
@@ -120,4 +123,18 @@ public boolean refresh(TypeElement typeElement) {
         }
         return true;
     }
+
+    /**
+     * @return The {@code NAMESPACE} constant of the {@code @FacesComponent} 
annotation
+     */
+    private static String getDefaultNamespace(AnnotationMirror 
annotationMirror) {
+        Element annotationType = 
annotationMirror.getAnnotationType().asElement();
+        for (VariableElement field : 
ElementFilter.fieldsIn(annotationType.getEnclosedElements())) {
+            if ("NAMESPACE".contentEquals(field.getSimpleName()) // NOI18N
+                    && field.getConstantValue() instanceof String namespace) {
+                return namespace;
+            }
+        }
+        return null; // no namespace field on jsf 2.1-

Review Comment:
   IMHO it makes more sense to return null since JSF 2.1- did not have the 
`namespace` field.
   It won't be checked anyway since `createTag` was missing too.
   
https://javadoc.io/static/javax.faces/javax.faces-api/2.1/javax/faces/component/FacesComponent.html



-- 
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

Reply via email to