Hi:
I've corrected the logic based on your comments.
Thanks
Mans
On Tuesday, February 9, 2016 11:46 AM, jskora <[email protected]> wrote:
Github user jskora commented on a diff in the pull request:
https://github.com/apache/nifi/pull/209#discussion_r52362955
--- Diff:
nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/AbstractAWSProcessor.java
---
@@ -161,6 +180,12 @@ private static AllowableValue
createAllowableValue(final Regions regions) {
problems.add(new ValidationResult.Builder().input("Access
Key").valid(false).explanation("Cannot set both Credentials File and Secret
Key/Access Key").build());
}
+ final boolean proxyHostSet =
validationContext.getProperty(PROXY_HOST).isSet();
+ final boolean proxyHostPortSet =
validationContext.getProperty(PROXY_HOST_PORT).isSet();
+ if (proxyHostSet ^ proxyHostPortSet ) {
--- End diff --
The [Java
operators](https://docs.oracle.com/javase/tutorial/java/nutsandbolts/opsummary.html)
consider the XOR operator ("^") to be a bitwise operator not a conditional
logic operator. Even if it works correctly on this line, I think it would be
more clear and less likely to be misinterpreted if the logical expressions were
spelled out explicitly.
` if ((proxyHostSet && !proxyHostPortSet) || (!proxyHostSet &&
proxyHostPortSet)) {`
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---