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 41769 - Ant hyperlinks can open the wrong file object if there are submounts
Summary: Ant hyperlinks can open the wrong file object if there are submounts
Status: VERIFIED FIXED
Alias: None
Product: projects
Classification: Unclassified
Component: Ant (show other bugs)
Version: 3.x
Hardware: All All
: P3 blocker (vote)
Assignee: Jesse Glick
URL:
Keywords: REGRESSION
Depends on: 24507
Blocks:
  Show dependency tree
 
Reported: 2004-04-07 01:30 UTC by klosels
Modified: 2005-12-20 15:47 UTC (History)
1 user (show)

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 klosels 2004-04-07 01:30:26 UTC
Usually I don't have my Ant build script in the
same directory as the source root but rather
build.xml in the project root while the source
root is something like src/java below. Both
directories are mounted in the filesystems.

On compile errors the Ant output shows something
like "src\java\de\foo\bar\MyFile.java [41] ';'
expected". This seems to be used for locating the
corresponding file as is. Since it's found with
this path from the mounted project root, it's
opened from there - regardless of the fact that
that filesystem is not enabled for compilation and
the path does not match the package structure.

Subsequently trying to run or debug MyFile results
in a "NoClassDefFoundError:
src/java/de/foo/bar/MyFile"

Workaround is more or less obvious: putting the
source root above the project root fixes this.

My suggestion though would be to either check for
a matching package/path or use only filesystems
with compilation capability for compile errors,
even if they come from the ant module.
That way opening wrongly based and sometimes
unnecessary duplicate editor windows wouldn't happen.
Comment 1 Jesse Glick 2004-04-07 02:12:14 UTC
Problem seems to be in AntOutputParser.findFO; apparently no longer
checks FileSystemCapability.COMPILE to find the right FileObject.
Seems to have been introduced by the patch issue #24507.

Workaround should be to move up the package root mount to be above the
more generic mount in Filesystems Settings, I think.

No longer an issue in NB 4.0, only for 3.6 - in 4.0 there are no
user-visible mounts and this class of problem cannot happen.
Comment 2 David Konecny 2004-04-07 09:17:31 UTC
Hmm, true. AOP.findFO uses FileUtil.fromFile which works according to
order of FSs in Repository.
Comment 3 Jesse Glick 2004-04-07 17:00:24 UTC
I believe this would be straightforward to fix in a 3.6.1 release if
there is one.
Comment 4 Jesse Glick 2004-04-29 16:05:16 UTC
Note: this issue also affects users of web apps, which automount the
source dirs (below the main dir). See issue #42565.
Comment 5 Marian Mirilovic 2005-12-20 15:47:40 UTC
This issue was solved long time ago. Because nobody has reopened it neither
added comments, we are verifying/closing it now. 
If you are still able to reproduce the problem, please reopen. Thanks in advance.