Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » ICompilationUnit & CompilationUnit
ICompilationUnit & CompilationUnit [message #460668] Sun, 02 August 2009 05:20 Go to next message
Eclipse UserFriend
Hi Guys,

I want to know if the same class which is in two diffrent
packages/projects in the same workspace will have the same
ICompilationUnit & CompilationUnit or they will be different.

I am developing application which will open the source of the class in an
editor but i want to know which one will be opened.

Thank you very much.
Re: ICompilationUnit & CompilationUnit [message #462566 is a reply to message #460668] Sun, 02 August 2009 10:51 Go to previous message
Eclipse UserFriend
"Eddy Freeman" <win1for@yahoo.com> wrote in message
news:83b0b27c4067e65573d0fe862d5c72ac$1@www.eclipse.org...
> Hi Guys,
>
> I want to know if the same class which is in two diffrent
> packages/projects in the same workspace will have the same
> ICompilationUnit & CompilationUnit or they will be different.

CompilationUnit is an internal type and you should not be relying on that
being the implementation of an ICompilationUnit.

If two classes are in different packages, they are not the same class. So
they clearly can't have the same ICompilationUnit.

ICompilationUnit extends ITypeRoot, which extends IJavaElement. If two
classes are in different projects, even if their contents are identical,
they must respond differently to IJavaElement.getPath() and other similar
methods. So again, they clearly can't have the same ICompilationUnit.
Previous Topic:Source File Path
Next Topic:Analyse MANIFEST.MF entries
Goto Forum:
  


Current Time: Sun Sep 14 08:28:15 EDT 2025

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

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

Back to the top