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 128326 - classpath/sourcepath doesn't update after reload
Summary: classpath/sourcepath doesn't update after reload
Status: VERIFIED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Source (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Jan Lahoda
URL:
Keywords:
: 126259 128325 129056 134275 135146 135881 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-02-25 15:56 UTC by faramir2
Modified: 2008-09-22 15:19 UTC (History)
6 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
A (source) patch against release61 (5.58 KB, patch)
2008-05-20 15:59 UTC, Jan Lahoda
Details | Diff
A binary patch against release61 (169.71 KB, application/octet-stream)
2008-05-20 15:59 UTC, Jan Lahoda
Details

Note You need to log in before you can comment on or make changes to this bug.
Description faramir2 2008-02-25 15:56:57 UTC
I have xml schema that is generated by maven using maven-jaxb-plugin. When I have deleted target directory and open 
project in java files, which uses resources from generated classes, exclamation marks appear. After building project, 
generated sources are created, but exclamation marks still appears. I can reopen project, and then exclamation mark 
disappear, but when I click reload project it doesn't. I can also open all files with exclamation mark, and then 
exclamation marks also disappear.

I have installed all available updates.

Product Version: NetBeans IDE 6.0 (Build 200711261600)
Java: 1.6.0; Java HotSpot(TM) Client VM 1.6.0-b105
System: Windows XP version 5.1 running on x86; Cp1250; pl_PL (nb)
Userdir: C:\Documents and Settings\faramir\.netbeans\6.0
Comment 1 Tomas Zezula 2008-02-25 16:28:32 UTC
Classpath module represents just an API, SPI bridge.
Project module is responsible for correct firing and so on.
Comment 2 Milos Kleint 2008-02-25 17:32:55 UTC
tzezula: faramir2 said "I can also open all files with exclamation mark, and then exclamation marks also disappear."
The fact that the exclamation mark disappears on java file opening, suggests this is not a problem of project firing
changes. 

Comment 3 Tomas Zezula 2008-02-25 18:50:19 UTC
mkleint: No.
This is the behavior when the IDE didn't got an event about source root recreation and children recreation. When you open the file the compiler completes  the 
closure using java.io.File. The files are marked by error until open because the RepoUpdater doesn't know about the change.
Comment 4 Milos Kleint 2008-02-25 19:58:16 UTC
issue 126259 is very related, most probably a duplicate.

quote:
"Secondly, if I edit the pom.xml file and remove a dependency, it disappears from the Libraries list in the Project view.
 Any code that relies on that dependency shows errors in the editor window (and is marked in the Project view with an
exclamation mark in a red circle).

However, when I add that same dependency back in exactly as it was (again, by editing the pom.xml), although it
reappears in the Libraries list, the files that depend on it still show errors, both in the project view and in their
respective editor windows."

that's the same behaviour we experiencing here, the project filres changes correctly but going from "error marks->no
error marks" state seems to be unreliable.
Comment 5 Jiri Prox 2008-02-26 06:42:21 UTC
*** Issue 128325 has been marked as a duplicate of this issue. ***
Comment 6 Milos Kleint 2008-03-04 14:52:08 UTC
*** Issue 129056 has been marked as a duplicate of this issue. ***
Comment 7 Milos Kleint 2008-03-04 14:53:01 UTC
*** Issue 126259 has been marked as a duplicate of this issue. ***
Comment 8 Milos Kleint 2008-03-04 14:54:02 UTC
multiple duplicates, increasing priority ->P2
Comment 9 Milos Kleint 2008-03-17 15:30:46 UTC
possibly duplicate of #129916 that is about to be fixed. Need to verify it's actually a duplicate..
Comment 10 Milos Kleint 2008-03-18 11:40:41 UTC
yes, duplicate of #129916. I could not reproduce anymore in a build that includes fix for #129916

*** This issue has been marked as a duplicate of 129916 ***
Comment 11 faramir2 2008-03-18 14:45:27 UTC
thanks mkleint, but how to I can use this fix? If it's possible without downloading sources and compiling or I must 
wait for new update pack?
Comment 12 Milos Kleint 2008-03-18 14:56:10 UTC
that owuld be a daily build of netbeans 6.1 from here for example:
http://deadlock.netbeans.org/hudson/job/trunk/lastSuccessfulBuild/artifact/nbbuild/dist/zip/

(please note that it's not included in the released beta of 6.1)
Comment 13 m0thr4 2008-04-01 11:43:35 UTC
Is there a workaround for this issue that I could apply to Netbeans 6.0.1?
Comment 14 faramir2 2008-04-16 11:44:50 UTC
I saw the same state in NetBeans 6.1 RC1. Red exclamation mark appear, but clicking "reload project" doesn't recheck 
classpath. Only after a long while (or when opening file with that mark) classpath is read again and exclamation mark 
disappear.

I think that code complementation is connected with this issue: after adding methods in generated sources, after 
pressing CTRL+SPACE new methods aren't visible.
Comment 15 Milos Kleint 2008-04-16 12:29:54 UTC
Honzo, can you look a it please? I can sporadically reproduce in the sample scenarios of commenting out junit dependency
in pom.xml and reinserting it later. once in a while the markers don't get updated.
Comment 16 Jan Lahoda 2008-05-16 14:59:48 UTC
My investigation shows that the change of classpath (in the case of Maven project and adding/removing dependency on
JUnit) is correctly fired and forces rescan of the corresponding source root. In some cases, the scanning is interrupted
(which is fine), but is not resumed as it should be.
Comment 17 Jan Lahoda 2008-05-16 16:30:11 UTC
I made the scan non-interruptible (as it was in NB6.0) for now:
http://hg.netbeans.org/main/rev/ad556cb5835b

After thinking about it more, I am not sure if the scan should be interruptible in this case - keeping this issue open
for now to decide (and implement) the (non-)interruptibility of this part of the scan.
Comment 18 Quality Engineering 2008-05-20 05:09:08 UTC
Integrated into 'main-golden', available in NB_Trunk_Production #206 build
Changeset: http://hg.netbeans.org/main/rev/ad556cb5835b
User: Jan Lahoda <jlahoda@netbeans.org>
Log: Temporary fix for #128326 - making the parseFiles invoked from updateFolder non-cancelable, as it originally was.
Comment 19 Jan Lahoda 2008-05-20 12:13:05 UTC
This issue needs to be closed, so it can be considered as a candidate for a patch release. I have filled issue #135415
for the cancelability concerns (please feel free to add yourself on CC). The patch from trunk cannot be applied to
release61 - I will attach a patch against release61 shortly.
Comment 20 Jan Lahoda 2008-05-20 15:51:31 UTC
I am going to attach two patches:
-a source patch against release61
-a binary patch against release61. To install it, put the 128326.jar into directory
${NETBEANS_INSTALL_DIR}/java2/modules/patches/org-netbeans-modules-java-source (${NETBEANS_INSTALL_DIR}/java2/modules/
should exist, patches/org-netbeans-modules-java-source will need to be created). It would be great if the people
experiencing the problems could test the patch. To remove the patch, it is enough to delete the 128326.jar from the
above directory.

Thanks.
Comment 21 Jan Lahoda 2008-05-20 15:59:05 UTC
Created attachment 61630 [details]
A (source) patch against release61
Comment 22 Jan Lahoda 2008-05-20 15:59:39 UTC
Created attachment 61631 [details]
A binary patch against release61
Comment 23 faramir2 2008-05-21 01:46:56 UTC
I copied .jar file as you said, but I still see misfunction.
Maybe I cannot describe it good enought? :(

I tried to record what's wrong and here you can download video (about 11 MB, 11min):
  http://www.mat.umk.pl/~faramir/nb-xvid.avi

I hope that help you to fix it (or explain that, this is feature not a bug :P).
Comment 24 Jan Lahoda 2008-05-26 08:17:20 UTC
faramir2: seems that there was another problem related to the generated sources (the src/main/java and the generated
source root are considered to be one compilation unit), should be fixed by this commit:
http://hg.netbeans.org/main?cmd=changeset;node=7aa22484bff8
Comment 25 Quality Engineering 2008-05-27 16:27:44 UTC
Integrated into 'main-golden', available in NB_Trunk_Production #221 build
Changeset: http://hg.netbeans.org/main/rev/7aa22484bff8
User: Jan Lahoda <jlahoda@netbeans.org>
Log: #128326 continued: the same instance of ClassPath may be provided used by more than one source root.
Comment 26 Jiri Prox 2008-05-28 15:10:21 UTC
*** Issue 135881 has been marked as a duplicate of this issue. ***
Comment 27 Jiri Prox 2008-06-03 08:09:58 UTC
faramir2: can you please verify the fix, we will be able then to include it in to patch2.
The dev builds can be downloaded here: http://deadlock.netbeans.org/hudson/job/trunk/

Thanks
Comment 28 faramir2 2008-06-03 15:57:35 UTC
I've tested it now. It works almost good, but one little bug stay - source packages are [re-]compiling, but test 
packages aren't.

To see more please watch:
  http://www.mat.umk.pl/~faramir/nb2-xvid.avi (11 MB)

Quality is very low, but I hope that you see what is wrong.
Comment 29 Jan Lahoda 2008-06-09 12:48:57 UTC
Not quite sure what is wrong there - might be the fact that changes in one source root won't cause recompile in other
source roots (issue #125870). More info on how to reproduce the problem would be helpful. Anyway, if I understand it
correctly, the above patches help, and the patches cannot be incorporated in the patch2 unless the issue is in verified
state. So, unless someone disagrees, I propose to create a new issue to cover the new problem and change status of this
one to verified. Jirka, could you please take care of this? Thanks.
Comment 30 faramir2 2008-06-09 15:14:01 UTC
Recompiling "Test source package" is wrong only (doesn't recompile it).

"Source package" is working correctly. If bug in "test source package" isn't so bad, I can say, that this issue can 
become VERIFIED.
Comment 31 faramir2 2008-06-09 15:14:02 UTC
Recompiling "Test source package" is wrong only (doesn't recompile it).

"Source package" is working correctly. If bug in "test source package" isn't so bad, I can say, that this issue can 
become VERIFIED.
Comment 32 Jiri Prox 2008-06-09 15:24:28 UTC
thanks for info, I'm marking it as verified then
Comment 33 pgebauer 2008-06-09 16:52:57 UTC
The fix has been ported into the release61_fixes branch:

http://hg.netbeans.org/release61_fixes/f99dba0ee5d2
Comment 34 Jan Becicka 2008-07-30 09:13:41 UTC
*** Issue 134275 has been marked as a duplicate of this issue. ***
Comment 35 Tomas Zezula 2008-09-22 15:19:35 UTC
*** Issue 135146 has been marked as a duplicate of this issue. ***