Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
kernel
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
af3
kernel
Commits
f3cc89e2
Commit
f3cc89e2
authored
8 years ago
by
Vincent Aravantinos
Browse files
Options
Downloads
Patches
Plain Diff
filterID utility method
refs 2712
parent
0c52fced
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/utils/ConstraintsUtils.java
+17
-1
17 additions, 1 deletion
...rc/org/fortiss/tooling/kernel/utils/ConstraintsUtils.java
with
17 additions
and
1 deletion
org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/utils/ConstraintsUtils.java
+
17
−
1
View file @
f3cc89e2
...
...
@@ -21,8 +21,10 @@ import java.util.NoSuchElementException;
import
java.util.function.Consumer
;
import
org.eclipse.emf.common.util.EList
;
import
org.eclipse.emf.common.util.TreeIterator
;
import
org.eclipse.emf.ecore.EObject
;
import
org.fortiss.tooling.kernel.extension.IConstraint
;
import
org.fortiss.tooling.kernel.model.
constraints.ConstrainedWithChecksum
;
import
org.fortiss.tooling.kernel.model.
IIdLabeled
;
import
org.fortiss.tooling.kernel.model.constraints.ConstraintInstance
;
import
org.fortiss.tooling.kernel.model.constraints.ConstraintsFactory
;
import
org.fortiss.tooling.kernel.model.constraints.ErrorConstraintInstanceStatus
;
...
...
@@ -244,4 +246,18 @@ public class ConstraintsUtils {
fix
.
accept
(
status
);
}
}
/** Removes the IDs of the given object and of its sub-elements. */
public
static
void
filterIDs
(
EObject
obj
)
{
if
(
obj
instanceof
IIdLabeled
)
{
((
IIdLabeled
)
obj
).
setId
(
0
);
}
TreeIterator
<
EObject
>
it
=
obj
.
eAllContents
();
while
(
it
.
hasNext
())
{
EObject
elt
=
it
.
next
();
if
(
elt
instanceof
IIdLabeled
)
{
((
IIdLabeled
)
elt
).
setId
(
0
);
}
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment