Skip to content

Fix ExecProcess command-line tokenization after #7565#7581

Merged
mattcasters merged 1 commit into
apache:mainfrom
leehaut:hotfix/lance-common-102
Jul 20, 2026
Merged

Fix ExecProcess command-line tokenization after #7565#7581
mattcasters merged 1 commit into
apache:mainfrom
leehaut:hotfix/lance-common-102

Conversation

@leehaut

@leehaut leehaut commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Fix

org.apache.hop.pipeline.transforms.execprocess.ExecProcessTest
Error:  org.apache.hop.pipeline.transforms.execprocess.ExecProcessTest.processRow_singleCommandString_capturesOutput -- Time elapsed: 5.674 s <<< ERROR!
java.lang.NullPointerException: Cannot invoke "Object.toString()" because "out[1]" is null
	at org.apache.hop.pipeline.transforms.execprocess.ExecProcessTest.processRow_singleCommandString_capturesOutput(ExecProcessTest.java:195)

Summary

  • Restore historical Runtime.exec(String) whitespace tokenization when argumentsInFields is false.
  • Improve ExecProcess Lombok accessors and unit tests #7565 changed exec(process[0]) to exec(new String[] {process[0]}), which treats the entire command line (e.g. /bin/echo hop-single) as the executable name, so stdout is null and CI fails on Linux.
  • Tokenize with StringTokenizer (same as the old Runtime.exec(String) behavior) before calling exec(String[]), avoiding the deprecated String overload.

Signed-off-by: lance <leehaut@gmail.com>
@mattcasters
mattcasters merged commit 70805d5 into apache:main Jul 20, 2026
1 check passed
mattcasters added a commit to mattcasters/hop that referenced this pull request Jul 20, 2026
…pache#7581

Use explicit whitespace tokenization before Runtime.exec(String[]) for
single-command mode (avoids the deprecated String overload), and add a
unit test for tokenizeCommandLine. Credit: @leehaut in apache#7581.
@mattcasters

Copy link
Copy Markdown
Contributor

Thanks @leehaut — we adopted your ExecProcess tokenization fix into #7584 (with credit) alongside the #7582 IT permission work, so this PR can be closed as covered by that if preferred.

mattcasters added a commit that referenced this pull request Jul 20, 2026
… exec (#7584)

* issue #7582 : fix IT write permissions and ExecProcess single-command exec

Harden integration-test Docker prep so project output/, files/, and roots
are writable under the container UID, and move generated spreadsheet/MDI/
parquet/http artifacts into world-writable output/ paths (with golden data
and gitignore updates). Also restore Runtime.exec(String) for ExecProcess
single-command mode so command lines are tokenized again (#7565 regression).

* issue #7582 : adopt StringTokenizer-based ExecProcess fix from #7581

Use explicit whitespace tokenization before Runtime.exec(String[]) for
single-command mode (avoids the deprecated String overload), and add a
unit test for tokenizeCommandLine. Credit: @leehaut in #7581.
mattcasters added a commit to hansva/hop that referenced this pull request Jul 20, 2026
Match historical Runtime.exec(String) whitespace tokenization via
StringTokenizer before exec(String[]), so single-command fields like
"/bin/echo hop-single" work again. Based on @leehaut's fix in apache#7581.
mattcasters added a commit to mattcasters/hop that referenced this pull request Jul 20, 2026
Bring in ExecProcess single-command tokenization fix (apache#7581/apache#7584) and
other main updates to unblock PR build.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants