You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2023/07/31 13:23:22 UTC
[commons-dbutils] 01/25: Clean up imports
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-dbutils.git
commit 5e538e28e51b8a45ba77713e6e14657c12cd40f9
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Mon Jul 31 09:00:37 2023 -0400
Clean up imports
---
.../java/org/apache/commons/dbutils/BeanProcessor.java | 4 ++--
src/main/java/org/apache/commons/dbutils/DbUtils.java | 2 +-
.../java/org/apache/commons/dbutils/QueryRunner.java | 1 +
.../handlers/properties/DatePropertyHandler.java | 4 ++--
.../apache/commons/dbutils/AsyncQueryRunnerTest.java | 1 -
.../commons/dbutils/BaseResultSetHandlerTest.java | 4 ++--
.../apache/commons/dbutils/BasicRowProcessorTest.java | 2 --
.../org/apache/commons/dbutils/BeanProcessorTest.java | 4 ++--
.../java/org/apache/commons/dbutils/DbUtilsTest.java | 18 +++++++++---------
.../commons/dbutils/GenerousBeanProcessorTest.java | 14 +++++++-------
.../org/apache/commons/dbutils/OutParameterTest.java | 5 +++--
.../org/apache/commons/dbutils/QueryRunnerTest.java | 4 ++--
.../apache/commons/dbutils/ResultSetIteratorTest.java | 4 ++--
.../commons/dbutils/handlers/BeanMapHandlerTest.java | 4 ++--
.../commons/dbutils/handlers/KeyedHandlerTest.java | 4 ++--
.../handlers/properties/DatePropertyHandlerTest.java | 10 +++++-----
.../dbutils/wrappers/SqlNullCheckedResultSetTest.java | 6 +++---
17 files changed, 45 insertions(+), 46 deletions(-)
diff --git a/src/main/java/org/apache/commons/dbutils/BeanProcessor.java b/src/main/java/org/apache/commons/dbutils/BeanProcessor.java
index 5060d4c..b6fb3ac 100644
--- a/src/main/java/org/apache/commons/dbutils/BeanProcessor.java
+++ b/src/main/java/org/apache/commons/dbutils/BeanProcessor.java
@@ -16,8 +16,6 @@
*/
package org.apache.commons.dbutils;
-import org.apache.commons.dbutils.annotations.Column;
-
import java.beans.BeanInfo;
import java.beans.IntrospectionException;
import java.beans.Introspector;
@@ -35,6 +33,8 @@ import java.util.List;
import java.util.Map;
import java.util.ServiceLoader;
+import org.apache.commons.dbutils.annotations.Column;
+
/**
* <p>
* {@code BeanProcessor} matches column names to bean property names
diff --git a/src/main/java/org/apache/commons/dbutils/DbUtils.java b/src/main/java/org/apache/commons/dbutils/DbUtils.java
index 5816532..67f5ef5 100644
--- a/src/main/java/org/apache/commons/dbutils/DbUtils.java
+++ b/src/main/java/org/apache/commons/dbutils/DbUtils.java
@@ -29,8 +29,8 @@ import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.SQLFeatureNotSupportedException;
import java.sql.Statement;
-import java.util.logging.Logger;
import java.util.Properties;
+import java.util.logging.Logger;
/**
* A collection of JDBC helper methods. This class is thread safe.
diff --git a/src/main/java/org/apache/commons/dbutils/QueryRunner.java b/src/main/java/org/apache/commons/dbutils/QueryRunner.java
index cba4dfd..8ee89db 100644
--- a/src/main/java/org/apache/commons/dbutils/QueryRunner.java
+++ b/src/main/java/org/apache/commons/dbutils/QueryRunner.java
@@ -25,6 +25,7 @@ import java.sql.SQLException;
import java.sql.Statement;
import java.util.LinkedList;
import java.util.List;
+
import javax.sql.DataSource;
/**
diff --git a/src/main/java/org/apache/commons/dbutils/handlers/properties/DatePropertyHandler.java b/src/main/java/org/apache/commons/dbutils/handlers/properties/DatePropertyHandler.java
index 7360ed0..c1ef96b 100644
--- a/src/main/java/org/apache/commons/dbutils/handlers/properties/DatePropertyHandler.java
+++ b/src/main/java/org/apache/commons/dbutils/handlers/properties/DatePropertyHandler.java
@@ -16,11 +16,11 @@
*/
package org.apache.commons.dbutils.handlers.properties;
-import org.apache.commons.dbutils.PropertyHandler;
-
import java.sql.Timestamp;
import java.util.Date;
+import org.apache.commons.dbutils.PropertyHandler;
+
/**
* {@link PropertyHandler} for date fields. Will convert {@link java.sql.Date}, {@link java.sql.Time}, and
* {@link java.sql.Timestamp} from SQL types to java types.
diff --git a/src/test/java/org/apache/commons/dbutils/AsyncQueryRunnerTest.java b/src/test/java/org/apache/commons/dbutils/AsyncQueryRunnerTest.java
index f890612..2fc891c 100644
--- a/src/test/java/org/apache/commons/dbutils/AsyncQueryRunnerTest.java
+++ b/src/test/java/org/apache/commons/dbutils/AsyncQueryRunnerTest.java
@@ -42,7 +42,6 @@ import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
-import org.mockito.MockitoAnnotations;
import org.mockito.junit.MockitoJUnitRunner;
@SuppressWarnings("boxing") // test code
diff --git a/src/test/java/org/apache/commons/dbutils/BaseResultSetHandlerTest.java b/src/test/java/org/apache/commons/dbutils/BaseResultSetHandlerTest.java
index f4b81a2..a7fa756 100644
--- a/src/test/java/org/apache/commons/dbutils/BaseResultSetHandlerTest.java
+++ b/src/test/java/org/apache/commons/dbutils/BaseResultSetHandlerTest.java
@@ -16,14 +16,14 @@
*/
package org.apache.commons.dbutils;
-import org.junit.Test;
-
import java.sql.SQLException;
import java.util.Collection;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.Map;
+import org.junit.Test;
+
public final class BaseResultSetHandlerTest extends BaseTestCase {
@Test
diff --git a/src/test/java/org/apache/commons/dbutils/BasicRowProcessorTest.java b/src/test/java/org/apache/commons/dbutils/BasicRowProcessorTest.java
index 4a425f6..525b391 100644
--- a/src/test/java/org/apache/commons/dbutils/BasicRowProcessorTest.java
+++ b/src/test/java/org/apache/commons/dbutils/BasicRowProcessorTest.java
@@ -20,13 +20,11 @@ import java.sql.SQLException;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
-import java.util.Arrays;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.Map;
-import java.util.Objects;
/**
* Test the BasicRowProcessor class.
diff --git a/src/test/java/org/apache/commons/dbutils/BeanProcessorTest.java b/src/test/java/org/apache/commons/dbutils/BeanProcessorTest.java
index 15fa93d..f941dac 100644
--- a/src/test/java/org/apache/commons/dbutils/BeanProcessorTest.java
+++ b/src/test/java/org/apache/commons/dbutils/BeanProcessorTest.java
@@ -16,7 +16,7 @@
*/
package org.apache.commons.dbutils;
-import org.apache.commons.dbutils.annotations.Column;
+import static org.junit.Assert.assertArrayEquals;
import java.beans.Introspector;
import java.beans.PropertyDescriptor;
@@ -28,7 +28,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import static org.junit.Assert.assertArrayEquals;
+import org.apache.commons.dbutils.annotations.Column;
public class BeanProcessorTest extends BaseTestCase {
diff --git a/src/test/java/org/apache/commons/dbutils/DbUtilsTest.java b/src/test/java/org/apache/commons/dbutils/DbUtilsTest.java
index 63ca398..b6d0ebb 100644
--- a/src/test/java/org/apache/commons/dbutils/DbUtilsTest.java
+++ b/src/test/java/org/apache/commons/dbutils/DbUtilsTest.java
@@ -16,9 +16,12 @@
*/
package org.apache.commons.dbutils;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.fail;
+import static org.mockito.Mockito.doThrow;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.reset;
+import static org.mockito.Mockito.verify;
import java.sql.Connection;
import java.sql.Driver;
@@ -27,12 +30,9 @@ import java.sql.SQLException;
import java.sql.Statement;
import java.util.Properties;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.fail;
-import static org.mockito.Mockito.doThrow;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.reset;
-import static org.mockito.Mockito.verify;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
public class DbUtilsTest {
diff --git a/src/test/java/org/apache/commons/dbutils/GenerousBeanProcessorTest.java b/src/test/java/org/apache/commons/dbutils/GenerousBeanProcessorTest.java
index eb4e9a1..19a8b42 100644
--- a/src/test/java/org/apache/commons/dbutils/GenerousBeanProcessorTest.java
+++ b/src/test/java/org/apache/commons/dbutils/GenerousBeanProcessorTest.java
@@ -16,19 +16,19 @@
*/
package org.apache.commons.dbutils;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.mockito.Mockito.when;
+
+import java.beans.PropertyDescriptor;
+import java.sql.ResultSetMetaData;
+
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.junit.MockitoJUnitRunner;
-import java.beans.PropertyDescriptor;
-import java.sql.ResultSetMetaData;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.mockito.Mockito.when;
-
@RunWith(MockitoJUnitRunner.class)
public class GenerousBeanProcessorTest {
diff --git a/src/test/java/org/apache/commons/dbutils/OutParameterTest.java b/src/test/java/org/apache/commons/dbutils/OutParameterTest.java
index 6282285..4b85590 100644
--- a/src/test/java/org/apache/commons/dbutils/OutParameterTest.java
+++ b/src/test/java/org/apache/commons/dbutils/OutParameterTest.java
@@ -18,14 +18,15 @@
package org.apache.commons.dbutils;
import static org.junit.Assert.assertEquals;
-import static org.mockito.Mockito.any;
-import static org.mockito.Mockito.eq;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import java.sql.CallableStatement;
import java.sql.Types;
+
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
diff --git a/src/test/java/org/apache/commons/dbutils/QueryRunnerTest.java b/src/test/java/org/apache/commons/dbutils/QueryRunnerTest.java
index 31f5682..985da7c 100644
--- a/src/test/java/org/apache/commons/dbutils/QueryRunnerTest.java
+++ b/src/test/java/org/apache/commons/dbutils/QueryRunnerTest.java
@@ -17,9 +17,9 @@
package org.apache.commons.dbutils;
import static org.junit.Assert.fail;
-import static org.mockito.Mockito.any;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.doThrow;
-import static org.mockito.Mockito.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.times;
diff --git a/src/test/java/org/apache/commons/dbutils/ResultSetIteratorTest.java b/src/test/java/org/apache/commons/dbutils/ResultSetIteratorTest.java
index 38c1078..186057b 100644
--- a/src/test/java/org/apache/commons/dbutils/ResultSetIteratorTest.java
+++ b/src/test/java/org/apache/commons/dbutils/ResultSetIteratorTest.java
@@ -16,13 +16,13 @@
*/
package org.apache.commons.dbutils;
-import org.junit.Test;
+import static org.mockito.Mockito.mock;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Iterator;
-import static org.mockito.Mockito.mock;
+import org.junit.Test;
/**
* ResultSetIteratorTest
diff --git a/src/test/java/org/apache/commons/dbutils/handlers/BeanMapHandlerTest.java b/src/test/java/org/apache/commons/dbutils/handlers/BeanMapHandlerTest.java
index 3a2662a..8d39b0d 100644
--- a/src/test/java/org/apache/commons/dbutils/handlers/BeanMapHandlerTest.java
+++ b/src/test/java/org/apache/commons/dbutils/handlers/BeanMapHandlerTest.java
@@ -16,7 +16,8 @@
*/
package org.apache.commons.dbutils.handlers;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
import static org.mockito.Mockito.when;
import java.sql.ResultSet;
@@ -29,7 +30,6 @@ import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
-import org.mockito.MockitoAnnotations;
import org.mockito.junit.MockitoJUnitRunner;
@RunWith(MockitoJUnitRunner.class)
diff --git a/src/test/java/org/apache/commons/dbutils/handlers/KeyedHandlerTest.java b/src/test/java/org/apache/commons/dbutils/handlers/KeyedHandlerTest.java
index 3460d39..7057412 100644
--- a/src/test/java/org/apache/commons/dbutils/handlers/KeyedHandlerTest.java
+++ b/src/test/java/org/apache/commons/dbutils/handlers/KeyedHandlerTest.java
@@ -16,6 +16,8 @@
*/
package org.apache.commons.dbutils.handlers;
+import static org.mockito.Mockito.mock;
+
import java.sql.SQLException;
import java.util.Map;
import java.util.Map.Entry;
@@ -24,8 +26,6 @@ import org.apache.commons.dbutils.BaseTestCase;
import org.apache.commons.dbutils.ResultSetHandler;
import org.apache.commons.dbutils.RowProcessor;
-import static org.mockito.Mockito.mock;
-
public class KeyedHandlerTest extends BaseTestCase {
public void testInjectedRowProcess() throws Exception {
diff --git a/src/test/java/org/apache/commons/dbutils/handlers/properties/DatePropertyHandlerTest.java b/src/test/java/org/apache/commons/dbutils/handlers/properties/DatePropertyHandlerTest.java
index b7ed03b..8c1c07d 100644
--- a/src/test/java/org/apache/commons/dbutils/handlers/properties/DatePropertyHandlerTest.java
+++ b/src/test/java/org/apache/commons/dbutils/handlers/properties/DatePropertyHandlerTest.java
@@ -16,16 +16,16 @@
*/
package org.apache.commons.dbutils.handlers.properties;
-import org.junit.Before;
-import org.junit.Test;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
import java.sql.Time;
import java.sql.Timestamp;
import java.util.Date;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import org.junit.Before;
+import org.junit.Test;
public class DatePropertyHandlerTest {
private DatePropertyHandler handler;
diff --git a/src/test/java/org/apache/commons/dbutils/wrappers/SqlNullCheckedResultSetTest.java b/src/test/java/org/apache/commons/dbutils/wrappers/SqlNullCheckedResultSetTest.java
index 1aafa2e..bfb1061 100644
--- a/src/test/java/org/apache/commons/dbutils/wrappers/SqlNullCheckedResultSetTest.java
+++ b/src/test/java/org/apache/commons/dbutils/wrappers/SqlNullCheckedResultSetTest.java
@@ -16,6 +16,9 @@
*/
package org.apache.commons.dbutils.wrappers;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.verify;
+
import java.io.ByteArrayInputStream;
import java.io.CharArrayReader;
import java.io.InputStream;
@@ -41,9 +44,6 @@ import java.util.Map;
import org.apache.commons.dbutils.BaseTestCase;
import org.apache.commons.dbutils.ProxyFactory;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
-
/**
* Test cases for {@code SqlNullCheckedResultSet} class.
*/