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 a37e8de046a328c3400ea2f78b51d792152e9569
Author: Gary Gregory <garydgreg...@gmail.com>
AuthorDate: Wed May 29 16:16:10 2024 -0400

    Sort members
---
 .../java/org/apache/commons/lang3/JavaVersion.java | 10 ++---
 .../org/apache/commons/lang3/SystemProperties.java | 28 ++++++-------
 .../apache/commons/lang3/function/Consumers.java   | 30 +++++++-------
 .../apache/commons/lang3/function/Functions.java   | 30 +++++++-------
 .../commons/lang3/StringUtilsTrimStripTest.java    |  8 ++--
 .../commons/lang3/function/ConsumersTest.java      | 46 +++++++++++-----------
 .../commons/lang3/function/FunctionsTest.java      | 16 ++++----
 .../apache/commons/lang3/math/NumberUtilsTest.java |  8 ++--
 8 files changed, 88 insertions(+), 88 deletions(-)

diff --git a/src/main/java/org/apache/commons/lang3/JavaVersion.java 
b/src/main/java/org/apache/commons/lang3/JavaVersion.java
index 355b6ab6e..feb53bd16 100644
--- a/src/main/java/org/apache/commons/lang3/JavaVersion.java
+++ b/src/main/java/org/apache/commons/lang3/JavaVersion.java
@@ -183,6 +183,11 @@ public enum JavaVersion {
      */
     JAVA_RECENT(maxVersion(), Float.toString(maxVersion()));
 
+    /**
+     * The regex to split version strings.
+     */
+    private static final String VERSION_SPLIT_REGEX = "\\.";
+
     /**
      * Transforms the given string with a Java version number to the
      * corresponding constant of this enumeration class. This method is used
@@ -313,11 +318,6 @@ public enum JavaVersion {
      */
     private final String name;
 
-    /**
-     * The regex to split version strings.
-     */
-    private static final String VERSION_SPLIT_REGEX = "\\.";
-
     /**
      * Constructs a new instance.
      *
diff --git a/src/main/java/org/apache/commons/lang3/SystemProperties.java 
b/src/main/java/org/apache/commons/lang3/SystemProperties.java
index 54137332d..1c2d03653 100644
--- a/src/main/java/org/apache/commons/lang3/SystemProperties.java
+++ b/src/main/java/org/apache/commons/lang3/SystemProperties.java
@@ -3708,6 +3708,20 @@ public final class SystemProperties {
         return getProperty(property, Suppliers.nul());
     }
 
+    /**
+     * Gets a System property, defaulting to {@code null} if the property 
cannot be read.
+     * <p>
+     * If a {@link SecurityException} is caught, the return value is {@code 
null}.
+     * </p>
+     *
+     * @param property        the system property name.
+     * @param defaultIfAbsent use this value when the property is empty or 
throws SecurityException.
+     * @return the system property value or {@code null} if a security problem 
occurs
+     */
+    static String getProperty(final String property, final String 
defaultIfAbsent) {
+        return getProperty(property, () -> defaultIfAbsent);
+    }
+
     /**
      * Gets a System property, defaulting to {@code null} if the property 
cannot be read.
      * <p>
@@ -3734,20 +3748,6 @@ public final class SystemProperties {
         }
     }
 
-    /**
-     * Gets a System property, defaulting to {@code null} if the property 
cannot be read.
-     * <p>
-     * If a {@link SecurityException} is caught, the return value is {@code 
null}.
-     * </p>
-     *
-     * @param property        the system property name.
-     * @param defaultIfAbsent use this value when the property is empty or 
throws SecurityException.
-     * @return the system property value or {@code null} if a security problem 
occurs
-     */
-    static String getProperty(final String property, final String 
defaultIfAbsent) {
-        return getProperty(property, () -> defaultIfAbsent);
-    }
-
     /**
      * Gets the current value from the system properties map.
      * <p>
diff --git a/src/main/java/org/apache/commons/lang3/function/Consumers.java 
b/src/main/java/org/apache/commons/lang3/function/Consumers.java
index 43f161d07..49b514ec1 100644
--- a/src/main/java/org/apache/commons/lang3/function/Consumers.java
+++ b/src/main/java/org/apache/commons/lang3/function/Consumers.java
@@ -31,21 +31,6 @@ public class Consumers {
     @SuppressWarnings("rawtypes")
     private static final Consumer NOP = Function.identity()::apply;
 
-    /**
-     * Gets the NOP Consumer singleton.
-     *
-     * @param <T> type type to consume.
-     * @return the NOP Consumer singleton.
-     */
-    @SuppressWarnings("unchecked")
-    public static <T> Consumer<T> nop() {
-        return NOP;
-    }
-
-    private Consumers() {
-        // No instances.
-    }
-
     /**
      * Applies the given {@link Consumer} action to the object if the consumer 
is not {@code null}. Otherwise, does
      * nothing.
@@ -60,4 +45,19 @@ public class Consumers {
             consumer.accept(object);
         }
     }
+
+    /**
+     * Gets the NOP Consumer singleton.
+     *
+     * @param <T> type type to consume.
+     * @return the NOP Consumer singleton.
+     */
+    @SuppressWarnings("unchecked")
+    public static <T> Consumer<T> nop() {
+        return NOP;
+    }
+
+    private Consumers() {
+        // No instances.
+    }
 }
