You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by kk...@apache.org on 2014/09/12 17:22:40 UTC
svn commit: r1624569 -
/tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ConstantPool.java
Author: kkolinko
Date: Fri Sep 12 15:22:40 2014
New Revision: 1624569
URL: http://svn.apache.org/r1624569
Log:
Remove unused ConstantPool.constantToString methods.
Found thanks to Cobertura coverage report.
Modified:
tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ConstantPool.java
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=1624569&r1=1624568&r2=1624569&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 Fri Sep 12 15:22:40 2014
@@ -72,58 +72,6 @@ public class ConstantPool {
/**
- * Resolve constant to a string representation.
- *
- * @param c Constant to be printed
- * @return String representation
- */
- public String constantToString( Constant c ) throws ClassFormatException {
- String str;
- int i;
- byte tag = c.getTag();
- switch (tag) {
- case Constants.CONSTANT_Class:
- i = ((ConstantClass) c).getNameIndex();
- c = getConstant(i, Constants.CONSTANT_Utf8);
- str = Utility.compactClassName(((ConstantUtf8) c).getBytes());
- break;
- case Constants.CONSTANT_Utf8:
- str = ((ConstantUtf8) c).getBytes();
- break;
- case Constants.CONSTANT_Double:
- str = String.valueOf(((ConstantDouble) c).getBytes());
- break;
- case Constants.CONSTANT_Float:
- str = String.valueOf(((ConstantFloat) c).getBytes());
- break;
- case Constants.CONSTANT_Long:
- str = String.valueOf(((ConstantLong) c).getBytes());
- break;
- case Constants.CONSTANT_Integer:
- str = String.valueOf(((ConstantInteger) c).getBytes());
- break;
- default: // Never reached
- throw new RuntimeException("Unknown constant type " + tag);
- }
- return str;
- }
-
-
- /**
- * Retrieve constant at `index' from constant pool and resolve it to
- * a string representation.
- *
- * @param index of constant in constant pool
- * @param tag expected type
- * @return String representation
- */
- public String constantToString( int index, byte tag ) throws ClassFormatException {
- Constant c = getConstant(index, tag);
- return constantToString(c);
- }
-
-
- /**
* Get constant from constant pool.
*
* @param index Index in constant pool
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org