Get rid of old commented code block for methods in ClassDefinition

This commit is contained in:
Ben Gruver 2012-11-09 23:56:13 -08:00
parent 98eede2ce1
commit 4060490e85

View File

@ -247,73 +247,4 @@ public class ClassDefinition {
}
}
}
//TODO: uncomment
/*private void writeDirectMethods(IndentingWriter writer) throws IOException {
if (classDataItem == null) {
return;
}
List<ClassDataItem.EncodedMethod> directMethods = classDataItem.getDirectMethods();
if (directMethods.size() == 0) {
return;
}
writer.write("\n\n");
writer.write("# direct methods\n");
writeMethods(writer, directMethods);
}
private void writeVirtualMethods(IndentingWriter writer) throws IOException {
if (classDataItem == null) {
return;
}
List<ClassDataItem.EncodedMethod> virtualMethods = classDataItem.getVirtualMethods();
if (virtualMethods.size() == 0) {
return;
}
writer.write("\n\n");
writer.write("# virtual methods\n");
writeMethods(writer, virtualMethods);
}
private void writeMethods(IndentingWriter writer, List<ClassDataItem.EncodedMethod> methods) throws IOException {
for (int i=0; i<methods.size(); i++) {
ClassDataItem.EncodedMethod method = methods.get(i);
if (i > 0) {
writer.write('\n');
}
AnnotationSetItem methodAnnotations = null;
AnnotationSetRefList parameterAnnotations = null;
AnnotationDirectoryItem annotations = classDefItem.getAnnotations();
if (annotations != null) {
methodAnnotations = annotations.getMethodAnnotations(method.method);
parameterAnnotations = annotations.getParameterAnnotations(method.method);
}
IndentingWriter methodWriter = writer;
// the encoded methods are sorted, so we just have to compare with the previous one to detect duplicates
if (i > 0 && method.equals(methods.get(i-1))) {
methodWriter = new CommentingIndentingWriter(writer, "#");
methodWriter.write("Ignoring method with duplicate signature\n");
System.err.println(String.format("Warning: class %s has duplicate method %s, Ignoring.",
classDefItem.getClassType().getTypeDescriptor(), method.method.getShortMethodString()));
}
MethodDefinition methodDefinition = new MethodDefinition(method);
methodDefinition.writeTo(methodWriter, methodAnnotations, parameterAnnotations);
ValidationException validationException = methodDefinition.getValidationException();
if (validationException != null) {
System.err.println(String.format("Error while disassembling method %s. Continuing.",
method.method.getMethodString()));
validationException.printStackTrace(System.err);
this.validationErrors = true;
}
}
}*/
}