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 193076 Details for
Bug 342603
Use of SetCommand with List lead to a wrong result
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Patches to address the issue.
342603.patch (text/plain), 2.58 KB, created by
Ed Merks
on 2011-04-12 13:11:55 EDT
(
hide
)
Description:
Patches to address the issue.
Filename:
MIME Type:
Creator:
Ed Merks
Created:
2011-04-12 13:11:55 EDT
Size:
2.58 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.emf.edit >Index: src/org/eclipse/emf/edit/command/SetCommand.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf/plugins/org.eclipse.emf.edit/src/org/eclipse/emf/edit/command/SetCommand.java,v >retrieving revision 1.17 >diff -u -r1.17 SetCommand.java >--- src/org/eclipse/emf/edit/command/SetCommand.java 13 Dec 2008 15:56:01 -0000 1.17 >+++ src/org/eclipse/emf/edit/command/SetCommand.java 12 Apr 2011 17:02:19 -0000 >@@ -140,7 +140,7 @@ > > // Determine the values that will remain and move them into the right order, if necessary. > // >- List<Object> remainingValues = new BasicEList.FastCompare<Object>(oldValues); >+ EList<Object> remainingValues = new BasicEList.FastCompare<Object>(oldValues); > remainingValues.removeAll(removedValues); > int count = -1; > for (Object object : values) >@@ -149,6 +149,7 @@ > if (position != -1 && position != ++count) > { > compound.append(MoveCommand.create(domain, owner, feature, object, count)); >+ remainingValues.move(count, position); > } > } > >@@ -156,17 +157,20 @@ > // > List<Object> addedValues = new BasicEList.FastCompare<Object>(values); > addedValues.removeAll(remainingValues); >- int addIndex = remainingValues.size(); >- for (ListIterator<?> i = values.listIterator(values.size()); i.hasPrevious(); ) >+ if (!addedValues.isEmpty()) > { >- Object object = i.previous(); >- if (addedValues.contains(object)) >+ int addIndex = remainingValues.size(); >+ for (ListIterator<?> i = values.listIterator(values.size()); i.hasPrevious(); ) > { >- compound.append(AddCommand.create(domain, owner, feature, object, addIndex)); >- } >- else >- { >- --addIndex; >+ Object object = i.previous(); >+ if (addedValues.contains(object)) >+ { >+ compound.append(AddCommand.create(domain, owner, feature, object, addIndex)); >+ } >+ else >+ { >+ --addIndex; >+ } > } > } > return compound;
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 342603
:
193062
| 193076