Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 199829 - inconsistency in o.e.bpel.ui.editparts.ActivityEditPart.addAllAdapters
Summary: inconsistency in o.e.bpel.ui.editparts.ActivityEditPart.addAllAdapters
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: 2007-08-14 01:50 EDT by Vitaly Tishkov CLA
Modified: 2022-10-03 11:12 EDT (History)
1 user (show)

See Also:


Attachments
a patch that fixes the bug (1.69 KB, patch)
2007-08-14 01:55 EDT, Vitaly Tishkov CLA
bbrodt: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Vitaly Tishkov CLA 2007-08-14 01:50:04 EDT
During my work on synchronizing src and design tabs for Flow I’ve found a little inconsistency in o.e.bpel.ui.editparts.ActivityEditPart.addAllAdapters():

 

      protected void addAllAdapters() {

            super.addAllAdapters();

            Sources sources = getActivity().getSources();

            if (sources != null) {

                  adapter.addToObject(sources);

                  for (Iterator it = sources.getChildren().iterator(); it.hasNext(); ) {

                        Source source = (Source)it.next();

                        // also include the link, if there is one (since we indirectly

                        // control the activation of the LinkEditPart)

                        if (source.getLink() != null) adapter.addToObject(source.getLink());

 

                        // Okay--the real problem here, is that the Activity might be

                        // referred to by a Source object, but the Activity is not going

                        // to find out about the creation of a new Sources that references

                        // it.  Therefore, our model listeners don't know what to do!

                        

                        // TODO: temporarily hacked around in FlowEditPart.FlowContentAdapter.

                        

                        // TODO: also include any parent flows, and the Links object of

                        // any parent flows that have one.  !

                        // TODO: in future, use a global listener to handle refreshing the

                        // correct source editpart.

                  }

            }

            Targets targets = getActivity().getTargets();

            if (targets != null) {

                  adapter.addToObject(targets);

                  for (Iterator it = targets.getChildren().iterator(); it.hasNext(); ) {

                        adapter.addToObject((Target)it.next());

                  }

            }

      }

 

 

Please note that if you remove all the comments then the method will look this way:

 

      protected void addAllAdapters() {

            super.addAllAdapters();

            Sources sources = getActivity().getSources();

            if (sources != null) {

                  adapter.addToObject(sources);

                  for (Iterator it = sources.getChildren().iterator(); it.hasNext(); ) {

                        Source source = (Source)it.next();

                        if (source.getLink() != null) adapter.addToObject(source.getLink());

 

                  }

            }

            Targets targets = getActivity().getTargets();

            if (targets != null) {

                  adapter.addToObject(targets);

                  for (Iterator it = targets.getChildren().iterator(); it.hasNext(); ) {

                        adapter.addToObject((Target)it.next());

                  }

            }

      }

 

This inconsistent behavior leads to different sets of eAdapters created for SourceImpl and TargetImpl (try to set breakpoints at the end of SourceImpl.setActivity() and TargetImpl.setActivity() to ensure that.

The different sets of eAdapters is an obstacle for restoring links in the design tab when editing the source tab.
The question: 

is there any reason not to make the ‘sources’ part of the method be similar to the ‘target’ part, i.e. the method will look this way:

 

      protected void addAllAdapters() {

            super.addAllAdapters();

            Sources sources = getActivity().getSources();

            if (sources != null) {

                  adapter.addToObject(sources);

                  for (Iterator it = sources.getChildren().iterator(); it.hasNext(); ) {

                        adapter.addToObject((Source)it.next());

 

                  }

            }

            Targets targets = getActivity().getTargets();

            if (targets != null) {

                  adapter.addToObject(targets);

                  for (Iterator it = targets.getChildren().iterator(); it.hasNext(); ) {

                        adapter.addToObject((Target)it.next());

                  }

            }

      }


Add/remove/Undo/redo/ seems to be working fine if the proposed patch is applied.
Comment 1 Vitaly Tishkov CLA 2007-08-14 01:55:08 EDT
Created attachment 76023 [details]
a patch that fixes the bug
Comment 2 Simon Moser CLA 2007-08-14 11:43:16 EDT
Reviewed the patch and checked in in (HEAD stream only)
Comment 3 Robert Brodt CLA 2012-04-18 14:34:34 EDT
Comment on attachment 76023 [details]
a patch that fixes the bug

Updated iplog flag for v1.0 release review.