matthiasblaesing commented on code in PR #9606:
URL: https://github.com/apache/netbeans/pull/9606#discussion_r3999428861


##########
enterprise/web.jsf.editor/src/org/netbeans/modules/web/jsf/editor/facelets/TagImpl.java:
##########
@@ -56,16 +57,12 @@ public boolean hasNonGenenericAttributes() {
 
     @Override
     public Collection<Attribute> getAttributes() {
-        //merge with default attributes
-        Collection<Attribute> all = new ArrayList<>(super.getAttributes());
-        all.addAll(attrs.values());
-        return all;
+        return attrs.values();

Review Comment:
   I suggest to wrap the Map passed into the constructor into 
`Collections#unmodifiableMap`- before the change `getAttributes` returned a 
copy and thus changes could not propagate, that is now different.



##########
enterprise/web.jsf.editor/test/unit/src/org/netbeans/modules/web/jsf/editor/facelets/FaceletsLibrarySupportTest.java:
##########
@@ -164,7 +173,18 @@ public void testClassBaseLibraryWithinCurrentProject() {
         Attribute a2 = t2.getAttribute("myattr");
         assertNotNull(a2);
         assertEquals("myattr", a2.getName());
-
+        
+        // TagHandlers must NOT have UIComponent default attributes
+        assertNull(t2.getAttribute("rendered"));
+        assertNull(t2.getAttribute("transient"));

Review Comment:
   For my understanding. I see this declaration:
   
   
https://github.com/apache/netbeans/blob/ca84efd918c1e037f7513a122bc45909ef92ba7a/enterprise/web.jsf.editor/test/unit/data/testJavaJSFLibrary/src/org/mysite/classtaglib/HyperComponent.java#L26-L27
   
   This implies that `HyperComponent` is in fact a `UIComponent`. Does this not 
become relevant because the tag library refers to `HyperComponent` only via 
`handler-class` and not via `component-type`?



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