Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » ITypeParameter bounds names are not signatures
ITypeParameter bounds names are not signatures [message #261322] Wed, 22 July 2009 05:04 Go to next message
Eclipse UserFriend
Hi

I am analysing the Java Model and in particular the type parameters of
IType & IMethod.

Why does the names of the bounds of a ITypeParameter are not signatures ?

For example,

in source :
public class P<E extends List<Integer>> {

public <T extends Thread & List<String>> void Test(){

}

}

In class file :

The bound of the ITypeParameter of the IType P will be :
java.util.List<java.lang.Integer>

The bounds of the ITypeParameter of the IMethod Test will be :
java.lang.Thread
java.util.List<java.lang.String>

That's a problem since we can't use org.eclipse.jdt.core.Signature methods.

Sorry for bad english.
Re: ITypeParameter bounds names are not signatures [message #261341 is a reply to message #261322] Wed, 22 July 2009 10:22 Go to previous messageGo to next message
Eclipse UserFriend
Found the reason :

in the method generateTypeParameterInfos of the class
org.eclipse.jdt.internal.core.ClassFileInfo, the type parameters
signatures are translated :

for (int j = 0; j < boundLength; j++) {
typeParameterBounds[j] =
Signature.toCharArray(typeParameterBoundSignatures[j]);
CharOperation.replace(typeParameterBounds[j], '/', '.');
}

If nobody replies, i think i will open a bug.



Romain Dervaux a écrit :
> Hi
>
> I am analysing the Java Model and in particular the type parameters of
> IType & IMethod.
>
> Why does the names of the bounds of a ITypeParameter are not signatures ?
>
> For example,
>
> in source :
> public class P<E extends List<Integer>> {
>
> public <T extends Thread & List<String>> void Test(){
>
> }
>
> }
>
> In class file :
>
> The bound of the ITypeParameter of the IType P will be :
> java.util.List<java.lang.Integer>
>
> The bounds of the ITypeParameter of the IMethod Test will be :
> java.lang.Thread
> java.util.List<java.lang.String>
>
> That's a problem since we can't use org.eclipse.jdt.core.Signature methods.
>
> Sorry for bad english.
Re: ITypeParameter bounds names are not signatures [message #261345 is a reply to message #261341] Wed, 22 July 2009 11:08 Go to previous messageGo to next message
Eclipse UserFriend
Romain Dervaux a écrit :
> Found the reason :
>
> in the method generateTypeParameterInfos of the class
> org.eclipse.jdt.internal.core.ClassFileInfo, the type parameters
> signatures are translated :
>
> for (int j = 0; j < boundLength; j++) {
> typeParameterBounds[j] =
> Signature.toCharArray(typeParameterBoundSignatures[j]);
> CharOperation.replace(typeParameterBounds[j], '/', '.');
> }
>
> If nobody replies, i think i will open a bug.
If you want signatures, you should use
org.eclipse.jdt.core.IType.getTypeParameterSignatures() or
org.eclipse.jdt.core.IMethod.getTypeParameterSignatures() even if the
latte one is deprecated.
--
Olivier
Re: ITypeParameter bounds names are not signatures [message #261386 is a reply to message #261345] Mon, 27 July 2009 09:29 Go to previous message
Eclipse UserFriend
> If you want signatures, you should use
> org.eclipse.jdt.core.IType.getTypeParameterSignatures() or
> org.eclipse.jdt.core.IMethod.getTypeParameterSignatures() even if the
> latte one is deprecated.

See https://bugs.eclipse.org/bugs/show_bug.cgi?id=246594

Markus
Previous Topic:Java Model to IBinding ?
Next Topic:Tag lib auto-completion and subdived project?
Goto Forum:
  


Current Time: Sat Jul 19 17:13:53 EDT 2025

Powered by FUDForum. Page generated in 0.03690 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top