Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » problem with ITypeBinding.getQualifiedName()
problem with ITypeBinding.getQualifiedName() [message #258905] Mon, 02 March 2009 15:48 Go to next message
Eclipse UserFriend
Originally posted by: first.last.oracle.com

I have a method declared like this:

public Set<Bar> getBars()

If I get the resolved binding for this method and
get the return type, by calling

IMethodBinding.getReturnType()

I get what appears to be the appropriate ITypeBinding back.
But a call to

ITypeBinding.getTypeDeclaration().getQualifiedName()

returns a String that looks like this:

"java.util.Set"

Unless I am confused by generics (which is often the case),
I am reading the JavaDoc for getQualifiedName() to mean that the
returned String should be something like this:

"java.util.Set<com.foo.Bar>"

The odd thing is that if I tweak the method declaration to be this:

public Set<Bar>[] getBars()

i.e. change the return type to be an array, getQualifiedName() then
returns:

"java.util.Set<com.foo.Bar>[]"

Am I missing something? Or is getQualifiedName() returning the incorrect
string here?

Thanks.
Brian Vosburgh
Dali
Re: problem with ITypeBinding.getQualifiedName() [message #258908 is a reply to message #258905] Mon, 02 March 2009 16:27 Go to previous message
Eclipse UserFriend
Originally posted by: first.last.oracle.com

Never mind. :-)

Not five minutes after I pressed "Send" I noticed
my call to getTypeDeclaration():

ITypeBinding.getTypeDeclaration().getQualifiedName()

instead of just querying the type binding directly:

ITypeBinding.getQualifiedName()

I think I got lost in all the meta-ness....

Brian Vosburgh wrote:
> I have a method declared like this:
>
> public Set<Bar> getBars()
>
> If I get the resolved binding for this method and
> get the return type, by calling
>
> IMethodBinding.getReturnType()
>
> I get what appears to be the appropriate ITypeBinding back.
> But a call to
>
> ITypeBinding.getTypeDeclaration().getQualifiedName()
>
> returns a String that looks like this:
>
> "java.util.Set"
>
> Unless I am confused by generics (which is often the case),
> I am reading the JavaDoc for getQualifiedName() to mean that the
> returned String should be something like this:
>
> "java.util.Set<com.foo.Bar>"
>
> The odd thing is that if I tweak the method declaration to be this:
>
> public Set<Bar>[] getBars()
>
> i.e. change the return type to be an array, getQualifiedName() then
> returns:
>
> "java.util.Set<com.foo.Bar>[]"
>
> Am I missing something? Or is getQualifiedName() returning the incorrect
> string here?
>
> Thanks.
> Brian Vosburgh
> Dali
Previous Topic:Applying Annotations to newly created IType
Next Topic:Stopping prematurely the SearchEngine
Goto Forum:
  


Current Time: Thu May 15 10:07:43 EDT 2025

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

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

Back to the top