diff --git a/src/main/java/abstractSyntaxTree/StatementExpression/MethodCallStatementExpression.java b/src/main/java/abstractSyntaxTree/StatementExpression/MethodCallStatementExpression.java index ce7a028..1107172 100644 --- a/src/main/java/abstractSyntaxTree/StatementExpression/MethodCallStatementExpression.java +++ b/src/main/java/abstractSyntaxTree/StatementExpression/MethodCallStatementExpression.java @@ -127,11 +127,10 @@ public class MethodCallStatementExpression extends AbstractType implements IExpr // Invoke the method for each receiving method in the chain for (ReceivingMethod receivingMethod : receivingMethods) { // Get the owner class for the current method in the chain - if (returnOfPreviousMethod == null) - owner = thisClass; - else + if (returnOfPreviousMethod != null) { // If the return of the previous method is not null, use it as the owner class for the current method in the chain owner = returnOfPreviousMethod; + } // Generate the code for each argument expression for the current method for (IExpression argument : receivingMethod.arguments) {