Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 325009 - NPE when changing int or boolean preference for the first time
Summary: NPE when changing int or boolean preference for the first time
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: IMP (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Robert M. Fuhrer CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-10 15:46 EDT by Adam Taylor CLA
Modified: 2014-01-09 15:04 EST (History)
0 users

See Also:


Attachments
proposed implementation (1.95 KB, patch)
2010-09-10 15:48 EDT, Adam Taylor CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Adam Taylor CLA 2010-09-10 15:46:16 EDT
Build Identifier: 

NPE when changing int or boolean preference for the first time

Reproducible: Always

Steps to Reproduce:
1. Open an an Imp language resource (so that a UniversalEditor is opened).
2. Goto the associated language preferences
3. modify any integer or boolean preference and click ok

==> NPE in error log
Comment 1 Adam Taylor CLA 2010-09-10 15:48:14 EDT
Created attachment 178658 [details]
proposed implementation

this patch also disables the apply and ok buttons on the preferences page when a non-int string is entered into an integer field
Comment 2 Robert M. Fuhrer CLA 2010-11-19 17:33:00 EST
Theoretically this should never happen, since the preference initializer should ensure that there is a legal value for each preference key. However, it might happen if the preferences DB didn't get initialized properly, so I added null guards as requested.

I'm not sure why the call to notifyState() was added to StringFieldEditor.refreshValidState(), so I omitted that. If you can explain why it's needed, I'll reconsider.

Changes checked into SVN trunk.