Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » IPackageFragment's getCompilationUnit is buggy
IPackageFragment's getCompilationUnit is buggy [message #258017] Fri, 09 January 2009 10:54 Go to next message
Eclipse UserFriend
Suppose I have multiple source folder such that they contain the packages
with the same name..
Project
Src1
com.mytest
Src2
com.mytest
-Foo.java

Suppose I have a handle to IPackageFragment instance that represents
com.mytest in src1. If I do getCompilationUnit("Foo.java") it will return
the right result. This doesnt look like expected behavior. Please confirm?
Re: IPackageFragment's getCompilationUnit is buggy [message #258045 is a reply to message #258017] Mon, 12 January 2009 04:27 Go to previous messageGo to next message
Eclipse UserFriend
Raheel Ashraf wrote:
> Suppose I have multiple source folder such that they contain the
> packages with the same name..
> Project
> Src1
> com.mytest
> Src2
> com.mytest
> -Foo.java
>
> Suppose I have a handle to IPackageFragment instance that represents
> com.mytest in src1. If I do getCompilationUnit("Foo.java") it will
> return the right result. This doesnt look like expected behavior.
> Please confirm?
You're wrong, it is the expected behavior. The Javadoc says:

* This is a handle-only method. The compilation unit may or may
not be present.

Dani
>
>
Re: IPackageFragment's getCompilationUnit is buggy [message #258054 is a reply to message #258045] Mon, 12 January 2009 11:59 Go to previous messageGo to next message
Eclipse UserFriend
hmm so what does it mean when it says "handle only method. May or may not
be present" I thought that this method is to use to fetch the compilation
unit instance given a package?
Re: IPackageFragment's getCompilationUnit is buggy [message #258064 is a reply to message #258054] Tue, 13 January 2009 02:06 Go to previous messageGo to next message
Eclipse UserFriend
"Raheel Ashraf" <rashraf@ca.ibm.com> wrote in message
news:79defde1dbc6458ea189bfa9645a4811$1@www.eclipse.org...
> hmm so what does it mean when it says "handle only method. May or may not
> be present" I thought that this method is to use to fetch the compilation
> unit instance given a package?

I think you guys are arguing about what the "correct result" is without ever
saying what you mean.

Raheel, can you post a code snippet that gives a different result than you
expect?
Re: IPackageFragment's getCompilationUnit is buggy [message #258075 is a reply to message #258064] Tue, 13 January 2009 03:14 Go to previous message
Eclipse UserFriend
Walter Harley wrote:
> "Raheel Ashraf" <rashraf@ca.ibm.com> wrote in message
> news:79defde1dbc6458ea189bfa9645a4811$1@www.eclipse.org...
>
>> hmm so what does it mean when it says "handle only method. May or may not
>> be present" I thought that this method is to use to fetch the compilation
>> unit instance given a package?
>>
>
> I think you guys are arguing about what the "correct result" is without ever
> saying what you mean.
>
Sorry Walter, but I understood it.

Dani
> Raheel, can you post a code snippet that gives a different result than you
> expect?
>
>
>
Previous Topic:Bootclasspath?
Next Topic:Problem with EditTemplateDialog
Goto Forum:
  


Current Time: Wed Apr 23 12:05:16 EDT 2025

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

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

Back to the top