Re: [PR] Add PD-specific README [commons-compress]

2024-05-23 Thread via GitHub


pepper-ankan commented on PR #533:
URL: https://github.com/apache/commons-compress/pull/533#issuecomment-2128479420

   Sorry, mistaken PR.  Apologies!


-- 
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-unsubscr...@commons.apache.org

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



Re: [PR] Add PD-specific README [commons-compress]

2024-05-23 Thread via GitHub


pepper-ankan closed pull request #533: Add PD-specific README
URL: https://github.com/apache/commons-compress/pull/533


-- 
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-unsubscr...@commons.apache.org

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



Re: [PR] Bump github/codeql-action from 3.25.5 to 3.25.6 [commons-io]

2024-05-23 Thread via GitHub


garydgregory merged PR #634:
URL: https://github.com/apache/commons-io/pull/634


-- 
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-unsubscr...@commons.apache.org

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



Re: [PR] Bump codecov/codecov-action from 4.4.0 to 4.4.1 [commons-io]

2024-05-23 Thread via GitHub


garydgregory merged PR #633:
URL: https://github.com/apache/commons-io/pull/633


-- 
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-unsubscr...@commons.apache.org

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



Re: [PR] Bump github/codeql-action from 3.25.5 to 3.25.6 [commons-scxml]

2024-05-23 Thread via GitHub


garydgregory merged PR #232:
URL: https://github.com/apache/commons-scxml/pull/232


-- 
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-unsubscr...@commons.apache.org

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



Re: [PR] Bump codecov/codecov-action from 4.4.0 to 4.4.1 [commons-scxml]

2024-05-23 Thread via GitHub


garydgregory merged PR #233:
URL: https://github.com/apache/commons-scxml/pull/233


-- 
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-unsubscr...@commons.apache.org

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



[jira] [Updated] (CLI-321) Add and use a Converter interface and implementations without using BeanUtils

2024-05-23 Thread Gary D. Gregory (Jira)


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

Gary D. Gregory updated CLI-321:

Fix Version/s: 1.8.1
   (was: 1.8.0)

> Add and use a Converter interface and implementations without using BeanUtils 
> --
>
> Key: CLI-321
> URL: https://issues.apache.org/jira/browse/CLI-321
> Project: Commons CLI
>  Issue Type: Improvement
>  Components: Parser
>Affects Versions: 1.6.0
>Reporter: Claude Warren
>Assignee: Claude Warren
>Priority: Minor
> Fix For: 1.8.1
>
>
> The current TypeHandler implementation notes indicate that the 
> BeanUtils.Converters should be used to create instances of the various types. 
>  This issue is to complete the implementation of TypeHandler so that it uses 
> the BeanUtils.Converters.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Updated] (CLI-322) Allow minus for kebab-case options

2024-05-23 Thread Gary D. Gregory (Jira)


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

Gary D. Gregory updated CLI-322:

Fix Version/s: 1.8.1
   (was: 1.8.0)

> Allow minus for kebab-case options
> --
>
> Key: CLI-322
> URL: https://issues.apache.org/jira/browse/CLI-322
> Project: Commons CLI
>  Issue Type: New Feature
>  Components: Parser
>Affects Versions: 1.6.0
>Reporter: Claude Warren
>Assignee: Claude Warren
>Priority: Minor
> Fix For: 1.8.1
>
>
> Currently minus (“-“) is not allowed in option names,
> which makes common long options in kebab-case
> (like {{--is-not-allowed}}) impossible.
> This change is to allow it inside an option name.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (LOGGING-192) NoClassDefFoundError: org/apache/logging/log4j/spi/LoggerAdapter when using custom classloader

2024-05-23 Thread Gary D. Gregory (Jira)


[ 
https://issues.apache.org/jira/browse/LOGGING-192?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17849119#comment-17849119
 ] 

Gary D. Gregory commented on LOGGING-192:
-

CC [~pkarwasz]

> NoClassDefFoundError: org/apache/logging/log4j/spi/LoggerAdapter when using 
> custom classloader
> --
>
> Key: LOGGING-192
> URL: https://issues.apache.org/jira/browse/LOGGING-192
> Project: Commons Logging
>  Issue Type: Bug
>Affects Versions: 1.3.0, 1.3.1, 1.3.2
> Environment: This behavior was observed while running Adopt Open JDK 
> 11 and the latest version of Tomcat 9.  The behavior can be reproduced 
> outside of tomcat (see attached reproduction case).
>Reporter: Dave Dority
>Priority: Major
> Attachments: commons-logging-classloading-issue.zip
>
>
> If you have:
>  * A web application running in Tomcat which contains commons-logging:1.2
>  * That web application contains a custom classloader for loading a 
> seperately distributed software component (whose dependencies will conflict 
> with the dependencies of the web application).
>  * The software component uses commons-logging:1.3.2
> When the web application attempts use software component, the code 
> [here|https://github.com/apache/commons-logging/blob/rel/commons-logging-1.3.2/src/main/java/org/apache/commons/logging/LogFactory.java#L918-L938]
>  looks for the presence of different logging implementation classes on the 
> thread context classloader's (TCCL) classpath to select an optimal 
> implementation.  It seems like what is happening is that the LogFactory class 
> looking for implementation class on the TCCL's classpath and the trying to 
> load the selected factory from the web application's custom classloader (the 
> loader for the instance of LogFactory that is running).  This is the result:
> {code:java}
> Exception in thread "main" java.lang.NoClassDefFoundError: 
> org/apache/logging/log4j/spi/LoggerAdapter
>         at java.base/java.lang.Class.forName0(Native Method)
>         at java.base/java.lang.Class.forName(Class.java:315)
>         at 
> org.apache.commons.logging.LogFactory.createFactory(LogFactory.java:419)
>         at 
> org.apache.commons.logging.LogFactory.lambda$newFactory$3(LogFactory.java:1431)
>         at java.base/java.security.AccessController.doPrivileged(Native 
> Method)
>         at 
> org.apache.commons.logging.LogFactory.newFactory(LogFactory.java:1431)
>         at 
> org.apache.commons.logging.LogFactory.getFactory(LogFactory.java:928)
>         at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:987)
>         at 
> org.component.ClassLoadedComponent.(ClassLoadedComponent.java:7)
>         at 
> java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native
>  Method)
>         at 
> java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
>         at 
> java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
>         at 
> java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
>         at java.base/java.lang.Class.newInstance(Class.java:584){code}
> This occurs when the web application has commons-logging:1.2 and the software 
> component has commons-logging:1.3.x.  This does not occur when both are using 
> version 1.2. 
> Unfortunately, changing the web application's version of commons-logging is 
> outside is not something I can influence.
> An isolated reproduction case is attached.  It requires Java 11.  To run it:
>  * Unzip it to a directory.
>  * Run 
> {code:java}
> ./gradlew reproduceIssue{code}
>   



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Updated] (LOGGING-192) NoClassDefFoundError: org/apache/logging/log4j/spi/LoggerAdapter when using custom classloader

