Fixes #211. Previously, '?' was not converted to '*' in
UnresolvedType.nameToSignature, but kept as-is. That is why - falsely -
it was necessary to handle the '?' case in UnresolvedType.forSignature
at all, reading this kind of bogus signature and creating a type for it
in TypeFactory.createTypeFromSignature. This, ironically, led to correct
JVM generic type signatures containing '*' not being handled at all.
The conversion should now work correctly both ways.
Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
return new UnresolvedType(signature, signatureErasure, typeParams);
}
// can't replace above with convertSigToType - leads to stackoverflow
- } else if ((firstChar == '?' || firstChar == '*') && signature.length()==1) {
+ } else if (firstChar == '*' && signature.length()==1) {
return WildcardedUnresolvedType.QUESTIONMARK;
} else if (firstChar == '+') {
// ? extends ...
return TypeFactory.createTypeFromSignature(signature);
case '-':
return TypeFactory.createTypeFromSignature(signature);
- case '?':
+ case '*':
return TypeFactory.createTypeFromSignature(signature);
case 'T':
return TypeFactory.createTypeFromSignature(signature);
return "C";
}
if (name.equals("?")) {
- return name;
+ return "*";
}
}
if (len == 0) {