mbien commented on code in PR #5320:
URL: https://github.com/apache/netbeans/pull/5320#discussion_r1098132487


##########
platform/o.n.swing.plaf/src/org/netbeans/swing/plaf/nimbus/NimbusLFCustoms.java:
##########
@@ -44,8 +44,6 @@ public Object[] createLookAndFeelCustomizationKeysAndValues() 
{
             fontsize = in.intValue();
         }
 
-        //XXX fetch the custom font size here instead
-        Font controlFont = new Font("Dialog", Font.PLAIN, fontsize); //NOI18N

Review Comment:
   this belongs to the commented out section below. Comment it out too or 
revert the change.



##########
platform/api.visual/src/org/netbeans/modules/visual/anchor/DefaultAnchorShapeResolver.java:
##########
@@ -49,33 +49,30 @@ public DefaultAnchorShapeResolver(ConnectionWidget 
connection,
         this.attachedEnd = attachedTo;
         this.attachedWidget = attachedWidget;
     }
-    
+
     public int getEndLocation()
     {
-        int retVal = 0;
-        
+        int retVal;
+
         if(attachedWidget != null)
         {
             Rectangle bounds = attachedWidget.getBounds();
             retVal = getLocation(bounds);
         }
         else
         {
-//            Rectangle bounds = attachedWidget.getBounds();
-            Rectangle bounds = new Rectangle();
+            Widget sourceWidget;
             if(attachedEnd == ConnectionEnd.SOURCE)
             {
-                Widget sourceWidget = 
getConnection().getSourceAnchor().getRelatedWidget();
-                bounds = sourceWidget.getBounds();
+                sourceWidget = 
getConnection().getSourceAnchor().getRelatedWidget();
             }
             else
             {
-                Widget sourceWidget = 
getConnection().getTargetAnchor().getRelatedWidget();
-                bounds = sourceWidget.getBounds();
+                sourceWidget = 
getConnection().getTargetAnchor().getRelatedWidget();
             }
-            retVal = getLocation(bounds);
+            retVal = getLocation(sourceWidget.getBounds());
         }
-        
+
         return retVal;

Review Comment:
   looking at the code again: this almost looks like a bug that it takes the 
`sourceWidget` bounds in both cases.
   
   Lets not obfuscate this.
   
   simply change
   `Rectangle bounds = new Rectangle();`
   into
   `Rectangle bounds;`
   if you want to get rid of the additional object and lets leave everything 
else as is.



##########
platform/api.visual/src/org/netbeans/modules/visual/graph/layout/hierarchicalsupport/LayeredGraph.java:
##########
@@ -168,8 +168,7 @@ public float[] computeLowerBarycenters(int upperLayerIndex) 
{
         int upperLayerSize = upperLayer.size();
         int lowerLayerSize = lowerLayer.size();
         float lowerBarycenters[] = new float[lowerLayerSize];
-        
-        float[] barycenters = new float[lowerLayerSize];
+

Review Comment:
   please remove the comment in L184 too.



##########
nbi/engine/src/org/netbeans/installer/utils/system/launchers/impl/CommonLauncher.java:
##########
@@ -95,8 +95,6 @@ protected long addData(FileOutputStream fos, File file, 
Progress progress, long
     
     //add rnd data
     protected void addData(FileOutputStream fos) throws IOException {
-        double rand = Math.random() * Byte.MAX_VALUE;
-        //fos.write(new byte[] {(byte)rand});
         fos.write(new byte[] {'#'});
     }

Review Comment:
   best approach would be to simply leave it as is or comment it out. Maybe 
someone wants to use the other version in future.



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