Community
Participate
Working Groups
4.5 M6 I'm seeing different results from Signature.getSignatureSimpleName() when called with an extends type signature. From a display page: Signature.getSignatureSimpleName("+Ljava.lang.CharSequence;") (java.lang.String) CharSequence Signature.getSignatureSimpleName("+QCharSequence;") (java.lang.String) ? extends CharSequence This came about from bug 334281c4 where we're trying to determine if two method signatures, one resolved and the other unresolved, are the same: (Ljava.lang.Iterable<+Ljava.lang.CharSequence;>;Lorg.eclipse.xtext.util.IAcceptor<Lorg.eclipse.xtext.xbase.compiler.CompilationTestHelper$Result;>;)V (QIterable<+QCharSequence;>;QIAcceptor<QResult;>;)V
I can see that org.eclipse.jdt.core.Signature.getSignatureSimpleName(char[]) is inconsistent between the two given examples. When simplifying the resolved variant we drop the "? extends" prefix. Given that Signature is API with lots of clients I'm reluctant, however, to make a call which version is correct, or even: whether the given input should be accepted. The javadoc requires a "type signature" as input. Strictly speaking, a wildcard in Java is not a type. OTOH, I can see that getTypeSignatureKind(char[]) does accept wildcards (and will answer WILDCARD_TYPE_SIGNATURE). Adjusting the resolved case to what we already answer in the unresolved case seems to make sense, but deciding either way feels like an API change to me.
New Gerrit change created: https://git.eclipse.org/r/44931
(In reply to Eclipse Genie from comment #2) > New Gerrit change created: https://git.eclipse.org/r/44931 @Jay, the proposed fix is straight-forward, but I'd still like a second and third opinion before releasing (including Hudson).
Patch looks good.
Gerrit change https://git.eclipse.org/r/44931 was merged to [master]. Commit: http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/?id=01fe9b211e794ff01834ebe0e40bd02cb1110d75
(In reply to Jay Arthanareeswaran from comment #4) > Patch looks good. thanks, released for 4.5 M7.
Verified for 4.5 M7 with build I20150426-2000.