Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
af3
AF3
Commits
8ce5a7e5
Commit
8ce5a7e5
authored
Nov 28, 2019
by
Tiziano Munaro
Browse files
Merge remote-tracking branch 'origin/master' into 3876
parents
4a23fb57
41454d26
Changes
4
Hide whitespace changes
Inline
Side-by-side
org.fortiss.af3.exploration/src/org/fortiss/af3/exploration/solutionconverter/platform/.ratings
View file @
8ce5a7e5
PlatformConnectorInstanceConverter.java 073e050ad673f41e9d012de01c1aee6fdd04e4ce GREEN
PlatformConnectorInstanceConverter.java 073e050ad673f41e9d012de01c1aee6fdd04e4ce GREEN
PlatformExecUnitInstantiationConverter.java a0
426a3ad7d2efac9b0f73ddb76ee2060d4101e5
GREEN
PlatformExecUnitInstantiationConverter.java
6
a0
03e2fbc3fc115ad39578c87ddd64f23da9593
GREEN
PlatformTransmissionConnectionConverter.java 365a2fb563e4ed36a1b159dfa3bcce47216a935c GREEN
PlatformTransmissionConnectionConverter.java 365a2fb563e4ed36a1b159dfa3bcce47216a935c GREEN
org.fortiss.af3.exploration/src/org/fortiss/af3/exploration/solutionconverter/platform/PlatformExecUnitInstantiationConverter.java
View file @
8ce5a7e5
...
@@ -16,7 +16,7 @@
...
@@ -16,7 +16,7 @@
package
org.fortiss.af3.exploration.solutionconverter.platform
;
package
org.fortiss.af3.exploration.solutionconverter.platform
;
import
static
java
.
util
.
Arrays
.
asList
;
import
static
java
.
util
.
Arrays
.
asList
;
import
static
org
.
fortiss
.
tooling
.
kernel
.
utils
.
EcoreUtils
.
pickFirstInstanceOf
;
import
static
org
.
fortiss
.
af3
.
exploration
.
util
.
DSESolutionConversionUtils
.
getAndRemoveSpec
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Collection
;
import
java.util.Collection
;
...
@@ -72,8 +72,7 @@ public class PlatformExecUnitInstantiationConverter
...
@@ -72,8 +72,7 @@ public class PlatformExecUnitInstantiationConverter
for
(
ExecutionUnit
instExecUnit
:
fromSuperSet
.
getEntries
())
{
for
(
ExecutionUnit
instExecUnit
:
fromSuperSet
.
getEntries
())
{
// Fetch the template element such that it can be removed after the instances were
// Fetch the template element such that it can be removed after the instances were
// added.
// added.
InstanceOfElement
instSpec
=
InstanceOfElement
instSpec
=
getAndRemoveSpec
(
instExecUnit
,
InstanceOfElement
.
class
);
pickFirstInstanceOf
(
InstanceOfElement
.
class
,
instExecUnit
.
getSpecifications
());
ExecutionUnit
templateExecUnit
=
(
ExecutionUnit
)
instSpec
.
getTemplateElement
();
ExecutionUnit
templateExecUnit
=
(
ExecutionUnit
)
instSpec
.
getTemplateElement
();
templateExecUnits
.
add
(
templateExecUnit
);
templateExecUnits
.
add
(
templateExecUnit
);
...
...
org.fortiss.af3.exploration/src/org/fortiss/af3/exploration/util/.ratings
View file @
8ce5a7e5
DSEProjectModelElementFactory.java a56e2cd564383726898336469ebc3203186e992f GREEN
DSEProjectModelElementFactory.java a56e2cd564383726898336469ebc3203186e992f GREEN
DSESolutionConversionUtils.java
d97459e189370cbfc202201832ed060e25564607
GREEN
DSESolutionConversionUtils.java
a6ccbba92864c653d1518a92455e87c17f7cc72b
GREEN
DSMLModelElementFactory.java 24b8cf9c900e948dcc71eb2a7fa26232baa6f7a5 GREEN
DSMLModelElementFactory.java 24b8cf9c900e948dcc71eb2a7fa26232baa6f7a5 GREEN
DSMLUtils.java c07eeef09787cea9db98533d346e3e384a232593 GREEN
DSMLUtils.java c07eeef09787cea9db98533d346e3e384a232593 GREEN
ExplorationModelElementFactory.java bb48b2d09b92efcb1b2d3e382555089bb7ed5db5 GREEN
ExplorationModelElementFactory.java bb48b2d09b92efcb1b2d3e382555089bb7ed5db5 GREEN
...
...
org.fortiss.af3.exploration/src/org/fortiss/af3/exploration/util/DSESolutionConversionUtils.java
View file @
8ce5a7e5
...
@@ -19,6 +19,7 @@ import static org.fortiss.tooling.kernel.utils.EcoreUtils.pickFirstInstanceOf;
...
@@ -19,6 +19,7 @@ import static org.fortiss.tooling.kernel.utils.EcoreUtils.pickFirstInstanceOf;
import
static
org
.
fortiss
.
tooling
.
kernel
.
utils
.
LoggingUtils
.
showError
;
import
static
org
.
fortiss
.
tooling
.
kernel
.
utils
.
LoggingUtils
.
showError
;
import
org.fortiss.af3.exploration.model.specification.ContainedByElement
;
import
org.fortiss.af3.exploration.model.specification.ContainedByElement
;
import
org.fortiss.af3.exploration.model.specification.IVolatileModelElementSpecification
;
import
org.fortiss.af3.exploration.solutionconverter.IDSESolutionConverter
;
import
org.fortiss.af3.exploration.solutionconverter.IDSESolutionConverter
;
import
org.fortiss.tooling.base.model.element.IHierarchicElement
;
import
org.fortiss.tooling.base.model.element.IHierarchicElement
;
import
org.fortiss.tooling.base.model.element.IModelElement
;
import
org.fortiss.tooling.base.model.element.IModelElement
;
...
@@ -36,18 +37,31 @@ public class DSESolutionConversionUtils {
...
@@ -36,18 +37,31 @@ public class DSESolutionConversionUtils {
// Prevent instantiation.
// Prevent instantiation.
}
}
/**
* Returns the given {@link IModelElementSpecification} if it is attached to the given
* {@link IModelElement} and deletes it. If no such {@link IModelElementSpecification} exists,
* {@code null} is returned.
*/
public
static
<
T
extends
IVolatileModelElementSpecification
>
T
getAndRemoveSpec
(
IModelElement
element
,
Class
<?
extends
T
>
specType
)
{
T
spec
=
pickFirstInstanceOf
(
specType
,
element
.
getSpecifications
());
if
(
spec
==
null
)
{
return
null
;
}
element
.
getSpecifications
().
remove
(
spec
);
return
spec
;
}
/**
/**
* Returns the container element referenced by the {@link ContainedByElement}
* Returns the container element referenced by the {@link ContainedByElement}
* {@link IModelElementSpecification} and removes the {@link IModelElementSpecification} form
* {@link IModelElementSpecification} and removes the {@link IModelElementSpecification} form
* the element. Returns {@code null} if no such {@link IModelElementSpecification} is found.
* the element. Returns {@code null} if no such {@link IModelElementSpecification} is found.
*/
*/
public
static
IHierarchicElement
getContainedByAndRemoveSpec
(
IModelElement
element
)
{
public
static
IHierarchicElement
getContainedByAndRemoveSpec
(
IModelElement
element
)
{
ContainedByElement
containmentSpec
=
ContainedByElement
containmentSpec
=
getAndRemoveSpec
(
element
,
ContainedByElement
.
class
);
pickFirstInstanceOf
(
ContainedByElement
.
class
,
element
.
getSpecifications
());
if
(
containmentSpec
==
null
)
{
if
(
containmentSpec
==
null
)
{
return
null
;
return
null
;
}
}
element
.
getSpecifications
().
remove
(
containmentSpec
);
return
containmentSpec
.
getFutureContainerRef
();
return
containmentSpec
.
getFutureContainerRef
();
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment