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.

Bug 27315 - Project.find (fo) - deos not work for FileObjects!
Summary: Project.find (fo) - deos not work for FileObjects!
Status: CLOSED FIXED
Alias: None
Product: projects
Classification: Unclassified
Component: Generic Infrastructure (show other bugs)
Version: 3.x
Hardware: All All
: P1 blocker (vote)
Assignee: Vitezslav Stejskal
URL:
Keywords:
Depends on: 27189
Blocks:
  Show dependency tree
 
Reported: 2002-09-13 16:31 UTC by Jan Jancura
Modified: 2003-12-11 14:14 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Jancura 2002-09-13 16:31:19 UTC
I tried it for examples/HelloWord FO, and null was
returned.
Comment 1 Torbjorn Norbye 2002-09-13 23:47:28 UTC
Verified.

The problem is the FileObject handling code in 
Project.knowsObject(Object object) :

   if (object instanceof FileObject) {
      try {
          objFS = ((FileObject) object).getFileSystem ();
      } catch (FileStateInvalidException e) {
          objFS = null;
      }

      if (objFS == filesystem) {

HelloWorld's FileSystem is not the project file system,
but ExLocalFileSystem (my root directory, /.)  

What's more, when I have multiple projects open, all the
source files report the same ExLocalFileSystem, not each
of their own ProjectFileSystems. 

So, the FileObject recognition code needs to get enhanced.
One quick fix is to do
  DataObject.find(fileobject)
and look for the DataObject (that works) but DataObject.find
may be slow (I've never looked at the implementation so
I don't know).

Alternatively, perhaps we have a quick way to check the
project contents using filesets?
Comment 2 Torbjorn Norbye 2002-09-13 23:51:58 UTC
One more note: while projectObject.getProject() works,
Project.find(projectObject) returns null. Probably not a big
deal.
Comment 3 Vitezslav Stejskal 2002-09-23 18:46:14 UTC
1. Semantics of Project.find and Project.findAll has been changed
according to issue #27189 (see details there). Basicaly, the
Project.findAll method should be used to get the list of projects
containing file. This method accept both DataObjects and FileObjects,
when DO is passed in the methods operates on primary file of that DO.

2. Project.find(ProjectObject) returns the same as
ProjectObject.getProject()

Comment 4 Jan Becicka 2003-08-29 11:05:29 UTC
Verified
Comment 5 Jan Becicka 2003-11-25 14:19:53 UTC
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 CLOSED.