Commit bd4fdc75 authored by ebruneton's avatar ebruneton
Browse files

implemented TODO in visitInnerClassType

[[Split portion of a mixed commit.]]
parent 1df1f2ec
......@@ -32,6 +32,13 @@ package org.objectweb.asm.util;
import org.objectweb.asm.Opcodes;
import org.objectweb.asm.signature.SignatureVisitor;
/**
* A {@link SignatureVisitor} that prints a disassembled view of the signature
* it visits.
*
* @author Eugene Kuleshov
* @author Eric Bruneton
*/
public class TraceSignatureVisitor implements SignatureVisitor {
private StringBuffer declaration;
......@@ -171,12 +178,10 @@ public class TraceSignatureVisitor implements SignatureVisitor {
case 'F':
declaration.append("float");
break;
case 'D':
// case 'D':
default:
declaration.append("double");
break;
default:
throw new IllegalArgumentException("Invalid descriptor "
+ descriptor);
}
endType();
}
......@@ -211,7 +216,11 @@ public class TraceSignatureVisitor implements SignatureVisitor {
}
public void visitInnerClassType(String name) {
// TODO tests
if (argumentStack % 2 == 1) {
declaration.append('>');
}
argumentStack /= 2;
declaration.append('.');
declaration.append(separator).append(name.replace('/', '.'));
separator = "";
argumentStack *= 2;
......@@ -220,17 +229,17 @@ public class TraceSignatureVisitor implements SignatureVisitor {
public void visitTypeArgument() {
if (argumentStack % 2 == 0) {
++argumentStack;
declaration.append("<");
declaration.append('<');
} else {
declaration.append(", ");
}
declaration.append("?");
declaration.append('?');
}
public SignatureVisitor visitTypeArgument(char tag) {
if (argumentStack % 2 == 0) {
++argumentStack;
declaration.append("<");
declaration.append('<');
} else {
declaration.append(", ");
}
......@@ -247,7 +256,7 @@ public class TraceSignatureVisitor implements SignatureVisitor {
public void visitEnd() {
if (argumentStack % 2 == 1) {
declaration.append(">");
declaration.append('>');
}
argumentStack /= 2;
endType();
......@@ -269,7 +278,7 @@ public class TraceSignatureVisitor implements SignatureVisitor {
private void endFormals() {
if (seenFormalParameter) {
declaration.append(">");
declaration.append('>');
seenFormalParameter = false;
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment