Skip to content

Commit b175c22

Browse files
authored
Merge pull request #2826 from hazendaz/copyright
More Eclipse based cleanups
2 parents 501db6e + 6c5c478 commit b175c22

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+52
-87
lines changed

src/main/java/org/apache/ibatis/binding/BindingException.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2009-2022 the original author or authors.
2+
* Copyright 2009-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -25,7 +25,6 @@ public class BindingException extends PersistenceException {
2525
private static final long serialVersionUID = 4300802238789381562L;
2626

2727
public BindingException() {
28-
super();
2928
}
3029

3130
public BindingException(String message) {

src/main/java/org/apache/ibatis/binding/MapperProxy.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,6 @@ private static class PlainMethodInvoker implements MapperMethodInvoker {
134134
private final MapperMethod mapperMethod;
135135

136136
public PlainMethodInvoker(MapperMethod mapperMethod) {
137-
super();
138137
this.mapperMethod = mapperMethod;
139138
}
140139

@@ -148,7 +147,6 @@ private static class DefaultMethodInvoker implements MapperMethodInvoker {
148147
private final MethodHandle methodHandle;
149148

150149
public DefaultMethodInvoker(MethodHandle methodHandle) {
151-
super();
152150
this.methodHandle = methodHandle;
153151
}
154152

src/main/java/org/apache/ibatis/builder/BuilderException.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2009-2022 the original author or authors.
2+
* Copyright 2009-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -25,7 +25,6 @@ public class BuilderException extends PersistenceException {
2525
private static final long serialVersionUID = -3885164021020443281L;
2626

2727
public BuilderException() {
28-
super();
2928
}
3029

3130
public BuilderException(String message) {

src/main/java/org/apache/ibatis/builder/IncompleteElementException.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2009-2022 the original author or authors.
2+
* Copyright 2009-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -22,7 +22,6 @@ public class IncompleteElementException extends BuilderException {
2222
private static final long serialVersionUID = -3697292286890900315L;
2323

2424
public IncompleteElementException() {
25-
super();
2625
}
2726

2827
public IncompleteElementException(String message, Throwable cause) {

src/main/java/org/apache/ibatis/builder/annotation/MapperAnnotationBuilder.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ private void parseCacheRef() {
215215
if (refType != void.class && !refName.isEmpty()) {
216216
throw new BuilderException("Cannot use both value() and name() attribute in the @CacheNamespaceRef");
217217
}
218-
String namespace = (refType != void.class) ? refType.getName() : refName;
218+
String namespace = refType != void.class ? refType.getName() : refName;
219219
try {
220220
assistant.useCacheRef(namespace);
221221
} catch (IncompleteElementException e) {
@@ -462,8 +462,8 @@ private void applyResults(Result[] results, Class<?> resultType, List<ResultMapp
462462
flags.add(ResultFlag.ID);
463463
}
464464
@SuppressWarnings("unchecked")
465-
Class<? extends TypeHandler<?>> typeHandler = (Class<? extends TypeHandler<?>>) ((result
466-
.typeHandler() == UnknownTypeHandler.class) ? null : result.typeHandler());
465+
Class<? extends TypeHandler<?>> typeHandler = (Class<? extends TypeHandler<?>>) (result
466+
.typeHandler() == UnknownTypeHandler.class ? null : result.typeHandler());
467467
boolean hasNestedResultMap = hasNestedResultMap(result);
468468
ResultMapping resultMapping = assistant.buildResultMapping(resultType, nullOrEmpty(result.property()),
469469
nullOrEmpty(result.column()), result.javaType() == void.class ? null : result.javaType(),
@@ -657,14 +657,13 @@ public static Class<?> getMethodReturnType(String mapperFqn, String localStateme
657657
return null;
658658
}
659659

660-
private class AnnotationWrapper {
660+
private static class AnnotationWrapper {
661661
private final Annotation annotation;
662662
private final String databaseId;
663663
private final SqlCommandType sqlCommandType;
664664
private boolean dirtySelect;
665665

666666
AnnotationWrapper(Annotation annotation) {
667-
super();
668667
this.annotation = annotation;
669668
if (annotation instanceof Select) {
670669
databaseId = ((Select) annotation).databaseId();

src/main/java/org/apache/ibatis/cache/CacheException.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2009-2022 the original author or authors.
2+
* Copyright 2009-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -25,7 +25,6 @@ public class CacheException extends PersistenceException {
2525
private static final long serialVersionUID = -193202262468464650L;
2626

2727
public CacheException() {
28-
super();
2928
}
3029

3130
public CacheException(String message) {

src/main/java/org/apache/ibatis/cache/CacheKey.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ public class CacheKey implements Cloneable, Serializable {
3131

3232
public static final CacheKey NULL_CACHE_KEY = new CacheKey() {
3333

34+
private static final long serialVersionUID = 1L;
35+
3436
@Override
3537
public void update(Object object) {
3638
throw new CacheException("Not allowed to update a null cache key instance.");

src/main/java/org/apache/ibatis/cache/NullCacheKey.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ public final class NullCacheKey extends CacheKey {
2626
private static final long serialVersionUID = 3704229911977019465L;
2727

2828
public NullCacheKey() {
29-
super();
3029
}
3130

3231
@Override

src/main/java/org/apache/ibatis/cache/decorators/LruCache.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2009-2022 the original author or authors.
2+
* Copyright 2009-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

src/main/java/org/apache/ibatis/datasource/DataSourceException.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2009-2022 the original author or authors.
2+
* Copyright 2009-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -25,7 +25,6 @@ public class DataSourceException extends PersistenceException {
2525
private static final long serialVersionUID = -5251396250407091334L;
2626

2727
public DataSourceException() {
28-
super();
2928
}
3029

3130
public DataSourceException(String message) {

src/main/java/org/apache/ibatis/datasource/pooled/PooledConnection.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
class PooledConnection implements InvocationHandler {
3030

3131
private static final String CLOSE = "close";
32-
private static final Class<?>[] IFACES = new Class<?>[] { Connection.class };
32+
private static final Class<?>[] IFACES = { Connection.class };
3333

3434
private final int hashCode;
3535
private final PooledDataSource dataSource;

src/main/java/org/apache/ibatis/datasource/pooled/PooledDataSource.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ private PooledConnection popConnection(String username, String password) throws
523523
state.badConnectionCount++;
524524
localBadConnectionCount++;
525525
conn = null;
526-
if (localBadConnectionCount > (poolMaximumIdleConnections + poolMaximumLocalBadConnectionTolerance)) {
526+
if (localBadConnectionCount > poolMaximumIdleConnections + poolMaximumLocalBadConnectionTolerance) {
527527
if (log.isDebugEnabled()) {
528528
log.debug("PooledDataSource: Could not get a good connection to the database.");
529529
}

src/main/java/org/apache/ibatis/exceptions/IbatisException.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2009-2022 the original author or authors.
2+
* Copyright 2009-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -24,7 +24,6 @@ public class IbatisException extends RuntimeException {
2424
private static final long serialVersionUID = 3880206998166270511L;
2525

2626
public IbatisException() {
27-
super();
2827
}
2928

3029
public IbatisException(String message) {

src/main/java/org/apache/ibatis/exceptions/PersistenceException.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2009-2022 the original author or authors.
2+
* Copyright 2009-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -24,7 +24,6 @@ public class PersistenceException extends IbatisException {
2424
private static final long serialVersionUID = -7537395265357977271L;
2525

2626
public PersistenceException() {
27-
super();
2827
}
2928

3029
public PersistenceException(String message) {

src/main/java/org/apache/ibatis/exceptions/TooManyResultsException.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2009-2022 the original author or authors.
2+
* Copyright 2009-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -23,7 +23,6 @@ public class TooManyResultsException extends PersistenceException {
2323
private static final long serialVersionUID = 8935197089745865786L;
2424

2525
public TooManyResultsException() {
26-
super();
2726
}
2827

2928
public TooManyResultsException(String message) {

src/main/java/org/apache/ibatis/executor/BatchResult.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2009-2022 the original author or authors.
2+
* Copyright 2009-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -32,7 +32,6 @@ public class BatchResult {
3232
private int[] updateCounts;
3333

3434
public BatchResult(MappedStatement mappedStatement, String sql) {
35-
super();
3635
this.mappedStatement = mappedStatement;
3736
this.sql = sql;
3837
this.parameterObjects = new ArrayList<>();

src/main/java/org/apache/ibatis/executor/ExecutorException.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2009-2022 the original author or authors.
2+
* Copyright 2009-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -25,7 +25,6 @@ public class ExecutorException extends PersistenceException {
2525
private static final long serialVersionUID = 4060977051977364820L;
2626

2727
public ExecutorException() {
28-
super();
2928
}
3029

3130
public ExecutorException(String message) {

src/main/java/org/apache/ibatis/executor/keygen/Jdbc3KeyGenerator.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ private static Collection<?> collectionize(Object param) {
229229
}
230230
}
231231

232-
private class KeyAssigner {
232+
private static class KeyAssigner {
233233
private final Configuration configuration;
234234
private final ResultSetMetaData rsmd;
235235
private final TypeHandlerRegistry typeHandlerRegistry;
@@ -240,7 +240,6 @@ private class KeyAssigner {
240240

241241
protected KeyAssigner(Configuration configuration, ResultSetMetaData rsmd, int columnPosition, String paramName,
242242
String propertyName) {
243-
super();
244243
this.configuration = configuration;
245244
this.rsmd = rsmd;
246245
this.typeHandlerRegistry = configuration.getTypeHandlerRegistry();

src/main/java/org/apache/ibatis/executor/loader/AbstractSerialStateHolder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public abstract class AbstractSerialStateHolder implements Externalizable {
4242

4343
private static final long serialVersionUID = 8940388717901644661L;
4444
private static final ThreadLocal<ObjectOutputStream> stream = new ThreadLocal<>();
45-
private byte[] userBeanBytes = new byte[0];
45+
private byte[] userBeanBytes = {};
4646
private Object userBean;
4747
private Map<String, ResultLoaderMap.LoadPair> unloadedProperties;
4848
private ObjectFactory objectFactory;

src/main/java/org/apache/ibatis/executor/resultset/DefaultResultSetHandler.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@ private boolean applyPropertyMappings(ResultSetWrapper rsw, ResultMap resultMap,
486486
column = null;
487487
}
488488
if (propertyMapping.isCompositeResult()
489-
|| (column != null && mappedColumnNames.contains(column.toUpperCase(Locale.ENGLISH)))
489+
|| column != null && mappedColumnNames.contains(column.toUpperCase(Locale.ENGLISH))
490490
|| propertyMapping.getResultSet() != null) {
491491
Object value = getPropertyMappingValue(rsw.getResultSet(), metaObject, propertyMapping, lazyLoader,
492492
columnPrefix);
@@ -503,7 +503,7 @@ private boolean applyPropertyMappings(ResultSetWrapper rsw, ResultMap resultMap,
503503
foundValues = true;
504504
}
505505
if (value != null
506-
|| (configuration.isCallSettersOnNulls() && !metaObject.getSetterType(property).isPrimitive())) {
506+
|| configuration.isCallSettersOnNulls() && !metaObject.getSetterType(property).isPrimitive()) {
507507
// gcode issue #377, call setter on nulls (value is not 'found')
508508
metaObject.setValue(property, value);
509509
}
@@ -565,7 +565,7 @@ private List<UnMappedColumnAutoMapping> createAutomaticMappings(ResultSetWrapper
565565
}
566566
} else {
567567
configuration.getAutoMappingUnknownColumnBehavior().doAction(mappedStatement, columnName,
568-
(property != null) ? property : propertyName, null);
568+
property != null ? property : propertyName, null);
569569
}
570570
}
571571
autoMappingsCache.put(mapKey, autoMapping);
@@ -583,7 +583,7 @@ private boolean applyAutomaticMappings(ResultSetWrapper rsw, ResultMap resultMap
583583
if (value != null) {
584584
foundValues = true;
585585
}
586-
if (value != null || (configuration.isCallSettersOnNulls() && !mapping.primitive)) {
586+
if (value != null || configuration.isCallSettersOnNulls() && !mapping.primitive) {
587587
// gcode issue #377, call setter on nulls (value is not 'found')
588588
metaObject.setValue(mapping.property, value);
589589
}
@@ -764,8 +764,8 @@ private Object applyConstructorAutomapping(ResultSetWrapper rsw, ResultMap resul
764764
throws SQLException {
765765
boolean foundValues = false;
766766
if (configuration.isArgNameBasedConstructorAutoMapping()) {
767-
foundValues = applyArgNameBasedConstructorAutoMapping(rsw, resultMap, columnPrefix, resultType,
768-
constructorArgTypes, constructorArgs, constructor, foundValues);
767+
foundValues = applyArgNameBasedConstructorAutoMapping(rsw, resultMap, columnPrefix, constructorArgTypes,
768+
constructorArgs, constructor, foundValues);
769769
} else {
770770
foundValues = applyColumnOrderBasedConstructorAutomapping(rsw, constructorArgTypes, constructorArgs, constructor,
771771
foundValues);
@@ -789,8 +789,8 @@ private boolean applyColumnOrderBasedConstructorAutomapping(ResultSetWrapper rsw
789789
}
790790

791791
private boolean applyArgNameBasedConstructorAutoMapping(ResultSetWrapper rsw, ResultMap resultMap,
792-
String columnPrefix, Class<?> resultType, List<Class<?>> constructorArgTypes, List<Object> constructorArgs,
793-
Constructor<?> constructor, boolean foundValues) throws SQLException {
792+
String columnPrefix, List<Class<?>> constructorArgTypes, List<Object> constructorArgs, Constructor<?> constructor,
793+
boolean foundValues) throws SQLException {
794794
List<String> missingArgs = null;
795795
Parameter[] params = constructor.getParameters();
796796
for (Parameter param : params) {

src/main/java/org/apache/ibatis/executor/resultset/ResultSetWrapper.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ public class ResultSetWrapper {
5151
private final Map<String, List<String>> unMappedColumnNamesMap = new HashMap<>();
5252

5353
public ResultSetWrapper(ResultSet rs, Configuration configuration) throws SQLException {
54-
super();
5554
this.typeHandlerRegistry = configuration.getTypeHandlerRegistry();
5655
this.resultSet = rs;
5756
final ResultSetMetaData metaData = rs.getMetaData();

src/main/java/org/apache/ibatis/io/VFS.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,7 @@ private static class VFSHolder {
5050
@SuppressWarnings("unchecked")
5151
static VFS createVFS() {
5252
// Try the user implementations first, then the built-ins
53-
List<Class<? extends VFS>> impls = new ArrayList<>();
54-
impls.addAll(USER_IMPLEMENTATIONS);
53+
List<Class<? extends VFS>> impls = new ArrayList<>(USER_IMPLEMENTATIONS);
5554
impls.addAll(Arrays.asList((Class<? extends VFS>[]) IMPLEMENTATIONS));
5655

5756
// Try each implementation class until a valid one is found

src/main/java/org/apache/ibatis/jdbc/AbstractSQL.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,6 @@ private static class SafeAppendable {
538538
private boolean empty = true;
539539

540540
public SafeAppendable(Appendable a) {
541-
super();
542541
this.appendable = a;
543542
}
544543

src/main/java/org/apache/ibatis/jdbc/RuntimeSqlException.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2009-2022 the original author or authors.
2+
* Copyright 2009-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -23,7 +23,6 @@ public class RuntimeSqlException extends RuntimeException {
2323
private static final long serialVersionUID = 5224696788505678598L;
2424

2525
public RuntimeSqlException() {
26-
super();
2726
}
2827

2928
public RuntimeSqlException(String message) {

src/main/java/org/apache/ibatis/jdbc/ScriptRunner.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ private void executeStatement(String command) throws SQLException {
248248
}
249249
try {
250250
boolean hasResults = statement.execute(sql);
251-
while (!(!hasResults && statement.getUpdateCount() == -1)) {
251+
while ((hasResults || (statement.getUpdateCount() != -1))) {
252252
checkWarnings(statement);
253253
printResults(statement, hasResults);
254254
hasResults = statement.getMoreResults();

src/main/java/org/apache/ibatis/logging/LogException.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2009-2022 the original author or authors.
2+
* Copyright 2009-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -25,7 +25,6 @@ public class LogException extends PersistenceException {
2525
private static final long serialVersionUID = 1022924004852350942L;
2626

2727
public LogException() {
28-
super();
2928
}
3029

3130
public LogException(String message) {

0 commit comments

Comments
 (0)