Commit 6ce6eb3d authored by ebruneton's avatar ebruneton
Browse files

patch from Andrei Loskutov

[[Split portion of a mixed commit.]]
parent 3c6ed260
......@@ -129,6 +129,8 @@ public class TraceSignatureVisitor implements SignatureVisitor {
endFormals();
if (!seenParameter) {
declaration.append('(');
} else {
seenParameter = false;
}
declaration.append(')');
returnType = new StringBuffer();
......@@ -195,13 +197,26 @@ public class TraceSignatureVisitor implements SignatureVisitor {
public void visitClassType(String name) {
if (!"java/lang/Object".equals(name)) {
declaration.append(separator).append(name.replace('/', '.'));
} else {
// Map<java.lang.Object,java.util.List>
// or
// abstract public V get(Object key); (seen in Dictionary.class)
// should have Object
// but java.lang.String extends java.lang.Object is unnecessary
boolean needObjectClass = argumentStack % 2 == 1 || seenParameter;
if (needObjectClass) {
declaration.append(separator).append(name.replace('/', '.'));
}
}
separator = "";
argumentStack *= 2;
}
public void visitInnerClassType(String name) {
// TODO
// TODO tests
declaration.append(separator).append(name.replace('/', '.'));
separator = "";
argumentStack *= 2;
}
public void visitTypeArgument() {
......
......@@ -57,7 +57,8 @@ public class TraceSignatureVisitorTest extends TestCase {
"M|C|(java.lang.String, java.lang.Class<?>, java.lang.reflect.Method[], java.lang.reflect.Method, java.lang.reflect.Method)|(Ljava/lang/String;Ljava/lang/Class<*>;[Ljava/lang/reflect/Method;Ljava/lang/reflect/Method;Ljava/lang/reflect/Method;)V",
"F|C|AA<byte[][]>|LAA<[[B>;",
"F|C|AA<java.util.Map<java.lang.String, java.lang.String>[][]>|LAA<[[Ljava/util/Map<Ljava/lang/String;Ljava/lang/String;>;>;",
"M|C|()|()V^TE;" };
"M|C|()|()V^TE;",
"F|C|java.util.Hashtable<java.lang.Object, java.lang.String>|Ljava/util/Hashtable<Ljava/lang/Object;Ljava/lang/String;>;" };
public static TestSuite suite() {
TestSuite suite = new TestSuite(TraceSignatureVisitorTest.class.getName());
......
Supports Markdown
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