Re: (commons-lang) 01/02: Deprecate SystemUtils.getUserName(String) in favor of SystemProperties.getUserName(Supplier)

2024-05-02 Thread Gary D. Gregory
I meant I'll only change the Suppliers to Strings. The deprecations are fine 
IMO. This is how I see it:

- Stock system property access is done through SystemProperties (you get 
Strings)
- More advanced services that require conversions like getting a Stream of 
Paths for a java.class.path is done elsewhere. 
- For example, SystemUtils gives you the 'user.home' string as a File belongs 
where it is now: File file = SystemUtils.getUserHome(). I don't think we need a 
User class for example.

Gary

On 2024/05/02 18:57:04 "Gary D. Gregory" wrote:
> Hi Bernd,
> 
> Sounds reasonable. I'll revert the deprecation and use String defaults 
> instead of Suppliers.
> 
> Gary
> 
> On 2024/05/01 17:56:34 Bernd Eckenfels wrote:
> > Hi Gregory,
> > 
> > What’s the idea behind that deprecation? The implementation is robust and 
> > simple and easy to use. I would guess most user rather want to specify a 
> > literal fallback than a supplier.
> > 
> > Gruss
> > Bernd
> > 
> > ggreg...@apache.org wrote on 1. May 2024 16:07 (GMT +02:00):
> > 
> > > 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 794f8aaf1e5a573a63ba6ca514eeb794bd39d855
> > > Author: Gary Gregory 
> > > AuthorDate: Wed May 1 09:12:09 2024 -0400
> > > 
> > > Deprecate SystemUtils.getUserName(String) in favor of
> > > SystemProperties.getUserName(Supplier)
> > > ---
> > >  src/changes/changes.xml | 1 +
> > >  src/main/java/org/apache/commons/lang3/SystemUtils.java | 3 +++
> > >  2 files changed, 4 insertions(+)
> > > 
> > > diff --git a/src/changes/changes.xml b/src/changes/changes.xml
> > > index cdd3a0cd0..1d896a999 100644
> > > --- a/src/changes/changes.xml
> > > +++ b/src/changes/changes.xml
> > > @@ -123,6 +123,7 @@ The  type attribute can be
> > > add,update,fix,remove.
> > >  Fix Java version in README.md #1170.
> > >  StringUtils.stripAccents() should handle
> > >  ligatures, UTF32 math blocks, etc. #1201.
> > >   > >  due-to="kijong.youn, Aakash Gupta, Gary
> > >  Gregory">TypeUtils.toString(Type) StackOverflowError for an inner
> > >  class in the inner class parameterized enclosing class #657.
> > > +Deprecate SystemUtils.getUserName(String) in favor of
> > > SystemProperties.getUserName(Supplier).
> > >  
> > >   > >  due-to="Dependabot">Bump commons-parent from 64 to 69 #1194.
> > >   > >  due-to="Dependabot">Bump org.codehaus.mojo:exec-maven-plugin from
> > >  3.1.1 to 3.2.0 #1175.
> > > diff --git a/src/main/java/org/apache/commons/lang3/SystemUtils.java
> > > b/src/main/java/org/apache/commons/lang3/SystemUtils.java
> > > index cbb4721fb..8044fd4b0 100644
> > > --- a/src/main/java/org/apache/commons/lang3/SystemUtils.java
> > > +++ b/src/main/java/org/apache/commons/lang3/SystemUtils.java
> > > @@ -17,6 +17,7 @@
> > >  package org.apache.commons.lang3;
> > >  
> > >  import java.io.File;
> > > +import java.util.function.Supplier;
> > >  
> > >  /**
> > >   * Helpers for {@link System}.
> > > @@ -2041,7 +2042,9 @@ public class SystemUtils {
> > >   * access to the specified system property.
> > >   * @see SystemProperties#getUserName()
> > >   * @since 3.10
> > > + * @deprecated Use {@link SystemProperties#getUserName(Supplier)}.
> > >   */
> > > +@Deprecated
> > >  public static String getUserName(final String defaultValue) {
> > >  return System.getProperty(SystemProperties.USER_NAME,
> > >  defaultValue);
> > >  }
> > > 
> > > 
> > 
> > 
> > Gruß
> > Bernd
> > — 
> > https://bernd.eckenfels.net
> > 
> > -
> > To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
> > For additional commands, e-mail: dev-h...@commons.apache.org
> > 
> > 
> 
> -
> To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
> For additional commands, e-mail: dev-h...@commons.apache.org
> 
> 

-
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org



Re: (commons-lang) 01/02: Deprecate SystemUtils.getUserName(String) in favor of SystemProperties.getUserName(Supplier)

2024-05-02 Thread Gary D. Gregory
Hello Elliotte,

OK, I'll use String defaults instead of Suppliers.

Gary

On 2024/05/02 16:48:48 Elliotte Rusty Harold wrote:
> I'm OK with preferring SystemProperties though I'm not sure that
> alpine justifies a new method and deprecation.
> 
> I second the opinion that a literal string is strongly preferable to a
> Supplier here. Pick the simplest thing that could possibly work. As
> Knuth warned us, premature optimization is the root of all evil in
> programming.
> 
> On Wed, May 1, 2024 at 1:56 PM Bernd Eckenfels  wrote:
> >
> > Hi Gregory,
> >
> > What’s the idea behind that deprecation? The implementation is robust and 
> > simple and easy to use. I would guess most user rather want to specify a 
> > literal fallback than a supplier.
> >
> > Gruss
> > Bernd
> >
> > ggreg...@apache.org wrote on 1. May 2024 16:07 (GMT +02:00):
> >
> > > 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 794f8aaf1e5a573a63ba6ca514eeb794bd39d855
> > > Author: Gary Gregory 
> > > AuthorDate: Wed May 1 09:12:09 2024 -0400
> > >
> > > Deprecate SystemUtils.getUserName(String) in favor of
> > > SystemProperties.getUserName(Supplier)
> > > ---
> > >  src/changes/changes.xml | 1 +
> > >  src/main/java/org/apache/commons/lang3/SystemUtils.java | 3 +++
> > >  2 files changed, 4 insertions(+)
> > >
> > > diff --git a/src/changes/changes.xml b/src/changes/changes.xml
> > > index cdd3a0cd0..1d896a999 100644
> > > --- a/src/changes/changes.xml
> > > +++ b/src/changes/changes.xml
> > > @@ -123,6 +123,7 @@ The  type attribute can be
> > > add,update,fix,remove.
> > >  Fix Java version in README.md #1170.
> > >  StringUtils.stripAccents() should handle
> > >  ligatures, UTF32 math blocks, etc. #1201.
> > >   > >  due-to="kijong.youn, Aakash Gupta, Gary
> > >  Gregory">TypeUtils.toString(Type) StackOverflowError for an inner
> > >  class in the inner class parameterized enclosing class #657.
> > > +Deprecate SystemUtils.getUserName(String) in favor of
> > > SystemProperties.getUserName(Supplier).
> > >  
> > >   > >  due-to="Dependabot">Bump commons-parent from 64 to 69 #1194.
> > >   > >  due-to="Dependabot">Bump org.codehaus.mojo:exec-maven-plugin from
> > >  3.1.1 to 3.2.0 #1175.
> > > diff --git a/src/main/java/org/apache/commons/lang3/SystemUtils.java
> > > b/src/main/java/org/apache/commons/lang3/SystemUtils.java
> > > index cbb4721fb..8044fd4b0 100644
> > > --- a/src/main/java/org/apache/commons/lang3/SystemUtils.java
> > > +++ b/src/main/java/org/apache/commons/lang3/SystemUtils.java
> > > @@ -17,6 +17,7 @@
> > >  package org.apache.commons.lang3;
> > >
> > >  import java.io.File;
> > > +import java.util.function.Supplier;
> > >
> > >  /**
> > >   * Helpers for {@link System}.
> > > @@ -2041,7 +2042,9 @@ public class SystemUtils {
> > >   * access to the specified system property.
> > >   * @see SystemProperties#getUserName()
> > >   * @since 3.10
> > > + * @deprecated Use {@link SystemProperties#getUserName(Supplier)}.
> > >   */
> > > +@Deprecated
> > >  public static String getUserName(final String defaultValue) {
> > >  return System.getProperty(SystemProperties.USER_NAME,
> > >  defaultValue);
> > >  }
> > >
> > >
> >
> >
> > Gruß
> > Bernd
> > —
> > https://bernd.eckenfels.net
> >
> > -
> > To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
> > For additional commands, e-mail: dev-h...@commons.apache.org
> >
> 
> 
> -- 
> Elliotte Rusty Harold
> elh...@ibiblio.org
> 
> -
> To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
> For additional commands, e-mail: dev-h...@commons.apache.org
> 
> 

-
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org



Re: (commons-lang) 01/02: Deprecate SystemUtils.getUserName(String) in favor of SystemProperties.getUserName(Supplier)

2024-05-02 Thread Gary D. Gregory
Hi Bernd,

Sounds reasonable. I'll revert the deprecation and use String defaults instead 
of Suppliers.

Gary

On 2024/05/01 17:56:34 Bernd Eckenfels wrote:
> Hi Gregory,
> 
> What’s the idea behind that deprecation? The implementation is robust and 
> simple and easy to use. I would guess most user rather want to specify a 
> literal fallback than a supplier.
> 
> Gruss
> Bernd
> 
> ggreg...@apache.org wrote on 1. May 2024 16:07 (GMT +02:00):
> 
> > 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 794f8aaf1e5a573a63ba6ca514eeb794bd39d855
> > Author: Gary Gregory 
> > AuthorDate: Wed May 1 09:12:09 2024 -0400
> > 
> > Deprecate SystemUtils.getUserName(String) in favor of
> > SystemProperties.getUserName(Supplier)
> > ---
> >  src/changes/changes.xml | 1 +
> >  src/main/java/org/apache/commons/lang3/SystemUtils.java | 3 +++
> >  2 files changed, 4 insertions(+)
> > 
> > diff --git a/src/changes/changes.xml b/src/changes/changes.xml
> > index cdd3a0cd0..1d896a999 100644
> > --- a/src/changes/changes.xml
> > +++ b/src/changes/changes.xml
> > @@ -123,6 +123,7 @@ The  type attribute can be
> > add,update,fix,remove.
> >  Fix Java version in README.md #1170.
> >  StringUtils.stripAccents() should handle
> >  ligatures, UTF32 math blocks, etc. #1201.
> >   >  due-to="kijong.youn, Aakash Gupta, Gary
> >  Gregory">TypeUtils.toString(Type) StackOverflowError for an inner
> >  class in the inner class parameterized enclosing class #657.
> > +Deprecate SystemUtils.getUserName(String) in favor of
> > SystemProperties.getUserName(Supplier).
> >  
> >   >  due-to="Dependabot">Bump commons-parent from 64 to 69 #1194.
> >   >  due-to="Dependabot">Bump org.codehaus.mojo:exec-maven-plugin from
> >  3.1.1 to 3.2.0 #1175.
> > diff --git a/src/main/java/org/apache/commons/lang3/SystemUtils.java
> > b/src/main/java/org/apache/commons/lang3/SystemUtils.java
> > index cbb4721fb..8044fd4b0 100644
> > --- a/src/main/java/org/apache/commons/lang3/SystemUtils.java
> > +++ b/src/main/java/org/apache/commons/lang3/SystemUtils.java
> > @@ -17,6 +17,7 @@
> >  package org.apache.commons.lang3;
> >  
> >  import java.io.File;
> > +import java.util.function.Supplier;
> >  
> >  /**
> >   * Helpers for {@link System}.
> > @@ -2041,7 +2042,9 @@ public class SystemUtils {
> >   * access to the specified system property.
> >   * @see SystemProperties#getUserName()
> >   * @since 3.10
> > + * @deprecated Use {@link SystemProperties#getUserName(Supplier)}.
> >   */
> > +@Deprecated
> >  public static String getUserName(final String defaultValue) {
> >  return System.getProperty(SystemProperties.USER_NAME,
> >  defaultValue);
> >  }
> > 
> > 
> 
> 
> Gruß
> Bernd
> — 
> https://bernd.eckenfels.net
> 
> -
> To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
> For additional commands, e-mail: dev-h...@commons.apache.org
> 
> 

-
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org



Re: (commons-lang) 01/02: Deprecate SystemUtils.getUserName(String) in favor of SystemProperties.getUserName(Supplier)

2024-05-02 Thread Elliotte Rusty Harold
I'm OK with preferring SystemProperties though I'm not sure that
alpine justifies a new method and deprecation.

I second the opinion that a literal string is strongly preferable to a
Supplier here. Pick the simplest thing that could possibly work. As
Knuth warned us, premature optimization is the root of all evil in
programming.

On Wed, May 1, 2024 at 1:56 PM Bernd Eckenfels  wrote:
>
> Hi Gregory,
>
> What’s the idea behind that deprecation? The implementation is robust and 
> simple and easy to use. I would guess most user rather want to specify a 
> literal fallback than a supplier.
>
> Gruss
> Bernd
>
> ggreg...@apache.org wrote on 1. May 2024 16:07 (GMT +02:00):
>
> > 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 794f8aaf1e5a573a63ba6ca514eeb794bd39d855
> > Author: Gary Gregory 
> > AuthorDate: Wed May 1 09:12:09 2024 -0400
> >
> > Deprecate SystemUtils.getUserName(String) in favor of
> > SystemProperties.getUserName(Supplier)
> > ---
> >  src/changes/changes.xml | 1 +
> >  src/main/java/org/apache/commons/lang3/SystemUtils.java | 3 +++
> >  2 files changed, 4 insertions(+)
> >
> > diff --git a/src/changes/changes.xml b/src/changes/changes.xml
> > index cdd3a0cd0..1d896a999 100644
> > --- a/src/changes/changes.xml
> > +++ b/src/changes/changes.xml
> > @@ -123,6 +123,7 @@ The  type attribute can be
> > add,update,fix,remove.
> >  Fix Java version in README.md #1170.
> >  StringUtils.stripAccents() should handle
> >  ligatures, UTF32 math blocks, etc. #1201.
> >   >  due-to="kijong.youn, Aakash Gupta, Gary
> >  Gregory">TypeUtils.toString(Type) StackOverflowError for an inner
> >  class in the inner class parameterized enclosing class #657.
> > +Deprecate SystemUtils.getUserName(String) in favor of
> > SystemProperties.getUserName(Supplier).
> >  
> >   >  due-to="Dependabot">Bump commons-parent from 64 to 69 #1194.
> >   >  due-to="Dependabot">Bump org.codehaus.mojo:exec-maven-plugin from
> >  3.1.1 to 3.2.0 #1175.
> > diff --git a/src/main/java/org/apache/commons/lang3/SystemUtils.java
> > b/src/main/java/org/apache/commons/lang3/SystemUtils.java
> > index cbb4721fb..8044fd4b0 100644
> > --- a/src/main/java/org/apache/commons/lang3/SystemUtils.java
> > +++ b/src/main/java/org/apache/commons/lang3/SystemUtils.java
> > @@ -17,6 +17,7 @@
> >  package org.apache.commons.lang3;
> >
> >  import java.io.File;
> > +import java.util.function.Supplier;
> >
> >  /**
> >   * Helpers for {@link System}.
> > @@ -2041,7 +2042,9 @@ public class SystemUtils {
> >   * access to the specified system property.
> >   * @see SystemProperties#getUserName()
> >   * @since 3.10
> > + * @deprecated Use {@link SystemProperties#getUserName(Supplier)}.
> >   */
> > +@Deprecated
> >  public static String getUserName(final String defaultValue) {
> >  return System.getProperty(SystemProperties.USER_NAME,
> >  defaultValue);
> >  }
> >
> >
>
>
> Gruß
> Bernd
> —
> https://bernd.eckenfels.net
>
> -
> To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
> For additional commands, e-mail: dev-h...@commons.apache.org
>


