Revert "Canonical type of arguments in method Qname" until TypeRes is ok

This commit is contained in:
oowekyala
2017-05-26 14:59:46 +02:00
parent b09cde6d03
commit 5b918ba53d
4 changed files with 8 additions and 13 deletions

View File

@ -55,8 +55,7 @@ public class ASTConstructorDeclaration extends AbstractJavaAccessNode implements
String[] types = new String[numParams];
for (int i = 0; i < numParams; i++) {
// Needs typeres ! TODO
types[i] = params.jjtGetChild(i).getFirstDescendantOfType(ASTType.class).getCanonicalTypeName();
types[i] = params.jjtGetChild(i).getFirstDescendantOfType(ASTType.class).getTypeImage();
}

View File

@ -125,9 +125,10 @@ public class ASTMethodDeclaration extends AbstractJavaAccessNode implements DFAG
String[] types = new String[numParams];
for (int i = 0; i < numParams; i++) {
types[i] = params.jjtGetChild(i).getFirstDescendantOfType(ASTType.class).getCanonicalTypeName();
types[i] = params.jjtGetChild(i).getFirstDescendantOfType(ASTType.class).getTypeImage();
}
qualifiedName = QualifiedName.makeOperationOf(parent, getMethodName(), types);
return qualifiedName;
}

View File

@ -31,9 +31,4 @@ public abstract class AbstractJavaTypeNode extends AbstractJavaNode implements T
public void setType(Class<?> type) {
this.type = type;
}
public String getCanonicalTypeName() {
return type.getCanonicalName();
}
}

View File

@ -133,15 +133,15 @@ public class QualifiedNameTest extends ParserTst {
public void testConstructorWithParams() {
final String TEST = "package bar; class Bzaz{ public Bzaz(int j, String k){}}";
Set<ASTConstructorDeclaration> nodes = getNodes(ASTConstructorDeclaration.class,
TEST);
for (ASTConstructorDeclaration declaration : nodes) {
QualifiableNode.QualifiedName qname = declaration.getQualifiedName();
// TODO fails due to typeres
assertEquals("bar.Bzaz#Bzaz(int,java.lang.String)", qname.toString());
assertEquals("bar.Bzaz#Bzaz(int,String)", qname.toString());
assertNotNull(qname.getOperation());
assertEquals("Bzaz(int,java.lang.String)", qname.getOperation());
assertEquals("Bzaz(int,String)", qname.getOperation());
}
}
@ -160,7 +160,7 @@ public class QualifiedNameTest extends ParserTst {
}
@Test
public void testConstructorOverload() { // TODO fails due to typeres
public void testConstructorOverload() {
final String TEST = "package bar; class Bzaz{ public Bzaz(int j) {} public Bzaz(int j, String k){}}";
Set<ASTConstructorDeclaration> nodes = getNodes(ASTConstructorDeclaration.class,
@ -171,7 +171,7 @@ public class QualifiedNameTest extends ParserTst {
}
@Test
public void testMethodOverload() { // TODO fails due to typeres
public void testMethodOverload() {
final String TEST = "package bar; class Bzaz{ public void foo(String j) {} " +
"public void foo(int j){} public void foo(double k){}}";