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.
Summary: | Project-specific settings do not work reliably | ||
---|---|---|---|
Product: | platform | Reporter: | Jesse Glick <jglick> |
Component: | -- Other -- | Assignee: | David Konecny <dkonecny> |
Status: | VERIFIED FIXED | ||
Severity: | blocker | CC: | issues, mmirilovic, vidyack |
Priority: | P2 | Keywords: | REGRESSION, SIMPLEFIX |
Version: | 3.x | ||
Hardware: | PC | ||
OS: | Linux | ||
Issue Type: | DEFECT | Exception Reporter: | |
Attachments: |
Module (JAR) with a project-specific option and an action to display it in a nonmodal dialog
Steps to exercise the module and demonstrate the problem NB 3.4.1 version of the module NB 3.3.2 version of the module; note - Options link is broken, so to see Options-like view of option, unhide SFS in Filesystems Settings, then look under Default System -> Services binary patch source code patch |
Description
Jesse Glick
2003-06-04 16:05:35 UTC
Created attachment 10587 [details]
Module (JAR) with a project-specific option and an action to display it in a nonmodal dialog
Created attachment 10588 [details]
Steps to exercise the module and demonstrate the problem
In NB 3.4.1 (change OpenIDE-Module-IDE-Dependencies to be 2.23.2), it is similar, but in step 17, prop1 stays as foo and rE is not called - i.e. it is slightly more broken. In NB 3.3.2, push IDE dep back to 1.43.3. Also comment out ProbeAction.iconResource, and use (Frame)null in place of WindowManager.getDefault().getMainWindow() in UsingSettingsThing's super constructor. 3.3.2 has some problems too - mainly, that changes to the bean in p2 are not written out until you view its BeanNode in the Services/ folder of the SFS (the .shadow is broken in 3.3.2 due to the newer syntax used here); but after that it works better. So I guess the summary is: it never really completely worked, at least not going as far back as NB 3.3 with the introduction of layerization of system options, but it got much worse in NB 3.4, and hardly any better in 3.5. Therefore marking a REGRESSION in 3.4. Created attachment 10589 [details]
NB 3.4.1 version of the module
Created attachment 10590 [details]
NB 3.3.2 version of the module; note - Options link is broken, so to see Options-like view of option, unhide SFS in Filesystems Settings, then look under Default System -> Services
Thanx for detailed testcase. That will help a lot. My first reaction is: this probably never worked correctly and hopefully if new projects are implemented soon we could kill this completely for next version so maybe this is not worth to fix. But I would like to look at it to learn more about the internals. Tentatively marking as 4.0 milestone. Created attachment 10606 [details]
binary patch
Created attachment 10607 [details]
source code patch
Attached is binary and source code patch which I just finished. The attached testcase worked fine on it. The binary patch must be put into netbeans\modules\autoload\patches\org-netbeans-modules-settings folder in the installation of NB. Should work for main trunk and NB35 because there was no change in trunk yet. Let me know if it works. It is not final and patch might require some refactorings. The problem is following: InstanceDO created for .settings file has lookup created by SerialDataConvertor. The SDC listens on underlaying fileobject and if there is a change (for example during the project switch) it modifies the lookup of the InstanceDO. More precisely it replaces InstanceCookie with a new one. The SystemOption is created by retrieving InstanceCookie from InstanceDO and by calling createInstance() on it. So far everything is OK. The problem is that once the SystemOption was created there is nobody who is listening on the lookup changes of the InstanceDO! And because of that the new InstanceCookie which was added into lookup by SerialDataConvertor is never called. If Options dialog is shown then there is an InstanceNode which listens on it and it somehow (I did not look into the details, just saw it from stack trace) causes the recreation of the SystemOption. The fix of this problem should be probably in some different place, but at the moment I did it directly in the SerialDataConvertor. It is very simple: if instance was already created from the InstanceCookie and IC is being replaced with the new one then I simply force creation of the new object (iff it is SystemOption subclass) what results in needed recreation of SystemOption and because SO is singleton the rest is straightforward. Fixed in trunk: Checking in settings/src/org/netbeans/modules/settings/convertors/SerialDataConv ertor.java; new revision: 1.21; previous revision: 1.20 Checking in src/org/netbeans/core/projects/SerialDataConvertor.java; new revision: 1.22; previous revision: 1.21 I was thinking about marking this SIMPLEFIX, but I'm not sure about that. The problem is serious, the fix is simple and should not have any sideeffects, but this problem is there for years (at least since NB3.3) without being noticed. Anyway, marking as SIMPLEFIX. There was NPE reported in issue 35086 caused by this fix. Improved in: Checking in src/org/netbeans/core/projects/SerialDataConvertor.java; new revision: 1.23; previous revision: 1.22 Checking in settings/src/org/netbeans/modules/settings/convertors/SerialDataConvertor.java; new revision: 1.22; previous revision: 1.21 *** Issue 35182 has been marked as a duplicate of this issue. *** verifying, it looong time in code |