This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
I need some way how to find FileObject (or ProjectMember or Line) for: Project & className. The current support for this problem is not very nice (I must go through all CompilationUnits). So, is it possible to define one SourcePath for each Project? It should contain all sources from all compilation units & resources. This will be usefull for Editor module too (at least).
:-) What is missing is what contents should be in that classpath, actually. - sources from the project - classes from outside (jars, .class files) fed to the compiler - reference sources (for the outside classes) - project output classes - a mixture of the above ?
? Should I design it? my initial idea is that it should contain "all sources" for project. it means all .java files from sources & resources.
I wouldn't think that this content would be useful to Editor - they update parser DB from both sources and classes inserted into the project. Mato ?
As I understand it, they can use sourcePath for finding a source, not for updating databases.
OK, that makes more sense.
It doesn't affect updater directly, but there are some cases that such feature will be useful, i.e: FastOpen (or Go to class...) action. You have FQN and you need the FileObject from that. Now I need traverse through all projects, all their CompilationUnits, all PathResources and because pathResource.getContents() is always throwing UnsupportedOExc. I need to find the FileObject recursively from pathResource.getFile(). It would be really helpful to have the possibility to obtain FO from FQN in specific javaproject directly.
I do not understand that part with throwing an exception and recursive something of FileObject. Could you please elaborate ?
I would like to use getContent to retrieve PathContent: PathContent pathContent = pathResource.getContents(); FileObject fobj = pathContent.findResource(resourceName); pathResource.getContents() throws UnsupportedOperationException (I don't test it in the current builds, maybe it already works OK), thats why I need to obtain FO in the way: FileObject pathFO = pathResource.getFile(); DataObject dobj = DataObject.find(pathFO); DataFolder df = (DataFolder)dobj.getCookie(DataFolder.class); and travese folders to find the FO from FQN. I admit this is hack :-), perhaps some better way exists. Please, advise ;-)
Solvable using: ProjectPath.find(whateverStartingPoint, PATH_SOURCE).findResource("resourceName"); findResource on PathContent automatically calls getAllResources() on itself and filters out invalid ones from the search.
*** Issue 27121 has been marked as a duplicate of this issue. ***
*** Issue 29281 has been marked as a duplicate of this issue. ***
Well. At least #27121 is not a duplicate, since it talks about allowing reference source items to be defined for Platform. This issue is for project. This issue talks about a merge path collecting sources from a project and reference sources so that source for a symbol can be easily found. Issue #29281 talks about implementation of such "reference source" resources (which can be collected onto classpath requested in this issue). Are they duplicate ?
Oops there's yet another issue (#32360), specifically for the single resource impl ;)
Probably the utility method creating an composite read only ClassPath of given type is sufficient. Am I right, Hanz?
Fixed.
As described in http://www.netbeans.org/servlets/ReadMsg?msgId=619519&listName=nbdiscuss the current work on projects prototype has been stopped. Marking issue as VERIFIED --->
---> CLOSED