if (0 != length) {
AbstractMethodDeclaration methodDeclaration = binding.sourceMethod();
List<VariableElement> params = new ArrayList<VariableElement>(length);
if (methodDeclaration != null) {
for (Argument argument : methodDeclaration.arguments) {
VariableElement param = new VariableElementImpl(_env, argument.binding);
params.add(param);
}
} else {
// binary method
boolean isEnumConstructor = binding.isConstructor()
&& binding.declaringClass.isEnum()
&& binding.declaringClass.isBinaryBinding()
&& ((binding.modifiers & ExtraCompilerModifiers.AccGenericSignature) == 0);
AnnotationBinding[][] parameterAnnotationBindings = null;
AnnotationHolder annotationHolder = binding.declaringClass.retrieveAnnotationHolder(binding, false);
if (annotationHolder != null) {
parameterAnnotationBindings = annotationHolder.getParameterAnnotations();
}
// we need to filter the synthetic arguments
if (isEnumConstructor) {
if (length == 2) {
// the two arguments are only the two synthetic arguments
return Collections.emptyList();
}
for (int i = 2; i < length; i++) {
TypeBinding typeBinding = binding.parameters[i];
StringBuilder builder = new StringBuilder("arg");//$NON-NLS-1$
builder.append(i - 2);
VariableElement param = new VariableElementImpl(_env,
new AptBinaryLocalVariableBinding(
String.valueOf(builder).toCharArray(),
typeBinding,
0,
null,
binding));
params.add(param);
}
} else {
int i = 0;
for (TypeBinding typeBinding : binding.parameters) {
StringBuilder builder = new StringBuilder("arg");//$NON-NLS-1$
builder.append(i);
VariableElement param = new VariableElementImpl(_env,
new AptBinaryLocalVariableBinding(
String.valueOf(builder).toCharArray(),
typeBinding,
0,
parameterAnnotationBindings != null ? parameterAnnotationBindings[i] : null,