leehaut opened a new issue, #9497:
URL: https://github.com/apache/hop/issues/9497
### What needs to happen?
## Background
`org.apache.hop.core.Result.getResult()` has been deprecated since 2.16. The
replacement is `isResult()`. Both methods return the same `boolean result`
field, so switching a call site does not change execution behavior.
```java
@Deprecated(since = "2.16")
public boolean getResult() {
return result;
}
public boolean isResult() {
return result;
}
```
`Result` already uses Lombok `@Getter`. For a `boolean` field the JavaBeans
accessor is `isResult()`. `getResult()` is only the legacy name, kept so
existing external code still compiles.
Calls on a `Result` returned by an action still use the deprecated method
and produce deprecation warnings. Example from
`plugins/misc/mail/src/test/java/org/apache/hop/mail/workflow/actions/mail/WorkflowEntryTest.java`:
```java
Result result = jem.execute(new Result(), 0);
assertFalse(result.getResult());
```
That assertion should become `assertFalse(result.isResult())`.
## Scope
Replace `getResult()` with `isResult()` only when the receiver is
`org.apache.hop.core.Result` (the boolean success flag).
This includes:
- Test assertions such as `assertTrue(result.getResult())` and
`assertFalse(result.getResult())` after `action.execute(...)`.
- Production calls on an `org.apache.hop.core.Result`, for example
`result.getResult()` in
`plugins/engines/replay/src/main/java/org/apache/hop/replay/workflow/WorkflowReplayGateAfterActionXp.java`,
where `result` is `extension.actionExecutionResult`.
Keep `Result.getResult()` in place. The deprecation note says it stays for
backward compatibility with external plugins and user code. Removing it is a
later, incompatible API change and is a separate task.
## Out of scope
Leave every `getResult()` that returns a `Result` object unchanged. A
textual replace of `getResult` with `isResult` will break the build. These
methods stay as they are:
- `IWorkflowEngine.getResult()` and `Workflow.getResult()`
- `IPipelineEngine.getResult()` and `Pipeline.getResult()`
- `ActionResult.getResult()`
- `getResult()` on the remote, Beam, and Spark engines
`HopGuiWorkflowGridDelegate` already does this correctly: it reads `Result
res = result.getResult()` from an `ActionResult`, then calls `res.isResult()`.
### Issue Priority
Priority: 3
### Issue Component
Component: Infrastructure
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]