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.
[#200911071423, GF v3 b71, jdk1.6, Mac OS X] to reproduce: ------------- 1) create two web projects WebA and WebB 2) modify index.jsp files in both projects to be able to distinguish them 3) set BP at title tag at both index.jsp files 3) right click the WebA Project Node and choose Debug ERROR: debugger stops at index.jsp from WebB project.
Reproduced.
It's caused by the insufficient sourcepath of the project. Sourcepath is just ".../WebApplicationA/src/java" and that does not contain index.jsp file. Therefore that file is found through GlobalPathRegistry, which returns randomly index.jsp either from WebApplicationA or WebApplicationB. That sourcepath is retrieved from classpath ".../WebApplicationA/build/web/WEB-INF/classes/". We need to have ".../WebApplicationA/web" on the sourcepath.
Cc'ing David for his opinion. Is this a regression?
nbjpdaconnect task get sourcepath element, which is set to "${web.docbase.dir}" According ANT verbose output web.docbase.dir = web I thought that this is not sufficient, that we need to have absolute path in the sourcepath. But apparently not, because this works fine when I replace JPDAStart.Sourcepath with Path. So this is a regression.
The regression is caused by the fix of issue #52920.
Why it does not create link? What about bug #52920?
Yes, of course. We no longer works with issues, but with bugs.
Well, this is not really true, this regression is caused by fix of bug 167941. We get correct Sourcepath object, but fail to extract the Path from it. This look like something that can not be correctly written. So it looks like we have to workaround just the refid case.
Fixed in changeset: 152863:e40ff48d304d http://hg.netbeans.org/main/rev/e40ff48d304d
Martin, couple of comments/questions: * looking at http://hg.netbeans.org/main/rev/ea89e1fab816 (bug 52920) I wonder if you tried to just reorder classpath instead of implementing "exclusive attribute". I mean prior ea89e1fab816 code was "new ClassPath[] {cp, sp}" but if that was changed to "new ClassPath[] {sp, cp}" that should give source path preference over compilation path and should resolve original problem user was complaining about, no? * problem reported in bug 167941 ("org.apache.tools.ant.types.Path is not a subclass of class org.netbeans.modules.debugger.jpda.ant.JPDAStart$Sourcepath") makes sense to me but I cannot explain it in detail as I do not know enough on how Ant decides when to instantiate org.apache.tools.ant.types.Path and when to instantiate org.netbeans.modules.debugger.jpda.ant.JPDAStart$Sourcepath. Perhaps JPDAStart.addSourcepath signature should accept Path instead of JPDAStart$Sourcepath and the method should try to cast it to JPDAStart$Sourcepath and if successful use isExclusive flag. Perhaps that would resolve issue 167941 correctly. * if isExclusive() is really needed then rather then introducing <sourcepath> in NB which overlaps with Ant <sourcepath> I would use different tag name for NB one, eg. <exclusivesourcepath> which would have exclusive always set to true and JPDAStart would have addSourcepath and addExclusiveSourcepath method. Again, just idea, I cannot guarantee it will work as it is about 8 years since I last looked at Ant sources.
Thanks for comments David * I did not want to reorder class-path as I was afraid of side-effects it can have, it can break other modules and someone might easily come with opposite demand. And it would not fulfill the request from bug 52920 "use these sources and ONLY these." * I do not know the ANT in such detail as well. But what do you suggest does not work. ANT fails with "sourcepath doesn't support the "exclusive" attribute" * This looks much more ugly to me and changing that now would be incompatible change. NB 6.7 uses exclusive attribute, if we delete it, we would break user's projects. I know that what I do with Sourcepath and Path to fix bug 167941 is not nice at all, but I consider it to be a workaround for ANT limitation. And as far as workarounds in implementation are possible I prefer to have clean and compatible APIs.