You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by GitBox <gi...@apache.org> on 2021/10/12 05:07:24 UTC
[GitHub] [maven] arturobernalg opened a new pull request #583: [MNG-7299] - Simplify conditional expression
arturobernalg opened a new pull request #583:
URL: https://github.com/apache/maven/pull/583
Following this checklist to help us incorporate your
contribution quickly and easily:
- [X] Make sure there is a [JIRA issue](https://issues.apache.org/jira/browse/MNG) filed
for the change (usually before you start working on it). Trivial changes like typos do not
require a JIRA issue. Your pull request should address just this issue, without
pulling in other changes.
- [X] Each commit in the pull request should have a meaningful subject line and body.
- [X] Format the pull request title like `[MNG-XXX] - Fixes bug in ApproximateQuantiles`,
where you replace `MNG-XXX` with the appropriate JIRA issue. Best practice
is to use the JIRA issue title in the pull request title and in the first line of the
commit message.
- [X] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [X] Run `mvn clean verify` to make sure basic checks pass. A more thorough check will
be performed on your pull request automatically.
- [X] You have run the [Core IT][core-its] successfully.
If your pull request is about ~20 lines of code you don't need to sign an
[Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf) if you are unsure
please ask on the developers list.
To make clear that you license your contribution under
the [Apache License Version 2.0, January 2004](http://www.apache.org/licenses/LICENSE-2.0)
you have to acknowledge this by using the following check-box.
- [X] I hereby declare this contribution to be licenced under the [Apache License Version 2.0, January 2004](http://www.apache.org/licenses/LICENSE-2.0)
- [ ] In any other case, please file an [Apache Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf).
[core-its]: https://maven.apache.org/core-its/core-it-suite/
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven] asfgit closed pull request #583: [MNG-7299] - Simplify conditional expression
Posted by GitBox <gi...@apache.org>.
asfgit closed pull request #583:
URL: https://github.com/apache/maven/pull/583
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven] michael-o commented on pull request #583: [MNG-7299] - Simplify conditional expression
Posted by GitBox <gi...@apache.org>.
michael-o commented on pull request #583:
URL: https://github.com/apache/maven/pull/583#issuecomment-1059844659
I have merged this anyway because:
1) the given ones aren't much better to read
2) more compact
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven] gnodet commented on pull request #583: [MNG-7299] - Simplify conditional expression
Posted by GitBox <gi...@apache.org>.
gnodet commented on pull request #583:
URL: https://github.com/apache/maven/pull/583#issuecomment-996530842
The question is whether those simplications are easier to read/understand or not.
It seems to me that all those changes come from methods that have a parameter / variable to invert the actual result. I think that in such cases, simplifying the boolean expression will make it more difficult to understand...
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven] slachiewicz commented on a change in pull request #583: [MNG-7299] - Simplify conditional expression
Posted by GitBox <gi...@apache.org>.
slachiewicz commented on a change in pull request #583:
URL: https://github.com/apache/maven/pull/583#discussion_r728440226
##########
File path: maven-model-builder/src/main/java/org/apache/maven/model/profile/activation/PropertyProfileActivator.java
##########
@@ -97,13 +97,13 @@ public boolean isActive( Profile profile, ProfileActivationContext context, Mode
// we have a value, so it has to match the system value...
boolean result = propValue.equals( sysValue );
- return reverseValue ? !result : result;
+ return reverseValue != result;
}
else
{
boolean result = StringUtils.isNotEmpty( sysValue );
Review comment:
no result var is redundant
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven] arturobernalg commented on a change in pull request #583: [MNG-7299] - Simplify conditional expression
Posted by GitBox <gi...@apache.org>.
arturobernalg commented on a change in pull request #583:
URL: https://github.com/apache/maven/pull/583#discussion_r728625408
##########
File path: maven-model-builder/src/main/java/org/apache/maven/model/profile/activation/PropertyProfileActivator.java
##########
@@ -97,13 +97,13 @@ public boolean isActive( Profile profile, ProfileActivationContext context, Mode
// we have a value, so it has to match the system value...
boolean result = propValue.equals( sysValue );
- return reverseValue ? !result : result;
+ return reverseValue != result;
}
else
{
boolean result = StringUtils.isNotEmpty( sysValue );
Review comment:
true. Changed.
TY
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org