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 62675

Summary: never mutate the settings objects
Product: editor Reporter: Jaroslav Tulach <jtulach>
Component: SettingsAssignee: Martin Roskanin <mroskanin>
Status: VERIFIED FIXED    
Severity: blocker    
Priority: P2    
Version: 5.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:
Bug Depends on:    
Bug Blocks: 59784    

Description Jaroslav Tulach 2005-08-19 15:06:32 UTC
An inconsistency between the spec and implementation has been 
found. The <code>editor/settings</code> expects the setting  
classes to be immutable, while the implementation mutates 
its instances. Various solutions to this problem has been  
discussed, however regardless of the actual solution, the  
TCR is clear - it asks the implementation to never mutate the 
settings objects.
Comment 1 Miloslav Metelka 2005-09-16 16:56:57 UTC
Although there is no doubt that this issue is a release stopper IMO this is no
beta stopper so I'm lowering the priority to P2 for now. We will resolve it into
5.0.
Comment 2 Martin Roskanin 2005-10-05 15:44:52 UTC
fixed in [maintrunk]

Checking in
src/org/netbeans/modules/editor/settings/storage/FontColorSettingsImpl.java;
/cvs/editor/settings/storage/src/org/netbeans/modules/editor/settings/storage/FontColorSettingsImpl.java,v
 <--  FontColorSettingsImpl.java
new revision: 1.15; previous revision: 1.14
done
Checking in
src/org/netbeans/modules/editor/settings/storage/KeyBindingSettingsImpl.java;
/cvs/editor/settings/storage/src/org/netbeans/modules/editor/settings/storage/KeyBindingSettingsImpl.java,v
 <--  KeyBindingSettingsImpl.java
new revision: 1.11; previous revision: 1.10
done
Checking in
src/org/netbeans/modules/editor/settings/storage/MimeLookupInitializerImpl.java;
/cvs/editor/settings/storage/src/org/netbeans/modules/editor/settings/storage/MimeLookupInitializerImpl.java,v
 <--  MimeLookupInitializerImpl.java
new revision: 1.4; previous revision: 1.3
done
Checking in
src/org/netbeans/modules/editor/settings/storage/api/FontColorSettings.java;
/cvs/editor/settings/storage/src/org/netbeans/modules/editor/settings/storage/api/FontColorSettings.java,v
 <--  FontColorSettings.java
new revision: 1.5; previous revision: 1.4
done

Comment 3 Martin Roskanin 2005-10-11 09:44:34 UTC
I rollbacked the fix. It should be done in a different way. It causes a problem
with keybindings propagation to editor, reopening issue
Checking in
src/org/netbeans/modules/editor/settings/storage/FontColorSettingsImpl.java;
/cvs/editor/settings/storage/src/org/netbeans/modules/editor/settings/storage/FontColorSettingsImpl.java,v
 <--  FontColorSettingsImpl.java
new revision: 1.16; previous revision: 1.15
done
Checking in
src/org/netbeans/modules/editor/settings/storage/KeyBindingSettingsImpl.java;
/cvs/editor/settings/storage/src/org/netbeans/modules/editor/settings/storage/KeyBindingSettingsImpl.java,v
 <--  KeyBindingSettingsImpl.java
new revision: 1.12; previous revision: 1.11
done
Checking in
src/org/netbeans/modules/editor/settings/storage/MimeLookupInitializerImpl.java;
/cvs/editor/settings/storage/src/org/netbeans/modules/editor/settings/storage/MimeLookupInitializerImpl.java,v
 <--  MimeLookupInitializerImpl.java
new revision: 1.5; previous revision: 1.4
done
Comment 4 Martin Roskanin 2005-11-29 12:28:21 UTC
tests created:
/cvs/editor/settings/storage/test/unit/src/org/netbeans/modules/editor/settings/storage/EditorSettingsStorageImmutabilityTest.java,v
 <--  EditorSettingsStorageImmutabilityTest.java
initial revision: 1.1
Comment 5 Martin Roskanin 2005-12-03 12:27:48 UTC
fixed in [maintrunk] + added tests

Yarda, thanks for the ideas from the branch immutable_68661 mentioned in issue
#68661

Checking in options/src/org/netbeans/modules/options/colors/ColorModel.java;
/cvs/editor/options/src/org/netbeans/modules/options/colors/ColorModel.java,v 
<--  ColorModel.java
new revision: 1.22; previous revision: 1.21
done
Checking in options/src/org/netbeans/modules/options/keymap/EditorBridge.java;
/cvs/editor/options/src/org/netbeans/modules/options/keymap/EditorBridge.java,v
 <--  EditorBridge.java
new revision: 1.8; previous revision: 1.7
done
Checking in options/src/org/netbeans/modules/options/keymap/KeymapModel.java;
/cvs/editor/options/src/org/netbeans/modules/options/keymap/KeymapModel.java,v 
<--  KeymapModel.java
new revision: 1.15; previous revision: 1.14
done
Checking in settings/src/org/netbeans/api/editor/settings/FontColorSettings.java;
/cvs/editor/settings/src/org/netbeans/api/editor/settings/FontColorSettings.java,v
 <--  FontColorSettings.java
new revision: 1.4; previous revision: 1.3
done
Checking in settings/src/org/netbeans/api/editor/settings/KeyBindingSettings.java;
/cvs/editor/settings/src/org/netbeans/api/editor/settings/KeyBindingSettings.java,v
 <--  KeyBindingSettings.java
new revision: 1.4; previous revision: 1.3
done
Checking in settings/storage/nbproject/project.properties;
/cvs/editor/settings/storage/nbproject/project.properties,v  <--  project.properties
new revision: 1.7; previous revision: 1.6
done
Checking in
settings/storage/src/org/netbeans/modules/editor/settings/storage/EditorSettingsImpl.java;
/cvs/editor/settings/storage/src/org/netbeans/modules/editor/settings/storage/EditorSettingsImpl.java,v
 <--  EditorSettingsImpl.java
new revision: 1.25; previous revision: 1.24
done
Checking in
settings/storage/src/org/netbeans/modules/editor/settings/storage/FontColorSettingsImpl.java;
/cvs/editor/settings/storage/src/org/netbeans/modules/editor/settings/storage/FontColorSettingsImpl.java,v
 <--  FontColorSettingsImpl.java
new revision: 1.25; previous revision: 1.24
done
Checking in
settings/storage/src/org/netbeans/modules/editor/settings/storage/KeyBindingSettingsImpl.java;
/cvs/editor/settings/storage/src/org/netbeans/modules/editor/settings/storage/KeyBindingSettingsImpl.java,v
 <--  KeyBindingSettingsImpl.java
new revision: 1.21; previous revision: 1.20
done
Checking in
settings/storage/src/org/netbeans/modules/editor/settings/storage/MimeLookupInitializerImpl.java;
/cvs/editor/settings/storage/src/org/netbeans/modules/editor/settings/storage/MimeLookupInitializerImpl.java,v
 <--  MimeLookupInitializerImpl.java
new revision: 1.7; previous revision: 1.6
done
Checking in
settings/storage/src/org/netbeans/modules/editor/settings/storage/api/EditorSettings.java;
/cvs/editor/settings/storage/src/org/netbeans/modules/editor/settings/storage/api/EditorSettings.java,v
 <--  EditorSettings.java
new revision: 1.6; previous revision: 1.5
done
Removing
settings/storage/src/org/netbeans/modules/editor/settings/storage/api/FontColorSettings.java;
/cvs/editor/settings/storage/src/org/netbeans/modules/editor/settings/storage/api/FontColorSettings.java,v
 <--  FontColorSettings.java
new revision: delete; previous revision: 1.5
done
Checking in
settings/storage/src/org/netbeans/modules/editor/settings/storage/api/FontColorSettingsFactory.java;
/cvs/editor/settings/storage/src/org/netbeans/modules/editor/settings/storage/api/FontColorSettingsFactory.java,v
 <--  FontColorSettingsFactory.java
new revision: 1.2; previous revision: 1.1
done
Removing
settings/storage/src/org/netbeans/modules/editor/settings/storage/api/KeyBindingSettings.java;
/cvs/editor/settings/storage/src/org/netbeans/modules/editor/settings/storage/api/KeyBindingSettings.java,v
 <--  KeyBindingSettings.java
new revision: delete; previous revision: 1.4
done
Checking in
settings/storage/src/org/netbeans/modules/editor/settings/storage/api/KeyBindingSettingsFactory.java;
/cvs/editor/settings/storage/src/org/netbeans/modules/editor/settings/storage/api/KeyBindingSettingsFactory.java,v
 <--  KeyBindingSettingsFactory.java
new revision: 1.2; previous revision: 1.1
done
Checking in
settings/storage/test/unit/src/org/netbeans/modules/editor/settings/storage/EditorSettingsStorageImmutabilityTest.java;
/cvs/editor/settings/storage/test/unit/src/org/netbeans/modules/editor/settings/storage/EditorSettingsStorageImmutabilityTest.java,v
 <--  EditorSettingsStorageImmutabilityTest.java
new revision: 1.3; previous revision: 1.2
done
Checking in
settings/storage/test/unit/src/org/netbeans/modules/editor/settings/storage/EditorSettingsStorageTest.java;
/cvs/editor/settings/storage/test/unit/src/org/netbeans/modules/editor/settings/storage/EditorSettingsStorageTest.java,v
 <--  EditorSettingsStorageTest.java
new revision: 1.5; previous revision: 1.4
done
RCS file:
/cvs/editor/settings/storage/test/unit/src/org/netbeans/modules/editor/settings/storage/EditorSettingsStorageTestBase.java,v
done
Checking in
settings/storage/test/unit/src/org/netbeans/modules/editor/settings/storage/EditorSettingsStorageTestBase.java;
/cvs/editor/settings/storage/test/unit/src/org/netbeans/modules/editor/settings/storage/EditorSettingsStorageTestBase.java,v
 <--  EditorSettingsStorageTestBase.java
initial revision: 1.1
done
Checking in src/org/netbeans/modules/editor/NbEditorUI.java;
/cvs/editor/src/org/netbeans/modules/editor/NbEditorUI.java,v  <--  NbEditorUI.java
new revision: 1.55; previous revision: 1.54
done
Checking in src/org/netbeans/modules/editor/options/BaseOptions.java;
/cvs/editor/src/org/netbeans/modules/editor/options/BaseOptions.java,v  <-- 
BaseOptions.java
new revision: 1.118; previous revision: 1.117
done
Comment 6 Jaroslav Tulach 2005-12-05 09:28:55 UTC
I am glad my work on branch was useful. I reviewed to patch and the "ideas are 
good", now the settings shall really be immutable. However, I hope there will 
not be too many small problems (which I had on my branch).