Author: markt
Date: Wed Sep 10 22:16:52 2014
New Revision: 1624150

URL: http://svn.apache.org/r1624150
Log:
Remove unused code (ConstantNameAndType)

Removed:
    
tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ConstantNameAndType.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=1624150&r1=1624149&r2=1624150&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 22:16:52 2014
@@ -114,7 +114,8 @@ public abstract class Constant implement
             case Constants.CONSTANT_Double:
                 return new ConstantDouble(file);
             case Constants.CONSTANT_NameAndType:
-                return new ConstantNameAndType(file);
+                Utility.swallowConstantNameAndType(file);
+                return null;
             case Constants.CONSTANT_Utf8:
                 return ConstantUtf8.getInstance(file);
             case Constants.CONSTANT_MethodHandle:

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=1624150&r1=1624149&r2=1624150&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 22:16:52 2014
@@ -104,12 +104,6 @@ public class ConstantPool implements Clo
             case Constants.CONSTANT_Integer:
                 str = String.valueOf(((ConstantInteger) c).getBytes());
                 break;
-            case Constants.CONSTANT_NameAndType:
-                str = (constantToString(((ConstantNameAndType) 
c).getNameIndex(),
-                        Constants.CONSTANT_Utf8)
-                        + " " + constantToString(((ConstantNameAndType) 
c).getSignatureIndex(),
-                        Constants.CONSTANT_Utf8));
-                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=1624150&r1=1624149&r2=1624150&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 22:16:52 2014
@@ -281,4 +281,9 @@ final class Utility {
     static void swallowConstantString(DataInput file) throws IOException {
         file.readUnsignedShort();   // Unused string index
     }
+
+    static void swallowConstantNameAndType(DataInput file) throws IOException {
+        file.readUnsignedShort();   // Unused name index
+        file.readUnsignedShort();   // Unused signature index
+    }
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to