diff --git a/src/main/java/org/apache/commons/lang3/function/Functions.java 
b/src/main/java/org/apache/commons/lang3/function/Functions.java
index cf8309f8f..8d9313ca5 100644
--- a/src/main/java/org/apache/commons/lang3/function/Functions.java
+++ b/src/main/java/org/apache/commons/lang3/function/Functions.java
@@ -26,6 +26,21 @@ import java.util.function.Function;
  */
 public final class Functions {
 
+    /**
+     * Applies the {@link Function} on the object if the function is not 
{@code null}. Otherwise, does nothing and
+     * returns {@code null}.
+     *
+     * @param object the object to apply the function.
+     * @param function the function to apply.
+     * @param <T> the type of the argument the function applies.
+     * @param <R> the type of the result the function returns.
+     * @return the value the function returns if the function is not {@code 
null}; {@code null} otherwise.
+     * @since 3.15.0
+     */
+    public static <T, R> R apply(final T object, final Function<T, R> 
function) {
+        return function != null ? function.apply(object) : null;
+    }
+
     /**
      * Starts a fluent chain like {@code 
function(foo::bar).andThen(...).andThen(...).apply(...);}
      *
@@ -41,19 +56,4 @@ public final class Functions {
     private Functions() {
         // no instances needed.
     }
-
-    /**
-     * Applies the {@link Function} on the object if the function is not 
{@code null}. Otherwise, does nothing and
-     * returns {@code null}.
-     *
-     * @param object the object to apply the function.
-     * @param function the function to apply.
-     * @param <T> the type of the argument the function applies.
-     * @param <R> the type of the result the function returns.
-     * @return the value the function returns if the function is not {@code 
null}; {@code null} otherwise.
-     * @since 3.15.0
-     */
-    public static <T, R> R apply(final T object, final Function<T, R> 
function) {
-        return function != null ? function.apply(object) : null;
-    }
 }
diff --git 
a/src/test/java/org/apache/commons/lang3/StringUtilsTrimStripTest.java 
b/src/test/java/org/apache/commons/lang3/StringUtilsTrimStripTest.java
index aa827ddf5..96aef4d64 100644
--- a/src/test/java/org/apache/commons/lang3/StringUtilsTrimStripTest.java
+++ b/src/test/java/org/apache/commons/lang3/StringUtilsTrimStripTest.java
@@ -111,13 +111,13 @@ public class StringUtilsTrimStripTest extends 
AbstractLangTest {
     }
 
     @Test
