-
Notifications
You must be signed in to change notification settings - Fork 31
MLE-26838: Added null check for conf.getStrings() method in various files #563
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
ce7d4c5
6268bb1
4861797
7957f7a
bc4d8bc
5cb01af
4ee221d
08bae28
5d13030
d129959
0cd4786
ea0f9c4
01d31db
2de11b0
6f14bad
853ba96
1b1772b
9287533
3920322
aca62c4
1fdfde3
da0a200
cb7c786
1538f69
ea07af3
488fb99
84a6c99
a8c778a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 27 of the commits added to the PR are not valid, and the XCC lib is being overridden by the wrong version here. I think you might have used the develop-12.0 branch to base your feature branch. This is not correct. Can you please rebase your fork to the develop branch and add your diff to it? |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -556,6 +556,10 @@ public void run() { | |||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
| String[] hosts = conf.getStrings(MarkLogicConstants.OUTPUT_HOST); | ||||||||||||||||||||||||||||||
| if (hosts == null || hosts.length == 0) { | ||||||||||||||||||||||||||||||
| throw new IllegalArgumentException(MarkLogicConstants.OUTPUT_HOST + | ||||||||||||||||||||||||||||||
| " is not specified."); | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
| for (String host : hosts) { | ||||||||||||||||||||||||||||||
|
Comment on lines
+562
to
563
|
||||||||||||||||||||||||||||||
| } | |
| for (String host : hosts) { | |
| } | |
| List<String> validHosts = new ArrayList<String>(); | |
| for (String host : hosts) { | |
| if (host != null && !host.trim().isEmpty()) { | |
| validHosts.add(host); | |
| } | |
| } | |
| if (validHosts.isEmpty()) { | |
| throw new IllegalArgumentException(MarkLogicConstants.OUTPUT_HOST + | |
| " does not contain any valid non-empty host values."); | |
| } | |
| for (String host : validHosts) { |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -79,8 +79,13 @@ public static List<ContentPermission> getDefaultPermissions(Configuration conf, | |
| ResultSequence result = null; | ||
| ContentSource cs; | ||
| try { | ||
| String[] hosts = conf.getStrings(MarkLogicConstants.OUTPUT_HOST); | ||
| if (hosts == null || hosts.length == 0) { | ||
| throw new IllegalArgumentException(MarkLogicConstants.OUTPUT_HOST + | ||
| " is not specified."); | ||
| } | ||
| cs = InternalUtilities.getOutputContentSource(conf, | ||
| conf.getStrings(MarkLogicConstants.OUTPUT_HOST)[0]); | ||
| hosts[0]); | ||
|
Comment on lines
+82
to
+88
|
||
|
|
||
| session = cs.newSession(); | ||
| RequestOptions options = new RequestOptions(); | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -104,11 +104,12 @@ public class InternalUtilities implements MarkLogicConstants { | |||||||||||
| */ | ||||||||||||
| public static ContentSource getInputContentSource(Configuration conf) | ||||||||||||
| throws URISyntaxException, XccConfigException, IOException { | ||||||||||||
| String host = conf.getStrings(INPUT_HOST)[0]; | ||||||||||||
| if (host == null || host.isEmpty()) { | ||||||||||||
| String[] hosts = conf.getStrings(INPUT_HOST); | ||||||||||||
| if (hosts == null || hosts.length == 0) { | ||||||||||||
| throw new IllegalArgumentException(INPUT_HOST + | ||||||||||||
| " is not specified."); | ||||||||||||
| } | ||||||||||||
| String host = hosts[0]; | ||||||||||||
|
|
||||||||||||
|
||||||||||||
| if (host == null || host.trim().isEmpty()) { | |
| throw new IllegalArgumentException(INPUT_HOST + | |
| " is not specified."); | |
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All the changes in this file is invalid