-- 
Elliotte Rusty Harold
elh...@ibiblio.org

-
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org



Re: (commons-lang) 01/02: Deprecate SystemUtils.getUserName(String) in favor of SystemProperties.getUserName(Supplier)

2024-05-01 Thread Gary Gregory
It feels like the supplier version is much better to avoid the use case of
building the string in place.

I would also like to centralize all things related directly to sys props in
the SysProp class. This way, you know to look in one place instead of
sometimes here and sometimes there.

Do you think we need both versions of the API?

Gary

On Wed, May 1, 2024, 1:56 PM Bernd Eckenfels  wrote:

> Hi Gregory,
>
> What’s the idea behind that deprecation? The implementation is robust and
> simple and easy to use. I would guess most user rather want to specify a
> literal fallback than a supplier.
>
> Gruss
> Bernd
>
> ggreg...@apache.org wrote on 1. May 2024 16:07 (GMT +02:00):
>
> > 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 794f8aaf1e5a573a63ba6ca514eeb794bd39d855
> > Author: Gary Gregory 
> > AuthorDate: Wed May 1 09:12:09 2024 -0400
> >
> > Deprecate SystemUtils.getUserName(String) in favor of
> > SystemProperties.getUserName(Supplier)
> > ---
> >  src/changes/changes.xml | 1 +
> >  src/main/java/org/apache/commons/lang3/SystemUtils.java | 3 +++
> >  2 files changed, 4 insertions(+)
> >
> > diff --git a/src/changes/changes.xml b/src/changes/changes.xml
> > index cdd3a0cd0..1d896a999 100644
> > --- a/src/changes/changes.xml
> > +++ b/src/changes/changes.xml
> > @@ -123,6 +123,7 @@ The  type attribute can be
> > add,update,fix,remove.
> >  Fix Java version in README.md #1170.
> >  StringUtils.stripAccents() should
> handle
> >  ligatures, UTF32 math blocks, etc. #1201.
> >   >  due-to="kijong.youn, Aakash Gupta, Gary
> >  Gregory">TypeUtils.toString(Type) StackOverflowError for an inner
> >  class in the inner class parameterized enclosing class
> #657.
> > +Deprecate SystemUtils.getUserName(String) in favor of
> > SystemProperties.getUserName(Supplier).
> >  
> >   >  due-to="Dependabot">Bump commons-parent from 64 to 69
> #1194.
> >   >  due-to="Dependabot">Bump org.codehaus.mojo:exec-maven-plugin from
> >  3.1.1 to 3.2.0 #1175.
> > diff --git a/src/main/java/org/apache/commons/lang3/SystemUtils.java
> > b/src/main/java/org/apache/commons/lang3/SystemUtils.java
> > index cbb4721fb..8044fd4b0 100644
> > --- a/src/main/java/org/apache/commons/lang3/SystemUtils.java
> > +++ b/src/main/java/org/apache/commons/lang3/SystemUtils.java
> > @@ -17,6 +17,7 @@
> >  package org.apache.commons.lang3;
> >
> >  import java.io.File;
> > +import java.util.function.Supplier;
> >
> >  /**
> >   * Helpers for {@link System}.
> > @@ -2041,7 +2042,9 @@ public class SystemUtils {
> >   * access to the specified system property.
> >   * @see SystemProperties#getUserName()
> >   * @since 3.10
> > + * @deprecated Use {@link SystemProperties#getUserName(Supplier)}.
> >   */
> > +@Deprecated
> >  public static String getUserName(final String defaultValue) {
> >  return System.getProperty(SystemProperties.USER_NAME,
> >  defaultValue);
> >  }
> >
> >
>
>
> Gruß
> Bernd
> —
> https://bernd.eckenfels.net
>
> -
> To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
> For additional commands, e-mail: dev-h...@commons.apache.org
>
>