2024-05-23 Thread Gary D. Gregory (Jira)


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

Gary D. Gregory updated LOGGING-192:

Fix Version/s: (was: 2.0)
   (was: 1.3.3)

> NoClassDefFoundError: org/apache/logging/log4j/spi/LoggerAdapter when using 
> custom classloader
> --
>
> Key: LOGGING-192
> URL: https://issues.apache.org/jira/browse/LOGGING-192
> Project: Commons Logging
>  Issue Type: Bug
>Affects Versions: 1.3.0, 1.3.1, 1.3.2
> Environment: This behavior was observed while running Adopt Open JDK 
> 11 and the latest version of Tomcat 9.  The behavior can be reproduced 
> outside of tomcat (see attached reproduction case).
>Reporter: Dave Dority
>Priority: Major
> Attachments: commons-logging-classloading-issue.zip
>
>
> If you have:
>  * A web application running in Tomcat which contains commons-logging:1.2
>  * That web application contains a custom classloader for loading a 
> seperately distributed software component (whose dependencies will conflict 
> with the dependencies of the web application).
>  * The software component uses commons-logging:1.3.2
> When the web application attempts use software component, the code 
> [here|https://github.com/apache/commons-logging/blob/rel/commons-logging-1.3.2/src/main/java/org/apache/commons/logging/LogFactory.java#L918-L938]
>  looks for the presence of different logging implementation classes on the 
> thread context classloader's (TCCL) classpath to select an optimal 
> implementation.  It seems like what is happening is that the LogFactory class 
> looking for implementation class on the TCCL's classpath and the trying to 
> load the selected factory from the web application's custom classloader (the 
> loader for the instance of LogFactory that is running).  This is the result:
> {code:java}
> Exception in thread "main" java.lang.NoClassDefFoundError: 
> org/apache/logging/log4j/spi/LoggerAdapter
>         at java.base/java.lang.Class.forName0(Native Method)
>         at java.base/java.lang.Class.forName(Class.java:315)
>         at 
> org.apache.commons.logging.LogFactory.createFactory(LogFactory.java:419)
>         at 
> org.apache.commons.logging.LogFactory.lambda$newFactory$3(LogFactory.java:1431)
>         at java.base/java.security.AccessController.doPrivileged(Native 
> Method)
>         at 
> org.apache.commons.logging.LogFactory.newFactory(LogFactory.java:1431)
>         at 
> org.apache.commons.logging.LogFactory.getFactory(LogFactory.java:928)
>         at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:987)
>         at 
> org.component.ClassLoadedComponent.(ClassLoadedComponent.java:7)
>         at 
> java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native
>  Method)
>         at 
> java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
>         at 
> java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
>         at 
> java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
>         at java.base/java.lang.Class.newInstance(Class.java:584){code}
> This occurs when the web application has commons-logging:1.2 and the software 
> component has commons-logging:1.3.x.  This does not occur when both are using 
> version 1.2. 
> Unfortunately, changing the web application's version of commons-logging is 
> outside is not something I can influence.
> An isolated reproduction case is attached.  It requires Java 11.  To run it:
>  * Unzip it to a directory.
>  * Run 
> {code:java}
> ./gradlew reproduceIssue{code}
>   



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Created] (LOGGING-192) NoClassDefFoundError: org/apache/logging/log4j/spi/LoggerAdapter when using custom classloader

2024-05-23 Thread Dave Dority (Jira)
Dave Dority created LOGGING-192:
---

 Summary: NoClassDefFoundError: 
org/apache/logging/log4j/spi/LoggerAdapter when using custom classloader
 Key: LOGGING-192
 URL: https://issues.apache.org/jira/browse/LOGGING-192
 Project: Commons Logging
  Issue Type: Bug
Affects Versions: 1.3.2, 1.3.1, 1.3.0
 Environment: This behavior was observed while running Adopt Open JDK 
11 and the latest version of Tomcat 9.  The behavior can be reproduced outside 
of tomcat (see attached reproduction case).
Reporter: Dave Dority
 Fix For: 2.0, 1.3.3
 Attachments: commons-logging-classloading-issue.zip

If you have:
 * A web application running in Tomcat which contains commons-logging:1.2
 * That web application contains a custom classloader for loading a seperately 
distributed software component (whose dependencies will conflict with the 
dependencies of the web application).
 * The software component uses commons-logging:1.3.2

When the web application attempts use software component, the code 
[here|https://github.com/apache/commons-logging/blob/rel/commons-logging-1.3.2/src/main/java/org/apache/commons/logging/LogFactory.java#L918-L938]
 looks for the presence of different logging implementation classes on the 
thread context classloader's (TCCL) classpath to select an optimal 
implementation.  It seems like what is happening is that the LogFactory class 
looking for implementation class on the TCCL's classpath and the trying to load 
the selected factory from the web application's custom classloader (the loader 
for the instance of LogFactory that is running).  This is the result:


{code:java}
Exception in thread "main" java.lang.NoClassDefFoundError: 
org/apache/logging/log4j/spi/LoggerAdapter
        at java.base/java.lang.Class.forName0(Native Method)
        at java.base/java.lang.Class.forName(Class.java:315)
        at 
org.apache.commons.logging.LogFactory.createFactory(LogFactory.java:419)
        at 
org.apache.commons.logging.LogFactory.lambda$newFactory$3(LogFactory.java:1431)
        at java.base/java.security.AccessController.doPrivileged(Native Method)
        at 
org.apache.commons.logging.LogFactory.newFactory(LogFactory.java:1431)
        at org.apache.commons.logging.LogFactory.getFactory(LogFactory.java:928)
        at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:987)
        at 
org.component.ClassLoadedComponent.(ClassLoadedComponent.java:7)
        at 
java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native
 Method)
        at 
java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
        at 
java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at 
java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
        at java.base/java.lang.Class.newInstance(Class.java:584){code}

This occurs when the web application has commons-logging:1.2 and the software 
component has commons-logging:1.3.x.  This does not occur when both are using 
version 1.2. 

Unfortunately, changing the web application's version of commons-logging is 
outside is not something I can influence.

