Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 273353 - Shouldn't access BPEL Editor from EditParts
Summary: Shouldn't access BPEL Editor from EditParts
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: BPEL (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: BPEL UI Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-04-22 18:16 EDT by Oleg Vazhnev CLA
Modified: 2022-10-03 11:11 EDT (History)
1 user (show)

See Also:


Attachments
patch for this bug (19.19 KB, patch)
2009-04-23 14:56 EDT, Oleg Vazhnev CLA
bbrodt: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Oleg Vazhnev CLA 2009-04-22 18:16:26 EDT
In many places such code can be found:

ModelHelper.getBPELEditor(getModel()).isHorizontalLayout()

For example, this line can be found in
- IfEditPart
- InvokeEditPart
- acctually any EditPart :)
- LeafBorder

This can result in NPE because bpelEditor can be null.
We can create EditParts inside other than BPELEditor window (for example inside 'Compare' window)

EditParts should not assume that they are created inside BPELEditor, they should not assume that BPELEditor exist.

Without fixing that it is not possible to implement some features, like 'Visual Compare of BPEL files'.

The fix could be very simple:

public boolean isHorizontalLayout(EObject model) {
    BPELEditor bpelEditor = ModelHelper.getBPELEditor(getModel());
    if (bpelEditor != null) {
        return bpelEditor.isHorizontalLayout();
    } else {
        return false;
    }
}
Comment 1 Simon Moser CLA 2009-04-23 05:30:32 EDT
Oleg, assuming you fixed this - can you provide patch based on the latest version of the HEAD code stream ?
Comment 2 Oleg Vazhnev CLA 2009-04-23 14:56:18 EDT
Created attachment 132998 [details]
patch for this bug
Comment 3 Simon Moser CLA 2009-04-27 04:45:34 EDT
I reviewed and released the patch attached 
Comment 4 Robert Brodt CLA 2012-04-18 14:47:39 EDT
Comment on attachment 132998 [details]
patch for this bug

Updated iplog flag for v1.0 release review.