MethodDefRow mdr = (MethodDefRow)er;
sd.drawIndent();
if (mdr.isClosing()) {
sd.drawDefault("}");
} else {
Method m = mdr.getMethod();
MethodSignature methodSig = null;
boolean displayGenerics = SystemFacade.getInstance().getPreferences().isSettingTrue(Settings.DISPLAY_GENERICS);
if (displayGenerics) {
SignatureAttribute signature = m.getAttributes().getSignatureAttribute();
if (signature != null) {
methodSig = Signatures.getMethodSignature(signature.getSignatureString());
}
}
String access = m.getAccessString();
if (access.length() > 0) {
sd.drawKeyword(access + " ");
}
if (methodSig != null) {
List<FormalTypeParameter> typeParams = methodSig.getFormalTypeParameters();
renderFormalTypeParameters(sd, ia, typeParams);
if (typeParams != null && typeParams.size() > 0) {
sd.drawKeyword(" ");
}
}
JavaType ret = m.getDescriptor().getReturn();
if (methodSig == null) {
if (ret.isPrimitive()) {
sd.drawKeyword(ret.getType());
} else {
sd.drawDefault(ia.getShortName(ret.getType()));
}
sd.drawDefault(ret.getDimensions());
} else {
renderGenericJavaType(sd, ia, methodSig.getReturnType());
}
sd.drawDefault(" ");
if (m.isDeprecated()) {
sd.drawDefaultOverstrike(m.getName());
} else {
sd.drawDefault(m.getName());
}
CodeAttribute ca = m.getAttributes().getCode();
LocalVariableTableAttribute lvs = null;
if (ca != null) {
lvs = ca.getAttributes().getLocalVariableTable();
}
int paramLVDefOffset = 0;
if (!AccessFlags.isStatic(m.getAccessFlags())) {
paramLVDefOffset = 1;
}
sd.drawDefault("(");
List<JavaType> params = m.getDescriptor().getParamList();
List<GenericJavaType> genParams = null;
if (methodSig != null) {
genParams = methodSig.getParameters();
}
boolean displayVarargs = SystemFacade.getInstance().getPreferences().isSettingTrue(Settings.DISPLAY_VARARGS);
for (int i = 0; i < params.size(); i++) {
if (i > 0) {
sd.drawDefault(", ");
}
JavaType item = params.get(i);
// last time, method has varargs flag and type is a one dimensional array
boolean isLastItem = (i == params.size()-1);
if (displayVarargs
&& isLastItem
&& AccessFlags.isVarArgs(m.getAccessFlags())
&& (item.getDimensionCount() > 0)) {
item.dropDimension();
if (methodSig == null) {
if (item.isPrimitive()) {
sd.drawKeyword(item.getType());
} else {
sd.drawDefault(ia.getShortName(item.getType()));
}
sd.drawDefault(item.getDimensions());
} else {
GenericJavaType genType = genParams.get(i);
genType.getBaseType().dropDimension();
renderGenericJavaType(sd, ia, genType);
}
sd.drawDefault(" ... ");
LocalVariable lv = null;
if (lvs != null) {
lv = lvs.getLocalVariable(paramLVDefOffset + i, 0);
}
if (lv != null) {
sd.drawDefault(lv.getName());
} else {
sd.drawDefault("p" + i);
}
} else {
if (methodSig == null) {
if (item.isPrimitive()) {
sd.drawKeyword(item.getType());
} else {
sd.drawDefault(ia.getShortName(item.getType()));
}
sd.drawDefault(item.getDimensions());
} else {
renderGenericJavaType(sd, ia, genParams.get(i));
}
sd.drawDefault(" ");
LocalVariable lv = null;
if (lvs != null) {
lv = lvs.getLocalVariable(paramLVDefOffset + i, 0);
}
if (lv != null) {
sd.drawDefault(lv.getName());
} else {
sd.drawDefault("p" + i);
}
}
}
sd.drawDefault(")");
List exc = m.getExceptions();
for (int i = 0; i < exc.size(); i++) {
if (i == 0) {
sd.drawKeyword(" throws ");
} else {
sd.drawDefault(", ");