-    public void testStripAccentsUWithBar() {
-        assertEquals("U u U u", StringUtils.stripAccents("\u0244 \u0289 \u1D7E 
\u1DB6"));
+    public void testStripAccentsTWithStroke() {
+        assertEquals("T t", StringUtils.stripAccents("\u0166 \u0167"));
     }
 
     @Test
-    public void testStripAccentsTWithStroke() {
-        assertEquals("T t", StringUtils.stripAccents("\u0166 \u0167"));
+    public void testStripAccentsUWithBar() {
+        assertEquals("U u U u", StringUtils.stripAccents("\u0244 \u0289 \u1D7E 
\u1DB6"));
     }
 
     @Test
diff --git a/src/test/java/org/apache/commons/lang3/function/ConsumersTest.java 
b/src/test/java/org/apache/commons/lang3/function/ConsumersTest.java
index 47828debf..e649c25db 100644
--- a/src/test/java/org/apache/commons/lang3/function/ConsumersTest.java
+++ b/src/test/java/org/apache/commons/lang3/function/ConsumersTest.java
@@ -31,22 +31,13 @@ import org.junit.jupiter.api.Test;
  */
 public class ConsumersTest extends AbstractLangTest {
 
-    /**
-     * Tests {@link Consumers#nop()}.
-     */
-    @Test
-    public void testNop() {
-        Stream.of("").forEach(Consumers.nop());
-        //
-        final Consumer<?> c1 = Consumers.nop();
-        c1.accept(null);
-        final Consumer<Object> c2 = Consumers.nop();
-        c2.accept(null);
-        final Consumer<String> c3 = Consumers.nop();
-        c3.accept(null);
-        //
-        Consumers.nop().accept(null);
-        Consumers.nop().accept("");
+    private static final class TestConsumer<T> implements Consumer<T> {
+        private boolean isCalled;
+
+        @Override
+        public void accept(T t) {
+            isCalled = true;
+        }
     }
 
     /**
@@ -67,12 +58,21 @@ public class ConsumersTest extends AbstractLangTest {
         assertEquals("foo", builder2.toString());
     }
 
-    private static final class TestConsumer<T> implements Consumer<T> {
-        private boolean isCalled;
-
-        @Override
-        public void accept(T t) {
-            isCalled = true;
-        }
+    /**
+     * Tests {@link Consumers#nop()}.
+     */
+    @Test
+    public void testNop() {
+        Stream.of("").forEach(Consumers.nop());
+        //
+        final Consumer<?> c1 = Consumers.nop();
+        c1.accept(null);
+        final Consumer<Object> c2 = Consumers.nop();
+        c2.accept(null);
+        final Consumer<String> c3 = Consumers.nop();
+        c3.accept(null);
+        //
+        Consumers.nop().accept(null);
+        Consumers.nop().accept("");
     }
 }
diff --git a/src/test/java/org/apache/commons/lang3/function/FunctionsTest.java 
b/src/test/java/org/apache/commons/lang3/function/FunctionsTest.java
index 4693eb00a..8f5825134 100644
--- a/src/test/java/org/apache/commons/lang3/function/FunctionsTest.java
+++ b/src/test/java/org/apache/commons/lang3/function/FunctionsTest.java
@@ -29,14 +29,6 @@ import org.junit.jupiter.api.Test;
  */
 public class FunctionsTest {
 
-    /**
-     * Tests {@link Functions#function(Function)}.
-     */
-    @Test
-    public void testFunction() {
-        assertEquals("foo", 
Functions.function(String::valueOf).andThen(String::toString).apply("foo"));
-    }
-
     /**
      * Tests {@link Functions#apply(Object, Function)}.
      */
@@ -46,4 +38,12 @@ public class FunctionsTest {
         assertEquals("foo-bar", Functions.apply(null, object -> "foo-bar"));
         assertNull(Functions.apply("foo", null));
     }
+
+    /**
+     * Tests {@link Functions#function(Function)}.
+     */
+    @Test
+    public void testFunction() {
+        assertEquals("foo", 
Functions.function(String::valueOf).andThen(String::toString).apply("foo"));
+    }
 }
diff --git a/src/test/java/org/apache/commons/lang3/math/NumberUtilsTest.java 
b/src/test/java/org/apache/commons/lang3/math/NumberUtilsTest.java
index 29404044d..46f46630c 100644
--- a/src/test/java/org/apache/commons/lang3/math/NumberUtilsTest.java
+++ b/src/test/java/org/apache/commons/lang3/math/NumberUtilsTest.java
@@ -141,19 +141,19 @@ public class NumberUtilsTest extends AbstractLangTest {
         return parsable;
     }
 
-    private boolean isParsableFloat(final String s) {
+    private boolean isParsableDouble(final String s) {
         final boolean parsable = NumberUtils.isParsable(s);
         assertTrue(isNumberFormatParsable(s), s);
         assertTrue(isNumberIntegerOnlyFormatParsable(s), s);
-        assertEquals(parsable, isApplyNonNull(s, Float::parseFloat), s);
+        assertEquals(parsable, isApplyNonNull(s, Double::parseDouble), s);
         return parsable;
     }
 
-    private boolean isParsableDouble(final String s) {
+    private boolean isParsableFloat(final String s) {
         final boolean parsable = NumberUtils.isParsable(s);
         assertTrue(isNumberFormatParsable(s), s);
         assertTrue(isNumberIntegerOnlyFormatParsable(s), s);
-        assertEquals(parsable, isApplyNonNull(s, Double::parseDouble), s);
+        assertEquals(parsable, isApplyNonNull(s, Float::parseFloat), s);
         return parsable;
     }
 

Reply via email to