Bug 198519 - [DataBinding] JavaBeanObservableValue may cause NPE when used with ComputedValue
Summary: [DataBinding] JavaBeanObservableValue may cause NPE when used with ComputedValue
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.4 M2   Edit
Assignee: Boris Bokowski CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2007-08-01 07:33 EDT by Katarzyna Marsza³ek CLA
Modified: 2007-09-06 14:10 EDT (History)
1 user (show)

See Also:


Attachments
patch (4.31 KB, patch)
2007-08-13 17:04 EDT, Boris Bokowski CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Katarzyna Marsza³ek CLA 2007-08-01 07:33:32 EDT
Build ID:  I20070625-1500

Steps To Reproduce:
 Simple case:

        new ComputedValue() {

            final IObservableValue name = BeansObservables.observeValue(dto, "name"); //$NON-NLS-1$

            @Override
            protected Object calculate() {
                return name.getValue() != null;
            }
        };


More information:
When ComputedValue recalculates the value, it calls the makeDirty() and then stopListening() methods which, in turn, may result in call to lastListenerRemoved() (if there are no other listeners attached) in the JavaBeanObservableValue class, causing listenerSupport.dispose() call. From now on, adding new listeners (which happens next during the calculate call) will cause NullPointerException.
Comment 1 Boris Bokowski CLA 2007-08-03 08:38:31 EDT
Should be easy to fix. 3.3.1 candidate?
Comment 2 Boris Bokowski CLA 2007-08-13 17:04:53 EDT
Created attachment 75999 [details]
patch
Comment 3 Boris Bokowski CLA 2007-08-13 17:05:42 EDT
Adding contributed keyword (for the test case)
Comment 4 Boris Bokowski CLA 2007-08-13 17:06:47 EDT
Patch released >20070813.
Comment 5 Brad Reynolds CLA 2007-08-13 20:03:55 EDT
(In reply to comment #1)
> Should be easy to fix. 3.3.1 candidate?
> 

+1

Sorry man, I'm really behind.
Comment 6 Boris Bokowski CLA 2007-09-06 14:10:44 EDT
Verified in M20070905-1045.