You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by se...@apache.org on 2015/08/12 13:22:40 UTC

svn commit: r1695478 - in /commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6: classfile/ generic/ util/

Author: sebb
Date: Wed Aug 12 11:22:39 2015
New Revision: 1695478

URL: http://svn.apache.org/r1695478
Log:
BCEL-231 Remove deprecated methods and classes
Part 2 (of several)

Removed:
    commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/AttributeReader.java
Modified:
    commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/Attribute.java
    commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/FieldOrMethod.java
    commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/StackMapEntry.java
    commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/generic/Instruction.java
    commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/generic/ReferenceType.java
    commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/util/ClassPath.java

Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/Attribute.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/Attribute.java?rev=1695478&r1=1695477&r2=1695478&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/Attribute.java (original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/Attribute.java Wed Aug 12 11:22:39 2015
@@ -100,20 +100,6 @@ public abstract class Attribute implemen
      * 
      * @param name the name of the attribute as stored in the class file
      * @param r    the reader object
-     * @deprecated Use {@link #addAttributeReader(String, UnknownAttributeReader)} instead
-     */
-    public static void addAttributeReader(String name, AttributeReader r)
-    {
-        readers.put(name, r);
-    }
-
-    /**
-     * Add an Attribute reader capable of parsing (user-defined) attributes
-     * named "name". You should not add readers for the standard attributes such
-     * as "LineNumberTable", because those are handled internally.
-     * 
-     * @param name the name of the attribute as stored in the class file
-     * @param r    the reader object
      */
     public static void addAttributeReader(String name, UnknownAttributeReader r)
     {

Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/FieldOrMethod.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/FieldOrMethod.java?rev=1695478&r1=1695477&r2=1695478&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/FieldOrMethod.java (original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/FieldOrMethod.java Wed Aug 12 11:22:39 2015
@@ -61,18 +61,6 @@ public abstract class FieldOrMethod exte
      * @param file Input stream
      * @throws IOException
      * @throws ClassFormatException
-     * @deprecated Use {@link #FieldOrMethod(java.io.DataInput, ConstantPool)} instead.
-     */
-    protected FieldOrMethod(DataInputStream file, ConstantPool constant_pool) throws IOException,
-            ClassFormatException {
-        this((DataInput) file, constant_pool);
-    }
-
-    /**
-     * Construct object from file stream.
-     * @param file Input stream
-     * @throws IOException
-     * @throws ClassFormatException
      */
     protected FieldOrMethod(DataInput file, ConstantPool constant_pool) throws IOException, ClassFormatException {
         this(file.readUnsignedShort(), file.readUnsignedShort(), file.readUnsignedShort(), null,

Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/StackMapEntry.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/StackMapEntry.java?rev=1695478&r1=1695477&r2=1695478&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/StackMapEntry.java (original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/classfile/StackMapEntry.java Wed Aug 12 11:22:39 2015
@@ -136,11 +136,6 @@ public final class StackMapEntry impleme
     }
 
 
-    @java.lang.Deprecated
-    public void setNumberOfLocals( int n ) { // TODO unused
-    }
-
-
     public int getNumberOfLocals() {
         return types_of_locals == null ? 0 : types_of_locals.length;
     }
@@ -156,11 +151,6 @@ public final class StackMapEntry impleme
     }
 
 
-    @java.lang.Deprecated
-    public void setNumberOfStackItems( int n ) { // TODO unused
-    }
-
-
     public int getNumberOfStackItems() {
         return types_of_stack_items == null ? 0 : types_of_stack_items.length;
     }

Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/generic/Instruction.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/generic/Instruction.java?rev=1695478&r1=1695477&r2=1695478&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/generic/Instruction.java (original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/generic/Instruction.java Wed Aug 12 11:22:39 2015
@@ -528,27 +528,6 @@ public abstract class Instruction implem
     public abstract void accept( Visitor v );
 
 
-    /** Get Comparator object used in the equals() method to determine
-     * equality of instructions.
-     *
-     * @return currently used comparator for equals()
-     * @deprecated use the built in comparator, or wrap this class in another object that implements these methods
-     */
-    @Deprecated
-    public static InstructionComparator getComparator() {
-        return cmp;
-    }
-
-
-    /** Set comparator to be used for equals().
-      * @deprecated use the built in comparator, or wrap this class in another object that implements these methods
-     */
-    @Deprecated
-    public static void setComparator( InstructionComparator c ) {
-        cmp = c;
-    }
-
-
     /** Check for equality, delegated to comparator
      * @return true if that is an Instruction and has the same opcode
      */

Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/generic/ReferenceType.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/generic/ReferenceType.java?rev=1695478&r1=1695477&r2=1695478&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/generic/ReferenceType.java (original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/generic/ReferenceType.java Wed Aug 12 11:22:39 2015
@@ -259,76 +259,4 @@ public abstract class ReferenceType exte
         return null;
     }
 
-
-    /**
-     * This commutative operation returns the first common superclass (narrowest ReferenceType
-     * referencing a class, not an interface).
-     * If one of the types is a superclass of the other, the former is returned.
-     * If "this" is Type.NULL, then t is returned.
-     * If t is Type.NULL, then "this" is returned.
-     * If "this" equals t ['this.equals(t)'] "this" is returned.
-     * If "this" or t is an ArrayType, then Type.OBJECT is returned.
-     * If "this" or t is a ReferenceType referencing an interface, then Type.OBJECT is returned.
-     * If not all of the two classes' superclasses cannot be found, "null" is returned.
-     * See the JVM specification edition 2, "�4.9.2 The Bytecode Verifier".
-     *
-     * @deprecated use getFirstCommonSuperclass(ReferenceType t) which has
-     *             slightly changed semantics.
-     * @throws ClassNotFoundException on failure to find superclasses of this
-     *  type, or the type passed as a parameter
-     */
-    @Deprecated
-    public ReferenceType firstCommonSuperclass( ReferenceType t ) throws ClassNotFoundException {
-        if (this.equals(Type.NULL)) {
-            return t;
-        }
-        if (t.equals(Type.NULL)) {
-            return this;
-        }
-        if (this.equals(t)) {
-            return this;
-            /*
-             * TODO: Above sounds a little arbitrary. On the other hand, there is
-             * no object referenced by Type.NULL so we can also say all the objects
-             * referenced by Type.NULL were derived from java.lang.Object.
-             * However, the Java Language's "instanceof" operator proves us wrong:
-             * "null" is not referring to an instance of java.lang.Object :)
-             */
-        }
-        if ((this instanceof ArrayType) || (t instanceof ArrayType)) {
-            return Type.OBJECT;
-            // TODO: Is there a proof of OBJECT being the direct ancestor of every ArrayType?
-        }
-        if (((this instanceof ObjectType) && ((ObjectType) this).referencesInterface())
-                || ((t instanceof ObjectType) && ((ObjectType) t).referencesInterface())) {
-            return Type.OBJECT;
-            // TODO: The above line is correct comparing to the vmspec2. But one could
-            // make class file verification a bit stronger here by using the notion of
-            // superinterfaces or even castability or assignment compatibility.
-        }
-        // this and t are ObjectTypes, see above.
-        ObjectType thiz = (ObjectType) this;
-        ObjectType other = (ObjectType) t;
-        JavaClass[] thiz_sups = Repository.getSuperClasses(thiz.getClassName());
-        JavaClass[] other_sups = Repository.getSuperClasses(other.getClassName());
-        if ((thiz_sups == null) || (other_sups == null)) {
-            return null;
-        }
-        // Waaahh...
-        JavaClass[] this_sups = new JavaClass[thiz_sups.length + 1];
-        JavaClass[] t_sups = new JavaClass[other_sups.length + 1];
-        System.arraycopy(thiz_sups, 0, this_sups, 1, thiz_sups.length);
-        System.arraycopy(other_sups, 0, t_sups, 1, other_sups.length);
-        this_sups[0] = Repository.lookupClass(thiz.getClassName());
-        t_sups[0] = Repository.lookupClass(other.getClassName());
-        for (JavaClass t_sup : t_sups) {
-            for (JavaClass this_sup : this_sups) {
-                if (this_sup.equals(t_sup)) {
-                    return ObjectType.getInstance(this_sup.getClassName());
-                }
-            }
-        }
-        // Huh? Did you ask for Type.OBJECT's superclass??
-        return null;
-    }
 }

Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/util/ClassPath.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/util/ClassPath.java?rev=1695478&r1=1695477&r2=1695478&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/util/ClassPath.java (original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/util/ClassPath.java Wed Aug 12 11:22:39 2015
@@ -44,7 +44,7 @@ import java.util.zip.ZipFile;
 public class ClassPath implements Serializable {
 
     private static final long serialVersionUID = 2099441438483340671L;
-    public static final ClassPath SYSTEM_CLASS_PATH = new ClassPath();
+    public static final ClassPath SYSTEM_CLASS_PATH = new ClassPath(getClassPath());
 
     private static final FilenameFilter ARCHIVE_FILTER = new FilenameFilter() {
 
@@ -94,17 +94,6 @@ public class ClassPath implements Serial
         vec.toArray(paths);
     }
 
-
-    /**
-     * Search for classes in CLASSPATH.
-     * @deprecated Use SYSTEM_CLASS_PATH constant
-     */
-    @Deprecated
-    public ClassPath() {
-        this(getClassPath());
-    }
-
-
     /** @return used class path string
      */
     @Override