[GitHub] [commons-vfs] arturobernalg opened a new pull request #152: Minor Improvement:

2020-12-20 Thread GitBox


arturobernalg opened a new pull request #152:
URL: https://github.com/apache/commons-vfs/pull/152


   * Add final
   * Unused import
   * Unnecessary semicolon
   * Use Standard Charset object
   * Compare
   * Use primitive
   * Replace block comment to text plain
   * Redundant 'if' statement
   * Fix @ mail info



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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [commons-collections] EruDev opened a new pull request #201: fix type erroring->erring

2020-12-20 Thread GitBox


EruDev opened a new pull request #201:
URL: https://github.com/apache/commons-collections/pull/201


   



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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [commons-compress] dependabot[bot] opened a new pull request #159: Bump zstd-jni from 1.4.5-12 to 1.4.8-1

2020-12-20 Thread GitBox


dependabot[bot] opened a new pull request #159:
URL: https://github.com/apache/commons-compress/pull/159


   Bumps [zstd-jni](https://github.com/luben/zstd-jni) from 1.4.5-12 to 1.4.8-1.
   
   Commits
   
   https://github.com/luben/zstd-jni/commit/f3d6a8e8407fe690b8c78bb8d4c60f8056a285ff;>f3d6a8e
 v1.4.8-1
   https://github.com/luben/zstd-jni/commit/cf78696ed8916415ed8e5fbc8df1464d1e2725b3;>cf78696
 v1.4.7-3
   https://github.com/luben/zstd-jni/commit/76da8a59b5be8f58fe0996c73c91065fc3309cf5;>76da8a5
 Fix bug with decompressedSize bounds check
   https://github.com/luben/zstd-jni/commit/776d9617ba16bc2acc1e1adfbe7ccc94242ccce7;>776d961
 v1.4.7-2
   https://github.com/luben/zstd-jni/commit/f63fdf8287ca79e2d17ad0e6bcafbbd0acc423aa;>f63fdf8
 Revert Move to on-demand loading of the native part
   https://github.com/luben/zstd-jni/commit/402b695d4d7865c3ab93c13890433a07517c7305;>402b695
 Update the README and OSGI manifest
   https://github.com/luben/zstd-jni/commit/0157e132ae5b2d96a4f916b431034a4b21a238bd;>0157e13
 Merge fix for buffer alignment
   https://github.com/luben/zstd-jni/commit/3ec8dccb84323875970b68d054abe8d1981c4b61;>3ec8dcc
 v1.4.7-1
   https://github.com/luben/zstd-jni/commit/f7c8279bc162c8c8b1964948d0f3b309ad715311;>f7c8279
 Don't pool buffers by default
   https://github.com/luben/zstd-jni/commit/4548ee8933a83709e0f23ff106e65ded35598275;>4548ee8
 Update test samples for v1.4.7
   Additional commits viewable in https://github.com/luben/zstd-jni/compare/v1.4.5-12...v1.4.8-1;>compare 
view
   
   
   
   
   
   [![Dependabot compatibility 
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=com.github.luben:zstd-jni=maven=1.4.5-12=1.4.8-1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
   
   Dependabot will resolve any conflicts with this PR as long as you don't 
alter it yourself. You can also trigger a rebase manually by commenting 
`@dependabot rebase`.
   
   [//]: # (dependabot-automerge-start)
   [//]: # (dependabot-automerge-end)
   
   ---
   
   
   Dependabot commands and options
   
   
   You can trigger Dependabot actions by commenting on this PR:
   - `@dependabot rebase` will rebase this PR
   - `@dependabot recreate` will recreate this PR, overwriting any edits that 
have been made to it
   - `@dependabot merge` will merge this PR after your CI passes on it
   - `@dependabot squash and merge` will squash and merge this PR after your CI 
passes on it
   - `@dependabot cancel merge` will cancel a previously requested merge and 
block automerging
   - `@dependabot reopen` will reopen this PR if it is closed
   - `@dependabot close` will close this PR and stop Dependabot recreating it. 
You can achieve the same result by closing it manually
   - `@dependabot ignore this major version` will close this PR and stop 
Dependabot creating any more for this major version (unless you reopen the PR 
or upgrade to it yourself)
   - `@dependabot ignore this minor version` will close this PR and stop 
Dependabot creating any more for this minor version (unless you reopen the PR 
or upgrade to it yourself)
   - `@dependabot ignore this dependency` will close this PR and stop 
Dependabot creating any more for this dependency (unless you reopen the PR or 
upgrade to it yourself)
   
   
   



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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[jira] [Commented] (LANG-1629) DurationFormatUtils.formatPeriod is infinite repetition when parameter is negative number

2020-12-20 Thread LeeJuHyun (Jira)


[ 
https://issues.apache.org/jira/browse/LANG-1629?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17252594#comment-17252594
 ] 

LeeJuHyun commented on LANG-1629:
-

Hi! [~kinow] [~aviprogrammer]

Thank you for reply.

I saw it at work today, but it was a different version.

In my project, version is commons-lang-2.6.jar.

*I'm so sorry for taking your time* :(

I'll test the latest version after work.

 

and Can i refactoring the code accodring to Google Java Style Guide? 

  --> [https://google.github.io/styleguide/javaguide.html]

 

I saw some refactoring to the code convention.

 e.g) DurationFormatUtils class in 346 line)
{code:java}
 if ( !Token.containsTokenWithValue(tokens, y) ) { // remove white space, 346 
line{code}
but, the other code white space is not exist
{code:java}
 if (!Token.containsTokenWithValue(tokens, d)) // other code convention 390 
line {code}
 

Can i try? 

 

Have a nice day.

thank you :)

> DurationFormatUtils.formatPeriod is infinite repetition when parameter is 
> negative number
> -
>
> Key: LANG-1629
> URL: https://issues.apache.org/jira/browse/LANG-1629
> Project: Commons Lang
>  Issue Type: Bug
>  Components: lang.time.*
>Affects Versions: 3.11
>Reporter: LeeJuHyun
>Priority: Major
> Fix For: Discussion
>
>
> if parameter number(*startMillis*, *endMillis*) is negative number then below 
> while loop is infinite repetition. (278 line ~)
> {code:java}
> public static String formatPeriod(final long startMillis, final long 
> endMillis, final String format, final boolean padWithZeros,
> final TimeZone timezone) {
> Validate.isTrue(startMillis <= endMillis, "startMillis must not be 
> greater than endMillis");
> // Used to optimise for differences under 28 days and
> // called formatDuration(millis, format); however this did not work
> // over leap years.
> // TODO: Compare performance to see if anything was lost by
> // losing this optimisation.
> final Token[] tokens = lexx(format); 
> // ...
> while (start.get(Calendar.YEAR) != target) {
> days += start.getActualMaximum(Calendar.DAY_OF_YEAR) - 
> start.get(Calendar.DAY_OF_YEAR);
> // Not sure I grok why this is needed, but the brutal tests show it is
> if (start instanceof GregorianCalendar &&
> start.get(Calendar.MONTH) == Calendar.FEBRUARY &&
> start.get(Calendar.DAY_OF_MONTH) == 29) {
> days += 1;
> }
> start.add(Calendar.YEAR, 1);
> days += start.get(Calendar.DAY_OF_YEAR);
> }{code}
>  
> How about putting in a validation to determine whether it's negative or 
> positive?
>  
> thank you :)
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[GitHub] [commons-fileupload] garydgregory merged pull request #48: Bump maven-pmd-plugin from 3.13.0 to 3.14.0

2020-12-20 Thread GitBox


garydgregory merged pull request #48:
URL: https://github.com/apache/commons-fileupload/pull/48


   



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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [commons-fileupload] garydgregory merged pull request #49: Slight optim: resuse the index position instead of recomputing it

2020-12-20 Thread GitBox


garydgregory merged pull request #49:
URL: https://github.com/apache/commons-fileupload/pull/49


   



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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [commons-io] garydgregory merged pull request #176: Minor improvements

2020-12-20 Thread GitBox


garydgregory merged pull request #176:
URL: https://github.com/apache/commons-io/pull/176


   



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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[jira] [Commented] (IO-695) Exception while there should be none in copyFile

2020-12-20 Thread Gary D. Gregory (Jira)


[ 
https://issues.apache.org/jira/browse/IO-695?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17252499#comment-17252499
 ] 

Gary D. Gregory commented on IO-695:


I've reworked some of the docs, please see git master for the current Javadoc. 

> Exception while there should be none in copyFile
> 
>
> Key: IO-695
> URL: https://issues.apache.org/jira/browse/IO-695
> Project: Commons IO
>  Issue Type: Bug
>  Components: Utilities
>Affects Versions: 2.8.0
>Reporter: Dominik Derwiński
>Priority: Minor
>
> {{public static void copyFile(final File srcFile, final File destFile, final 
> boolean preserveFileDate)}} java doc says: "If the modification operation 
> fails, no indication is provided", yet the method raises an {{IOException}} 
> "Failed setLastModified on ...".



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[GitHub] [commons-io] coveralls commented on pull request #176: Minor improvement:

2020-12-20 Thread GitBox


coveralls commented on pull request #176:
URL: https://github.com/apache/commons-io/pull/176#issuecomment-748648969


   
   [![Coverage 
Status](https://coveralls.io/builds/35847910/badge)](https://coveralls.io/builds/35847910)
   
   Coverage increased (+0.07%) to 88.712% when pulling 
**91dc31aa29116a6b3f51a68e87e13052bf095bca on 
arturobernalg:feature/minor_improvement** into 
**3859146f2c43b91fbe2968453ae154d5b34c6ba6 on apache:master**.
   



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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [commons-io] arturobernalg commented on pull request #176: Minor improvement:

2020-12-20 Thread GitBox


arturobernalg commented on pull request #176:
URL: https://github.com/apache/commons-io/pull/176#issuecomment-748647081


   > @arturobernalg
   > Please rebase on master to pickup a fix for Checkstyle.
   > TY!
   
   Done.



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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [commons-text] garydgregory merged pull request #192: Minor Improvements

2020-12-20 Thread GitBox


garydgregory merged pull request #192:
URL: https://github.com/apache/commons-text/pull/192


   



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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [commons-io] garydgregory commented on pull request #176: Minor improvement:

2020-12-20 Thread GitBox


garydgregory commented on pull request #176:
URL: https://github.com/apache/commons-io/pull/176#issuecomment-748639584


   @arturobernalg 
   Please rebase on master to pickup a fix for Checkstyle.
   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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [commons-io] arturobernalg opened a new pull request #176: Minor improvement:

2020-12-20 Thread GitBox


arturobernalg opened a new pull request #176:
URL: https://github.com/apache/commons-io/pull/176


   Minor improvement:
   * Add Final
   * Unused import
   * Unnecessary semicolon



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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[jira] [Commented] (MATH-1563) Implementation of Adaptive Probability Generation Strategy for Genetic Algorithm

2020-12-20 Thread Gilles Sadowski (Jira)


[ 
https://issues.apache.org/jira/browse/MATH-1563?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17252449#comment-17252449
 ] 

Gilles Sadowski commented on MATH-1563:
---

{quote}Any other activity required to pursue this?
{quote}
Did you *subscribe* to the "dev" ML?
See my [message over there|https://markmail.org/message/vcfohqoexrsdjnfq].


> Implementation of Adaptive Probability Generation Strategy for Genetic 
> Algorithm
> 
>
> Key: MATH-1563
> URL: https://issues.apache.org/jira/browse/MATH-1563
> Project: Commons Math
>  Issue Type: Improvement
>Reporter: AVIJIT BASAK
>Priority: Major
>
> In Genetic Algorithm probability of crossover and mutation operation can be 
> generated in an adaptive manner. Some experiment was done related to this and 
> published in this article 
> "https://www.ijcaonline.org/archives/volume175/number10/basak-2020-ijca-920572.pdf;.
> Currently Apache's API works on constant probability strategy. I would like 
> to propose incorporation of rank based adaptive probability generation 
> strategy as described in the mentioned article. This will improve the 
> performance and robustness of the algorithm and would make this more suitable 
> for use in higher dimensional problems like machine learning or deep learning.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (SANDBOX-511) Minor Improvement commons-graph

2020-12-20 Thread Gary D. Gregory (Jira)


[ 
https://issues.apache.org/jira/browse/SANDBOX-511?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17252444#comment-17252444
 ] 

Gary D. Gregory commented on SANDBOX-511:
-

IMO, we don't need Jira tickets for these kinds of changes. 

> Minor Improvement commons-graph 
> 
>
> Key: SANDBOX-511
> URL: https://issues.apache.org/jira/browse/SANDBOX-511
> Project: Commons Sandbox
>  Issue Type: Improvement
>  Components: Graph
>Reporter: Arturo Bernal
>Priority: Major
>  Labels: pull-request-available
>
> * Add Final
>  * Unused import
>  * Unnecessary semicolon
>  * 'for' loop replaceable with enhanced 'for'
>  * Fix some JavaDoc issues



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (MATH-1563) Implementation of Adaptive Probability Generation Strategy for Genetic Algorithm

2020-12-20 Thread AVIJIT BASAK (Jira)


[ 
https://issues.apache.org/jira/browse/MATH-1563?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17252436#comment-17252436
 ] 

AVIJIT BASAK commented on MATH-1563:


I have sent an email with subject "*[MATH] A Proposal for Implementation of 
Adaptive Probability Generation Strategy for Genetic Algorithm*" to 
"*d...@commons.apache.org*" with the proposal referring this Jira.

Any other activity required to pursue this?

 

> Implementation of Adaptive Probability Generation Strategy for Genetic 
> Algorithm
> 
>
> Key: MATH-1563
> URL: https://issues.apache.org/jira/browse/MATH-1563
> Project: Commons Math
>  Issue Type: Improvement
>Reporter: AVIJIT BASAK
>Priority: Major
>
> In Genetic Algorithm probability of crossover and mutation operation can be 
> generated in an adaptive manner. Some experiment was done related to this and 
> published in this article 
> "https://www.ijcaonline.org/archives/volume175/number10/basak-2020-ijca-920572.pdf;.
> Currently Apache's API works on constant probability strategy. I would like 
> to propose incorporation of rank based adaptive probability generation 
> strategy as described in the mentioned article. This will improve the 
> performance and robustness of the algorithm and would make this more suitable 
> for use in higher dimensional problems like machine learning or deep learning.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (LANG-1354) FieldUtils should ignore any synthetic fields

2020-12-20 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/LANG-1354?focusedWorklogId=526509=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-526509
 ]

ASF GitHub Bot logged work on LANG-1354:


Author: ASF GitHub Bot
Created on: 20/Dec/20 13:12
Start Date: 20/Dec/20 13:12
Worklog Time Spent: 10m 
  Work Description: mdbuck commented on pull request #339:
URL: https://github.com/apache/commons-lang/pull/339#issuecomment-748606143


   shrug



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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 526509)
Time Spent: 20m  (was: 10m)

> FieldUtils should ignore any synthetic fields
> -
>
> Key: LANG-1354
> URL: https://issues.apache.org/jira/browse/LANG-1354
> Project: Commons Lang
>  Issue Type: Improvement
>Reporter: Yegor Koldov
>Priority: Minor
>  Time Spent: 20m
>  Remaining Estimate: 0h
>
> For my opinion [FieldUtils.getAllFieldsList | 
> https://github.com/apache/commons-lang/blob/release/src/main/java/org/apache/commons/lang3/reflect/FieldUtils.java#L212]
>  should ignore any synthetic fileds (Jacoco for ex.)
> If you agree with that, i could prepaire PR on github



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (LANG-1354) FieldUtils should ignore any synthetic fields

2020-12-20 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/LANG-1354?focusedWorklogId=526508=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-526508
 ]

ASF GitHub Bot logged work on LANG-1354:


Author: ASF GitHub Bot
Created on: 20/Dec/20 13:12
Start Date: 20/Dec/20 13:12
Worklog Time Spent: 10m 
  Work Description: mdbuck closed pull request #339:
URL: https://github.com/apache/commons-lang/pull/339


   



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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 526508)
Remaining Estimate: 0h
Time Spent: 10m

> FieldUtils should ignore any synthetic fields
> -
>
> Key: LANG-1354
> URL: https://issues.apache.org/jira/browse/LANG-1354
> Project: Commons Lang
>  Issue Type: Improvement
>Reporter: Yegor Koldov
>Priority: Minor
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> For my opinion [FieldUtils.getAllFieldsList | 
> https://github.com/apache/commons-lang/blob/release/src/main/java/org/apache/commons/lang3/reflect/FieldUtils.java#L212]
>  should ignore any synthetic fileds (Jacoco for ex.)
> If you agree with that, i could prepaire PR on github



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[GitHub] [commons-lang] mdbuck commented on pull request #339: [LANG-1354] Added Methods to FieldUtils to Return Non-Synthetic Fields From a Class

2020-12-20 Thread GitBox


mdbuck commented on pull request #339:
URL: https://github.com/apache/commons-lang/pull/339#issuecomment-748606143


   shrug



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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [commons-lang] mdbuck closed pull request #339: [LANG-1354] Added Methods to FieldUtils to Return Non-Synthetic Fields From a Class

2020-12-20 Thread GitBox


mdbuck closed pull request #339:
URL: https://github.com/apache/commons-lang/pull/339


   



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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [commons-graph] arturobernalg commented on pull request #5: [SANDBOX-511] Minor Improvement commons-graph

2020-12-20 Thread GitBox


arturobernalg commented on pull request #5:
URL: https://github.com/apache/commons-graph/pull/5#issuecomment-748602278


   Hi
   
   I just think it can be good practice.
   
   



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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[jira] [Comment Edited] (LANG-1627) BooleanUtils.xor not behaving as expected with any odd number of true's

2020-12-20 Thread Avijit Chakraborty (Jira)


[ 
https://issues.apache.org/jira/browse/LANG-1627?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17252209#comment-17252209
 ] 

Avijit Chakraborty edited comment on LANG-1627 at 12/20/20, 12:25 PM:
--

Hi [~alb-i986],

I had a look into the code of BooleanUtils#xor() methods and at first glance, 
the implementations looked correct to me.

When Exclusive OR is applied to 2 inputs then the output becomes true when only 
one of the inputs is true. 

The definition of multi-input exclusive OR gates says that the final output is 
a 1 when the number of 1s at its inputs is odd, and a 0 when the number of 
incoming 1s is even. I referred to 
[https://en.wikipedia.org/wiki/XOR_gate#More_than_two_inputs] 

So, going by this definition (true ^ true ^ true) = true sounds good.

Although I agree with you that the Javadoc of these 2 methods can be improved 
by including the fact that output will be true if the number of incoming trues 
are odd.


was (Author: aviprogrammer):
Hi [~alb-i986],

I had a look into the code of BooleanUtils#xor() methods and at first instance, 
the implementations looked correct to me.

When Exclusive OR is applied to 2 inputs then the output becomes true when only 
one of the inputs is true. 

The definition of multi-input exclusive OR gates says that the final output is 
a 1 when the number of 1s at its inputs is odd, and a 0 when the number of 
incoming 1s is even. I referred to 
[https://en.wikipedia.org/wiki/XOR_gate#More_than_two_inputs] 

So, going by this definition (true ^ true ^ true) = true sounds good.

Although I agree with you that the Javadoc of these 2 methods can be improved 
by including the fact that output will be true if the number of incoming trues 
are odd.

> BooleanUtils.xor not behaving as expected with any odd number of true's
> ---
>
> Key: LANG-1627
> URL: https://issues.apache.org/jira/browse/LANG-1627
> Project: Commons Lang
>  Issue Type: Bug
>Affects Versions: 3.11
>Reporter: Alberto Scotto
>Priority: Major
>
> Hi,
> I was expecting a xor function that takes a variable number of arguments to 
> *return true if and only if exactly one among all of the arguments is true*, 
> regardless of the number of arguments.
> This holds true given three false's:
> {code:java}
> @Test
> public void threeFalse() {
>  boolean[] bools = new boolean[]{Boolean.FALSE, Boolean.FALSE, Boolean.FALSE};
>  assertFalse(BooleanUtils.xor(bools));
> }{code}
>  
>  It also holds true given 4 true's, as well as for any even number of trues.
> {code:java}
> @Test
> public void fourTrue() {
> boolean[] bools = new boolean[]{Boolean.TRUE, Boolean.TRUE, 
> Boolean.TRUE, Boolean.TRUE};
> assertFalse(BooleanUtils.xor(bools));
> }
> {code}
> The above tests pass.
> But with any odd number of true's that doesn't hold anymore:
>  
> {code:java}
> @Test
> public void threeTrue() {
>  boolean[] bools = new boolean[]{Boolean.TRUE, Boolean.TRUE, Boolean.TRUE};
>  assertFalse(BooleanUtils.xor(bools));
> }
> {code}
> This test fails.
> That was totally unexpected to me.
>  But as it turns out, even
> {noformat}
> true ^ true ^ true{noformat}
> evaluates to true. That was unexpected too to me, at a first sight.
> The thing is that xor (I mean the original boolean operator) is a binary 
> operator, so if you want to make it n-ary, one simple solution is to apply it 
> in two by two: ((a ^ b) ^ c) ^ d
>  And that's what is done in the implementation of the method BooleanUtils#xor.
> But that brings to BooleanUtils.xor(true, true, true) == true, and at the 
> same time BooleanUtils.xor(true, true, true, true) == false, which just 
> doesn't sound right to me.
> Whether or not you agree with me that that is a bug of the method, please at 
> least update the Javadoc, because right now it is not providing the user 
> enough information. Look:
> {code:java}
> Performs an xor on a set of booleans.
>  BooleanUtils.xor(true, true)   = false
>  BooleanUtils.xor(false, false) = false
>  BooleanUtils.xor(true, false)  = true
> {code}
>  
> Thanks.
> Cheers



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[GitHub] [commons-graph] kinow edited a comment on pull request #5: [SANDBOX-511] Minor Improvement commons-graph

2020-12-20 Thread GitBox


kinow edited a comment on pull request #5:
URL: https://github.com/apache/commons-graph/pull/5#issuecomment-748590807


   > IMO on type ensure that the reference will never change. For the values 
types it will ensure that the value cannot change. If you check some of the 
other apache commons modules you can see that they follow the same approach.
   
   Yup, there are many modules in Commons that use `final`. I use it to ensure 
immutability in some objects. But not everyone writes
   
   ```java
   public void methodA(final param1, final param2) {
 return param1 + param2;
   }
   ```
   
   Some projects may enforce it. But as far as I am aware, we have nothing in 
Commons, nor in Commons Graph. So reviewers would have to inspect each PR to 
ensure the code was consistent in using the `final` modifiers.
   
   Otherwise, in a few months/years, the code would have a few methods and 
local variables without the `final`, and we would need to keep updating the 
code again, chasing for variables missing the `final` modifier.
   
   I prefer to use it to enforce immutability on the end-user, not on other 
developers unless necessary (i.e. not for a variable used once in a method, or 
a parameter in a method that is private or not intended to be extended). Making 
the reviewing process a bi simpler IMHO. Let's leave it open and see if others 
prefer to use the `final` modifier everywhere it's possible in Graph (ping 
@garydgregory ?).
   
   -Bruno



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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [commons-graph] kinow commented on pull request #5: [SANDBOX-511] Minor Improvement commons-graph

2020-12-20 Thread GitBox


kinow commented on pull request #5:
URL: https://github.com/apache/commons-graph/pull/5#issuecomment-748590807


   > IMO on type ensure that the reference will never change. For the values 
types it will ensure that the value cannot change. If you check some of the 
other apache commons modules you can see that they follow the same approach.
   
   Yup, there are many modules in Commons that use `final`. I use it to ensure 
immutability in some objects. But not everyone writes
   
   ```java
   public void methodA(final param1, final param2) {
 return param1 + param2;
   }
   ```
   
   Some projects may enforce it. But as far as I am aware, we have nothing in 
Commons, nor in Commons Graph. So reviewers would have to inspect each PR to 
ensure the code was consistent in using the `final` modifiers.
   
   Otherwise, in a few months/years, the code would have a few methods and 
local variables without the `final`, and we would need to keep updating the 
code again, chasing for variables missing the `final` modifier.
   
   Let's leave it open and see if others prefer to use the `final` modifier 
everywhere it's possible in Graph (ping @garydgregory ?).
   
   -Bruno



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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [commons-graph] arturobernalg commented on pull request #5: [SANDBOX-511] Minor Improvement commons-graph

2020-12-20 Thread GitBox


arturobernalg commented on pull request #5:
URL: https://github.com/apache/commons-graph/pull/5#issuecomment-748588724


   IMO on type ensure that the reference will never change. For the values 
types it will ensure that the value cannot change. If you check some of the 
other apache commons modules you can see that they follow the same approach.



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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [commons-graph] arturobernalg closed pull request #4: Minor Improvement

2020-12-20 Thread GitBox


arturobernalg closed pull request #4:
URL: https://github.com/apache/commons-graph/pull/4


   



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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[jira] [Updated] (SANDBOX-511) Minor Improvement commons-graph

2020-12-20 Thread Arturo Bernal (Jira)


 [ 
https://issues.apache.org/jira/browse/SANDBOX-511?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Arturo Bernal updated SANDBOX-511:
--
Labels: pull-request-available  (was: )

> Minor Improvement commons-graph 
> 
>
> Key: SANDBOX-511
> URL: https://issues.apache.org/jira/browse/SANDBOX-511
> Project: Commons Sandbox
>  Issue Type: Improvement
>  Components: Graph
>Reporter: Arturo Bernal
>Priority: Major
>  Labels: pull-request-available
>
> * Add Final
>  * Unused import
>  * Unnecessary semicolon
>  * 'for' loop replaceable with enhanced 'for'
>  * Fix some JavaDoc issues



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[GitHub] [commons-graph] arturobernalg opened a new pull request #5: [SANDBOX-511] Minor Improvement commons-graph

2020-12-20 Thread GitBox


arturobernalg opened a new pull request #5:
URL: https://github.com/apache/commons-graph/pull/5


   * Add Final
   * Unused import
   * Unnecessary semicolon
   * 'for' loop replaceable with enhanced 'for'
   * Fix some JavaDoc issues



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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[jira] [Updated] (SANDBOX-511) Minor Improvement commons-graph

2020-12-20 Thread Arturo Bernal (Jira)


 [ 
https://issues.apache.org/jira/browse/SANDBOX-511?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Arturo Bernal updated SANDBOX-511:
--
Summary: Minor Improvement commons-graph   (was: Minor Improvement)

> Minor Improvement commons-graph 
> 
>
> Key: SANDBOX-511
> URL: https://issues.apache.org/jira/browse/SANDBOX-511
> Project: Commons Sandbox
>  Issue Type: Improvement
>  Components: Graph
>Reporter: Arturo Bernal
>Priority: Major
>
> * Add Final
>  * Unused import
>  * Unnecessary semicolon
>  * 'for' loop replaceable with enhanced 'for'
>  * Fix some JavaDoc issues



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Updated] (SANDBOX-511) Minor Improvement

2020-12-20 Thread Arturo Bernal (Jira)


 [ 
https://issues.apache.org/jira/browse/SANDBOX-511?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Arturo Bernal updated SANDBOX-511:
--
Component/s: Graph

> Minor Improvement
> -
>
> Key: SANDBOX-511
> URL: https://issues.apache.org/jira/browse/SANDBOX-511
> Project: Commons Sandbox
>  Issue Type: Improvement
>  Components: Graph
>Reporter: Arturo Bernal
>Priority: Major
>
> * Add Final
>  * Unused import
>  * Unnecessary semicolon
>  * 'for' loop replaceable with enhanced 'for'
>  * Fix some JavaDoc issues



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Created] (SANDBOX-511) Minor Improvement

2020-12-20 Thread Arturo Bernal (Jira)
Arturo Bernal created SANDBOX-511:
-

 Summary: Minor Improvement
 Key: SANDBOX-511
 URL: https://issues.apache.org/jira/browse/SANDBOX-511
 Project: Commons Sandbox
  Issue Type: Improvement
Reporter: Arturo Bernal


* Add Final
 * Unused import
 * Unnecessary semicolon
 * 'for' loop replaceable with enhanced 'for'
 * Fix some JavaDoc issues



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[GitHub] [commons-graph] arturobernalg opened a new pull request #4: Minor Improvement

2020-12-20 Thread GitBox


arturobernalg opened a new pull request #4:
URL: https://github.com/apache/commons-graph/pull/4


   * Add Final
   * Unused import
   * Unnecessary semicolon
   * 'for' loop replaceable with enhanced 'for'
   * Fix some JavaDoc issues



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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org