Re: (commons-lang) 01/02: Deprecate SystemUtils.getUserName(String) in favor of SystemProperties.getUserName(Supplier)

2024-05-01 Thread Bernd Eckenfels
Hi Gregory,

What’s the idea behind that deprecation? The implementation is robust and 
simple and easy to use. I would guess most user rather want to specify a 
literal fallback than a supplier.

Gruss
Bernd

ggreg...@apache.org wrote on 1. May 2024 16:07 (GMT +02:00):

> 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 794f8aaf1e5a573a63ba6ca514eeb794bd39d855
> Author: Gary Gregory 
> AuthorDate: Wed May 1 09:12:09 2024 -0400
> 
> Deprecate SystemUtils.getUserName(String) in favor of
> SystemProperties.getUserName(Supplier)
> ---
>  src/changes/changes.xml | 1 +
>  src/main/java/org/apache/commons/lang3/SystemUtils.java | 3 +++
>  2 files changed, 4 insertions(+)
> 
> diff --git a/src/changes/changes.xml b/src/changes/changes.xml
> index cdd3a0cd0..1d896a999 100644
> --- a/src/changes/changes.xml
> +++ b/src/changes/changes.xml
> @@ -123,6 +123,7 @@ The  type attribute can be
> add,update,fix,remove.
>  Fix Java version in README.md #1170.
>  StringUtils.stripAccents() should handle
>  ligatures, UTF32 math blocks, etc. #1201.
>due-to="kijong.youn, Aakash Gupta, Gary
>  Gregory">TypeUtils.toString(Type) StackOverflowError for an inner
>  class in the inner class parameterized enclosing class #657.
> +Deprecate SystemUtils.getUserName(String) in favor of
> SystemProperties.getUserName(Supplier).
>  
>due-to="Dependabot">Bump commons-parent from 64 to 69 #1194.
>due-to="Dependabot">Bump org.codehaus.mojo:exec-maven-plugin from
>  3.1.1 to 3.2.0 #1175.
> diff --git a/src/main/java/org/apache/commons/lang3/SystemUtils.java
> b/src/main/java/org/apache/commons/lang3/SystemUtils.java
> index cbb4721fb..8044fd4b0 100644
> --- a/src/main/java/org/apache/commons/lang3/SystemUtils.java
> +++ b/src/main/java/org/apache/commons/lang3/SystemUtils.java
> @@ -17,6 +17,7 @@
>  package org.apache.commons.lang3;
>  
>  import java.io.File;
> +import java.util.function.Supplier;
>  
>  /**
>   * Helpers for {@link System}.
> @@ -2041,7 +2042,9 @@ public class SystemUtils {
>   * access to the specified system property.
>   * @see SystemProperties#getUserName()
>   * @since 3.10
> + * @deprecated Use {@link SystemProperties#getUserName(Supplier)}.
>   */
> +@Deprecated
>  public static String getUserName(final String defaultValue) {
>  return System.getProperty(SystemProperties.USER_NAME,
>  defaultValue);
>  }
> 
> 


Gruß
Bernd
— 
https://bernd.eckenfels.net

-
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org