src/share/classes/com/sun/tools/hat/internal/server/RefsByTypeQuery.java

Print this page
rev 10195 : 8048267: Replace uses of 'new Long()' with appropriate alternative across core classes
Reviewed-by: chegar, psandoz
Contributed-by: otaviojava@java.net

@@ -61,25 +61,25 @@
                          System.out.println("null class for " + ref);
                          continue;
                     }
                     Long count = referrersStat.get(cl);
                     if (count == null) {
-                        count = new Long(1);
+                        count = 1L;
                     } else {
-                        count = new Long(count.longValue() + 1);
+                        count = count + 1L;
                     }
                     referrersStat.put(cl, count);
                 }
                 instance.visitReferencedObjects(
                     new AbstractJavaHeapObjectVisitor() {
                         public void visit(JavaHeapObject obj) {
                             JavaClass cl = obj.getClazz();
                             Long count = refereesStat.get(cl);
                             if (count == null) {
-                                count = new Long(1);
+                                count = 1L;
                             } else {
-                                count = new Long(count.longValue() + 1);
+                                count = count + 1L;
                             }
                             refereesStat.put(cl, count);
                         }
                     }
                 );