Skip to content

Commit

Permalink
fix(bpmn-model): do not return raw type on connectTo
Browse files Browse the repository at this point in the history
  • Loading branch information
ThorbenLindhauer committed Sep 10, 2018
1 parent b0257c0 commit 9b45432
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
Expand Up @@ -365,8 +365,7 @@ public AbstractExclusiveGatewayBuilder<?> moveToLastExclusiveGateway() {
}
}

@SuppressWarnings("rawtypes")
public AbstractFlowNodeBuilder connectTo(String identifier) {
public AbstractFlowNodeBuilder<?, ?> connectTo(String identifier) {
final ModelElementInstance target = modelInstance.getModelElementById(identifier);
if (target == null) {
throw new BpmnModelException(
Expand Down
Expand Up @@ -1919,6 +1919,17 @@ public void testMoveToDoesNotReturnRawBuilders() {
.serviceTask("task", b -> b.name("name"));
}

/** or else generic types in parameters are not available and things won't compile */
@Test
public void testConnectToDoesNotReturnRawBuilder() {
Bpmn.createProcess()
.startEvent()
.serviceTask("goto")
.connectTo("goto")
.serviceTask("task", b -> b.name("name"))
.done();
}

protected Message assertMessageEventDefinition(String elementId, String messageName) {
final MessageEventDefinition messageEventDefinition =
assertAndGetSingleEventDefinition(elementId, MessageEventDefinition.class);
Expand Down

0 comments on commit 9b45432

Please sign in to comment.