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 have two toolchains Sun and Gnu create empty application and create two configurations ConfSun and ConfGnu: one use Sun and another Gnu toolchain. Create empty file with something like: #if definded (__GNUC__) || defined (__GNUG__) int gnu; #else int nonGnu; #endif One block is active while another is in gray (that's OK). then try to change active configuration => project is not reparsed, because no notification from project system about changed configuration. The same if change configuration in combobox on toolbar
Bug confirmed. Fix is simple and safe: Macintosh-49[547] hg diff diff -r 7caec8644340 cnd.makeproject/src/org/netbeans/modules/cnd/makeproject/NativeProjectProvider.java --- a/cnd.makeproject/src/org/netbeans/modules/cnd/makeproject/NativeProjectProvider.java Wed Apr 02 10:51:35 2008 -0700 +++ b/cnd.makeproject/src/org/netbeans/modules/cnd/makeproject/NativeProjectProvider.java Wed Apr 02 12:16:36 2008 -0700 @@ -353,6 +353,12 @@ final public class NativeProjectProvider if (oldConf == null) { // What else can we do? firePropertiesChanged(getMakeConfigurationDescriptor().getProjectItems(), true, true, true); + return; + } + + // Check compiler collection. Fire if different + if (!oldMConf.getCompilerSet().getName().equals(newMConf.getCompilerSet().getName())) { + fireFilesPropertiesChanged(); return; } Whether it is a P1 is difficult to say. I would be comfortable putting the change in because of the low risk but it is not a regression and the use case is not super common.
It is now fixed and I will commit to trunk shortly. Please escalate if we want the fix in 6.1.
Fixed in trunk (main). Can QA pls verify? Plsease nothe the test code should be #if defined and not #if definded
verified in trunk. Bug is fixed. But now when you switches project configuration, then IDE reparses project. I verified on Boost, IDE reparses project quickly. But on very big project (OpenSolaris for example) it can be slow process.
I opened in IDE 2 projects (described project(small project) + boost project). I switched configuration in small project ==> IDE reparses boost
I think it's not good to re-parse all other open projects when a configuration is changed for one of them. It could cause some performance issues.
Using a different API call that doesn't cause all project to be reparsed: changeset 51f0361a0ea6 in main details: http://hg.netbeans.org/main?cmd=changeset;node=51f0361a0ea6 description: 131825 Project system doesn't notify code model about changed configuration diffs (12 lines): diff -r 12033798e5ea -r 51f0361a0ea6 cnd.makeproject/src/org/netbeans/modules/cnd/makeproject/NativeProjectProvider.java --- a/cnd.makeproject/src/org/netbeans/modules/cnd/makeproject/NativeProjectProvider.java Thu Apr 03 09:40:10 2008 -0700 +++ b/cnd.makeproject/src/org/netbeans/modules/cnd/makeproject/NativeProjectProvider.java Thu Apr 03 11:33:19 2008 -0700 @@ -358,7 +358,7 @@ final public class NativeProjectProvider // Check compiler collection. Fire if different (IZ 131825) if (!oldMConf.getCompilerSet().getName().equals(newMConf.getCompilerSet().getName())) { - fireFilesPropertiesChanged(); + firePropertiesChanged(getAllFiles(), true); return; } Please retest...
verified in trunk (200804040003 build)
131825 is not completely fixed and I'm not sure we want to apply what we have in trunk today to 6.1. The remaining problems seems to be in the code model and in the interaction with some project system notifications. After several days of discussion with code model team I will reassign bug to vkvashin. There are several option and most require changes in code model. Here is the situation as I see it: 1) Project system cannot use filesPropertiesChanged because it triggers reparsing of *all* files in *all* projects. 2) Project system cannot use filesPropertiesChanged(fileItems) because it semantically is not identical to the one above. Code model side doesn't filter out excluded files. 3) During investigation of this bug I found a serious performance bug in the way code model and project system interacts. When you change macros or includes from global Options/C/C++/Code Assistance dialog, the project system sends out a filesPropertiesChanged notification for each open native project to the code model which again loops over all open native projects before it reparses them. It means projects will get reparsed more than once. This is actually a separate bug but it intersects with the solution of 131825. Solution 2) is what is currently in trunk. Here is a couple of suggestions to what we can do: a) Nothing. Don't push to the partial fix for 131825 to release61. 131825 is still broken in 6.1 and problem in 3) is still present. Probably not a big deal. b) Push current partial fix for 131825 to release61. It does fix 131825 except in some corner cases. Problem in 3) is still broken. c) Code model filters out excluded files in their implementation of filesPropertiesChanged(fileItems) in addition to the partial fix already in trunk. 131825 is completely fixed. 3) is still broken. d) Combine c) with removing code that loops over open projects in project system. It should also fix 3). e) Change project system call back to filesPropertiesChanged and remove loop in code model. It should fix 131825 and 3) but I'm not sure it is doable on the code model side. Anyway, it is up to vkvashin to decide....
I've committed (into main) a change that I believe solves remaining issues: http://hg.netbeans.org/main/rev/d030a1498334 Please review the changes.
I tested the changes and they do fix the problem originally described in this IZ and they do also fix the problem with the double looping. The change on the project side is correct. I'm not in the position to review the changes on the code model side though. They seems rather complicated and need a reviewer that is familiar with the code model code.
I reviewed the code model part and fix is correct.
verified bug in trunk again. works for me.
Fixed in release61: http://hg.netbeans.org/release61/rev/285cf1d7d7ad http://hg.netbeans.org/release61/rev/d0f3553e4937 http://hg.netbeans.org/release61/rev/d60d0086495f
verified in 200804082140 build (branch: release61)