Skip to content

[ci] formatting #2793

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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