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


The following commit(s) were added to refs/heads/master by this push:
     new 8b5ce4070 Use Checkstyle to validate import order
8b5ce4070 is described below

commit 8b5ce4070f285322e31d4f211497255f31f023f6
Author: Gary Gregory <garydgreg...@gmail.com>
AuthorDate: Mon Oct 9 10:34:39 2023 -0400

    Use Checkstyle to validate import order
---
 src/main/java/org/apache/commons/lang3/ObjectUtils.java             | 2 +-
 src/site/resources/checkstyle/checkstyle.xml                        | 6 ++++++
 .../builder/ReflectionToStringBuilderCustomImplementationTest.java  | 6 +++---
 3 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/src/main/java/org/apache/commons/lang3/ObjectUtils.java 
b/src/main/java/org/apache/commons/lang3/ObjectUtils.java
index a754229d1..381832a84 100644
--- a/src/main/java/org/apache/commons/lang3/ObjectUtils.java
+++ b/src/main/java/org/apache/commons/lang3/ObjectUtils.java
@@ -38,9 +38,9 @@ import java.util.stream.Stream;
 import org.apache.commons.lang3.exception.CloneFailedException;
 import org.apache.commons.lang3.function.Suppliers;
 import org.apache.commons.lang3.mutable.MutableInt;
+import org.apache.commons.lang3.stream.Streams;
 import org.apache.commons.lang3.text.StrBuilder;
 import org.apache.commons.lang3.time.DurationUtils;
-import org.apache.commons.lang3.stream.Streams;
 
 /**
  * Operations on {@link Object}.
diff --git a/src/site/resources/checkstyle/checkstyle.xml 
b/src/site/resources/checkstyle/checkstyle.xml
index 1fdaec7e9..7c178861d 100644
--- a/src/site/resources/checkstyle/checkstyle.xml
+++ b/src/site/resources/checkstyle/checkstyle.xml
@@ -53,5 +53,11 @@ limitations under the License.
     <module name="GenericWhitespace"/>
     <module name="WhitespaceAfter"/>
     <module name="NoWhitespaceBefore"/>
+    <module name="ImportOrder">
+      <property name="option" value="top"/>
+      <property name="groups" value="java,javax,org"/>
+      <property name="ordered" value="true"/>
+      <property name="separated" value="true"/>
+    </module>
  </module>
 </module>
diff --git 
a/src/test/java/org/apache/commons/lang3/builder/ReflectionToStringBuilderCustomImplementationTest.java
 
b/src/test/java/org/apache/commons/lang3/builder/ReflectionToStringBuilderCustomImplementationTest.java
index 61e9ee635..dd1acdd58 100644
--- 
a/src/test/java/org/apache/commons/lang3/builder/ReflectionToStringBuilderCustomImplementationTest.java
+++ 
b/src/test/java/org/apache/commons/lang3/builder/ReflectionToStringBuilderCustomImplementationTest.java
@@ -16,12 +16,12 @@
  */
 package org.apache.commons.lang3.builder;
 
-import org.apache.commons.lang3.AbstractLangTest;
-import org.junit.jupiter.api.Test;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 import java.lang.reflect.Field;
 
-import static org.junit.jupiter.api.Assertions.assertEquals;
+import org.apache.commons.lang3.AbstractLangTest;
+import org.junit.jupiter.api.Test;
 
 /**
  * Tests {@link ReflectionToStringBuilder} always uses {@link 
ReflectionToStringBuilder#getValue(Field)} to get the

Reply via email to