< prev index next >

src/java.base/share/classes/jdk/internal/org/objectweb/asm/Type.java

Print this page

        

*** 652,662 **** * Returns the descriptor corresponding to this Java type. * * @return the descriptor corresponding to this Java type. */ public String getDescriptor() { ! StringBuffer buf = new StringBuffer(); getDescriptor(buf); return buf.toString(); } /** --- 652,662 ---- * Returns the descriptor corresponding to this Java type. * * @return the descriptor corresponding to this Java type. */ public String getDescriptor() { ! StringBuilder buf = new StringBuilder(); getDescriptor(buf); return buf.toString(); } /**
*** 670,680 **** * @return the descriptor corresponding to the given argument and return * types. */ public static String getMethodDescriptor(final Type returnType, final Type... argumentTypes) { ! StringBuffer buf = new StringBuffer(); buf.append('('); for (int i = 0; i < argumentTypes.length; ++i) { argumentTypes[i].getDescriptor(buf); } buf.append(')'); --- 670,680 ---- * @return the descriptor corresponding to the given argument and return * types. */ public static String getMethodDescriptor(final Type returnType, final Type... argumentTypes) { ! StringBuilder buf = new StringBuilder(); buf.append('('); for (int i = 0; i < argumentTypes.length; ++i) { argumentTypes[i].getDescriptor(buf); } buf.append(')');
*** 687,697 **** * string buffer. * * @param buf * the string buffer to which the descriptor must be appended. */ ! private void getDescriptor(final StringBuffer buf) { if (this.buf == null) { // descriptor is in byte 3 of 'off' for primitive types (buf == // null) buf.append((char) ((off & 0xFF000000) >>> 24)); } else if (sort == OBJECT) { --- 687,697 ---- * string buffer. * * @param buf * the string buffer to which the descriptor must be appended. */ ! private void getDescriptor(final StringBuilder buf) { if (this.buf == null) { // descriptor is in byte 3 of 'off' for primitive types (buf == // null) buf.append((char) ((off & 0xFF000000) >>> 24)); } else if (sort == OBJECT) {
*** 727,737 **** * @param c * an object class, a primitive class or an array class. * @return the descriptor corresponding to the given class. */ public static String getDescriptor(final Class<?> c) { ! StringBuffer buf = new StringBuffer(); getDescriptor(buf, c); return buf.toString(); } /** --- 727,737 ---- * @param c * an object class, a primitive class or an array class. * @return the descriptor corresponding to the given class. */ public static String getDescriptor(final Class<?> c) { ! StringBuilder buf = new StringBuilder(); getDescriptor(buf, c); return buf.toString(); } /**
*** 741,751 **** * a {@link Constructor Constructor} object. * @return the descriptor of the given constructor. */ public static String getConstructorDescriptor(final Constructor<?> c) { Class<?>[] parameters = c.getParameterTypes(); ! StringBuffer buf = new StringBuffer(); buf.append('('); for (int i = 0; i < parameters.length; ++i) { getDescriptor(buf, parameters[i]); } return buf.append(")V").toString(); --- 741,751 ---- * a {@link Constructor Constructor} object. * @return the descriptor of the given constructor. */ public static String getConstructorDescriptor(final Constructor<?> c) { Class<?>[] parameters = c.getParameterTypes(); ! StringBuilder buf = new StringBuilder(); buf.append('('); for (int i = 0; i < parameters.length; ++i) { getDescriptor(buf, parameters[i]); } return buf.append(")V").toString();
*** 758,768 **** * a {@link Method Method} object. * @return the descriptor of the given method. */ public static String getMethodDescriptor(final Method m) { Class<?>[] parameters = m.getParameterTypes(); ! StringBuffer buf = new StringBuffer(); buf.append('('); for (int i = 0; i < parameters.length; ++i) { getDescriptor(buf, parameters[i]); } buf.append(')'); --- 758,768 ---- * a {@link Method Method} object. * @return the descriptor of the given method. */ public static String getMethodDescriptor(final Method m) { Class<?>[] parameters = m.getParameterTypes(); ! StringBuilder buf = new StringBuilder(); buf.append('('); for (int i = 0; i < parameters.length; ++i) { getDescriptor(buf, parameters[i]); } buf.append(')');
*** 776,786 **** * @param buf * the string buffer to which the descriptor must be appended. * @param c * the class whose descriptor must be computed. */ ! private static void getDescriptor(final StringBuffer buf, final Class<?> c) { Class<?> d = c; while (true) { if (d.isPrimitive()) { char car; if (d == Integer.TYPE) { --- 776,786 ---- * @param buf * the string buffer to which the descriptor must be appended. * @param c * the class whose descriptor must be computed. */ ! private static void getDescriptor(final StringBuilder buf, final Class<?> c) { Class<?> d = c; while (true) { if (d.isPrimitive()) { char car; if (d == Integer.TYPE) {
< prev index next >