Skip to content

Commit 8de8c9f

Browse files
committed
Addendum to the GraphProcessor fix, which properly accounts for vararg
parameters.
1 parent e994e06 commit 8de8c9f

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

src/main/java/unquietcode/tools/flapi/MethodParser.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -519,4 +519,9 @@ public boolean compilerEquivalent(MethodParser other) {
519519
// otherwise, equal (probably)
520520
return true;
521521
}
522+
523+
// return the number of parameters, accounting for varargs
524+
public int parameterCount() {
525+
return params.size() + (varargType != null ? 1 : 0);
526+
}
522527
}

src/main/java/unquietcode/tools/flapi/graph/processors/GraphProcessor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public void visit(LateralTransition transition) {
8888

8989
// if no specific parameters, start after the last regular parameter
9090
if (transition.getChainParameterPositions().isEmpty()) {
91-
final int offset = new MethodParser(transition.getMethodSignature()).params.size();
91+
final int offset = new MethodParser(transition.getMethodSignature()).parameterCount();
9292

9393
positionFunction = new Function<Integer, Integer>() {
9494
public Integer apply(Integer idx) {

0 commit comments

Comments
 (0)