Hi, while I was creating a type reference, using
recoder.kit.TypeKit.createTypeReference, of this type:
Map.Entry<String, String>
I received a NullPointerException.
Both parameters of type Map.Entry where represented as TypeArgumentDeclaration
which contains a TypeReference.
It seems that the TypeReference inside TypeArgumentDeclaration has no parent.
I patched this problem changing the methods:
recoder.java.reference.TypeReference
public void makeParentRoleValid() {
super.makeParentRoleValid();
if (prefix != null) {
prefix.setReferenceSuffix(this);
}
if (name != null) {
name.setParent(this);
}
if (typeArguments != null) {
for(TypeArgumentDeclaration ta : typeArguments) {
ta.setParent(this);
//AP 22/06/2011 - 16.27
ta.makeParentRoleValid();
}
}
}
recoder.java.declaration.TypeArgumentDeclaration
public void makeParentRoleValid() {
super.makeParentRoleValid();
if (typeReference != null){
typeReference.setParent(this);
//AP 22/06/2011 - 16.27
typeReference.makeParentRoleValid();
}
}
I'd like to know if there is a better solution in order to solve this problem.
Thanks a lot :-)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
this looks like bugs to me in TypeKit. It should be fixed there instead.
I will investigate it further after July 10, but "unfortunately", I am going
onto vacation for now ;)
Regards,
Tobias
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi, while I was creating a type reference, using
recoder.kit.TypeKit.createTypeReference, of this type:
I received a NullPointerException.
Both parameters of type Map.Entry where represented as TypeArgumentDeclaration
which contains a TypeReference.
It seems that the TypeReference inside TypeArgumentDeclaration has no parent.
I patched this problem changing the methods:
recoder.java.reference.TypeReference
recoder.java.declaration.TypeArgumentDeclaration
I'd like to know if there is a better solution in order to solve this problem.
Thanks a lot :-)
Hej,
this looks like bugs to me in TypeKit. It should be fixed there instead.
I will investigate it further after July 10, but "unfortunately", I am going
onto vacation for now ;)
Regards,
Tobias
Hi,
I cannot reproduce this. Which of the overloaded methods are you using? Can
you provide a minimal example that triggers the bug?
/Tobias