Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 49531 Details for
Bug 156425
Performance problems in Element.validateNotOwnSelf
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Patch that fixes the problem for me
notOwnSelf.patch (text/plain), 1.66 KB, created by
Christian Damus
on 2006-09-06 15:47:04 EDT
(
hide
)
Description:
Patch that fixes the problem for me
Filename:
MIME Type:
Creator:
Christian Damus
Created:
2006-09-06 15:47:04 EDT
Size:
1.66 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.uml2.uml >Index: src/org/eclipse/uml2/uml/internal/operations/ElementOperations.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.uml2/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/operations/ElementOperations.java,v >retrieving revision 1.44 >diff -u -r1.44 ElementOperations.java >--- src/org/eclipse/uml2/uml/internal/operations/ElementOperations.java 21 Jun 2006 13:33:12 -0000 1.44 >+++ src/org/eclipse/uml2/uml/internal/operations/ElementOperations.java 6 Sep 2006 19:49:03 -0000 >@@ -15,10 +15,12 @@ > import java.util.ArrayList; > import java.util.Collections; > import java.util.HashMap; >+import java.util.HashSet; > import java.util.Iterator; > import java.util.List; > import java.util.ListIterator; > import java.util.Map; >+import java.util.Set; > > import org.eclipse.emf.common.util.BasicDiagnostic; > import org.eclipse.emf.common.util.Diagnostic; >@@ -129,7 +131,10 @@ > DiagnosticChain diagnostics, Map context) { > boolean result = true; > >- if (element.allOwnedElements().contains(element)) { >+ // get all elements owning the 'element' >+ Set owners = collectOwners(element); >+ >+ if (owners.contains(element)) { > result = false; > > if (diagnostics != null) { >@@ -144,6 +149,17 @@ > > return result; > } >+ >+ protected static Set collectOwners(Element element) { >+ Set result = new HashSet(); >+ Element owner = element.getOwner(); >+ >+ while ((owner != null) && result.add(owner)) { >+ owner = owner.getOwner(); >+ } >+ >+ return result; >+ } > > /** > * <!-- begin-user-doc -->
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 156425
: 49531