Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
monticore
EmbeddedMontiArc
generators
EMAM2Middleware
Commits
e0a6c31d
Commit
e0a6c31d
authored
Mar 07, 2018
by
Alexander David Hellwig
Browse files
Fixed: no clusters are returned on error
parent
83998fda
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/de/monticore/lang/monticar/generator/middleware/helpers/ClusterHelper.java
View file @
e0a6c31d
...
...
@@ -32,17 +32,22 @@ public class ClusterHelper {
ExpandedComponentInstanceSymbol
compTarget
=
c
.
getTargetPort
().
getComponentInstance
().
orElse
(
null
);
if
(
compSource
==
null
||
compTarget
==
null
)
Log
.
error
(
"ComponentInstance of source or target not found!"
);
graph
.
addEdge
(
compSource
,
compTarget
);
if
(!
compSource
.
equals
(
compTarget
))
graph
.
addEdge
(
compSource
,
compTarget
);
});
ConnectivityInspector
<
ExpandedComponentInstanceSymbol
,
DefaultEdge
>
connectivityInspector
=
new
ConnectivityInspector
<>(
graph
);
if
(
connectivityInspector
.
connectedSetOf
(
componentInstanceSymbol
).
size
()
!=
1
)
Log
.
error
(
"0x8EFC3: The supercomponent can only be connected to subcomponents via middleware ports!"
);
graph
.
removeVertex
(
componentInstanceSymbol
);
return
connectivityInspector
.
connectedSets
();
int
instanceSetSize
=
connectivityInspector
.
connectedSetOf
(
componentInstanceSymbol
).
size
();
if
(
instanceSetSize
!=
1
)
{
Log
.
warn
(
"0x8EFC3: The supercomponent can only be connected to subcomponents via middleware ports!"
);
return
new
ArrayList
<>();
}
//All subcomps are connected via non mw -> only highest level needs to be generated
if
(
instanceSetSize
!=
componentInstanceSymbol
.
getSubComponents
().
size
()
+
1
)
graph
.
removeVertex
(
componentInstanceSymbol
);
List
<
Set
<
ExpandedComponentInstanceSymbol
>>
res
=
connectivityInspector
.
connectedSets
();
return
res
;
}
public
static
List
<
ExpandedComponentInstanceSymbol
>
getClusterSubcomponents
(
ExpandedComponentInstanceSymbol
componentInstanceSymbol
)
{
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment