Re: [commons-lang] 02/02: Add IntToIntFunction

2023-07-10 Thread Gary Gregory
You're right! Thank you. I'll clean it up.

Gary


On Mon, Jul 10, 2023, 09:18 Alex Herbert  wrote:

> Is this not the same as:
>
> java.util.function.IntUnaryOperator
>
> On Mon, 10 Jul 2023 at 12:56,  wrote:
> >
> > This is an automated email from the ASF dual-hosted git repository.
> >
> > ggregory pushed a commit to branch master
> > in repository https://gitbox.apache.org/repos/asf/commons-lang.git
> >
> > commit 120d3489aad924e310a8071a66139947ace7a685
> > Author: Gary Gregory 
> > AuthorDate: Mon Jul 10 07:56:18 2023 -0400
> >
> > Add IntToIntFunction
> > ---
> >  src/changes/changes.xml|  1 +
> >  .../commons/lang3/function/IntToIntFunction.java   | 52
> ++
> >  .../lang3/function/IntToIntFunctionTest.java   | 40
> +
> >  3 files changed, 93 insertions(+)
> >
> > diff --git a/src/changes/changes.xml b/src/changes/changes.xml
> > index b9930b0d2..a9d493949 100644
> > --- a/src/changes/changes.xml
> > +++ b/src/changes/changes.xml
> > @@ -216,6 +216,7 @@ The  type attribute can be
> add,update,fix,remove.
> >  Add and
> ExceptionUtils.isChecked() and isUnchecked() #1069
> >  Add and use ExceptionUtils.throwUnchecked(throwable).
> >  Add LockingVisitors.create(O, ReadWriteLock).
> > +Add IntToIntFunction.
> >  
> >   due-to="Dependabot, XenoAmess, Gary Gregory">Bump actions/cache from 2.1.4
> to 3.0.10 #742, #752, #764, #833, #867, #959, #964.
> >   due-to="Dependabot, Gary Gregory">Bump actions/checkout from 2 to 3.1.0
> #819, #825, #859, #963.
> > diff --git
> a/src/main/java/org/apache/commons/lang3/function/IntToIntFunction.java
> b/src/main/java/org/apache/commons/lang3/function/IntToIntFunction.java
> > new file mode 100644
> > index 0..45f309743
> > --- /dev/null
> > +++
> b/src/main/java/org/apache/commons/lang3/function/IntToIntFunction.java
> > @@ -0,0 +1,52 @@
> > +/*
> > + * Licensed to the Apache Software Foundation (ASF) under one or more
> > + * contributor license agreements.  See the NOTICE file distributed with
> > + * this work for additional information regarding copyright ownership.
> > + * The ASF licenses this file to You under the Apache License, Version
> 2.0
> > + * (the "License"); you may not use this file except in compliance with
> > + * the License.  You may obtain a copy of the License at
> > + *
> > + *  http://www.apache.org/licenses/LICENSE-2.0
> > + *
> > + * Unless required by applicable law or agreed to in writing, software
> > + * distributed under the License is distributed on an "AS IS" BASIS,
> > + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
> implied.
> > + * See the License for the specific language governing permissions and
> > + * limitations under the License.
> > + */
> > +
> > +package org.apache.commons.lang3.function;
> > +
> > +import java.util.function.Function;
> > +
> > +/**
> > + * Represents a function that accepts an int-valued argument and
> produces an int-valued result. This is the {@code int}-to-{@code int}
> primitive specialization
> > + * for {@link Function}.
> > + *
> > + * 
> > + * This is a functional interface
> whose functional method is {@link #applyAsInt(int)}.
> > + * 
> > + *
> > + * @see Function
> > + * @since 3.13.0
> > + */
> > +@FunctionalInterface
> > +public interface IntToIntFunction {
> > +
> > +/**
> > + * Returns a function that always returns its input argument.
> > + *
> > + * @return a function that always returns its input argument
> > + */
> > +static IntToIntFunction identity() {
> > +return i -> i;
> > +}
> > +
> > +/**
> > + * Applies this function to the given argument.
> > + *
> > + * @param value the function argument
> > + * @return the function result
> > + */
> > +int applyAsInt(int value);
> > +}
> > diff --git
> a/src/test/java/org/apache/commons/lang3/function/IntToIntFunctionTest.java
> b/src/test/java/org/apache/commons/lang3/function/IntToIntFunctionTest.java
> > new file mode 100644
> > index 0..d8d11ae07
> > --- /dev/null
> > +++
> b/src/test/java/org/apache/commons/lang3/function/IntToIntFunctionTest.java
> > @@ -0,0 +1,40 @@
> > +/*
> > + * Licensed to the Apache Software Foundation (ASF) under one or more
> > + * contributor license agreements.  See the NOTICE file distributed with
> > + * this work for additional information regarding copyright ownership.
> > + * The ASF licenses this file to You under the Apache License, Version
> 2.0
> > + * (the "License"); you may not use this file except in compliance with
> > + * the License.  You may obtain a copy of the License at
> > + *
> > + *  http://www.apache.org/licenses/LICENSE-2.0
> > + *
> > + * Unless required by applicable law or agreed to in writing, software
> > + * distributed under the License is distributed on an "AS IS" BASIS,
> > + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
> implied.
> > + * See the 

Re: [commons-lang] 02/02: Add IntToIntFunction

2023-07-10 Thread Alex Herbert
Is this not the same as:

java.util.function.IntUnaryOperator

On Mon, 10 Jul 2023 at 12:56,  wrote:
>
> This is an automated email from the ASF dual-hosted git repository.
>
> ggregory pushed a commit to branch master
> in repository https://gitbox.apache.org/repos/asf/commons-lang.git
>
> commit 120d3489aad924e310a8071a66139947ace7a685
> Author: Gary Gregory 
> AuthorDate: Mon Jul 10 07:56:18 2023 -0400
>
> Add IntToIntFunction
> ---
>  src/changes/changes.xml|  1 +
>  .../commons/lang3/function/IntToIntFunction.java   | 52 
> ++
>  .../lang3/function/IntToIntFunctionTest.java   | 40 +
>  3 files changed, 93 insertions(+)
>
> diff --git a/src/changes/changes.xml b/src/changes/changes.xml
> index b9930b0d2..a9d493949 100644
> --- a/src/changes/changes.xml
> +++ b/src/changes/changes.xml
> @@ -216,6 +216,7 @@ The  type attribute can be add,update,fix,remove.
>  Add and ExceptionUtils.isChecked() 
> and isUnchecked() #1069
>  Add and use ExceptionUtils.throwUnchecked(throwable).
>  Add LockingVisitors.create(O, ReadWriteLock).
> +Add IntToIntFunction.
>  
>   due-to="Dependabot, XenoAmess, Gary Gregory">Bump actions/cache from 2.1.4 to 
> 3.0.10 #742, #752, #764, #833, #867, #959, #964.
>   due-to="Dependabot, Gary Gregory">Bump actions/checkout from 2 to 3.1.0 #819, 
> #825, #859, #963.
> diff --git 
> a/src/main/java/org/apache/commons/lang3/function/IntToIntFunction.java 
> b/src/main/java/org/apache/commons/lang3/function/IntToIntFunction.java
> new file mode 100644
> index 0..45f309743
> --- /dev/null
> +++ b/src/main/java/org/apache/commons/lang3/function/IntToIntFunction.java
> @@ -0,0 +1,52 @@
> +/*
> + * Licensed to the Apache Software Foundation (ASF) under one or more
> + * contributor license agreements.  See the NOTICE file distributed with
> + * this work for additional information regarding copyright ownership.
> + * The ASF licenses this file to You under the Apache License, Version 2.0
> + * (the "License"); you may not use this file except in compliance with
> + * the License.  You may obtain a copy of the License at
> + *
> + *  http://www.apache.org/licenses/LICENSE-2.0
> + *
> + * Unless required by applicable law or agreed to in writing, software
> + * distributed under the License is distributed on an "AS IS" BASIS,
> + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
> + * See the License for the specific language governing permissions and
> + * limitations under the License.
> + */
> +
> +package org.apache.commons.lang3.function;
> +
> +import java.util.function.Function;
> +
> +/**
> + * Represents a function that accepts an int-valued argument and produces an 
> int-valued result. This is the {@code int}-to-{@code int} primitive 
> specialization
> + * for {@link Function}.
> + *
> + * 
> + * This is a functional interface whose 
> functional method is {@link #applyAsInt(int)}.
> + * 
> + *
> + * @see Function
> + * @since 3.13.0
> + */
> +@FunctionalInterface
> +public interface IntToIntFunction {
> +
> +/**
> + * Returns a function that always returns its input argument.
> + *
> + * @return a function that always returns its input argument
> + */
> +static IntToIntFunction identity() {
> +return i -> i;
> +}
> +
> +/**
> + * Applies this function to the given argument.
> + *
> + * @param value the function argument
> + * @return the function result
> + */
> +int applyAsInt(int value);
> +}
> diff --git 
> a/src/test/java/org/apache/commons/lang3/function/IntToIntFunctionTest.java 
> b/src/test/java/org/apache/commons/lang3/function/IntToIntFunctionTest.java
> new file mode 100644
> index 0..d8d11ae07
> --- /dev/null
> +++ 
> b/src/test/java/org/apache/commons/lang3/function/IntToIntFunctionTest.java
> @@ -0,0 +1,40 @@
> +/*
> + * Licensed to the Apache Software Foundation (ASF) under one or more
> + * contributor license agreements.  See the NOTICE file distributed with
> + * this work for additional information regarding copyright ownership.
> + * The ASF licenses this file to You under the Apache License, Version 2.0
> + * (the "License"); you may not use this file except in compliance with
> + * the License.  You may obtain a copy of the License at
> + *
> + *  http://www.apache.org/licenses/LICENSE-2.0
> + *
> + * Unless required by applicable law or agreed to in writing, software
> + * distributed under the License is distributed on an "AS IS" BASIS,
> + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
> + * See the License for the specific language governing permissions and
> + * limitations under the License.
> + */
> +
> +package org.apache.commons.lang3.function;
> +
> +import static org.junit.jupiter.api.Assertions.assertEquals;
> +
> +import org.apache.commons.lang3.AbstractLangTest;
> +import org.junit.jupiter.api.Test;
> +
> 

Re: commons-fileupload2-jakarta

2023-07-10 Thread Romain Manni-Bucau
Le lun. 10 juil. 2023 à 11:49, Gary Gregory  a
écrit :

> As we all (should) know, there is no way to tell how a much a jar file is
> used, beyond what Maven Central tells us, especially once within a
> company's network that use it's own repository like Artifactory...
>

(not sure I get your point) Do you mean there are so much application
servers which are not known? We are not in general case there and the end
user case was already covered so think it is one of the rare cases we know.


>
> Gary
>
> On Mon, Jul 10, 2023, 02:26 Romain Manni-Bucau 
> wrote:
>
> > @Dennis: good question but how many servers do reuse commons? I know most
> > of them reimplemented it (to own it or cause they dont use servlet or
> want
> > a reactive based API) or reused tomcat forked (payara for ex or other
> > tomcat based servers). So at the end I think the question is not "why"
> > which is a wish but more "does" and from my window fileupload is not a
> > common thing.
> >
> > Romain Manni-Bucau
> > @rmannibucau  |  Blog
> >  | Old Blog
> >  | Github <
> > https://github.com/rmannibucau> |
> > LinkedIn  | Book
> > <
> >
> https://www.packtpub.com/application-development/java-ee-8-high-performance
> > >
> >
> >
> > Le lun. 10 juil. 2023 à 07:33, Dennis Kieselhorst  a
> > écrit :
> >
> > > Hmm why should every server create it's own impl instead of sharing
> > > capabilities like multipart handling and parsing as a common library?
> > >
> > > I agree with the consumer part but the lib is still useful in the
> future
> > > to handle server side of things
> > >
> > > Dennis
> > >
> > > -
> > > To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
> > > For additional commands, e-mail: dev-h...@commons.apache.org
> > >
> > >
> >
>


Re: commons-fileupload2-jakarta

2023-07-10 Thread Gary Gregory
As we all (should) know, there is no way to tell how a much a jar file is
used, beyond what Maven Central tells us, especially once within a
company's network that use it's own repository like Artifactory...

Gary

On Mon, Jul 10, 2023, 02:26 Romain Manni-Bucau 
wrote:

> @Dennis: good question but how many servers do reuse commons? I know most
> of them reimplemented it (to own it or cause they dont use servlet or want
> a reactive based API) or reused tomcat forked (payara for ex or other
> tomcat based servers). So at the end I think the question is not "why"
> which is a wish but more "does" and from my window fileupload is not a
> common thing.
>
> Romain Manni-Bucau
> @rmannibucau  |  Blog
>  | Old Blog
>  | Github <
> https://github.com/rmannibucau> |
> LinkedIn  | Book
> <
> https://www.packtpub.com/application-development/java-ee-8-high-performance
> >
>
>
> Le lun. 10 juil. 2023 à 07:33, Dennis Kieselhorst  a
> écrit :
>
> > Hmm why should every server create it's own impl instead of sharing
> > capabilities like multipart handling and parsing as a common library?
> >
> > I agree with the consumer part but the lib is still useful in the future
> > to handle server side of things
> >
> > Dennis
> >
> > -
> > To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
> > For additional commands, e-mail: dev-h...@commons.apache.org
> >
> >
>


Re: commons-fileupload2-jakarta

2023-07-10 Thread Romain Manni-Bucau
@Dennis: good question but how many servers do reuse commons? I know most
of them reimplemented it (to own it or cause they dont use servlet or want
a reactive based API) or reused tomcat forked (payara for ex or other
tomcat based servers). So at the end I think the question is not "why"
which is a wish but more "does" and from my window fileupload is not a
common thing.

Romain Manni-Bucau
@rmannibucau  |  Blog
 | Old Blog
 | Github  |
LinkedIn  | Book



Le lun. 10 juil. 2023 à 07:33, Dennis Kieselhorst  a
écrit :

> Hmm why should every server create it's own impl instead of sharing
> capabilities like multipart handling and parsing as a common library?
>
> I agree with the consumer part but the lib is still useful in the future
> to handle server side of things
>
> Dennis
>
> -
> To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
> For additional commands, e-mail: dev-h...@commons.apache.org
>
>