private IBinaryAnnotation[][] getParameterAnnotations(NdMethod ndMethod) { List<NdMethodParameter> parameters = ndMethod.getMethodParameters(); if (parameters.isEmpty()) { return null; } IBinaryAnnotation[][] result = new IBinaryAnnotation[parameters.size()][]; for (int idx = 0; idx < parameters.size(); idx++) { NdMethodParameter next = parameters.get(idx); result[idx] = toAnnotationArray(next.getAnnotations()); } // int newLength = result.length; // while (newLength > 0 && result[newLength - 1] == null) { // --newLength; // } // // if (newLength < result.length) { // if (newLength == 0) { // return null; // } // IBinaryAnnotation[][] newResult = new IBinaryAnnotation[newLength][]; // System.arraycopy(result, 0, newResult, 0, newLength); // result = newResult; // } return result; }
private IBinaryAnnotation[][] getParameterAnnotations(NdMethod ndMethod) { List<NdMethodParameter> parameters = ndMethod.getMethodParameters(); if (parameters.isEmpty()) { return null; } IBinaryAnnotation[][] result = new IBinaryAnnotation[parameters.size()][]; for (int idx = 0; idx < parameters.size(); idx++) { NdMethodParameter next = parameters.get(idx); result[idx] = toAnnotationArray(next.getAnnotations()); } // int newLength = result.length; // while (newLength > 0 && result[newLength - 1] == null) { // --newLength; // } // // if (newLength < result.length) { // if (newLength == 0) { // return null; // } // IBinaryAnnotation[][] newResult = new IBinaryAnnotation[newLength][]; // System.arraycopy(result, 0, newResult, 0, newLength); // result = newResult; // } return result; }
/** * Returns method parameter names that were not defined by the compiler. */ public char[][] getParameterNames() { List<NdMethodParameter> params = getMethodParameters(); // Use index to count the "real" parameters. int index = 0; char[][] result = new char[params.size()][]; for (int idx = 0; idx < result.length; idx++) { NdMethodParameter param = params.get(idx); if (!param.isCompilerDefined()) { result[index] = param.getName().getChars(); index++; } } return CharArrayUtils.subarray(result, 0, index); }
/** * Returns method parameter names that were not defined by the compiler. */ public char[][] getParameterNames() { List<NdMethodParameter> params = getMethodParameters(); // Use index to count the "real" parameters. int index = 0; char[][] result = new char[params.size()][]; for (int idx = 0; idx < result.length; idx++) { NdMethodParameter param = params.get(idx); if (!param.isCompilerDefined()) { result[index] = param.getName().getChars(); index++; } } return CharArrayUtils.subarray(result, 0, index); }
public void getGenericSignature(CharArrayBuffer result, boolean includeExceptions) { NdTypeParameter.getSignature(result, getTypeParameters()); result.append('('); for (NdMethodParameter next : getMethodParameters()) { // Compiler-defined arguments don't show up in the generic signature if (!next.isCompilerDefined()) { next.getType().getSignature(result); } } result.append(')'); NdTypeSignature returnType = getReturnType(); if (returnType == null) { result.append('V'); } else { returnType.getSignature(result); } if (includeExceptions) { List<NdMethodException> exceptions = getExceptions(); for (NdMethodException next : exceptions) { result.append('^'); next.getExceptionType().getSignature(result); } } }
public void getGenericSignature(CharArrayBuffer result, boolean includeExceptions) { NdTypeParameter.getSignature(result, getTypeParameters()); result.append('('); for (NdMethodParameter next : getMethodParameters()) { // Compiler-defined arguments don't show up in the generic signature if (!next.isCompilerDefined()) { next.getType().getSignature(result); } } result.append(')'); NdTypeSignature returnType = getReturnType(); if (returnType == null) { result.append('V'); } else { returnType.getSignature(result); } if (includeExceptions) { List<NdMethodException> exceptions = getExceptions(); for (NdMethodException next : exceptions) { result.append('^'); next.getExceptionType().getSignature(result); } } }