diff options
Diffstat (limited to 'subprojects/language-semantics/src')
-rw-r--r-- | subprojects/language-semantics/src/main/java/tools/refinery/language/semantics/metadata/MetadataCreator.java | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/subprojects/language-semantics/src/main/java/tools/refinery/language/semantics/metadata/MetadataCreator.java b/subprojects/language-semantics/src/main/java/tools/refinery/language/semantics/metadata/MetadataCreator.java index 0c18b1b3..d6115c5c 100644 --- a/subprojects/language-semantics/src/main/java/tools/refinery/language/semantics/metadata/MetadataCreator.java +++ b/subprojects/language-semantics/src/main/java/tools/refinery/language/semantics/metadata/MetadataCreator.java | |||
@@ -47,12 +47,22 @@ public class MetadataCreator { | |||
47 | } | 47 | } |
48 | 48 | ||
49 | public List<NodeMetadata> getNodesMetadata() { | 49 | public List<NodeMetadata> getNodesMetadata() { |
50 | var nodes = new NodeMetadata[initializer.getNodeCount()]; | 50 | return getNodesMetadata(initializer.getNodeCount()); |
51 | } | ||
52 | |||
53 | public List<NodeMetadata> getNodesMetadata(int nodeCount) { | ||
54 | var nodes = new NodeMetadata[Math.max(initializer.getNodeCount(), nodeCount)]; | ||
51 | for (var entry : initializer.getNodeTrace().keyValuesView()) { | 55 | for (var entry : initializer.getNodeTrace().keyValuesView()) { |
52 | var node = entry.getOne(); | 56 | var node = entry.getOne(); |
53 | var id = entry.getTwo(); | 57 | var id = entry.getTwo(); |
54 | nodes[id] = getNodeMetadata(node); | 58 | nodes[id] = getNodeMetadata(node); |
55 | } | 59 | } |
60 | for (int i = 0; i < nodes.length; i++) { | ||
61 | if (nodes[i] == null) { | ||
62 | var nodeName = "#" + i; | ||
63 | nodes[i] = new NodeMetadata(nodeName, nodeName, NodeKind.IMPLICIT); | ||
64 | } | ||
65 | } | ||
56 | return List.of(nodes); | 66 | return List.of(nodes); |
57 | } | 67 | } |
58 | 68 | ||