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
15a5fae3
Commit
15a5fae3
authored
12 years ago
by
Dongyue Mou
Browse files
Options
Downloads
Patches
Plain Diff
fixed bug by implemented the prepareID method for dummy root object.
refs 1098
parent
2ae69390
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/internal/DummyTopLevelElement.java
+14
-1
14 additions, 1 deletion
...fortiss/tooling/kernel/internal/DummyTopLevelElement.java
with
14 additions
and
1 deletion
org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/DummyTopLevelElement.java
+
14
−
1
View file @
15a5fae3
...
...
@@ -20,8 +20,10 @@ package org.fortiss.tooling.kernel.internal;
import
org.eclipse.core.runtime.Assert
;
import
org.eclipse.core.runtime.IProgressMonitor
;
import
org.eclipse.emf.common.command.CommandStackListener
;
import
org.eclipse.emf.common.util.TreeIterator
;
import
org.eclipse.emf.ecore.EObject
;
import
org.fortiss.tooling.kernel.extension.data.ITopLevelElement
;
import
org.fortiss.tooling.kernel.model.IIdLabeled
;
import
org.fortiss.tooling.kernel.service.IPersistencyService
;
/**
...
...
@@ -120,7 +122,18 @@ final class DummyTopLevelElement implements ITopLevelElement {
/** {@inheritDoc} */
@Override
public
void
prepareIDs
(
EObject
modelElement
)
{
// ignore
if
(!(
modelElement
instanceof
IIdLabeled
))
return
;
int
id
=
Integer
.
MIN_VALUE
;
for
(
TreeIterator
<
EObject
>
iter
=
getRootModelElement
().
eAllContents
();
iter
.
hasNext
();)
{
EObject
o
=
iter
.
next
();
if
(
o
instanceof
IIdLabeled
)
{
id
=
Math
.
max
(
id
,
((
IIdLabeled
)
o
).
getId
());
}
}
((
IIdLabeled
)
modelElement
).
setId
(
id
+
1
);
}
/** {@inheritDoc} */
...
...
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