X-Git-Url: http://git.phpeclipse.com diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/core/Signature.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/core/Signature.java index c9f8da2..fbf86b3 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/core/Signature.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/core/Signature.java @@ -745,10 +745,10 @@ public final class Signature { * @exception IllegalArgumentException * if the signature is not syntactically correct */ - public static String getElementType(String typeSignature) - throws IllegalArgumentException { - return new String(getElementType(typeSignature.toCharArray())); - } +// public static String getElementType(String typeSignature) +// throws IllegalArgumentException { +// return new String(getElementType(typeSignature.toCharArray())); +// } /** * Returns the number of parameter types in the given method signature. @@ -810,10 +810,10 @@ public final class Signature { * @exception IllegalArgumentException * if the signature is not syntactically correct */ - public static int getParameterCount(String methodSignature) - throws IllegalArgumentException { - return getParameterCount(methodSignature.toCharArray()); - } +// public static int getParameterCount(String methodSignature) +// throws IllegalArgumentException { +// return getParameterCount(methodSignature.toCharArray()); +// } /** * Extracts the parameter type signatures from the given method signature. @@ -955,13 +955,13 @@ public final class Signature { * if name is null * @since 2.0 */ - public static char[] getQualifier(char[] name) { - int lastDot = CharOperation.lastIndexOf(C_DOT, name); - if (lastDot == -1) { - return CharOperation.NO_CHAR; - } - return CharOperation.subarray(name, 0, lastDot); - } +// public static char[] getQualifier(char[] name) { +// int lastDot = CharOperation.lastIndexOf(C_DOT, name); +// if (lastDot == -1) { +// return CharOperation.NO_CHAR; +// } +// return CharOperation.subarray(name, 0, lastDot); +// } /** * Returns a string containing all but the last segment of the given @@ -1052,13 +1052,13 @@ public final class Signature { * if name is null * @since 2.0 */ - public static char[] getSimpleName(char[] name) { - int lastDot = CharOperation.lastIndexOf(C_DOT, name); - if (lastDot == -1) { - return name; - } - return CharOperation.subarray(name, lastDot + 1, name.length); - } +// public static char[] getSimpleName(char[] name) { +// int lastDot = CharOperation.lastIndexOf(C_DOT, name); +// if (lastDot == -1) { +// return name; +// } +// return CharOperation.subarray(name, lastDot + 1, name.length); +// } /** * Returns the last segment of the given dot-separated qualified name. @@ -1399,80 +1399,80 @@ public final class Signature { * * @since 2.0 */ - public static char[] toCharArray(char[] signature) - throws IllegalArgumentException { - try { - int sigLength = signature.length; - - if (sigLength == 0 || signature[0] == C_PARAM_START) { - return toCharArray(signature, CharOperation.NO_CHAR, null, - true, true); - } - - // compute result length - int resultLength = 0; - int index = -1; - while (signature[++index] == C_ARRAY) { - resultLength += 2; // [] - } - switch (signature[index]) { - case C_BOOLEAN: - resultLength += BOOLEAN.length; - break; - case C_BYTE: - resultLength += BYTE.length; - break; - case C_CHAR: - resultLength += CHAR.length; - break; - case C_DOUBLE: - resultLength += DOUBLE.length; - break; - case C_FLOAT: - resultLength += FLOAT.length; - break; - case C_INT: - resultLength += INT.length; - break; - case C_LONG: - resultLength += LONG.length; - break; - case C_SHORT: - resultLength += SHORT.length; - break; - case C_VOID: - resultLength += VOID.length; - break; - case C_RESOLVED: - case C_UNRESOLVED: - int end = CharOperation.indexOf(C_SEMICOLON, signature, index); - if (end == -1) - throw new IllegalArgumentException(); - int start = index + 1; - resultLength += end - start; - break; - default: - throw new IllegalArgumentException(); - } - - char[] result = new char[resultLength]; - copyType(signature, 0, result, 0, true); - - /** - * Converts '$' separated type signatures into '.' separated type - * signature. NOTE: This assumes that the type signature is an inner - * type signature. This is true in most cases, but someone can - * define a non-inner type name containing a '$'. However to tell - * the difference, we would have to resolve the signature, which - * cannot be done at this point. - */ - CharOperation.replace(result, C_DOLLAR, C_DOT); - - return result; - } catch (ArrayIndexOutOfBoundsException e) { - throw new IllegalArgumentException(); - } - } +// public static char[] toCharArray(char[] signature) +// throws IllegalArgumentException { +// try { +// int sigLength = signature.length; +// +// if (sigLength == 0 || signature[0] == C_PARAM_START) { +// return toCharArray(signature, CharOperation.NO_CHAR, null, +// true, true); +// } +// +// // compute result length +// int resultLength = 0; +// int index = -1; +// while (signature[++index] == C_ARRAY) { +// resultLength += 2; // [] +// } +// switch (signature[index]) { +// case C_BOOLEAN: +// resultLength += BOOLEAN.length; +// break; +// case C_BYTE: +// resultLength += BYTE.length; +// break; +// case C_CHAR: +// resultLength += CHAR.length; +// break; +// case C_DOUBLE: +// resultLength += DOUBLE.length; +// break; +// case C_FLOAT: +// resultLength += FLOAT.length; +// break; +// case C_INT: +// resultLength += INT.length; +// break; +// case C_LONG: +// resultLength += LONG.length; +// break; +// case C_SHORT: +// resultLength += SHORT.length; +// break; +// case C_VOID: +// resultLength += VOID.length; +// break; +// case C_RESOLVED: +// case C_UNRESOLVED: +// int end = CharOperation.indexOf(C_SEMICOLON, signature, index); +// if (end == -1) +// throw new IllegalArgumentException(); +// int start = index + 1; +// resultLength += end - start; +// break; +// default: +// throw new IllegalArgumentException(); +// } +// +// char[] result = new char[resultLength]; +// copyType(signature, 0, result, 0, true); +// +// /** +// * Converts '$' separated type signatures into '.' separated type +// * signature. NOTE: This assumes that the type signature is an inner +// * type signature. This is true in most cases, but someone can +// * define a non-inner type name containing a '$'. However to tell +// * the difference, we would have to resolve the signature, which +// * cannot be done at this point. +// */ +// CharOperation.replace(result, C_DOLLAR, C_DOT); +// +// return result; +// } catch (ArrayIndexOutOfBoundsException e) { +// throw new IllegalArgumentException(); +// } +// } /** * Converts the given array of qualified name segments to a qualified name. @@ -1540,14 +1540,14 @@ public final class Signature { * the list of name segments, possibly empty * @return the dot-separated qualified name, or the empty string */ - public static String toQualifiedName(String[] segments) { - int length = segments.length; - char[][] charArrays = new char[length][]; - for (int i = 0; i < length; i++) { - charArrays[i] = segments[i].toCharArray(); - } - return new String(toQualifiedName(charArrays)); - } +// public static String toQualifiedName(String[] segments) { +// int length = segments.length; +// char[][] charArrays = new char[length][]; +// for (int i = 0; i < length; i++) { +// charArrays[i] = segments[i].toCharArray(); +// } +// return new String(toQualifiedName(charArrays)); +// } /** * Converts the given type signature to a readable string. The signature is