Author: sebb Date: Fri Sep 11 08:45:29 2015 New Revision: 1702398 URL: http://svn.apache.org/r1702398 Log: Tidy up
Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/Const.java Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/Const.java URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/Const.java?rev=1702398&r1=1702397&r2=1702398&view=diff ============================================================================== --- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/Const.java (original) +++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/Const.java Fri Sep 11 08:45:29 2015 @@ -24,6 +24,7 @@ import java.util.Collections; * Constants for the project, mostly defined in the JVM specification. * * @version $Id$ + * @since 6.0 (intended to replace the Constant interface) */ public final class Const { @@ -1489,7 +1490,8 @@ public final class Const { }; /** - * + * The primitive type names corresponding to the T_XX constants, + * e.g., TYPE_NAMES[T_INT] = "int" * @param index * @return * @since 6.0 @@ -1501,7 +1503,7 @@ public final class Const { /** The primitive class names corresponding to the T_XX constants, * e.g., CLASS_TYPE_NAMES[T_INT] = "java.lang.Integer" */ - private static final String[] CLASS_TYPE_NAMES = { // TODO currently unused - are they needed? + private static final String[] CLASS_TYPE_NAMES = { ILLEGAL_TYPE, ILLEGAL_TYPE, ILLEGAL_TYPE, ILLEGAL_TYPE, "java.lang.Boolean", "java.lang.Character", "java.lang.Float", "java.lang.Double", "java.lang.Byte", "java.lang.Short", @@ -1509,6 +1511,17 @@ public final class Const { ILLEGAL_TYPE, ILLEGAL_TYPE, ILLEGAL_TYPE, ILLEGAL_TYPE }; + /** + * The primitive class names corresponding to the T_XX constants, + * e.g., CLASS_TYPE_NAMES[T_INT] = "java.lang.Integer" + * @param index + * @return + * @since 6.0 + */ + public static String getClassTypeName(int index) { + return CLASS_TYPE_NAMES[index]; + } + /** The signature characters corresponding to primitive types, * e.g., SHORT_TYPE_NAMES[T_INT] = "I" */