Re: setting package on new Java objects
Tomas Zezula <[email protected]> Tue, 19 Aug 2003 08:46:58 +0200
| Newsgroups | gmane.comp.java.netbeans.modules.projects.devel |
|---|---|
| Organization | Sun Microsystems |
| Message-ID | <[email protected]> |
On Tue, 2003-08-19 at 00:07, Cliff Draper wrote: > From: Svata Dedic <[email protected]> > Date: Sat, 16 Aug 2003 15:29:21 +0200 > > Please check the setup of the project you are working with. Could you > > please send back output from > > ClassPath cp = ProjectPath.find(javaObject, ProjectPath.PATH_SOURCE); > > System.err.println(cp); > > this should pring out what the project thinks the source roots are. > > You may get in trouble if the source is not in any project; maybe there > > may be some issue left for template sources (those coming from > > system/project filesystem), let us know if it is your case. > > Using the following code, > ClassPath cp = ProjectPath.find(javaObject, ProjectPath.PATH_SOURCE); > System.err.println("cp.class="+cp.getClass()); > System.err.println("cp="+cp); > FileObject[] roots = cp.getRoots(); > for (int i = 0; i < roots.length; ++i) > System.err.println("root="+roots[i]); > System.err.println("entries="+cp.entries()); > System.err.println("type="+cp.getType()); > System.err.println("resources="+cp.getResources()); > System.err.println("allResources="+cp.getAllResources()); > > I got the following output: > cp.class=class org.netbeans.modules.java.classpath.DefaultProxyClassPath > cp=org.netbeans.modules.java.classpath.DefaultProxyClassPath@7463b3 > root=/home/cliffwd/cvs/sequoia/ffjuserdir/samples/src > entries=[org.netbeans.spi.java.classpath.ClassPathBase$CPEntryImpl@1d62b0c] > type=source > resources=[org.netbeans.modules.java.project.SourceContainer$ResourceImpl@1bb5d98] > allResources=[org.netbeans.modules.java.project.SourceContainer$ResourceImpl@1bb5d98] > > And I'm getting a package Identifier of > ".home.cliffwd.cvs.sequoia.ffjuserdir.samples.src.examples" where I > expect "examples". > > The source java file is being created by the module. It's source is > underneath the project's source root. The root of classpath is OK, it seems that there is an issue in the SourceModel implementation. I will try to reproduce it and let you know. Tomas > > regards, > Cliff Draper Sun Microsystems, Forte Tools > My opinions may or may not reflect those of my employer. > ---------------------------- food for thought --------------------------- > "Programmer, noun: A red-eyed, mumbling mammal capable of conversing with > inanimate objects." [email protected] > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] >