From cc2f0a7375bbc5f4cbab4444dc9b51ca5bd92a7a Mon Sep 17 00:00:00 2001 From: Jeremy Landis Date: Fri, 3 Feb 2023 23:27:19 -0500 Subject: [PATCH] [ci] formatting --- .../apache/ibatis/type/LongTypeHandler.java | 14 +- .../apache/ibatis/type/MappedJdbcTypes.java | 7 +- .../org/apache/ibatis/type/MappedTypes.java | 5 +- .../apache/ibatis/type/MonthTypeHandler.java | 4 +- .../apache/ibatis/type/NClobTypeHandler.java | 11 +- .../ibatis/type/NStringTypeHandler.java | 11 +- .../apache/ibatis/type/ObjectTypeHandler.java | 11 +- .../type/OffsetDateTimeTypeHandler.java | 5 +- .../ibatis/type/OffsetTimeTypeHandler.java | 5 +- .../apache/ibatis/type/ShortTypeHandler.java | 14 +- .../ibatis/type/SimpleTypeRegistry.java | 3 +- .../ibatis/type/SqlDateTypeHandler.java | 14 +- .../ibatis/type/SqlTimeTypeHandler.java | 14 +- .../ibatis/type/SqlTimestampTypeHandler.java | 11 +- .../apache/ibatis/type/SqlxmlTypeHandler.java | 3 +- .../apache/ibatis/type/StringTypeHandler.java | 11 +- .../ibatis/type/TimeOnlyTypeHandler.java | 14 +- .../apache/ibatis/type/TypeAliasRegistry.java | 6 +- .../org/apache/ibatis/type/TypeHandler.java | 4 +- .../ibatis/type/TypeHandlerRegistry.java | 18 +- .../org/apache/ibatis/type/TypeReference.java | 9 +- .../ibatis/type/UnknownTypeHandler.java | 23 +- .../ibatis/type/YearMonthTypeHandler.java | 8 +- .../apache/ibatis/type/YearTypeHandler.java | 3 +- .../ibatis/type/ZonedDateTimeTypeHandler.java | 5 +- .../java/org/apache/ibatis/util/MapUtil.java | 5 +- .../autoconstructor/AutoConstructorTest.java | 4 +- .../autoconstructor/ExtensiveSubject.java | 79 +++--- .../autoconstructor/PrimitiveSubject.java | 5 +- .../apache/ibatis/binding/BindingTest.java | 35 ++- .../ibatis/binding/BoundAuthorMapper.java | 22 +- .../ibatis/binding/BoundBlogMapper.java | 46 ++-- .../org/apache/ibatis/binding/FlushTest.java | 82 +++---- .../builder/AnnotationMapperBuilderTest.java | 3 +- .../ibatis/builder/CachedAuthorMapper.java | 16 +- .../ibatis/builder/ExampleObjectFactory.java | 6 +- .../ibatis/builder/XmlConfigBuilderTest.java | 21 +- .../xml/dynamic/DynamicSqlSourceTest.java | 5 +- .../xml/dynamic/ExpressionEvaluatorTest.java | 3 +- .../builder/xsd/CachedAuthorMapper.java | 16 +- .../builder/xsd/XmlConfigBuilderTest.java | 15 +- .../builder/xsd/XmlMapperBuilderTest.java | 5 +- .../org/apache/ibatis/cache/CacheKeyTest.java | 12 +- .../ibatis/cache/SerializedCacheTest.java | 17 +- .../apache/ibatis/cache/SoftCacheTest.java | 6 +- .../cursor/defaults/DefaultCursorTest.java | 5 +- .../databases/blog/StoredProcedures.java | 8 +- .../jndi/JndiDataSourceFactoryTest.java | 4 +- .../datasource/pooled/MysqlTimeoutTest.java | 5 +- .../unpooled/UnpooledDataSourceTest.java | 14 +- .../org/apache/ibatis/domain/blog/Author.java | 23 +- .../domain/blog/ComplexImmutableAuthor.java | 5 +- .../ibatis/domain/blog/ImmutableAuthor.java | 23 +- .../apache/ibatis/domain/blog/PostLite.java | 88 +++---- .../apache/ibatis/domain/blog/PostLiteId.java | 62 ++--- .../ibatis/executor/BaseExecutorTest.java | 21 +- .../ibatis/executor/ResultExtractorTest.java | 4 +- .../ibatis/executor/ReuseExecutorTest.java | 4 +- .../executor/loader/CglibProxyTest.java | 14 +- .../executor/loader/JavassistProxyTest.java | 16 +- .../loader/SerializableProxyTest.java | 61 +++-- .../DefaultResultSetHandlerTest.java | 5 +- .../DefaultResultSetHandlerTest2.java | 4 +- .../statement/BaseStatementHandlerTest.java | 166 +++++++------ .../apache/ibatis/io/ResolverUtilTest.java | 22 +- .../org/apache/ibatis/io/ResourcesTest.java | 4 +- .../java/org/apache/ibatis/io/VFSTest.java | 11 +- .../java/org/apache/ibatis/jdbc/SQLTest.java | 6 +- .../apache/ibatis/jdbc/SelectBuilderTest.java | 3 +- .../org/apache/ibatis/jdbc/SqlRunnerTest.java | 5 +- .../apache/ibatis/mapping/BoundSqlTest.java | 10 +- .../ibatis/mapping/CacheBuilderTest.java | 6 +- .../ibatis/parsing/PropertyParserTest.java | 10 +- .../ibatis/parsing/XPathParserTest.java | 5 +- .../org/apache/ibatis/plugin/PluginTest.java | 5 +- .../ibatis/reflection/ExceptionUtilTest.java | 8 +- .../ibatis/reflection/MetaClassTest.java | 6 +- .../ibatis/reflection/MetaObjectTest.java | 9 +- .../ibatis/reflection/ReflectorTest.java | 79 ++++-- .../reflection/TypeParameterResolverTest.java | 12 +- .../factory/DefaultObjectFactoryTest.java | 15 +- .../scripting/LanguageDriverRegistryTest.java | 13 +- .../ancestor_ref/AncestorRefTest.java | 4 +- .../OneManyColumnPrefixTest.java | 4 +- .../ArrayResultTypeTest.java | 7 +- .../submitted/association_nested/Folder.java | 15 +- .../associationtest/AssociationTest.java | 7 +- .../associationtype/AssociationTypeTest.java | 7 +- .../handlers/DummyTypeHandler.java | 32 +-- .../automapping/AutomappingTest.java | 4 +- .../submitted/awful_table/AwfulTable.java | 226 ++++++++++-------- .../submitted/awful_table/AwfulTableTest.java | 4 +- .../ibatis/submitted/basetest/BaseTest.java | 4 +- .../submitted/batch_keys/BatchKeysTest.java | 9 +- .../submitted/batch_test/BatchTest.java | 6 +- .../ibatis/submitted/blobtest/BlobRecord.java | 46 ++-- .../ibatis/submitted/blobtest/BlobTest.java | 142 ++++++----- .../submitted/bringrags/SimpleObjectTest.java | 8 +- 98 files changed, 1031 insertions(+), 891 deletions(-) diff --git a/src/main/java/org/apache/ibatis/type/LongTypeHandler.java b/src/main/java/org/apache/ibatis/type/LongTypeHandler.java index 20f0e7f85be..c2cec77ae65 100644 --- a/src/main/java/org/apache/ibatis/type/LongTypeHandler.java +++ b/src/main/java/org/apache/ibatis/type/LongTypeHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2009-2022 the original author or authors. + * Copyright 2009-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,28 +26,24 @@ public class LongTypeHandler extends BaseTypeHandler { @Override - public void setNonNullParameter(PreparedStatement ps, int i, Long parameter, JdbcType jdbcType) - throws SQLException { + public void setNonNullParameter(PreparedStatement ps, int i, Long parameter, JdbcType jdbcType) throws SQLException { ps.setLong(i, parameter); } @Override - public Long getNullableResult(ResultSet rs, String columnName) - throws SQLException { + public Long getNullableResult(ResultSet rs, String columnName) throws SQLException { long result = rs.getLong(columnName); return result == 0 && rs.wasNull() ? null : result; } @Override - public Long getNullableResult(ResultSet rs, int columnIndex) - throws SQLException { + public Long getNullableResult(ResultSet rs, int columnIndex) throws SQLException { long result = rs.getLong(columnIndex); return result == 0 && rs.wasNull() ? null : result; } @Override - public Long getNullableResult(CallableStatement cs, int columnIndex) - throws SQLException { + public Long getNullableResult(CallableStatement cs, int columnIndex) throws SQLException { long result = cs.getLong(columnIndex); return result == 0 && cs.wasNull() ? null : result; } diff --git a/src/main/java/org/apache/ibatis/type/MappedJdbcTypes.java b/src/main/java/org/apache/ibatis/type/MappedJdbcTypes.java index 8c28541563c..a44e83e74ea 100644 --- a/src/main/java/org/apache/ibatis/type/MappedJdbcTypes.java +++ b/src/main/java/org/apache/ibatis/type/MappedJdbcTypes.java @@ -1,5 +1,5 @@ /* - * Copyright 2009-2022 the original author or authors. + * Copyright 2009-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,15 +23,16 @@ /** * The annotation that specify jdbc types to map {@link TypeHandler}. - * *

* How to use: + * *

- * @MappedJdbcTypes({JdbcType.CHAR, JdbcType.VARCHAR})
+ * @MappedJdbcTypes({ JdbcType.CHAR, JdbcType.VARCHAR })
  * public class StringTrimmingTypeHandler implements TypeHandler<String> {
  *   // ...
  * }
  * 
+ * * @author Eduardo Macarron */ @Documented diff --git a/src/main/java/org/apache/ibatis/type/MappedTypes.java b/src/main/java/org/apache/ibatis/type/MappedTypes.java index ddcb6e8f4a2..7ca770013fb 100644 --- a/src/main/java/org/apache/ibatis/type/MappedTypes.java +++ b/src/main/java/org/apache/ibatis/type/MappedTypes.java @@ -1,5 +1,5 @@ /* - * Copyright 2009-2022 the original author or authors. + * Copyright 2009-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,15 +23,16 @@ /** * The annotation that specify java types to map {@link TypeHandler}. - * *

* How to use: + * *

  * @MappedTypes(String.class)
  * public class StringTrimmingTypeHandler implements TypeHandler<String> {
  *   // ...
  * }
  * 
+ * * @author Eduardo Macarron */ @Documented diff --git a/src/main/java/org/apache/ibatis/type/MonthTypeHandler.java b/src/main/java/org/apache/ibatis/type/MonthTypeHandler.java index 3c7fca680b7..5efc2762efa 100644 --- a/src/main/java/org/apache/ibatis/type/MonthTypeHandler.java +++ b/src/main/java/org/apache/ibatis/type/MonthTypeHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2009-2022 the original author or authors. + * Copyright 2009-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,8 +22,8 @@ import java.time.Month; /** - * * @since 3.4.5 + * * @author Björn Raupach */ public class MonthTypeHandler extends BaseTypeHandler { diff --git a/src/main/java/org/apache/ibatis/type/NClobTypeHandler.java b/src/main/java/org/apache/ibatis/type/NClobTypeHandler.java index e04bc361198..710f02c5d9a 100644 --- a/src/main/java/org/apache/ibatis/type/NClobTypeHandler.java +++ b/src/main/java/org/apache/ibatis/type/NClobTypeHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2009-2022 the original author or authors. + * Copyright 2009-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -35,22 +35,19 @@ public void setNonNullParameter(PreparedStatement ps, int i, String parameter, J } @Override - public String getNullableResult(ResultSet rs, String columnName) - throws SQLException { + public String getNullableResult(ResultSet rs, String columnName) throws SQLException { Clob clob = rs.getClob(columnName); return toString(clob); } @Override - public String getNullableResult(ResultSet rs, int columnIndex) - throws SQLException { + public String getNullableResult(ResultSet rs, int columnIndex) throws SQLException { Clob clob = rs.getClob(columnIndex); return toString(clob); } @Override - public String getNullableResult(CallableStatement cs, int columnIndex) - throws SQLException { + public String getNullableResult(CallableStatement cs, int columnIndex) throws SQLException { Clob clob = cs.getClob(columnIndex); return toString(clob); } diff --git a/src/main/java/org/apache/ibatis/type/NStringTypeHandler.java b/src/main/java/org/apache/ibatis/type/NStringTypeHandler.java index ac4c2bdadd4..1c57102d022 100644 --- a/src/main/java/org/apache/ibatis/type/NStringTypeHandler.java +++ b/src/main/java/org/apache/ibatis/type/NStringTypeHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2009-2022 the original author or authors. + * Copyright 2009-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -32,20 +32,17 @@ public void setNonNullParameter(PreparedStatement ps, int i, String parameter, J } @Override - public String getNullableResult(ResultSet rs, String columnName) - throws SQLException { + public String getNullableResult(ResultSet rs, String columnName) throws SQLException { return rs.getNString(columnName); } @Override - public String getNullableResult(ResultSet rs, int columnIndex) - throws SQLException { + public String getNullableResult(ResultSet rs, int columnIndex) throws SQLException { return rs.getNString(columnIndex); } @Override - public String getNullableResult(CallableStatement cs, int columnIndex) - throws SQLException { + public String getNullableResult(CallableStatement cs, int columnIndex) throws SQLException { return cs.getNString(columnIndex); } diff --git a/src/main/java/org/apache/ibatis/type/ObjectTypeHandler.java b/src/main/java/org/apache/ibatis/type/ObjectTypeHandler.java index 704baaca81e..4552129b1e7 100644 --- a/src/main/java/org/apache/ibatis/type/ObjectTypeHandler.java +++ b/src/main/java/org/apache/ibatis/type/ObjectTypeHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2009-2022 the original author or authors. + * Copyright 2009-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -32,20 +32,17 @@ public void setNonNullParameter(PreparedStatement ps, int i, Object parameter, J } @Override - public Object getNullableResult(ResultSet rs, String columnName) - throws SQLException { + public Object getNullableResult(ResultSet rs, String columnName) throws SQLException { return rs.getObject(columnName); } @Override - public Object getNullableResult(ResultSet rs, int columnIndex) - throws SQLException { + public Object getNullableResult(ResultSet rs, int columnIndex) throws SQLException { return rs.getObject(columnIndex); } @Override - public Object getNullableResult(CallableStatement cs, int columnIndex) - throws SQLException { + public Object getNullableResult(CallableStatement cs, int columnIndex) throws SQLException { return cs.getObject(columnIndex); } } diff --git a/src/main/java/org/apache/ibatis/type/OffsetDateTimeTypeHandler.java b/src/main/java/org/apache/ibatis/type/OffsetDateTimeTypeHandler.java index b816f3ce22a..1cfb3e4fa70 100644 --- a/src/main/java/org/apache/ibatis/type/OffsetDateTimeTypeHandler.java +++ b/src/main/java/org/apache/ibatis/type/OffsetDateTimeTypeHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2009-2022 the original author or authors. + * Copyright 2009-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,13 +23,14 @@ /** * @since 3.4.5 + * * @author Tomas Rohovsky */ public class OffsetDateTimeTypeHandler extends BaseTypeHandler { @Override public void setNonNullParameter(PreparedStatement ps, int i, OffsetDateTime parameter, JdbcType jdbcType) - throws SQLException { + throws SQLException { ps.setObject(i, parameter); } diff --git a/src/main/java/org/apache/ibatis/type/OffsetTimeTypeHandler.java b/src/main/java/org/apache/ibatis/type/OffsetTimeTypeHandler.java index a795715ef7f..0b0a67df4f5 100644 --- a/src/main/java/org/apache/ibatis/type/OffsetTimeTypeHandler.java +++ b/src/main/java/org/apache/ibatis/type/OffsetTimeTypeHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2009-2022 the original author or authors. + * Copyright 2009-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,13 +23,14 @@ /** * @since 3.4.5 + * * @author Tomas Rohovsky */ public class OffsetTimeTypeHandler extends BaseTypeHandler { @Override public void setNonNullParameter(PreparedStatement ps, int i, OffsetTime parameter, JdbcType jdbcType) - throws SQLException { + throws SQLException { ps.setObject(i, parameter); } diff --git a/src/main/java/org/apache/ibatis/type/ShortTypeHandler.java b/src/main/java/org/apache/ibatis/type/ShortTypeHandler.java index 206bcf67293..f52bee7644c 100644 --- a/src/main/java/org/apache/ibatis/type/ShortTypeHandler.java +++ b/src/main/java/org/apache/ibatis/type/ShortTypeHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2009-2022 the original author or authors. + * Copyright 2009-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,28 +26,24 @@ public class ShortTypeHandler extends BaseTypeHandler { @Override - public void setNonNullParameter(PreparedStatement ps, int i, Short parameter, JdbcType jdbcType) - throws SQLException { + public void setNonNullParameter(PreparedStatement ps, int i, Short parameter, JdbcType jdbcType) throws SQLException { ps.setShort(i, parameter); } @Override - public Short getNullableResult(ResultSet rs, String columnName) - throws SQLException { + public Short getNullableResult(ResultSet rs, String columnName) throws SQLException { short result = rs.getShort(columnName); return result == 0 && rs.wasNull() ? null : result; } @Override - public Short getNullableResult(ResultSet rs, int columnIndex) - throws SQLException { + public Short getNullableResult(ResultSet rs, int columnIndex) throws SQLException { short result = rs.getShort(columnIndex); return result == 0 && rs.wasNull() ? null : result; } @Override - public Short getNullableResult(CallableStatement cs, int columnIndex) - throws SQLException { + public Short getNullableResult(CallableStatement cs, int columnIndex) throws SQLException { short result = cs.getShort(columnIndex); return result == 0 && cs.wasNull() ? null : result; } diff --git a/src/main/java/org/apache/ibatis/type/SimpleTypeRegistry.java b/src/main/java/org/apache/ibatis/type/SimpleTypeRegistry.java index e39c5205fd2..4eecbe5a4e4 100644 --- a/src/main/java/org/apache/ibatis/type/SimpleTypeRegistry.java +++ b/src/main/java/org/apache/ibatis/type/SimpleTypeRegistry.java @@ -1,5 +1,5 @@ /* - * Copyright 2009-2022 the original author or authors. + * Copyright 2009-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -50,7 +50,6 @@ private SimpleTypeRegistry() { /* * Tells us if the class passed in is a known common type - * * @param clazz The class to check * @return True if the class is known */ diff --git a/src/main/java/org/apache/ibatis/type/SqlDateTypeHandler.java b/src/main/java/org/apache/ibatis/type/SqlDateTypeHandler.java index 9158764f395..1a07dd55210 100644 --- a/src/main/java/org/apache/ibatis/type/SqlDateTypeHandler.java +++ b/src/main/java/org/apache/ibatis/type/SqlDateTypeHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2009-2022 the original author or authors. + * Copyright 2009-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -27,26 +27,22 @@ public class SqlDateTypeHandler extends BaseTypeHandler { @Override - public void setNonNullParameter(PreparedStatement ps, int i, Date parameter, JdbcType jdbcType) - throws SQLException { + public void setNonNullParameter(PreparedStatement ps, int i, Date parameter, JdbcType jdbcType) throws SQLException { ps.setDate(i, parameter); } @Override - public Date getNullableResult(ResultSet rs, String columnName) - throws SQLException { + public Date getNullableResult(ResultSet rs, String columnName) throws SQLException { return rs.getDate(columnName); } @Override - public Date getNullableResult(ResultSet rs, int columnIndex) - throws SQLException { + public Date getNullableResult(ResultSet rs, int columnIndex) throws SQLException { return rs.getDate(columnIndex); } @Override - public Date getNullableResult(CallableStatement cs, int columnIndex) - throws SQLException { + public Date getNullableResult(CallableStatement cs, int columnIndex) throws SQLException { return cs.getDate(columnIndex); } } diff --git a/src/main/java/org/apache/ibatis/type/SqlTimeTypeHandler.java b/src/main/java/org/apache/ibatis/type/SqlTimeTypeHandler.java index b62acbedf8b..a2c63582298 100644 --- a/src/main/java/org/apache/ibatis/type/SqlTimeTypeHandler.java +++ b/src/main/java/org/apache/ibatis/type/SqlTimeTypeHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2009-2022 the original author or authors. + * Copyright 2009-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -27,26 +27,22 @@ public class SqlTimeTypeHandler extends BaseTypeHandler