jtulach commented on code in PR #9787:
URL: https://github.com/apache/netbeans/pull/9787#discussion_r4479378248


##########
platform/openide.nodes/src/org/openide/nodes/NodeSupport.java:
##########
@@ -0,0 +1,125 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.openide.nodes;
+
+import java.awt.Image;
+import java.awt.datatransfer.Transferable;
+import java.util.Arrays;
+import java.util.List;
+import java.util.MissingResourceException;
+import org.openide.util.ImageUtilities;
+import org.openide.util.datatransfer.NewType;
+import org.openide.util.datatransfer.PasteType;
+
+final class NodeSupport {

Review Comment:
   - good idea to separate this code into a static utility class
   - there already is `NodeOp`...
      - maybe you want to put these methods there
   - I would slightly prefer `NodeUtils` than "support"



##########
platform/openide.nodes/src/org/openide/nodes/Node.java:
##########
@@ -1851,5 +1864,144 @@ public PropertyEditor get() {
             return super.get();
         }
     }
+
+    private static final class EmptyNode extends Node {

Review Comment:
   I'd make it its own outer class.



##########
platform/openide.nodes/src/org/openide/nodes/Node.java:
##########
@@ -87,8 +90,18 @@
 * @author Jaroslav Tulach,
 */
 public abstract class Node extends FeatureDescriptor implements 
Lookup.Provider, HelpCtx.Provider {
+
+    static {
+        //hook for testing:
+        boolean doLog = false;
+        assert doLog = true;
+        if (doLog) {
+            Logger.getLogger("org.openide.nodes.Node-init").log(Level.FINEST, 
"Initializing org.openide.nodes.Node"); //NOI18N
+        }
+    }
+
     /** An empty leaf node. */
-    public static final Node EMPTY = new AbstractNode(Children.LEAF);
+    public static final Node EMPTY = new EmptyNode();

Review Comment:
   - I like it more than #9781



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