Re: setting package on new Java objects

Tomas Zezula <[email protected]> Wed, 20 Aug 2003 09:06:39 +0200
Newsgroups gmane.comp.java.netbeans.modules.projects.devel
Organization Sun Microsystems
Message-ID <[email protected]>
Hi Cliff,
if the packageObject is a FileObject or its getPackageNameExt method
delegates on the FileObject.getPackageNameExt () the problem is in it.
The FO.getPackageNameExt method is deprecated and can not be used in the
NB 4.0. It supposes that the root of a FileSystem is a root of a Java
ClassPath entry. You have to use the ClassPath to obtain the correct
package name.

Tomas

On Tue, 2003-08-19 at 18:38, Cliff Draper wrote:
> It looks like the problem was in my code.  There was a line of code
> that set the package to be the wrong thing.  (Maybe
> packageObject.getPackageNameExt used to work, but doesn't in this case.)
> 
>         sourceElement.setPackage(Identifier.create(packageObject.getPackageNameExt('.', '.')));
> 
> And I changed it to
> 
>         sourceElement.setPackage(Identifier.create(packageObject.getName()));
> 
> And that fixed the package issue.  Thanks for the help.
> 
> Cliff Draper    Sun Microsystems, Forte Tools
> My opinions may or may not reflect those of my employer.
> ---------------------------- food for thought ---------------------------
> This sentence threee errors.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>