You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Fix#9497 Replace deprecated Result.getResult() calls with isResult() - #9498
org.apache.hop.core.Result.getResult() has been deprecated since 2.16 in favor of isResult(). Both methods read the same success flag, so this change does not alter execution behavior.
Call sites whose receiver is org.apache.hop.core.Result now use isResult(). This covers production code (LineageRunLifecycleEmitter, LoadBalancingWorkflowEngine, CypherScript, WorkflowReplayGateAfterActionXp) and the action tests that assert on execute(...).
Result.getResult() stays, marked @Deprecated(since = "2.16"), and delegates to isResult() so external plugins keep compiling. It has to be a real method: with getResult() present, Lombok treats it as the getter for boolean result and does not generate isResult().
Plain accessors that duplicated @Getter / @Setter are removed: getRows(), and the get/set pair for bytes read and written by the current action. setRows() stays, because a null argument is stored as an empty list.
ResultTest covers the default flag, setResult, agreement between isResult() and the deprecated getResult(), clone / lightClone, the XML round trip, and the "result" JSON property.
Methods named getResult() that return a Result object are unchanged. That includes Workflow.getResult(), Pipeline.getResult(), ActionResult.getResult(), and WebResult.getResult().
Test plan
./mvnw -pl core test -Dtest=ResultTest
Run a touched action test module, for example plugins/actions/http or plugins/misc/mail, and confirm success and failure assertions still match the action outcome
Compile the touched modules and confirm there is no deprecation warning for org.apache.hop.core.Result.getResult() at the updated call sites
Thanks for this cleanup. The code changes look good to me. Three things before we merge:
1. The documentation still uses getResult()
docs/hop-user-manual/modules/ROOT/pages/workflow/actions/eval.adoc (line 127) tells JavaScript users to call previous_result.getResult(). Scripts written from that page will fail at runtime once the deprecated method is removed, so this one matters most. Please change it to previous_result.isResult().
docs/hop-dev-manual/modules/ROOT/pages/sdk/workflows.adoc uses result.getResult() on lines 107, 114 and 151. This is the code plugin developers copy, so it should show isResult() too.
2. The @deprecated tag on getResult() lost its link
In Result.java the tag changed from {@link #isResult()} to plain isResult(). Without the link, IDEs can't jump to the replacement and Javadoc no longer checks that the method exists. Please keep {@link #isResult()}.
3. Explain why isResult() is written out
The class has @Getter, so the explicit isResult() looks redundant, but it isn't. Lombok skips the getter for the boolean result because getResult() already exists. If someone later deletes isResult() as boilerplate, every call site migrated in this PR stops compiling. A one-line comment above isResult() would prevent that, for example:
// Written out: Lombok does not generate isResult() while the deprecated getResult() exists.
The @deprecated tag on getResult() is {@link #isResult()} again.
isResult() has a comment explaining why it is written out: Lombok does not generate it while the deprecated getResult() exists.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix #9497
Summary
org.apache.hop.core.Result.getResult()has been deprecated since 2.16 in favor ofisResult(). Both methods read the same success flag, so this change does not alter execution behavior.org.apache.hop.core.Resultnow useisResult(). This covers production code (LineageRunLifecycleEmitter,LoadBalancingWorkflowEngine,CypherScript,WorkflowReplayGateAfterActionXp) and the action tests that assert onexecute(...).Result.getResult()stays, marked@Deprecated(since = "2.16"), and delegates toisResult()so external plugins keep compiling. It has to be a real method: withgetResult()present, Lombok treats it as the getter forboolean resultand does not generateisResult().@Getter/@Setterare removed:getRows(), and the get/set pair for bytes read and written by the current action.setRows()stays, because anullargument is stored as an empty list.ResultTestcovers the default flag,setResult, agreement betweenisResult()and the deprecatedgetResult(),clone/lightClone, the XML round trip, and the"result"JSON property.Methods named
getResult()that return aResultobject are unchanged. That includesWorkflow.getResult(),Pipeline.getResult(),ActionResult.getResult(), andWebResult.getResult().Test plan
./mvnw -pl core test -Dtest=ResultTestplugins/actions/httporplugins/misc/mail, and confirm success and failure assertions still match the action outcomeorg.apache.hop.core.Result.getResult()at the updated call sites