Skip to content

Commit

Permalink
[ci] formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
hazendaz committed Feb 4, 2023
1 parent 8c563b3 commit cc2f0a7
Show file tree
Hide file tree
Showing 98 changed files with 1,031 additions and 891 deletions.
14 changes: 5 additions & 9 deletions src/main/java/org/apache/ibatis/type/LongTypeHandler.java
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -26,28 +26,24 @@
public class LongTypeHandler extends BaseTypeHandler<Long> {

@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;
}
Expand Down
7 changes: 4 additions & 3 deletions src/main/java/org/apache/ibatis/type/MappedJdbcTypes.java
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -23,15 +23,16 @@

/**
* The annotation that specify jdbc types to map {@link TypeHandler}.
*
* <p>
* <b>How to use:</b>
*
* <pre>
* &#064;MappedJdbcTypes({JdbcType.CHAR, JdbcType.VARCHAR})
* &#064;MappedJdbcTypes({ JdbcType.CHAR, JdbcType.VARCHAR })
* public class StringTrimmingTypeHandler implements TypeHandler&lt;String&gt; {
* // ...
* }
* </pre>
*
* @author Eduardo Macarron
*/
@Documented
Expand Down
5 changes: 3 additions & 2 deletions src/main/java/org/apache/ibatis/type/MappedTypes.java
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -23,15 +23,16 @@

/**
* The annotation that specify java types to map {@link TypeHandler}.
*
* <p>
* <b>How to use:</b>
*
* <pre>
* &#064;MappedTypes(String.class)
* public class StringTrimmingTypeHandler implements TypeHandler&lt;String&gt; {
* // ...
* }
* </pre>
*
* @author Eduardo Macarron
*/
@Documented
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/apache/ibatis/type/MonthTypeHandler.java
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -22,8 +22,8 @@
import java.time.Month;

/**
*
* @since 3.4.5
*
* @author Björn Raupach
*/
public class MonthTypeHandler extends BaseTypeHandler<Month> {
Expand Down
11 changes: 4 additions & 7 deletions src/main/java/org/apache/ibatis/type/NClobTypeHandler.java
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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);
}
Expand Down
11 changes: 4 additions & 7 deletions src/main/java/org/apache/ibatis/type/NStringTypeHandler.java
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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);
}

Expand Down
11 changes: 4 additions & 7 deletions src/main/java/org/apache/ibatis/type/ObjectTypeHandler.java
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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);
}
}
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -23,13 +23,14 @@

/**
* @since 3.4.5
*
* @author Tomas Rohovsky
*/
public class OffsetDateTimeTypeHandler extends BaseTypeHandler<OffsetDateTime> {

@Override
public void setNonNullParameter(PreparedStatement ps, int i, OffsetDateTime parameter, JdbcType jdbcType)
throws SQLException {
throws SQLException {
ps.setObject(i, parameter);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -23,13 +23,14 @@

/**
* @since 3.4.5
*
* @author Tomas Rohovsky
*/
public class OffsetTimeTypeHandler extends BaseTypeHandler<OffsetTime> {

@Override
public void setNonNullParameter(PreparedStatement ps, int i, OffsetTime parameter, JdbcType jdbcType)
throws SQLException {
throws SQLException {
ps.setObject(i, parameter);
}

Expand Down
14 changes: 5 additions & 9 deletions src/main/java/org/apache/ibatis/type/ShortTypeHandler.java
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -26,28 +26,24 @@
public class ShortTypeHandler extends BaseTypeHandler<Short> {

@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;
}
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/org/apache/ibatis/type/SimpleTypeRegistry.java
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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
*/
Expand Down
14 changes: 5 additions & 9 deletions src/main/java/org/apache/ibatis/type/SqlDateTypeHandler.java
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -27,26 +27,22 @@
public class SqlDateTypeHandler extends BaseTypeHandler<Date> {

@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);
}
}
14 changes: 5 additions & 9 deletions src/main/java/org/apache/ibatis/type/SqlTimeTypeHandler.java
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -27,26 +27,22 @@
public class SqlTimeTypeHandler extends BaseTypeHandler<Time> {

@Override
public void setNonNullParameter(PreparedStatement ps, int i, Time parameter, JdbcType jdbcType)
throws SQLException {
public void setNonNullParameter(PreparedStatement ps, int i, Time parameter, JdbcType jdbcType) throws SQLException {
ps.setTime(i, parameter);
}

@Override
public Time getNullableResult(ResultSet rs, String columnName)
throws SQLException {
public Time getNullableResult(ResultSet rs, String columnName) throws SQLException {
return rs.getTime(columnName);
}

@Override
public Time getNullableResult(ResultSet rs, int columnIndex)
throws SQLException {
public Time getNullableResult(ResultSet rs, int columnIndex) throws SQLException {
return rs.getTime(columnIndex);
}

@Override
public Time getNullableResult(CallableStatement cs, int columnIndex)
throws SQLException {
public Time getNullableResult(CallableStatement cs, int columnIndex) throws SQLException {
return cs.getTime(columnIndex);
}
}
Loading

0 comments on commit cc2f0a7

Please sign in to comment.