*/
public class ResolvedMemberImpl extends MemberImpl implements IHasPosition, AnnotatedElement, TypeVariableDeclaringElement, ResolvedMember {
- public String[] parameterNames = null;
+ private String[] parameterNames = null;
protected UnresolvedType[] checkedExceptions = UnresolvedType.NONE;
/**
* if this member is a parameterized version of a member in a generic type,
return getDeclaringType().resolve(world).getSourceContext();
}
- public final String[] getParameterNames() {
+ public String[] getParameterNames() {
+
return parameterNames;
}
public final void setParameterNames(String[] pnames) {
? UnresolvedType.NONE
: UnresolvedType.forNames(exnTable.getExceptionNames());
+ }
+
+ public String[] getParameterNames() {
+ determineParameterNames();
+ return super.getParameterNames();
+ }
+
+ private boolean parameterNamesInitialized = false;
+
+ public void determineParameterNames() {
+ if (parameterNamesInitialized) return;
+ parameterNamesInitialized=true;
LocalVariableTable varTable = method.getLocalVariableTable();
int len = getArity();
if (varTable == null) {
- this.parameterNames = Utility.makeArgNames(len);
+ setParameterNames(Utility.makeArgNames(len));
} else {
UnresolvedType[] paramTypes = getParameterTypes();
String[] paramNames = new String[len];
}
index += paramTypes[i].getSize();
}
- this.parameterNames = paramNames;
+ setParameterNames(paramNames);
}
}
UnresolvedType inType = enclosingMethod.getEnclosingClass().getType();
ResolvedMemberImpl sig = MemberImpl.makeExceptionHandlerSignature(inType, catchType);
- sig.parameterNames = new String[] {findHandlerParamName(startOfHandler)};
+ sig.setParameterNames(new String[] {findHandlerParamName(startOfHandler)});
BcelShadow s =
new BcelShadow(