tmysik commented on a change in pull request #2673:
URL: https://github.com/apache/netbeans/pull/2673#discussion_r559090277



##########
File path: php/php.dbgp/src/org/netbeans/modules/php/dbgp/packets/Property.java
##########
@@ -64,12 +66,9 @@ public String getName() {
     }
 
     public void setName(String value) {
-        Node node = getNode().getAttributes().getNamedItem(NAME);
-        if (node == null) {
-            node = getNode().getOwnerDocument().createAttribute(NAME);
-            getNode().appendChild(node);
-        }
-        node.setNodeValue(value);
+        assert getNode() instanceof Element;
+        Element element = (Element) getNode();

Review comment:
       One note to the `assert` - imagine that it would happen - what it will 
take tell you? Just that the node is not an `Element`... Not great, probably, 
and the assertion would need to be likely improved to something like:
   
   ```
   assert getNode() instanceof Element : "expected Element but got " + 
getNode().getClass().getName();
   ```
   




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

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