An isolated reproduction case is attached.  It requires Java 11.  To run it:
 * Unzip it to a directory.
 * Run 
{code:java}
./gradlew reproduceIssue{code}
  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


Re: [PR] CONFIGURATION-846 restore previous behavior allowing spring to inject multiple values [commons-configuration]

2024-05-23 Thread via GitHub


kbarlowgw commented on PR #425:
URL: 
https://github.com/apache/commons-configuration/pull/425#issuecomment-2127989266

   Sorry for the delay... Unfortunately I did encounter an error (full error
   attached):
   
   "loggerName":
   "org.springframework.boot.diagnostics.LoggingFailureAnalysisReporter",
   "message": "Application failed to start due to an exception",
   "thrown":
   {
   "commonElementCount": 0,
   "localizedMessage": "Failed to bind properties under
   'server.compression.enabled' to boolean",
   "message": "Failed to bind properties under
   'server.compression.enabled' to boolean",
   "name":
   "org.springframework.boot.context.properties.bind.BindException",
   "cause":
   {
   "commonElementCount": 94,
   "localizedMessage": "Failed to convert from type
   [java.lang.String[]] to type [boolean] for value [null]",
   "message": "Failed to convert from type [java.lang.String[]] to
   type [boolean] for value [null]",
   "name":
   "org.springframework.core.convert.ConversionFailedException",
   "cause":
   {
   "commonElementCount": 94,
   "localizedMessage": "A null value cannot be assigned to a
   primitive type",
   "message": "A null value cannot be assigned to a primitive
   type",
   "name": "java.lang.IllegalArgumentException",
   "extendedStackTrace":
   [
   
   I think what you want is:
   
   @Override
   public Object getProperty(final String name) {
 final String[] propValue = source.getStringArray(name);
 if (propValue == null || propValue.length == 0) {
   return null;
 } else if (propValue.length == 1) {
   return propValue[0];
 } else return propValue;
   }
   
   
   On Thu, May 23, 2024 at 1:26 PM Gary Gregory ***@***.***>
   wrote:
   
   > I would like to hear from @kbarlowgw
   > 
   > and if this PR affects the use case from #309
   > 
   > negatively...
   >
   > —
   > Reply to this email directly, view it on GitHub
   > 
,
   > or unsubscribe
   > 

   > .
   > You are receiving this because you were mentioned.Message ID:
   > ***@***.***>
   >
   


-- 
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-unsubscr...@commons.apache.org

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



Re: [PR] Change visibility of PropertyUtilsBean.getReadMethod(Class, PropertyDescriptor) [commons-beanutils]

2024-05-23 Thread via GitHub


garydgregory commented on PR #232:
URL: 
https://github.com/apache/commons-beanutils/pull/232#issuecomment-2127934355

   @doublep 
   We can break BC in a major release like 2.0.0. The question really is: What 
is the best design? WDYT?
   


-- 
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-unsubscr...@commons.apache.org

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



Re: [PR] CONFIGURATION-846 restore previous behavior allowing spring to inject multiple values [commons-configuration]

2024-05-23 Thread via GitHub


garydgregory commented on PR #425:
URL: 
https://github.com/apache/commons-configuration/pull/425#issuecomment-2127691962

   I would like to hear from @kbarlowgw and if this PR affects the use case 
from #309 negatively...


-- 
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-unsubscr...@commons.apache.org

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



Re: [PR] Bump org.apache.commons:commons-parent from 69 to 70 [commons-io]

2024-05-23 Thread via GitHub


garydgregory merged PR #628:
URL: https://github.com/apache/commons-io/pull/628


-- 
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-unsubscr...@commons.apache.org

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



Re: [PR] Bump org.apache.commons:commons-parent from 69 to 70 [commons-io]

2024-05-23 Thread via GitHub


garydgregory commented on PR #628:
URL: https://github.com/apache/commons-io/pull/628#issuecomment-2127402763

   @dependabot rebase


-- 
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-unsubscr...@commons.apache.org

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



Re: [PR] Bump org.codehaus.mojo:exec-maven-plugin from 3.2.0 to 3.3.0 [commons-io]

2024-05-23 Thread via GitHub


garydgregory merged PR #632:
URL: https://github.com/apache/commons-io/pull/632


-- 
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-unsubscr...@commons.apache.org

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



Re: [PR] Bump commons.bytebuddy.version from 1.14.15 to 1.14.16 [commons-io]

2024-05-23 Thread via GitHub


garydgregory merged PR #631:
URL: https://github.com/apache/commons-io/pull/631


-- 
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-unsubscr...@commons.apache.org

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



Re: [PR] Bump org.codehaus.mojo:exec-maven-plugin from 3.2.0 to 3.3.0 [commons-lang]

2024-05-23 Thread via GitHub


garydgregory merged PR #1224:
URL: https://github.com/apache/commons-lang/pull/1224


-- 
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-unsubscr...@commons.apache.org

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



Re: [PR] Bump commons.bytebuddy.version from 1.14.15 to 1.14.16 [commons-text]

2024-05-23 Thread via GitHub


garydgregory merged PR #548:
URL: https://github.com/apache/commons-text/pull/548


-- 
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-unsubscr...@commons.apache.org

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



Re: [PR] IO-831 Support https & http by URIOrigin [commons-io]

2024-05-23 Thread via GitHub


garydgregory commented on code in PR #630:
URL: https://github.com/apache/commons-io/pull/630#discussion_r1611790377


##
src/test/java/org/apache/commons/io/build/AbstractOriginTest.java:
##
@@ -130,4 +133,12 @@ public void testGetWriter() throws IOException {
 public void testSize() throws IOException {
 assertEquals(Files.size(Paths.get(FILE_NAME_RO)), 
getOriginRo().getByteArray().length);
 }
+
+@Test
+public void testURI() throws Exception {

Review Comment:
   This test is in the wrong class, it does not do anything generic that would 
apply to all of its subclasses. Use `URIOriginTest`



-- 
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-unsubscr...@commons.apache.org

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



Re: [PR] CONFIGURATION-846 restore previous behavior allowing spring to inject multiple values [commons-configuration]

2024-05-23 Thread via GitHub


abollini commented on PR #425:
URL: 
https://github.com/apache/commons-configuration/pull/425#issuecomment-2127239110

   hi @garydgregory thanks for looking to that.
   I have updated the PR to flag the variable as final as by your suggestion. I 
confirm that the expectation is to have preserved the goal of the fix for 
CONFIGURATION-834
   Indeed, the test introduced by @kbarlowgw is still there
   
https://github.com/apache/commons-configuration/pull/425/files#diff-b3d5f2d39a771e588b33d0d9719c4edcbbdaf3059bca13b4f70d7e0226d74ee8R106
   
   I have only updated the test value to make the test more reliable, moreover 
in the test that I have added for the multiple values the interpolation is also 
checked
   
https://github.com/apache/commons-configuration/pull/425/files#diff-b3d5f2d39a771e588b33d0d9719c4edcbbdaf3059bca13b4f70d7e0226d74ee8R115


-- 
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-unsubscr...@commons.apache.org

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



Re: [PR] Bump org.codehaus.mojo:exec-maven-plugin from 3.2.0 to 3.3.0 [commons-lang]

2024-05-23 Thread via GitHub


garydgregory commented on PR #1224:
URL: https://github.com/apache/commons-lang/pull/1224#issuecomment-2127234688

   @dependabot rebase


-- 
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-unsubscr...@commons.apache.org

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



Re: [PR] Same changes as [TEXT-234] [commons-lang]

2024-05-23 Thread via GitHub


garydgregory merged PR #1223:
URL: https://github.com/apache/commons-lang/pull/1223


-- 
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-unsubscr...@commons.apache.org

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



Re: [PR] LANG-1733: Add null handling features working with Java 8 specs [commons-lang]

2024-05-23 Thread via GitHub


garydgregory commented on code in PR #1215:
URL: https://github.com/apache/commons-lang/pull/1215#discussion_r1611600584


##
src/main/java/org/apache/commons/lang3/function/Consumers.java:
##
@@ -46,4 +46,17 @@ private Consumers() {
 // No instances.
 }
 
+/**
+ * Applies the given {@link Consumer} action to the object if the object 
is not null. If the object is null, it does
+ * nothing.
+ *
+ * @param object the object to be consumed.
+ * @param consumer the consumer to consume.
+ * @param  the type of the argument the consumer accepts.
+ */
+public static  void acceptIfNotNull(final T object, final Consumer 
consumer) {

Review Comment:
   I disagree that the API is noop if the input to the functional object is 
null. A lot of APIs accept null as valid input, for example to reset a value to 
its default.
   



##
src/main/java/org/apache/commons/lang3/function/Functions.java:
##
@@ -41,4 +41,20 @@ public static  Function function(final 
Function function) {
 private Functions() {
 // no instances needed.
 }
+
+/**
+ * Applies the {@link Function} on the object if the object and the 
function are not {@code null}. Otherwise, do
+ * nothing.
+ *
+ * @param object the object to apply the function.
+ * @param function the function to apply.
+ * @param  the type of the argument the function applies.
+ * @param  the type of the result the function returns.
+ * @return the value the function returns if the object and the function 
are not {@code null}; {@code null}
+ * otherwise.
+ * @since 3.15.0
+ */
+public static  R applyIfNotNull(final T object, final Function 
function) {
+return object != null && function != null ? function.apply(object) : 
null;

Review Comment:
   I disagree that the API is noop if the input to the functional object is 
null. A lot of APIs accept null as valid input, for example to reset a value to 
its default.
   



-- 
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-unsubscr...@commons.apache.org

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



[jira] [Resolved] (LANG-1736) Pair.hashCode() leads to a lot of hash collisions

2024-05-23 Thread Gary D. Gregory (Jira)


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

Gary D. Gregory resolved LANG-1736.
---
Resolution: Information Provided

> Pair.hashCode() leads to a lot of hash collisions
> -
>
> Key: LANG-1736
> URL: https://issues.apache.org/jira/browse/LANG-1736
> Project: Commons Lang
>  Issue Type: Improvement
>  Components: lang.tuple.*
>Affects Versions: 3.14.0
>Reporter: TobiasKiecker
>Priority: Trivial
> Attachments: Main.java
>
>
> The implementation of Pair.hashCode() has hash collisions for most java 
> primitives with close values. This could affect the performance of maps with 
> pairs as keys.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Resolved] (LANG-1735) Fix Javadoc for FluentBitSet.setInclusive(int, int)

2024-05-23 Thread Gary D. Gregory (Jira)


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

Gary D. Gregory resolved LANG-1735.
---
Fix Version/s: 3.15.0
   Resolution: Fixed

> Fix Javadoc for FluentBitSet.setInclusive(int, int)
> ---
>
> Key: LANG-1735
> URL: https://issues.apache.org/jira/browse/LANG-1735
> Project: Commons Lang
>  Issue Type: Improvement
>  Components: lang.*
>Affects Versions: 3.14.0
>Reporter: TobiasKiecker
>Priority: Minor
>  Labels: documentation
> Fix For: 3.15.0
>
>
> Documentation states toIndex "exclusive" should be "inclusive" based on 
> function name and actual implementation.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


Re: [PR] [LANG-1735] Fix Javadoc for FluentBitSet.setInclusive(int, int) [commons-lang]

2024-05-23 Thread via GitHub


garydgregory merged PR #1222:
URL: https://github.com/apache/commons-lang/pull/1222


-- 
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-unsubscr...@commons.apache.org

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



[jira] [Updated] (LANG-1735) Fix Javadoc for FluentBitSet.setInclusive(int, int)

2024-05-23 Thread Gary D. Gregory (Jira)


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

Gary D. Gregory updated LANG-1735:
--
Summary: Fix Javadoc for FluentBitSet.setInclusive(int, int)  (was: Improve 
FluentBitSet documentation for setInclusive)

> Fix Javadoc for FluentBitSet.setInclusive(int, int)
> ---
>
> Key: LANG-1735
> URL: https://issues.apache.org/jira/browse/LANG-1735
> Project: Commons Lang
>  Issue Type: Improvement
>  Components: lang.*
>Affects Versions: 3.14.0
>Reporter: TobiasKiecker
>Priority: Minor
>  Labels: documentation
>
> Documentation states toIndex "exclusive" should be "inclusive" based on 
> function name and actual implementation.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


Re: [PR] [LANG-1735] Fix Javadoc for FluentBitSet.setInclusive(int, int) [commons-lang]

2024-05-23 Thread via GitHub


garydgregory commented on PR #1222:
URL: https://github.com/apache/commons-lang/pull/1222#issuecomment-2126952967

   https://issues.apache.org/jira/browse/LANG-1735
   


-- 
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-unsubscr...@commons.apache.org

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



Re: [PR] Bump org.apache.commons:commons-parent from 69 to 70 [commons-lang]

2024-05-23 Thread via GitHub


garydgregory commented on PR #1217:
URL: https://github.com/apache/commons-lang/pull/1217#issuecomment-2126943315

   @dependabot rebase


-- 
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-unsubscr...@commons.apache.org

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



[jira] [Updated] (NET-730) Cannot connect to FTP server with HTTP proxy

2024-05-23 Thread Johannes Thalmair (Jira)


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

Johannes Thalmair updated NET-730:
--
Description: 
After updating from Commons Net 3.9.0 to 3.10.0, I can no longer connect to an 
FTP server with an HTTP proxy that requires authorization. Sadly I do not have 
direct access to that server and don't know which proxy is running there. A try 
to connect just blocks for 5 minutes and then fails with an IOException: No 
response from proxy

    at org.apache.commons.net.ftp.FTPHTTPClient .tunnelHandshake(FTPHTTPClient 
.java:209)

    at org.apache.commons.net.ftp.FTPHTTPClient .connect(FTPHTTPClient 
.java:173)

 

I'm using the org.apache.commons.net.ftp.FTPHTTPClient for connecting and 
already did some debugging. The change that causes my problem is the switch 
from the deprecated 
org.apache.commons.net.util.Base64.{{{}encodeToString(byte[]){}}} to 
java.util.Base64.getEncoder().encodeToString({{{}byte[]{}}}) to encode the 
Proxy-Authorization header in FTPHTTPClient.tunnelHandshake() (see 
[https://github.com/apache/commons-net/commit/396bade29ad98d20a2c039ac561db56b63018b39])
 The old encoding method added a CRLF / "\r\n" to the end of the String, while 
the new one does not. This specific proxy seems to expect it, I don't know if 
others do, too.

  was:
After updating from Commons Net 3.9.0 to 3.10.0, I can no longer connect to an 
FTP server with an HTTP proxy that requires authorization. Sadly I do not have 
direct access to that server and don't know which proxy is running there. A try 
to connect just blocks for 5 minutes and then fails with an IOException: No 
response from proxy

    at org.apache.commons.net.ftp.FTPHTTPClient .tunnelHandshake(FTPHTTPClient 
.java:209)

    at org.apache.commons.net.ftp.FTPHTTPClient .connect(FTPHTTPClient 
.java:173)

 

I'm using the org.apache.commons.net.ftp.FTPHTTPClient for connecting and 
already did some debugging. The change that causes my problem is the switch 
from the deprecated 
org.apache.commons.net.util.Base64.{{{}encodeToString(byte[]){}}} to 
java.util.Base64.getEncoder().encodeToString({{{}byte[]{}}}) to encode the 
Proxy-Authorization header in FTPHTTPClient.tunnelHandshake() (see 
[[https://github.com/apache/commons-net/commit/396bade29ad98d20a2c039ac561db56b63018b39])
 The old encoding method added a CRLF / "\r\n" to the end of the String, while 
the new one does not. This specific proxy seems to expect it, I don't know if 
others do, too.


> Cannot connect to FTP server with HTTP proxy
> 
>
> Key: NET-730
> URL: https://issues.apache.org/jira/browse/NET-730
> Project: Commons Net
>  Issue Type: Bug
>  Components: FTP
>Affects Versions: 3.10.0
>Reporter: Johannes Thalmair
>Priority: Major
>
> After updating from Commons Net 3.9.0 to 3.10.0, I can no longer connect to 
> an FTP server with an HTTP proxy that requires authorization. Sadly I do not 
> have direct access to that server and don't know which proxy is running 
> there. A try to connect just blocks for 5 minutes and then fails with an 
> IOException: No response from proxy
>     at org.apache.commons.net.ftp.FTPHTTPClient 
> .tunnelHandshake(FTPHTTPClient .java:209)
>     at org.apache.commons.net.ftp.FTPHTTPClient .connect(FTPHTTPClient 
> .java:173)
>  
> I'm using the org.apache.commons.net.ftp.FTPHTTPClient for connecting and 
> already did some debugging. The change that causes my problem is the switch 
> from the deprecated 
> org.apache.commons.net.util.Base64.{{{}encodeToString(byte[]){}}} to 
> java.util.Base64.getEncoder().encodeToString({{{}byte[]{}}}) to encode the 
> Proxy-Authorization header in FTPHTTPClient.tunnelHandshake() (see 
> [https://github.com/apache/commons-net/commit/396bade29ad98d20a2c039ac561db56b63018b39])
>  The old encoding method added a CRLF / "\r\n" to the end of the String, 
> while the new one does not. This specific proxy seems to expect it, I don't 
> know if others do, too.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Updated] (NET-730) Cannot connect to FTP server with HTTP proxy

2024-05-23 Thread Johannes Thalmair (Jira)


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

Johannes Thalmair updated NET-730:
--
Description: 
After updating from Commons Net 3.9.0 to 3.10.0, I can no longer connect to an 
FTP server with an HTTP proxy that requires authorization. Sadly I do not have 
direct access to that server and don't know which proxy is running there. A try 
to connect just blocks for 5 minutes and then fails with an IOException: No 
response from proxy

    at org.apache.commons.net.ftp.FTPHTTPClient .tunnelHandshake(FTPHTTPClient 
.java:209)

    at org.apache.commons.net.ftp.FTPHTTPClient .connect(FTPHTTPClient 
.java:173)

 

I'm using the org.apache.commons.net.ftp.FTPHTTPClient for connecting and 
already did some debugging. The change that causes my problem is the switch 
from the deprecated 
org.apache.commons.net.util.Base64.{{{}encodeToString(byte[]){}}} to 
java.util.Base64.getEncoder().encodeToString({{{}byte[]{}}}) to encode the 
Proxy-Authorization header in FTPHTTPClient.tunnelHandshake() (see 
[[https://github.com/apache/commons-net/commit/396bade29ad98d20a2c039ac561db56b63018b39])
 The old encoding method added a CRLF / "\r\n" to the end of the String, while 
the new one does not. This specific proxy seems to expect it, I don't know if 
others do, too.

  was:
After updating from Commons Net 3.9.0 to 3.10.0, I can no longer connect to an 
FTP server with an HTTP proxy that requires authorization. Sadly I do not have 
direct access to that server and don't know which proxy is running there. A try 
to connect just blocks for 5 minutes and then fails with an IOException: No 
response from proxy

    at org.apache.commons.net.ftp.FTPHTTPClient .tunnelHandshake(FTPHTTPClient 
.java:209)

    at org.apache.commons.net.ftp.FTPHTTPClient .connect(FTPHTTPClient 
.java:173)

 

I'm using the org.apache.commons.net.ftp.FTPHTTPClient for connecting and 
already did some debugging. The change that causes my problem is the switch 
from the deprecated 
org.apache.commons.net.util.Base64.{{{}encodeToString(byte[]){}}} to 
java.util.Base64.getEncoder().encodeToString({{{}byte[]{}}}) to encode the 
Proxy-Authorization header in FTPHTTPClient.tunnelHandshake() (see [link commit 
on 
github|[https://github.com/apache/commons-net/commit/396bade29ad98d20a2c039ac561db56b63018b39]).]
 The old encoding method added a CRLF / "\r\n" to the end of the String, while 
the new one does not. This specific proxy seems to expect it, I don't know if 
others do, too.


> Cannot connect to FTP server with HTTP proxy
> 
>
> Key: NET-730
> URL: https://issues.apache.org/jira/browse/NET-730
> Project: Commons Net
>  Issue Type: Bug
>  Components: FTP
>Affects Versions: 3.10.0
>Reporter: Johannes Thalmair
>Priority: Major
>
> After updating from Commons Net 3.9.0 to 3.10.0, I can no longer connect to 
> an FTP server with an HTTP proxy that requires authorization. Sadly I do not 
> have direct access to that server and don't know which proxy is running 
> there. A try to connect just blocks for 5 minutes and then fails with an 
> IOException: No response from proxy
>     at org.apache.commons.net.ftp.FTPHTTPClient 
> .tunnelHandshake(FTPHTTPClient .java:209)
>     at org.apache.commons.net.ftp.FTPHTTPClient .connect(FTPHTTPClient 
> .java:173)
>  
> I'm using the org.apache.commons.net.ftp.FTPHTTPClient for connecting and 
> already did some debugging. The change that causes my problem is the switch 
> from the deprecated 
> org.apache.commons.net.util.Base64.{{{}encodeToString(byte[]){}}} to 
> java.util.Base64.getEncoder().encodeToString({{{}byte[]{}}}) to encode the 
> Proxy-Authorization header in FTPHTTPClient.tunnelHandshake() (see 
> [[https://github.com/apache/commons-net/commit/396bade29ad98d20a2c039ac561db56b63018b39])
>  The old encoding method added a CRLF / "\r\n" to the end of the String, 
> while the new one does not. This specific proxy seems to expect it, I don't 
> know if others do, too.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Created] (NET-730) Cannot connect to FTP server with HTTP proxy

2024-05-23 Thread Johannes Thalmair (Jira)
Johannes Thalmair created NET-730:
-

 Summary: Cannot connect to FTP server with HTTP proxy
 Key: NET-730
 URL: https://issues.apache.org/jira/browse/NET-730
 Project: Commons Net
  Issue Type: Bug
  Components: FTP
Affects Versions: 3.10.0
Reporter: Johannes Thalmair


After updating from Commons Net 3.9.0 to 3.10.0, I can no longer connect to an 
FTP server with an HTTP proxy that requires authorization. Sadly I do not have 
direct access to that server and don't know which proxy is running there. A try 
to connect just blocks for 5 minutes and then fails with an IOException: No 
response from proxy

    at org.apache.commons.net.ftp.FTPHTTPClient .tunnelHandshake(FTPHTTPClient 
.java:209)

    at org.apache.commons.net.ftp.FTPHTTPClient .connect(FTPHTTPClient 
.java:173)

 

I'm using the org.apache.commons.net.ftp.FTPHTTPClient for connecting and 
already did some debugging. The change that causes my problem is the switch 
from the deprecated 
org.apache.commons.net.util.Base64.{{{}encodeToString(byte[]){}}} to 
java.util.Base64.getEncoder().encodeToString({{{}byte[]{}}}) to encode the 
Proxy-Authorization header in FTPHTTPClient.tunnelHandshake() (see [link commit 
on 
github|[https://github.com/apache/commons-net/commit/396bade29ad98d20a2c039ac561db56b63018b39]).]
 The old encoding method added a CRLF / "\r\n" to the end of the String, while 
the new one does not. This specific proxy seems to expect it, I don't know if 
others do, too.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[PR] Fix TEXT-234 [commons-text]

2024-05-23 Thread via GitHub


TobiasKiecker opened a new pull request, #547:
URL: https://github.com/apache/commons-text/pull/547

   continued to implement changes to Javadoc as mentioned in: 
https://github.com/apache/commons-text/pull/546


-- 
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-unsubscr...@commons.apache.org

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



Re: [PR] Fixed TEXT-234 [commons-text]

2024-05-23 Thread via GitHub


TobiasKiecker commented on PR #546:
URL: https://github.com/apache/commons-text/pull/546#issuecomment-2126433466

   I will do that


-- 
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-unsubscr...@commons.apache.org

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



Re: [PR] Fixed TEXT-234 [commons-text]

2024-05-23 Thread via GitHub


TobiasKiecker closed pull request #546: Fixed TEXT-234
URL: https://github.com/apache/commons-text/pull/546


-- 
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-unsubscr...@commons.apache.org

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



[PR] Fix TEXT-234 [commons-lang]

2024-05-23 Thread via GitHub


TobiasKiecker opened a new pull request, #1223:
URL: https://github.com/apache/commons-lang/pull/1223

   Update StrBuilder.java to reflect changes made to commons-text with regards 
to newline. 
(https://github.com/apache/commons-text/commit/f934b1a539e483a54eeedd97394b5defde8254ea)


-- 
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-unsubscr...@commons.apache.org

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



[PR] fixed LANG-1735 [commons-lang]

2024-05-23 Thread via GitHub


TobiasKiecker opened a new pull request, #1222:
URL: https://github.com/apache/commons-lang/pull/1222

   fixed documentation


-- 
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-unsubscr...@commons.apache.org

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



Re: [PR] Update StrBuilder.java to be in line with changes proposed in TEXT-234 [commons-lang]

2024-05-23 Thread via GitHub


TobiasKiecker closed pull request #1221: Update StrBuilder.java to be in line 
with changes proposed in TEXT-234
URL: https://github.com/apache/commons-lang/pull/1221


-- 
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-unsubscr...@commons.apache.org

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



[jira] [Comment Edited] (STATISTICS-85) Quantile implementation

2024-05-23 Thread Alex Herbert (Jira)


[ 
https://issues.apache.org/jira/browse/STATISTICS-85?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17848547#comment-17848547
 ] 

Alex Herbert edited comment on STATISTICS-85 at 5/23/24 6:17 AM:
-

h2. Background

This ticket is related to STATISTICS-18: Port the Percentile class from Commons 
Math.

I originally started doing that and found several issues. The CM API is based 
on implementing the UnivariateStatistic interface. This will create 1 value 
given an input array. This is not ideal as it is often required to obtain 
multiple percentiles from the same array. This is solved by allowing the 
Percentile to cache a work array that is used for partitioning, and cache known 
values within that array that are correctly sorted (this speeds up repeats 
calls). The API is thus bloated by this restriction. The API is also tied to 
the type of data being processed (double[]). The full API is:
{code:java}
org.apache.commons.math4.legacy.stat.descriptive.rank

public class Percentile extends 
org.apache.commons.math4.legacy.stat.descriptive.AbstractUnivariateStatistic {
public Percentile();
public Percentile(double);
public Percentile(Percentile);
public void setData(double[]);
public void setData(double[], double[]);
public void setData(double[], int, int);
public void setData(double[], double[], int, int);
public double evaluate(double);
public double evaluate(double[], double);
public double evaluate(double[], double[], double);
public double evaluate(double[], int, int);
public double evaluate(double[], double[], int, int);
public double evaluate(double[], int, int, double);
public double evaluate(double[], double[], int, int, double);
public double getQuantile();
public void setQuantile(double);
public Percentile copy();
public Percentile$EstimationType getEstimationType();
public Percentile withEstimationType(Percentile$EstimationType);
public NaNStrategy getNaNStrategy();
public Percentile withNaNStrategy(NaNStrategy);
public KthSelector getKthSelector();
public PivotingStrategy getPivotingStrategy();
public Percentile withKthSelector(KthSelector);
public org.apache.commons.math4.legacy.stat.descriptive.UnivariateStatistic 
copy();

public abstract class Percentile$EstimationType extends
java.lang.Enum {
public static final Percentile$EstimationType LEGACY;
public static final Percentile$EstimationType R_1;
public static final Percentile$EstimationType R_2;
public static final Percentile$EstimationType R_3;
public static final Percentile$EstimationType R_4;
public static final Percentile$EstimationType R_5;
public static final Percentile$EstimationType R_6;
public static final Percentile$EstimationType R_7;
public static final Percentile$EstimationType R_8;
public static final Percentile$EstimationType R_9;
// Ties the enum to the double[] data type and to the KthSelector 
implementation
public double evaluate(double[], double, KthSelector);
// Only implemented in R_7: data, weights, p
public abstract double evaluate(double[], double[], double);
}
}

// Depends on:

org.apache.commons.math4.legacy.stat.ranking

public final class NaNStrategy extends java.lang.Enum {
public static final NaNStrategy MINIMAL;
public static final NaNStrategy MAXIMAL;
public static final NaNStrategy REMOVED;
public static final NaNStrategy FIXED;
public static final NaNStrategy FAILED;
}
{code}
The new Quantile API removes coupling to the double[] data type and allows 
multiple p values to be passed together. This allows the underlying 
implementation to reuse the algorithm from CM, or find an improvement given 
that all the positions to be sorted in the array are known.
h2. Bugs

There are two bugs in CM Percentile as shown:
{code:java}
@Test
void testCMBugs() {
// Always interpolates pairs so creates NaN when this is the upper value
// even if the upper value should be ignored
// Uses: low + 0.0 * (NaN - low)
// This also does an additional search for the upper value even when it
// is not used.
Percentile p = new Percentile().withNaNStrategy(NaNStrategy.FIXED);
Assertions.assertEquals(1, p.evaluate(new double[] {0, 1, 2}, 50));
Assertions.assertEquals(Double.NaN, p.evaluate(new double[] {0, 1, 
Double.NaN}, 50));

// Cannot use a NaNStrategy on the work array
Percentile p2 = new Percentile().withNaNStrategy(NaNStrategy.FAILED);
double[] x = {0, 1, Double.NaN};
Assertions.assertThrows(NotANumberException.class, () -> p2.evaluate(x, 
50));
// With a work array
p2.setData(x);
Assertions.assertDoesNotThrow(() -> p2.evaluate(50));
}
{code}
Note that the requirement to always interpolate {{{}v = a[i] * alpha * (a[i+1] 
- 

[jira] [Comment Edited] (STATISTICS-85) Quantile implementation

2024-05-23 Thread Alex Herbert (Jira)


[ 
https://issues.apache.org/jira/browse/STATISTICS-85?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17848547#comment-17848547
 ] 

Alex Herbert edited comment on STATISTICS-85 at 5/23/24 6:14 AM:
-

h2. Background

This ticket is related to STATISTICS-18: Port the Percentile class from Commons 
Math.

I originally started doing that and found several issues. The CM API is based 
on implementing the UnivariateStatistic interface. This will create 1 value 
given an input array. This is not ideal as it is often required to obtain 
multiple percentiles from the same array. This is solved by allowing the 
Percentile to cache a work array that is used for partitioning, and cache known 
values within that array that are correctly sorted (this speeds up repeats 
calls). The API is thus bloated by this restriction. The API is also tied to 
the type of data being processed (double[]). The full API is:
{code:java}
org.apache.commons.math4.legacy.stat.descriptive.rank

public class Percentile extends 
org.apache.commons.math4.legacy.stat.descriptive.AbstractUnivariateStatistic {
public Percentile();
public Percentile(double);
public Percentile(Percentile);
public void setData(double[]);
public void setData(double[], double[]);
public void setData(double[], int, int);
public void setData(double[], double[], int, int);
public double evaluate(double);
public double evaluate(double[], double);
public double evaluate(double[], double[], double);
public double evaluate(double[], int, int);
public double evaluate(double[], double[], int, int);
public double evaluate(double[], int, int, double);
public double evaluate(double[], double[], int, int, double);
public double getQuantile();
public void setQuantile(double);
public Percentile copy();
public Percentile$EstimationType getEstimationType();
public Percentile withEstimationType(Percentile$EstimationType);
public NaNStrategy getNaNStrategy();
public Percentile withNaNStrategy(NaNStrategy);
public KthSelector getKthSelector();
public PivotingStrategy getPivotingStrategy();
public Percentile withKthSelector(KthSelector);
public org.apache.commons.math4.legacy.stat.descriptive.UnivariateStatistic 
copy();

public abstract class Percentile$EstimationType extends
java.lang.Enum {
public static final Percentile$EstimationType LEGACY;
public static final Percentile$EstimationType R_1;
public static final Percentile$EstimationType R_2;
public static final Percentile$EstimationType R_3;
public static final Percentile$EstimationType R_4;
public static final Percentile$EstimationType R_5;
public static final Percentile$EstimationType R_6;
public static final Percentile$EstimationType R_7;
public static final Percentile$EstimationType R_8;
public static final Percentile$EstimationType R_9;
// Ties the enum to the double[] data type and to the KthSelector 
implementation
public double evaluate(double[], double, KthSelector);
// Only implemented in R_7: data, weights, p
public abstract double evaluate(double[], double[], double);
}
}

// Depends on:

org.apache.commons.math4.legacy.stat.ranking

public final class NaNStrategy extends java.lang.Enum {
public static final NaNStrategy MINIMAL;
public static final NaNStrategy MAXIMAL;
public static final NaNStrategy REMOVED;
public static final NaNStrategy FIXED;
public static final NaNStrategy FAILED;
}
{code}
The new Quantile API removes coupling to the double[] data type and allows 
multiple p values to be passed together. This allows the underlying 
implementation to reuse the algorithm from CM, or find an improvement given 
that all the positions to be sorted in the array are known.
h2. Bugs

There are two bugs in CM Percentile as shown:
{code:java}
@Test
void testCMBugs() {
// Always interpolates pairs so creates NaN when this is the upper value
// even if the upper value should be ignored
// Uses: low + 0.0 * (NaN - low)
// This also does an additional search for the upper value even when it
// is not used.
Percentile p = new Percentile().withNaNStrategy(NaNStrategy.FIXED);
Assertions.assertEquals(1, p.evaluate(new double[] {0, 1, 2}, 50));
Assertions.assertEquals(Double.NaN, p.evaluate(new double[] {0, 1, 
Double.NaN}, 50));

// Cannot use a NaNStrategy on the work array
Percentile p2 = new Percentile().withNaNStrategy(NaNStrategy.FAILED);
double[] x = {0, 1, Double.NaN};
Assertions.assertThrows(NotANumberException.class, () -> p2.evaluate(x, 
50));
// With a work array
p2.setData(x);
Assertions.assertDoesNotThrow(() -> p2.evaluate(50));
}
{code}
Note that the requirement to always interpolate {{v = a[i] * alpha * (a[i+1] - 

[jira] [Updated] (STATISTICS-85) Quantile implementation

2024-05-23 Thread Alex Herbert (Jira)


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

Alex Herbert updated STATISTICS-85:
---
Description: 
Add a quantile implementation. This will interpolate the value of a sorted 
array of data for probability p in [0, 1].

Replace the legacy API from Commons Math Percentile with an updated API. The 
new API should:
 * Decouple estimation of quantile positions inside data of length n; and the 
selection of correctly-ordered indices in array data.
 * Support multiple data types.
 * Support pre-sorted data.
 * Avoid performance issues observed in the CM Percentile implementation.

h2. Proposed API
{code:java}
org.apache.commons.statistics.descriptive

public final class Quantile {
// overwrite=true; EstimationMethod.HF8; NaNPolicy.ERROR
public static Quantile withDefaults();
public Quantile withOverwrite(boolean);
public Quantile with(EstimationMethod);

// Could support NaN handling ... see below for NaNPolicy
public Quantile with(NaNPolicy);

// Create n uniform probabilities in range [p1, p2]
public static double[] probabilities(int n);
public static double[] probabilities(int n, double p1, double p2);

// Quantiles on sorted data a of size n
public double evaluate(int n, java.util.function.IntToDoubleFunction a, 
double p);
public double[] evaluate(int n, java.util.function.IntToDoubleFunction a, 
double... p);

// Quantiles on the primitive types that cannot be easily sorted
public double evaluate(double[] a, double p);
public double[] evaluate(double[] a, double... p);
public double evaluate(int[] a, double p);
public double[] evaluate(int[] a, double... p);
public double evaluate(long[] a, double p);
public double[] evaluate(long[] a, double... p);
public double evaluate(float[] a, double p);
public double[] evaluate(float[] a, double... p);

// Provide the 9 methods in Hyndman and Fan (1996)
// Sample Quantiles in Statistical Packages.
// The American Statistician, 50, 361-365.
public abstract class Quantile$EstimationMethod extends
java.lang.Enum {
public static final Quantile$EstimationMethod HF1;
public static final Quantile$EstimationMethod HF2;
public static final Quantile$EstimationMethod HF3;
public static final Quantile$EstimationMethod HF4;
public static final Quantile$EstimationMethod HF5;
public static final Quantile$EstimationMethod HF6;
public static final Quantile$EstimationMethod HF7;
public static final Quantile$EstimationMethod HF8;
public static final Quantile$EstimationMethod HF9;
}
}

Note: The CM API used the 9 methods from Hyndman and Fann but labelled them as 
R1-9; this may be derived from the same names used in the R language. I propose 
to rename as HF1-9 to reflect the origin.

{code}
h2. NaNPolicy

There are multiple options here. For reference R and Python's numpy only 
provide the option to exclude NaN:
 * R: quantile errors if NaN is present. median returns NaN. They is an option 
to exclude NaN.
 * numpy: two methods are provided: median/nanmedian + quantile/nanquantile 
(the non-nan versions will return NaN if any NaNs are present)

Commons Math provides a remapping. Note the Statistics ranking module has the 
same NaNStrategy as that in CM:
 * MINIMAL: map to -infinity
 * MAXIMAL: map to +infinity
 * REMOVED: ignore from the data
 * FIXED: leave in place. This makes no sense for quantiles. It is done by 
moving to the end following the order imposed by Double.compare.
 * FAILED: raise an exception

I favour the simpler option of: treating NaN so they are above/below all other 
values; removing them from the data; or raising an exception. I do not see the 
requirement to remap NaN to infinity. This can be done by the user.

The API can be simplified by using:
{code:java}
public final class NaNPolicy extends java.lang.Enum {
public static final NaNPolicy LAST;// Move to end of data
public static final NaNPolicy FIRST;   // Move to start of data
public static final NaNPolicy REMOVE;  // Remove from data
public static final NaNPolicy ERROR;   // Raise exception
}
{code}
Note that the FIRST option is not strictly required. But if there is an option 
to order the NaNs (i.e. LAST) then both orders should be supported.

Which option to use as the default is not clear. As a drop in substitute for 
Arrays.sort the default would be handle NaN with a move to the end (LAST). As 
an API to signal to the user that the quantiles are possibly corrupted then 
ERROR would be the default. A user can then decide what to do if they receive 
errors during their analysis. Note that a separation of the Quantile API from 
the partitioning API (see below) may result in doing NaN processing twice 
introducing a performance overhead. If this will occur by default it should