harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From odea...@apache.org
Subject svn commit: r825878 - in /harmony/enhanced/classlib/trunk/modules/applet/src/main/java/org/apache/harmony/applet: Factory.java Launcher.java
Date Fri, 16 Oct 2009 13:15:19 GMT
Author: odeakin
Date: Fri Oct 16 13:15:19 2009
New Revision: 825878

URL: http://svn.apache.org/viewvc?rev=825878&view=rev
Log:
Fix some findbugs errors:
 - Use Integer.valueOf() instead of new Integer() for better performance.
 - Make constant private fields static.

Modified:
    harmony/enhanced/classlib/trunk/modules/applet/src/main/java/org/apache/harmony/applet/Factory.java
    harmony/enhanced/classlib/trunk/modules/applet/src/main/java/org/apache/harmony/applet/Launcher.java

Modified: harmony/enhanced/classlib/trunk/modules/applet/src/main/java/org/apache/harmony/applet/Factory.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/applet/src/main/java/org/apache/harmony/applet/Factory.java?rev=825878&r1=825877&r2=825878&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/applet/src/main/java/org/apache/harmony/applet/Factory.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/applet/src/main/java/org/apache/harmony/applet/Factory.java
Fri Oct 16 13:15:19 2009
@@ -54,11 +54,11 @@
     }
 
     void remove(Document doc) {
-        documents.remove(new Integer(doc.id));
+        documents.remove(Integer.valueOf(doc.id));
     }
 
     void dispose(int id) {
-        Proxy p = allProxies.get(new Integer(id));
+        Proxy p = allProxies.get(Integer.valueOf(id));
         if (p == null) {
             return;
         }
@@ -70,7 +70,7 @@
     Document getDocument(URL docBase, int docId) {
         synchronized(documents) {
             Document doc;
-            Integer objDocId = new Integer(docId);
+            Integer objDocId = Integer.valueOf(docId);
             doc = documents.get(objDocId);
             if (doc == null) {
                 doc = new Document(this, docBase, docId);
@@ -99,28 +99,28 @@
     }
     
     void start(int id) {
-        Proxy p = allProxies.get(new Integer(id));
+        Proxy p = allProxies.get(Integer.valueOf(id));
         if (p != null) {
             p.start();
         }
     }
     
     void stop(int id) {
-        Proxy p = allProxies.get(new Integer(id));
+        Proxy p = allProxies.get(Integer.valueOf(id));
         if (p != null) {
             p.stop();
         }
     }
     
     void init(int id) {
-        Proxy p = allProxies.get(new Integer(id));
+        Proxy p = allProxies.get(Integer.valueOf(id));
         if (p != null) {
             p.init();
         }
     }
     
     void destroy(int id) {
-        Proxy p = allProxies.get(new Integer(id));
+        Proxy p = allProxies.get(Integer.valueOf(id));
         if (p != null) {
             p.destroy();
         }
@@ -139,11 +139,11 @@
     }
 
     void add(Proxy p) {
-        allProxies.put(new Integer(p.params.id), p);
+        allProxies.put(Integer.valueOf(p.params.id), p);
     }
     
     void remove(Proxy p) {
-        allProxies.remove(new Integer(p.params.id));
+        allProxies.remove(Integer.valueOf(p.params.id));
     }
     
     void dump() {

Modified: harmony/enhanced/classlib/trunk/modules/applet/src/main/java/org/apache/harmony/applet/Launcher.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/applet/src/main/java/org/apache/harmony/applet/Launcher.java?rev=825878&r1=825877&r2=825878&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/applet/src/main/java/org/apache/harmony/applet/Launcher.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/applet/src/main/java/org/apache/harmony/applet/Launcher.java
Fri Oct 16 13:15:19 2009
@@ -39,8 +39,8 @@
     private final Panel placeholder;
     private final Label status;
     
-    private final int appletId = 1;
-    private final int documentId = 2;
+    private static final int appletId = 1;
+    private static final int documentId = 2;
     
     private URL codeBase;
     private String className;



Mime
View raw message