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.
This is a regression in comparison with at least build 20071001. Preparation: Cygwin, MinGW and MSYS are installed. Cygwin is added to PATH Steps to reproduce: - run IDE - open Tools->Options->C/C++ - add paths to MinGW/bin and MSYS/bin to the "Current PATH" list - remove path to Cygwin/bin from the "Current PATH" list - press OK - open Tools->Options->C/C++ Result: "Current Path" list has an original view (has a path to Cygwin/bin and doesn't have paths to MinGW/bin and MSYS/bin).
I think I found the root cause of the bug: CppSettings is supposed to be singleton but public static CppSettings getDefault() { return (CppSettings) findObject(CppSettings.class, true); } sometimes returns a new and reinitialized object. This may be a regression but I don't think it is caused by any changes in CND though. Strange. Fix is to change the code to public static CppSettings getDefault() { return (CppSettings) findObject(CppSettings.class, true); if (cppSettings == null) { cppSettings = (CppSettings) findObject(CppSettings.class, true); } return cppSettings; which ensures there is only one singleton. Patch: # This patch file was generated by NetBeans IDE # This patch can be applied using context Tools: Apply Diff Patch action on respective folder. # It uses platform neutral UTF-8 encoding. # Above lines and this line are ignored by the patching process. Index: cnd/core/src/org/netbeans/modules/cnd/settings/CppSettings.java --- cnd/core/src/org/netbeans/modules/cnd/settings/CppSettings.java Base (1.9) +++ cnd/core/src/org/netbeans/modules/cnd/settings/CppSettings.java Locally Modified (Based On 1.9) @@ -96,6 +96,7 @@ private String path = null; + private static CppSettings cppSettings = null; /** Initialize each property */ protected void initialize() { @@ -107,8 +108,11 @@ /** Return the signleton cppSettings */ public static CppSettings getDefault() { - return (CppSettings) findObject(CppSettings.class, true); + if (cppSettings == null) { + cppSettings = (CppSettings) findObject(CppSettings.class, true); } + return cppSettings; + } /** * Return the local version of $PATH. This masquerades as a property but isn't!
Fixed.
verified in build 200710310000