Class MethodResult
In case of side effects the new value should have a reference identifier corresponding to the original argument. If the analysis supports it, this information can be used to replace all the values with the same reference value with the updated one.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescription@Nullable ValueThe return value of the method invocation ifisReturnValuePresent, throws otherwise.@Nullable ReferenceValueThe updated instance value after a method invocation ifisInstanceUpdated(), throws otherwise.The updated parameter value after a method invocation ifisAnyParameterUpdated(), throws otherwise.static MethodResultReturns a result communicating to the receiver that the creator is not able to provide any additional information about the method execution.booleanWhether any parameter was updated during method execution.booleanWhether the calling instance was updated during method execution.booleanReturns whether the result is invalid (i.e., whether it was created viainvalidResult()).booleanWhether the result provides a return value.
-
Method Details
-
invalidResult
Returns a result communicating to the receiver that the creator is not able to provide any additional information about the method execution.This should be the only way to communicate this type of information, while any other result with all empty parameters means a method returning void and with no side effects.
- Returns:
- an invalid result.
-
isResultValid
public boolean isResultValid()Returns whether the result is invalid (i.e., whether it was created viainvalidResult()).- Returns:
- whether the result is invalid.
-
isReturnValuePresent
public boolean isReturnValuePresent()Whether the result provides a return value. We need to specify this since null is a valid return value.- Returns:
- whether the result provides a return value.
-
isInstanceUpdated
public boolean isInstanceUpdated()Whether the calling instance was updated during method execution.- Returns:
- whether the calling instance was updated during method execution.
-
isAnyParameterUpdated
public boolean isAnyParameterUpdated()Whether any parameter was updated during method execution.- Returns:
- whether any parameter was updated during method execution.
-
getReturnValue
The return value of the method invocation ifisReturnValuePresent, throws otherwise.- Returns:
- the return value of the method invocation.
-
getUpdatedInstance
The updated instance value after a method invocation ifisInstanceUpdated(), throws otherwise.The identifier of the returned value can be matched to identify the old values using the same reference.
- Returns:
- the updated instance value after a method invocation.
-
getUpdatedParameters
The updated parameter value after a method invocation ifisAnyParameterUpdated(), throws otherwise.Each element of the list (corresponding to the parameter position, instance not included and the first parameter is always element 0) contains either null, if the specific parameter was not updated, or the updated parameter value.
The identifier of the returned values can be matched to identify the old values using the same reference.
- Returns:
- the updated parameters value after a method invocation.
-