jakarta-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dbros...@apache.org
Subject svn commit: r1149467 - in /jakarta/bcel/trunk/src/main/java/org/apache/bcel: classfile/ generic/ verifier/structurals/
Date Fri, 22 Jul 2011 05:06:13 GMT
Author: dbrosius
Date: Fri Jul 22 05:06:11 2011
New Revision: 1149467

URL: http://svn.apache.org/viewvc?rev=1149467&view=rev
Log:
use boxed primitive cache

Modified:
    jakarta/bcel/trunk/src/main/java/org/apache/bcel/classfile/ConstantInteger.java
    jakarta/bcel/trunk/src/main/java/org/apache/bcel/classfile/ConstantLong.java
    jakarta/bcel/trunk/src/main/java/org/apache/bcel/classfile/Utility.java
    jakarta/bcel/trunk/src/main/java/org/apache/bcel/generic/BIPUSH.java
    jakarta/bcel/trunk/src/main/java/org/apache/bcel/generic/FieldGen.java
    jakarta/bcel/trunk/src/main/java/org/apache/bcel/generic/ICONST.java
    jakarta/bcel/trunk/src/main/java/org/apache/bcel/generic/LCONST.java
    jakarta/bcel/trunk/src/main/java/org/apache/bcel/generic/LDC.java
    jakarta/bcel/trunk/src/main/java/org/apache/bcel/generic/LDC2_W.java
    jakarta/bcel/trunk/src/main/java/org/apache/bcel/generic/SIPUSH.java
    jakarta/bcel/trunk/src/main/java/org/apache/bcel/generic/Type.java
    jakarta/bcel/trunk/src/main/java/org/apache/bcel/verifier/structurals/Subroutines.java

Modified: jakarta/bcel/trunk/src/main/java/org/apache/bcel/classfile/ConstantInteger.java
URL: http://svn.apache.org/viewvc/jakarta/bcel/trunk/src/main/java/org/apache/bcel/classfile/ConstantInteger.java?rev=1149467&r1=1149466&r2=1149467&view=diff
==============================================================================
--- jakarta/bcel/trunk/src/main/java/org/apache/bcel/classfile/ConstantInteger.java (original)
+++ jakarta/bcel/trunk/src/main/java/org/apache/bcel/classfile/ConstantInteger.java Fri Jul
22 05:06:11 2011
@@ -117,6 +117,6 @@ public final class ConstantInteger exten
     /** @return Integer object
      */
     public Object getConstantValue( ConstantPool cp ) {
-        return new Integer(bytes);
+        return Integer.valueOf(bytes);
     }
 }

Modified: jakarta/bcel/trunk/src/main/java/org/apache/bcel/classfile/ConstantLong.java
URL: http://svn.apache.org/viewvc/jakarta/bcel/trunk/src/main/java/org/apache/bcel/classfile/ConstantLong.java?rev=1149467&r1=1149466&r2=1149467&view=diff
==============================================================================
--- jakarta/bcel/trunk/src/main/java/org/apache/bcel/classfile/ConstantLong.java (original)
+++ jakarta/bcel/trunk/src/main/java/org/apache/bcel/classfile/ConstantLong.java Fri Jul 22
05:06:11 2011
@@ -117,6 +117,6 @@ public final class ConstantLong extends 
     /** @return Long object
      */
     public Object getConstantValue( ConstantPool cp ) {
-        return new Long(bytes);
+        return Long.valueOf(bytes);
     }
 }

Modified: jakarta/bcel/trunk/src/main/java/org/apache/bcel/classfile/Utility.java
URL: http://svn.apache.org/viewvc/jakarta/bcel/trunk/src/main/java/org/apache/bcel/classfile/Utility.java?rev=1149467&r1=1149466&r2=1149467&view=diff
==============================================================================
--- jakarta/bcel/trunk/src/main/java/org/apache/bcel/classfile/Utility.java (original)
+++ jakarta/bcel/trunk/src/main/java/org/apache/bcel/classfile/Utility.java Fri Jul 22 05:06:11
2011
@@ -56,7 +56,7 @@ public abstract class Utility {
 
 
     private static void wrap( ThreadLocal<Integer> tl, int value ) {
-        tl.set(new Integer(value));
+        tl.set(Integer.valueOf(value));
     }
 
     private static ThreadLocal<Integer> consumed_chars = new ThreadLocal<Integer>()
{

Modified: jakarta/bcel/trunk/src/main/java/org/apache/bcel/generic/BIPUSH.java
URL: http://svn.apache.org/viewvc/jakarta/bcel/trunk/src/main/java/org/apache/bcel/generic/BIPUSH.java?rev=1149467&r1=1149466&r2=1149467&view=diff
==============================================================================
--- jakarta/bcel/trunk/src/main/java/org/apache/bcel/generic/BIPUSH.java (original)
+++ jakarta/bcel/trunk/src/main/java/org/apache/bcel/generic/BIPUSH.java Fri Jul 22 05:06:11
2011
@@ -78,7 +78,7 @@ public class BIPUSH extends Instruction 
 
 
     public Number getValue() {
-        return new Integer(b);
+        return Integer.valueOf(b);
     }
 
 

Modified: jakarta/bcel/trunk/src/main/java/org/apache/bcel/generic/FieldGen.java
URL: http://svn.apache.org/viewvc/jakarta/bcel/trunk/src/main/java/org/apache/bcel/generic/FieldGen.java?rev=1149467&r1=1149466&r2=1149467&view=diff
==============================================================================
--- jakarta/bcel/trunk/src/main/java/org/apache/bcel/generic/FieldGen.java (original)
+++ jakarta/bcel/trunk/src/main/java/org/apache/bcel/generic/FieldGen.java Fri Jul 22 05:06:11
2011
@@ -136,7 +136,7 @@ public class FieldGen extends FieldGenOr
     public void setInitValue( int i ) {
         checkType(Type.INT);
         if (i != 0) {
-            value = new Integer(i);
+            value = Integer.valueOf(i);
         }
     }
 
@@ -144,7 +144,7 @@ public class FieldGen extends FieldGenOr
     public void setInitValue( short s ) {
         checkType(Type.SHORT);
         if (s != 0) {
-            value = new Integer(s);
+            value = Integer.valueOf(s);
         }
     }
 
@@ -152,7 +152,7 @@ public class FieldGen extends FieldGenOr
     public void setInitValue( char c ) {
         checkType(Type.CHAR);
         if (c != 0) {
-            value = new Integer(c);
+            value = Integer.valueOf(c);
         }
     }
 
@@ -160,7 +160,7 @@ public class FieldGen extends FieldGenOr
     public void setInitValue( byte b ) {
         checkType(Type.BYTE);
         if (b != 0) {
-            value = new Integer(b);
+            value = Integer.valueOf(b);
         }
     }
 
@@ -168,7 +168,7 @@ public class FieldGen extends FieldGenOr
     public void setInitValue( boolean b ) {
         checkType(Type.BOOLEAN);
         if (b) {
-            value = new Integer(1);
+            value = Integer.valueOf(1);
         }
     }
 

Modified: jakarta/bcel/trunk/src/main/java/org/apache/bcel/generic/ICONST.java
URL: http://svn.apache.org/viewvc/jakarta/bcel/trunk/src/main/java/org/apache/bcel/generic/ICONST.java?rev=1149467&r1=1149466&r2=1149467&view=diff
==============================================================================
--- jakarta/bcel/trunk/src/main/java/org/apache/bcel/generic/ICONST.java (original)
+++ jakarta/bcel/trunk/src/main/java/org/apache/bcel/generic/ICONST.java Fri Jul 22 05:06:11
2011
@@ -51,7 +51,7 @@ public class ICONST extends Instruction 
 
 
     public Number getValue() {
-        return new Integer(value);
+        return Integer.valueOf(value);
     }
 
 

Modified: jakarta/bcel/trunk/src/main/java/org/apache/bcel/generic/LCONST.java
URL: http://svn.apache.org/viewvc/jakarta/bcel/trunk/src/main/java/org/apache/bcel/generic/LCONST.java?rev=1149467&r1=1149466&r2=1149467&view=diff
==============================================================================
--- jakarta/bcel/trunk/src/main/java/org/apache/bcel/generic/LCONST.java (original)
+++ jakarta/bcel/trunk/src/main/java/org/apache/bcel/generic/LCONST.java Fri Jul 22 05:06:11
2011
@@ -53,7 +53,7 @@ public class LCONST extends Instruction 
 
 
     public Number getValue() {
-        return new Long(value);
+        return Long.valueOf(value);
     }
 
 

Modified: jakarta/bcel/trunk/src/main/java/org/apache/bcel/generic/LDC.java
URL: http://svn.apache.org/viewvc/jakarta/bcel/trunk/src/main/java/org/apache/bcel/generic/LDC.java?rev=1149467&r1=1149466&r2=1149467&view=diff
==============================================================================
--- jakarta/bcel/trunk/src/main/java/org/apache/bcel/generic/LDC.java (original)
+++ jakarta/bcel/trunk/src/main/java/org/apache/bcel/generic/LDC.java Fri Jul 22 05:06:11
2011
@@ -103,7 +103,7 @@ public class LDC extends CPInstruction i
             case org.apache.bcel.Constants.CONSTANT_Float:
                 return new Float(((org.apache.bcel.classfile.ConstantFloat) c).getBytes());
             case org.apache.bcel.Constants.CONSTANT_Integer:
-                return new Integer(((org.apache.bcel.classfile.ConstantInteger) c).getBytes());
+                return Integer.valueOf(((org.apache.bcel.classfile.ConstantInteger) c).getBytes());
             case org.apache.bcel.Constants.CONSTANT_Class:
             	int nameIndex = ((org.apache.bcel.classfile.ConstantClass) c).getNameIndex();
             	c = cpg.getConstantPool().getConstant(nameIndex);

Modified: jakarta/bcel/trunk/src/main/java/org/apache/bcel/generic/LDC2_W.java
URL: http://svn.apache.org/viewvc/jakarta/bcel/trunk/src/main/java/org/apache/bcel/generic/LDC2_W.java?rev=1149467&r1=1149466&r2=1149467&view=diff
==============================================================================
--- jakarta/bcel/trunk/src/main/java/org/apache/bcel/generic/LDC2_W.java (original)
+++ jakarta/bcel/trunk/src/main/java/org/apache/bcel/generic/LDC2_W.java Fri Jul 22 05:06:11
2011
@@ -59,7 +59,7 @@ public class LDC2_W extends CPInstructio
         org.apache.bcel.classfile.Constant c = cpg.getConstantPool().getConstant(index);
         switch (c.getTag()) {
             case org.apache.bcel.Constants.CONSTANT_Long:
-                return new Long(((org.apache.bcel.classfile.ConstantLong) c).getBytes());
+                return Long.valueOf(((org.apache.bcel.classfile.ConstantLong) c).getBytes());
             case org.apache.bcel.Constants.CONSTANT_Double:
                 return new Double(((org.apache.bcel.classfile.ConstantDouble) c).getBytes());
             default: // Never reached

Modified: jakarta/bcel/trunk/src/main/java/org/apache/bcel/generic/SIPUSH.java
URL: http://svn.apache.org/viewvc/jakarta/bcel/trunk/src/main/java/org/apache/bcel/generic/SIPUSH.java?rev=1149467&r1=1149466&r2=1149467&view=diff
==============================================================================
--- jakarta/bcel/trunk/src/main/java/org/apache/bcel/generic/SIPUSH.java (original)
+++ jakarta/bcel/trunk/src/main/java/org/apache/bcel/generic/SIPUSH.java Fri Jul 22 05:06:11
2011
@@ -76,7 +76,7 @@ public class SIPUSH extends Instruction 
 
 
     public Number getValue() {
-        return new Integer(b);
+        return Integer.valueOf(b);
     }
 
 

Modified: jakarta/bcel/trunk/src/main/java/org/apache/bcel/generic/Type.java
URL: http://svn.apache.org/viewvc/jakarta/bcel/trunk/src/main/java/org/apache/bcel/generic/Type.java?rev=1149467&r1=1149466&r2=1149467&view=diff
==============================================================================
--- jakarta/bcel/trunk/src/main/java/org/apache/bcel/generic/Type.java (original)
+++ jakarta/bcel/trunk/src/main/java/org/apache/bcel/generic/Type.java Fri Jul 22 05:06:11
2011
@@ -152,7 +152,7 @@ public abstract class Type implements ja
     private static final ThreadLocal<Integer> consumed_chars = new ThreadLocal<Integer>()
{
 
         protected Integer initialValue() {
-            return new Integer(0);
+            return Integer.valueOf(0);
         }
     };//int consumed_chars=0; // Remember position in string, see getArgumentTypes
 
@@ -163,7 +163,7 @@ public abstract class Type implements ja
 
 
     private static void wrap( ThreadLocal<Integer> tl, int value ) {
-        tl.set(new Integer(value));
+        tl.set(Integer.valueOf(value));
     }
 
 

Modified: jakarta/bcel/trunk/src/main/java/org/apache/bcel/verifier/structurals/Subroutines.java
URL: http://svn.apache.org/viewvc/jakarta/bcel/trunk/src/main/java/org/apache/bcel/verifier/structurals/Subroutines.java?rev=1149467&r1=1149466&r2=1149467&view=diff
==============================================================================
--- jakarta/bcel/trunk/src/main/java/org/apache/bcel/verifier/structurals/Subroutines.java
(original)
+++ jakarta/bcel/trunk/src/main/java/org/apache/bcel/verifier/structurals/Subroutines.java
Fri Jul 22 05:06:11 2011
@@ -252,7 +252,7 @@ public class Subroutines{
 			for (int i=0; i<subs.length; i++){
 				int[] lvs = subs[i].getAccessedLocalsIndices();
 				for (int j=0; j<lvs.length; j++){
-					s.add(new Integer(lvs[j]));
+					s.add(Integer.valueOf(lvs[j]));
 				}
 				if(subs[i].subSubs().length != 0){
 					_getRecursivelyAccessedLocalsIndicesHelper(s, subs[i].subSubs());
@@ -276,7 +276,7 @@ public class Subroutines{
     				// RET is not a LocalVariableInstruction in the current version of BCEL.
     				if (ih.getInstruction() instanceof LocalVariableInstruction || ih.getInstruction()
instanceof RET){
     					int idx = ((IndexedInstruction) (ih.getInstruction())).getIndex();
-    					acc.add(new Integer(idx));
+    					acc.add(Integer.valueOf(idx));
     					// LONG? DOUBLE?.
     					try{
     						// LocalVariableInstruction instances are typed without the need to look into
@@ -284,7 +284,7 @@ public class Subroutines{
     						if (ih.getInstruction() instanceof LocalVariableInstruction){
     							int s = ((LocalVariableInstruction) ih.getInstruction()).getType(null).getSize();
     							if (s==2) {
-                                    acc.add(new Integer(idx+1));
+                                    acc.add(Integer.valueOf(idx+1));
                                 }
     						}
     					}
@@ -349,9 +349,9 @@ public class Subroutines{
 	}// end Inner Class SubrouteImpl
 
 	//Node coloring constants
-	private static final Integer WHITE = new Integer(0);
-	private static final Integer GRAY = new Integer(1);
-	private static final Integer BLACK = new Integer(2);
+	private static final Integer WHITE = Integer.valueOf(0);
+	private static final Integer GRAY = Integer.valueOf(1);
+	private static final Integer BLACK = Integer.valueOf(2);
 	
 	/**
 	 * The map containing the subroutines found.
@@ -518,7 +518,7 @@ public class Subroutines{
 		for (int i=0; i<subs.length; i++){
 			int index = ((RET) (subs[i].getLeavingRET().getInstruction())).getIndex();
 			
-			if (!set.add(new Integer(index))){
+			if (!set.add(Integer.valueOf(index))){
 				// Don't use toString() here because of possibly infinite recursive subSubs() calls then.
 				SubroutineImpl si = (SubroutineImpl) subs[i];
 				throw new StructuralCodeConstraintException("Subroutine with local variable '"+si.localVariable+"',
JSRs '"+si.theJSRs+"', RET '"+si.theRET+"' is called by a subroutine which uses the same local
variable index as itself; maybe even a recursive call? JustIce's clean definition of a subroutine
forbids both.");
@@ -526,7 +526,7 @@ public class Subroutines{
 
 			noRecursiveCalls(subs[i], set);
 			
-			set.remove(new Integer(index));
+			set.remove(Integer.valueOf(index));
 		}
 	} 
 	



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@jakarta.apache.org
For additional commands, e-mail: notifications-help@jakarta.apache.org


Mime
View raw message