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


##########
profiler/profiler.heapwalker/src/org/netbeans/modules/profiler/heapwalk/ClassesListController.java:
##########
@@ -164,8 +164,7 @@ public Object[][] getData(String[] filterStrings, int 
filterType, boolean showZe
                     else data[i][4] = (retainedSizeByClass > 0 ? "+" : "") + 
numberFormat.format(retainedSizeByClass); // NOI18N 
                 }
             } else {
-                data[i][1] = new Double((double) instancesCount /
-                                     (double) totalLiveInstances * 100);
+                data[i][1] = instancesCount / totalLiveInstances * 100;

Review Comment:
   At least one double cast is necessary else this becomes an integer division, 
which is not what we want.
   
   ```suggestion
                   data[i][1] = (double) instancesCount / totalLiveInstances * 
100;
   ```



##########
platform/openide.explorer/src/org/openide/explorer/view/NodeTableModel.java:
##########
@@ -163,9 +164,9 @@ public void setProperties(Property[] props) {
                     Object o = props[i].getValue(ATTR_ORDER_NUMBER);
 
                     if (o instanceof Integer) {
-                        sort.put(new Double(((Integer) o).doubleValue()), 
Integer.valueOf(ia));
+                        sort.put(((Integer)o).doubleValue(), ia);

Review Comment:
   It would be good if the code here (lines 167, 169, 222, and 224) would be 
identical to the code in `NodeTableModel.java`. They already look pretty 
similar, so there is no need to handle this differently.



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