Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » Resolving generics TT in method signature(<T:Ljava.lang.Object;>([TT;)[TT; )
Resolving generics TT in method signature [message #874727] Mon, 21 May 2012 08:49 Go to next message
Eclipse UserFriend
Hi,

is there a simple means to resolve TT to java.lang.Object as given in the Signature <T:Ljava.lang.Object;>([TT;)[TT; using JDT utility methods?

org.eclipse.jdt.core.Signature offers a wealth of methods that remove any kind of generics - but I couldn't find anything that would help me to resolve TT.

Thanks,
Marcel

[Updated on: Mon, 21 May 2012 08:50] by Moderator

Re: Resolving generics TT in method signature [message #874983 is a reply to message #874727] Mon, 21 May 2012 18:33 Go to previous messageGo to next message
Eclipse UserFriend
Hi Marcel,

AFAICS the Signature class only performs strictly syntactic translations, whereas resolving is a semantic operation.

Considering the next logical step, what would you expect from
<T::I1;:I2;> m(TT;)V
(where T is a type variable with two bounds)? If you'd want the actual erasure you'd need to find the least upper bound, which however is implemented only for bindings (and can only be).

You probably don't want to go through any resolved bindings, right?

If you just need the special case for unbounded type variables, I'm afraid you may have to code this yourself.

best,
Stephan
Re: Resolving generics TT in method signature [message #875061 is a reply to message #874983] Tue, 22 May 2012 00:23 Go to previous messageGo to next message
Eclipse UserFriend
Hi Stephan,

thanks for your answer. So, I've to create that mapping by myself. I've to dig a little deeper into the signatures then and figure out how these strings are composed.

>You probably don't want to go through any resolved bindings, right?

I don't have them at this point. I only have signatures stored in the CompletionProposals. I just have to be sure that I can map any JDT signature to their bytecode counterpart. Otherwise I may fail to find the right proposals. http://goo.gl/aadho http://goo.gl/9YtZL

Thanks.
Marcel
Re: Resolving generics TT in method signature [message #875448 is a reply to message #875061] Tue, 22 May 2012 15:18 Go to previous message
Eclipse UserFriend
Marcel Bruch wrote on Tue, 22 May 2012 06:23
I just have to be sure that I can map any JDT signature to their bytecode counterpart. Otherwise I may fail to find the right proposals.


So, Engine.getSignature() prefers generic signatures over raw ones. Out of curiosity: why do you need to compare against raw signatures? Where do you get those from?

best,
Stephan

Previous Topic:Why does cancel button exist?
Next Topic:Eclipe always opening same files
Goto Forum:
  


Current Time: Tue Jul 22 19:08:02 EDT 2025

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

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

Back to the top