Skip to content

Commit

Permalink
[KYUUBI apache#2478][FOLLOWUP] Invoke getOpts method instead of Refle…
Browse files Browse the repository at this point in the history
…ction
  • Loading branch information
turboFei committed Apr 29, 2022
1 parent 973339d commit 4400f36
Showing 1 changed file with 1 addition and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -162,15 +162,7 @@ int initArgs(String[] args) {
int code = 0;
if (cl.getOptionValues('e') != null) {
commands = Arrays.asList(cl.getOptionValues('e'));
try {
Field optsField = BeeLine.class.getDeclaredField("opts");
optsField.setAccessible(true);
BeeLineOpts opts = (BeeLineOpts) optsField.get(this);
opts.setAllowMultiLineCommand(false);
} catch (Exception t) {
error(t.getMessage());
return 1;
}
getOpts().setAllowMultiLineCommand(false); // When using -e, command is always a single line
}

if (!commands.isEmpty() && getOpts().getScriptFile() != null) {
Expand Down

0 comments on commit 4400f36

Please sign in to comment.