Skip to content

Commit

Permalink
Fix that InputOutputSpecification can be null
Browse files Browse the repository at this point in the history
Change-Id: I486ee546dafab23937c3e2c31ff521a2517a9596
  • Loading branch information
Stephane Drapeau authored and Stephane Drapeau committed Dec 21, 2023
1 parent 6272f56 commit 7d3ab12
Showing 1 changed file with 17 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -198,23 +198,31 @@ public List<FlowNode> getFlowNodeElements(EObject container, String className) {
public List<DataInput> getDataInputs(EObject container) {
List<DataInput> result = List.of();
if (container instanceof Lane && ((Lane) container).getPartitionElement() instanceof InputOutputSpecification) {
InputOutputSpecification ioSepc = (InputOutputSpecification) ((Lane) container).getPartitionElement();
result = ioSepc.getDataInputs();
InputOutputSpecification ioSpec = (InputOutputSpecification) ((Lane) container).getPartitionElement();
if (ioSpec != null) {
result = ioSpec.getDataInputs();
}
} else if (container instanceof SubProcess) {
InputOutputSpecification ioSepc = ((SubProcess) container).getIoSpecification();
result = ioSepc.getDataInputs();
InputOutputSpecification ioSpec = ((SubProcess) container).getIoSpecification();
if (ioSpec != null) {
result = ioSpec.getDataInputs();
}
}
return result;
}

public List<DataOutput> getDataOutputs(EObject container) {
List<DataOutput> result = List.of();
if (container instanceof Lane && ((Lane) container).getPartitionElement() instanceof InputOutputSpecification) {
InputOutputSpecification ioSepc = (InputOutputSpecification) ((Lane) container).getPartitionElement();
result = ioSepc.getDataOutputs();
InputOutputSpecification ioSpec = (InputOutputSpecification) ((Lane) container).getPartitionElement();
if (ioSpec != null) {
result = ioSpec.getDataOutputs();
}
} else if (container instanceof SubProcess) {
InputOutputSpecification ioSepc = ((SubProcess) container).getIoSpecification();
result = ioSepc.getDataOutputs();
InputOutputSpecification ioSpec = ((SubProcess) container).getIoSpecification();
if (ioSpec != null) {
result = ioSpec.getDataOutputs();
}
}
return result;
}
Expand Down

0 comments on commit 7d3ab12

Please sign in to comment.