jakarta-bcel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dbros...@apache.org
Subject svn commit: r230959 - in /jakarta/bcel/trunk/src/java/org/apache/bcel: classfile/ generic/ util/ verifier/statics/
Date Tue, 09 Aug 2005 03:31:12 GMT
Author: dbrosius
Date: Mon Aug  8 20:30:38 2005
New Revision: 230959

URL: http://svn.apache.org/viewcvs?rev=230959&view=rev
Log:
use interface references, where possible

Modified:
    jakarta/bcel/trunk/src/java/org/apache/bcel/classfile/Utility.java
    jakarta/bcel/trunk/src/java/org/apache/bcel/generic/ClassGen.java
    jakarta/bcel/trunk/src/java/org/apache/bcel/generic/FieldGen.java
    jakarta/bcel/trunk/src/java/org/apache/bcel/generic/FieldGenOrMethodGen.java
    jakarta/bcel/trunk/src/java/org/apache/bcel/generic/InstructionList.java
    jakarta/bcel/trunk/src/java/org/apache/bcel/generic/MethodGen.java
    jakarta/bcel/trunk/src/java/org/apache/bcel/generic/Type.java
    jakarta/bcel/trunk/src/java/org/apache/bcel/util/BCELFactory.java
    jakarta/bcel/trunk/src/java/org/apache/bcel/util/ClassPath.java
    jakarta/bcel/trunk/src/java/org/apache/bcel/util/ClassVector.java
    jakarta/bcel/trunk/src/java/org/apache/bcel/util/InstructionFinder.java
    jakarta/bcel/trunk/src/java/org/apache/bcel/verifier/statics/IntList.java

Modified: jakarta/bcel/trunk/src/java/org/apache/bcel/classfile/Utility.java
URL: http://svn.apache.org/viewcvs/jakarta/bcel/trunk/src/java/org/apache/bcel/classfile/Utility.java?rev=230959&r1=230958&r2=230959&view=diff
==============================================================================
--- jakarta/bcel/trunk/src/java/org/apache/bcel/classfile/Utility.java (original)
+++ jakarta/bcel/trunk/src/java/org/apache/bcel/classfile/Utility.java Mon Aug  8 20:30:38
2005
@@ -29,8 +29,10 @@
 import java.io.Reader;
 import java.io.Writer;
 import java.util.ArrayList;
+import java.util.List;
 import java.util.zip.GZIPInputStream;
 import java.util.zip.GZIPOutputStream;
+
 import org.apache.bcel.Constants;
 import org.apache.bcel.util.ByteSequence;
 
@@ -559,9 +561,8 @@
 							    boolean chopit)
     throws ClassFormatException
   {
-    ArrayList vec = new ArrayList();
+    List vec = new ArrayList();
     int       index;
-    String[]  types;
 
     try { // Read all declarations between for `(' and `)'
       if(signature.charAt(0) != '(')

Modified: jakarta/bcel/trunk/src/java/org/apache/bcel/generic/ClassGen.java
URL: http://svn.apache.org/viewcvs/jakarta/bcel/trunk/src/java/org/apache/bcel/generic/ClassGen.java?rev=230959&r1=230958&r2=230959&view=diff
==============================================================================
--- jakarta/bcel/trunk/src/java/org/apache/bcel/generic/ClassGen.java (original)
+++ jakarta/bcel/trunk/src/java/org/apache/bcel/generic/ClassGen.java Mon Aug  8 20:30:38
2005
@@ -19,6 +19,8 @@
 
 import java.util.ArrayList;
 import java.util.Iterator;
+import java.util.List;
+
 import org.apache.bcel.Constants;
 import org.apache.bcel.classfile.AccessFlags;
 import org.apache.bcel.classfile.Attribute;
@@ -47,10 +49,10 @@
   private ConstantPoolGen cp; // Template for building up constant pool
 
   // ArrayLists instead of arrays to gather fields, methods, etc.
-  private ArrayList field_vec = new ArrayList();
-  private ArrayList method_vec = new ArrayList();
-  private ArrayList attribute_vec = new ArrayList();
-  private ArrayList interface_vec = new ArrayList();
+  private List field_vec = new ArrayList();
+  private List method_vec = new ArrayList();
+  private List attribute_vec = new ArrayList();
+  private List interface_vec = new ArrayList();
 
   private static BCELComparator _cmp = new BCELComparator() {
     public boolean equals(Object o1, Object o2) {

Modified: jakarta/bcel/trunk/src/java/org/apache/bcel/generic/FieldGen.java
URL: http://svn.apache.org/viewcvs/jakarta/bcel/trunk/src/java/org/apache/bcel/generic/FieldGen.java?rev=230959&r1=230958&r2=230959&view=diff
==============================================================================
--- jakarta/bcel/trunk/src/java/org/apache/bcel/generic/FieldGen.java (original)
+++ jakarta/bcel/trunk/src/java/org/apache/bcel/generic/FieldGen.java Mon Aug  8 20:30:38
2005
@@ -19,6 +19,8 @@
 
 import java.util.ArrayList;
 import java.util.Iterator;
+import java.util.List;
+
 import org.apache.bcel.Constants;
 import org.apache.bcel.classfile.Attribute;
 import org.apache.bcel.classfile.Constant;
@@ -226,7 +228,7 @@
 
   public String  getSignature()  { return type.getSignature(); }
 
-  private ArrayList observers;
+  private List observers;
 
   /** Add observer for this object.
    */

Modified: jakarta/bcel/trunk/src/java/org/apache/bcel/generic/FieldGenOrMethodGen.java
URL: http://svn.apache.org/viewcvs/jakarta/bcel/trunk/src/java/org/apache/bcel/generic/FieldGenOrMethodGen.java?rev=230959&r1=230958&r2=230959&view=diff
==============================================================================
--- jakarta/bcel/trunk/src/java/org/apache/bcel/generic/FieldGenOrMethodGen.java (original)
+++ jakarta/bcel/trunk/src/java/org/apache/bcel/generic/FieldGenOrMethodGen.java Mon Aug 
8 20:30:38 2005
@@ -1,5 +1,7 @@
 package org.apache.bcel.generic;
 import java.util.ArrayList;
+import java.util.List;
+
 import org.apache.bcel.Constants;
 import org.apache.bcel.classfile.AccessFlags;
 import org.apache.bcel.classfile.Attribute;
@@ -17,7 +19,7 @@
   protected String          name;
   protected Type            type;
   protected ConstantPoolGen cp;
-  private   ArrayList       attribute_vec = new ArrayList();
+  private   List       		attribute_vec = new ArrayList();
 
   protected FieldGenOrMethodGen() {}
 

Modified: jakarta/bcel/trunk/src/java/org/apache/bcel/generic/InstructionList.java
URL: http://svn.apache.org/viewcvs/jakarta/bcel/trunk/src/java/org/apache/bcel/generic/InstructionList.java?rev=230959&r1=230958&r2=230959&view=diff
==============================================================================
--- jakarta/bcel/trunk/src/java/org/apache/bcel/generic/InstructionList.java (original)
+++ jakarta/bcel/trunk/src/java/org/apache/bcel/generic/InstructionList.java Mon Aug  8 20:30:38
2005
@@ -24,7 +24,9 @@
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.Iterator;
+import java.util.List;
 import java.util.Map;
+
 import org.apache.bcel.Constants;
 import org.apache.bcel.classfile.Constant;
 import org.apache.bcel.util.ByteSequence;
@@ -702,7 +704,7 @@
     first.prev = null; // Completely separated from rest of list
     last.next  = null;
 
-    ArrayList target_vec = new ArrayList();
+    List target_vec = new ArrayList();
 
     for(InstructionHandle ih=first; ih != null; ih = ih.next)
       ih.getInstruction().dispose(); // e.g. BranchInstructions release their targets
@@ -963,7 +965,7 @@
    */
   public Instruction[] getInstructions() {
     ByteSequence  bytes        = new ByteSequence(getByteCode());
-    ArrayList     instructions = new ArrayList();
+    List instructions = new ArrayList();
 
     try {
       while(bytes.available() > 0) {
@@ -971,9 +973,7 @@
       }
     } catch(IOException e) { throw new ClassGenException(e.toString()); }
 
-    Instruction[] result = new Instruction[instructions.size()];
-    instructions.toArray(result);
-    return result;
+    return (Instruction[])instructions.toArray(new Instruction[instructions.size()]);
   }
 
   public String toString() {
@@ -1227,7 +1227,7 @@
     }
   }
 
-  private ArrayList observers;
+  private List observers;
 
   /** Add observer for this object.
    */

Modified: jakarta/bcel/trunk/src/java/org/apache/bcel/generic/MethodGen.java
URL: http://svn.apache.org/viewcvs/jakarta/bcel/trunk/src/java/org/apache/bcel/generic/MethodGen.java?rev=230959&r1=230958&r2=230959&view=diff
==============================================================================
--- jakarta/bcel/trunk/src/java/org/apache/bcel/generic/MethodGen.java (original)
+++ jakarta/bcel/trunk/src/java/org/apache/bcel/generic/MethodGen.java Mon Aug  8 20:30:38
2005
@@ -20,7 +20,9 @@
 import java.util.ArrayList;
 import java.util.Hashtable;
 import java.util.Iterator;
+import java.util.List;
 import java.util.Stack;
+
 import org.apache.bcel.Constants;
 import org.apache.bcel.classfile.Attribute;
 import org.apache.bcel.classfile.Code;
@@ -59,11 +61,11 @@
   private InstructionList il;
   private boolean strip_attributes;
 
-  private ArrayList variable_vec = new ArrayList();
-  private ArrayList line_number_vec = new ArrayList();
-  private ArrayList exception_vec = new ArrayList();
-  private ArrayList throws_vec = new ArrayList();
-  private ArrayList code_attrs_vec = new ArrayList();
+  private List variable_vec = new ArrayList();
+  private List line_number_vec = new ArrayList();
+  private List exception_vec = new ArrayList();
+  private List throws_vec = new ArrayList();
+  private List code_attrs_vec = new ArrayList();
 
   private static BCELComparator _cmp = new BCELComparator() {
     public boolean equals(Object o1, Object o2) {
@@ -1014,7 +1016,7 @@
     return maxStackDepth;
   }
 
-  private ArrayList observers;
+  private List observers;
 
   /** Add observer for this object.
    */

Modified: jakarta/bcel/trunk/src/java/org/apache/bcel/generic/Type.java
URL: http://svn.apache.org/viewcvs/jakarta/bcel/trunk/src/java/org/apache/bcel/generic/Type.java?rev=230959&r1=230958&r2=230959&view=diff
==============================================================================
--- jakarta/bcel/trunk/src/java/org/apache/bcel/generic/Type.java (original)
+++ jakarta/bcel/trunk/src/java/org/apache/bcel/generic/Type.java Mon Aug  8 20:30:38 2005
@@ -18,6 +18,8 @@
 
 
 import java.util.ArrayList;
+import java.util.List;
+
 import org.apache.bcel.Constants;
 import org.apache.bcel.classfile.ClassFormatException;
 import org.apache.bcel.classfile.Utility;
@@ -189,7 +191,7 @@
    * @return array of argument types
    */
   public static Type[] getArgumentTypes(String signature) {
-    ArrayList vec = new ArrayList();
+    List vec = new ArrayList();
     int       index;
     Type[]     types;
 

Modified: jakarta/bcel/trunk/src/java/org/apache/bcel/util/BCELFactory.java
URL: http://svn.apache.org/viewcvs/jakarta/bcel/trunk/src/java/org/apache/bcel/util/BCELFactory.java?rev=230959&r1=230958&r2=230959&view=diff
==============================================================================
--- jakarta/bcel/trunk/src/java/org/apache/bcel/util/BCELFactory.java (original)
+++ jakarta/bcel/trunk/src/java/org/apache/bcel/util/BCELFactory.java Mon Aug  8 20:30:38
2005
@@ -4,6 +4,7 @@
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.Iterator;
+import java.util.List;
 import java.util.Map;
 
 import org.apache.bcel.Constants;
@@ -235,7 +236,7 @@
   }
 
   // Memorize BranchInstructions that need an update
-  private ArrayList branches = new ArrayList();
+  private List branches = new ArrayList();
 
   public void visitBranchInstruction(BranchInstruction bi) {
     BranchHandle bh   = (BranchHandle)branch_map.get(bi);

Modified: jakarta/bcel/trunk/src/java/org/apache/bcel/util/ClassPath.java
URL: http://svn.apache.org/viewcvs/jakarta/bcel/trunk/src/java/org/apache/bcel/util/ClassPath.java?rev=230959&r1=230958&r2=230959&view=diff
==============================================================================
--- jakarta/bcel/trunk/src/java/org/apache/bcel/util/ClassPath.java (original)
+++ jakarta/bcel/trunk/src/java/org/apache/bcel/util/ClassPath.java Mon Aug  8 20:30:38 2005
@@ -26,6 +26,7 @@
 import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.Iterator;
+import java.util.List;
 import java.util.StringTokenizer;
 import java.util.zip.ZipEntry;
 import java.util.zip.ZipFile;
@@ -49,7 +50,7 @@
   public ClassPath(String class_path) {
     this.class_path = class_path;
 
-    ArrayList vec = new ArrayList();
+    List vec = new ArrayList();
 
     for(StringTokenizer tok=new StringTokenizer(class_path,
 						System.getProperty("path.separator"));
@@ -103,7 +104,7 @@
     return false;
   }
 
-  private static final void getPathComponents(String path, ArrayList list) {
+  private static final void getPathComponents(String path, List list) {
     if(path != null) {
       StringTokenizer tok = new StringTokenizer(path, File.pathSeparator);
 
@@ -127,12 +128,12 @@
     String boot_path  = System.getProperty("sun.boot.class.path");
     String ext_path   = System.getProperty("java.ext.dirs");
 
-    ArrayList list = new ArrayList();
+    List list = new ArrayList();
 
     getPathComponents(class_path, list);
     getPathComponents(boot_path, list);
 
-    ArrayList dirs = new ArrayList();
+    List dirs = new ArrayList();
     getPathComponents(ext_path, dirs);
 
     for(Iterator e = dirs.iterator(); e.hasNext(); ) {

Modified: jakarta/bcel/trunk/src/java/org/apache/bcel/util/ClassVector.java
URL: http://svn.apache.org/viewcvs/jakarta/bcel/trunk/src/java/org/apache/bcel/util/ClassVector.java?rev=230959&r1=230958&r2=230959&view=diff
==============================================================================
--- jakarta/bcel/trunk/src/java/org/apache/bcel/util/ClassVector.java (original)
+++ jakarta/bcel/trunk/src/java/org/apache/bcel/util/ClassVector.java Mon Aug  8 20:30:38
2005
@@ -17,6 +17,8 @@
 package org.apache.bcel.util;
 
 import java.util.ArrayList;
+import java.util.List;
+
 import org.apache.bcel.classfile.JavaClass;
 
 /** 
@@ -29,7 +31,7 @@
  * @deprecated as of 5.1.1 - 7/17/2005
 */
 public class ClassVector implements java.io.Serializable {
-  protected ArrayList vec = new ArrayList();
+  protected List vec = new ArrayList();
   
   public void      addElement(JavaClass clazz) { vec.add(clazz); }
   public JavaClass elementAt(int index)        { return (JavaClass)vec.get(index); }

Modified: jakarta/bcel/trunk/src/java/org/apache/bcel/util/InstructionFinder.java
URL: http://svn.apache.org/viewcvs/jakarta/bcel/trunk/src/java/org/apache/bcel/util/InstructionFinder.java?rev=230959&r1=230958&r2=230959&view=diff
==============================================================================
--- jakarta/bcel/trunk/src/java/org/apache/bcel/util/InstructionFinder.java (original)
+++ jakarta/bcel/trunk/src/java/org/apache/bcel/util/InstructionFinder.java Mon Aug  8 20:30:38
2005
@@ -20,7 +20,9 @@
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.Iterator;
+import java.util.List;
 import java.util.Map;
+
 import org.apache.bcel.Constants;
 import org.apache.bcel.generic.ClassGenException;
 import org.apache.bcel.generic.Instruction;
@@ -200,7 +202,7 @@
 				  " not found in instruction list.");
     try {
       RE regex = new RE(search);
-      ArrayList matches = new ArrayList();
+      List matches = new ArrayList();
 
       while(start < il_string.length() && regex.match(il_string, start)) {
 	int startExpr = regex.getParenStart(0); 

Modified: jakarta/bcel/trunk/src/java/org/apache/bcel/verifier/statics/IntList.java
URL: http://svn.apache.org/viewcvs/jakarta/bcel/trunk/src/java/org/apache/bcel/verifier/statics/IntList.java?rev=230959&r1=230958&r2=230959&view=diff
==============================================================================
--- jakarta/bcel/trunk/src/java/org/apache/bcel/verifier/statics/IntList.java (original)
+++ jakarta/bcel/trunk/src/java/org/apache/bcel/verifier/statics/IntList.java Mon Aug  8 20:30:38
2005
@@ -18,6 +18,7 @@
 
 
 import java.util.ArrayList;
+import java.util.List;
 
 /**
  * A small utility class representing a set of basic int values.
@@ -27,7 +28,7 @@
  */
 public class IntList{
 	/** The int are stored as Integer objects here. */
-	private ArrayList theList;
+	private List theList;
 	/** This constructor creates an empty list. */
 	IntList(){
 		theList = new ArrayList();



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


Mime
View raw message