Author: markt
Date: Wed Sep 10 21:56:03 2014
New Revision: 1624142

URL: http://svn.apache.org/r1624142
Log:
Remove unused code (ConstantCP and sub-classes)

Removed:
    tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ConstantCP.java
    
tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ConstantFieldref.java
    
tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ConstantInterfaceMethodref.java
    
tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ConstantMethodref.java
Modified:
    tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/Constant.java
    tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ConstantPool.java
    tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/Utility.java

Modified: tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/Constant.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/Constant.java?rev=1624142&r1=1624141&r2=1624142&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/Constant.java 
(original)
+++ tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/Constant.java Wed 
Sep 10 21:56:03 2014
@@ -98,11 +98,10 @@ public abstract class Constant implement
             case Constants.CONSTANT_Class:
                 return new ConstantClass(file);
             case Constants.CONSTANT_Fieldref:
-                return new ConstantFieldref(file);
             case Constants.CONSTANT_Methodref:
-                return new ConstantMethodref(file);
             case Constants.CONSTANT_InterfaceMethodref:
-                return new ConstantInterfaceMethodref(file);
+                Utility.swallowConstantCP(file);
+                return null;
             case Constants.CONSTANT_String:
                 return new ConstantString(file);
             case Constants.CONSTANT_Integer:

Modified: 
tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ConstantPool.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ConstantPool.java?rev=1624142&r1=1624141&r2=1624142&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ConstantPool.java 
(original)
+++ tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ConstantPool.java 
Wed Sep 10 21:56:03 2014
@@ -115,13 +115,6 @@ public class ConstantPool implements Clo
                         + " " + constantToString(((ConstantNameAndType) 
c).getSignatureIndex(),
                         Constants.CONSTANT_Utf8));
                 break;
-            case Constants.CONSTANT_InterfaceMethodref:
-            case Constants.CONSTANT_Methodref:
-            case Constants.CONSTANT_Fieldref:
-                str = (constantToString(((ConstantCP) c).getClassIndex(), 
Constants.CONSTANT_Class)
-                        + "." + constantToString(((ConstantCP) 
c).getNameAndTypeIndex(),
-                        Constants.CONSTANT_NameAndType));
-                break;
             default: // Never reached
                 throw new RuntimeException("Unknown constant type " + tag);
         }

Modified: tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/Utility.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/Utility.java?rev=1624142&r1=1624141&r2=1624142&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/Utility.java 
(original)
+++ tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/Utility.java Wed 
Sep 10 21:56:03 2014
@@ -267,4 +267,9 @@ final class Utility {
         file.readUnsignedShort();   // Unused class index
         file.readUnsignedShort();   // Unused method index
     }
+
+    static void swallowConstantCP(DataInput file) throws IOException {
+        file.readUnsignedShort();   // Unused class index
+        file.readUnsignedShort();   // Unused name and type index
+    }
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to