Author: tv
Date: Sun Apr 21 14:06:23 2024
New Revision: 1917245
URL: http://svn.apache.org/viewvc?rev=1917245&view=rev
Log:
Eclipse cleanup
Modified:
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/ColumnImpl.java
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/Database.java
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/Torque.java
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/TorqueInstance.java
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/AbstractAdapter.java
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/IDMethod.java
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/OracleAdapter.java
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/avalon/Torque.java
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/criteria/Criterion.java
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/criteria/FromElement.java
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/criteria/JoinType.java
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/criteria/PreparedStatementPartImpl.java
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/criteria/SqlEnum.java
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/dsfactory/AbstractDataSourceFactory.java
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/dsfactory/converters/DurationConverter.java
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/manager/AbstractBaseManager.java
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/manager/MethodCacheKey.java
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/map/DatabaseMap.java
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/map/TableMap.java
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/oid/IDBroker.java
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/om/ComboKey.java
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/om/ObjectKey.java
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/om/mapper/IntegerMapper.java
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/om/mapper/LongMapper.java
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/sql/OrderBy.java
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/sql/SqlBuilder.java
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/sql/WhereClauseExpression.java
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/util/AbstractPeerImpl.java
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/util/AvgHelper.java
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/util/BasePeerImpl.java
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/util/ExceptionMapperImpl.java
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/util/JdbcTypedValue.java
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/util/LargeSelect.java
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/util/ResultsetSpliterator.java
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/util/TorqueConnectionImpl.java
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/util/TransactionManagerImpl.java
db/torque/trunk/torque-runtime/src/test/java/org/apache/torque/ColumnImplTest.java
db/torque/trunk/torque-runtime/src/test/java/org/apache/torque/MockBaseTestCase.java
db/torque/trunk/torque-runtime/src/test/java/org/apache/torque/criteria/CriteriaTest.java
db/torque/trunk/torque-runtime/src/test/java/org/apache/torque/criteria/CriterionTest.java
db/torque/trunk/torque-runtime/src/test/java/org/apache/torque/om/ComboKeyTest.java
db/torque/trunk/torque-runtime/src/test/java/org/apache/torque/om/NumberKeyTest.java
db/torque/trunk/torque-runtime/src/test/java/org/apache/torque/om/mapper/BigDecimalMapperTest.java
db/torque/trunk/torque-runtime/src/test/java/org/apache/torque/om/mapper/CompositeMapperTest.java
db/torque/trunk/torque-runtime/src/test/java/org/apache/torque/om/mapper/IntegerMapperTest.java
db/torque/trunk/torque-runtime/src/test/java/org/apache/torque/om/mapper/ObjectListMapperTest.java
db/torque/trunk/torque-runtime/src/test/java/org/apache/torque/om/mapper/StringMapperTest.java
db/torque/trunk/torque-runtime/src/test/java/org/apache/torque/sql/SqlBuilderTest.java
db/torque/trunk/torque-runtime/src/test/java/org/apache/torque/util/BasePeerImplTest.java
db/torque/trunk/torque-runtime/src/test/java/org/apache/torque/util/SummaryHelperTest.java
db/torque/trunk/torque-runtime/src/test/java/org/apache/torque/util/functions/AbstractFunctionTest.java
db/torque/trunk/torque-runtime/src/test/java/org/apache/torque/util/functions/AggregateFunctionTest.java
db/torque/trunk/torque-runtime/src/test/resources/log4j2-test.xml
Modified:
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/ColumnImpl.java
URL:
http://svn.apache.org/viewvc/db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/ColumnImpl.java?rev=1917245&r1=1917244&r2=1917245&view=diff
==============================================================================
---
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/ColumnImpl.java
(original)
+++
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/ColumnImpl.java
Sun Apr 21 14:06:23 2024
@@ -393,11 +393,7 @@ public class ColumnImpl implements Colum
{
return true;
}
- if (obj == null)
- {
- return false;
- }
- if (getClass() != obj.getClass())
+ if ((obj == null) || (getClass() != obj.getClass()))
{
return false;
}
Modified:
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/Database.java
URL:
http://svn.apache.org/viewvc/db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/Database.java?rev=1917245&r1=1917244&r2=1917245&view=diff
==============================================================================
---
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/Database.java
(original)
+++
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/Database.java
Sun Apr 21 14:06:23 2024
@@ -50,7 +50,7 @@ public class Database
/**
* The Map of this database.
*/
- private DatabaseMap databaseMap;
+ private final DatabaseMap databaseMap;
/**
* The DataSourceFactory to obtain connections to this database.
@@ -122,7 +122,7 @@ public class Database
/**
* Returns the database map for this database.
- *
+ *
* @return the DatabaseMap for this database, or null
* if no DatabaseMap exists for this database.
*/
Modified:
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/Torque.java
URL:
http://svn.apache.org/viewvc/db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/Torque.java?rev=1917245&r1=1917244&r2=1917245&view=diff
==============================================================================
--- db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/Torque.java
(original)
+++ db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/Torque.java
Sun Apr 21 14:06:23 2024
@@ -472,8 +472,8 @@ public final class Torque
/**
* Returns a Map containing all Databases registered to Torque.
* The key of the Map is the name of the database, and the value is the
- * database instance.
- *
+ * database instance.
+ *
* <p>
* Note that in the very special case where a new database which
* is not configured in Torque's configuration gets known to Torque
Modified:
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/TorqueInstance.java
URL:
http://svn.apache.org/viewvc/db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/TorqueInstance.java?rev=1917245&r1=1917244&r2=1917245&view=diff
==============================================================================
---
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/TorqueInstance.java
(original)
+++
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/TorqueInstance.java
Sun Apr 21 14:06:23 2024
@@ -1269,6 +1269,6 @@ public class TorqueInstance
throw new NullPointerException("databaseName is null");
}
- return databases.computeIfAbsent(databaseName, key -> new
Database(key));
+ return databases.computeIfAbsent(databaseName, Database::new);
}
}
Modified:
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/AbstractAdapter.java
URL:
http://svn.apache.org/viewvc/db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/AbstractAdapter.java?rev=1917245&r1=1917244&r2=1917245&view=diff
==============================================================================
---
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/AbstractAdapter.java
(original)
+++
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/AbstractAdapter.java
Sun Apr 21 14:06:23 2024
@@ -290,6 +290,7 @@ public abstract class AbstractAdapter im
*
* @return a <code>boolean</code> value
*/
+ @Override
public boolean useGetGeneratedKeys()
{
return this.useGetGeneratedKeys;
@@ -302,6 +303,7 @@ public abstract class AbstractAdapter im
* @param dmd database meta data
* @throws SQLException if there are problems getting the JDBC meta data
*/
+ @Override
public void setCapabilities(DatabaseMetaData dmd) throws SQLException
{
this.useGetGeneratedKeys = dmd.supportsGetGeneratedKeys();
Modified:
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/IDMethod.java
URL:
http://svn.apache.org/viewvc/db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/IDMethod.java?rev=1917245&r1=1917244&r2=1917245&view=diff
==============================================================================
---
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/IDMethod.java
(original)
+++
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/IDMethod.java
Sun Apr 21 14:06:23 2024
@@ -55,14 +55,14 @@ public enum IDMethod
NO_ID_METHOD("none");
/** The name of the id method. */
- private String idMethod;
+ private final String idMethod;
/**
* Constructor.
*
* @param idMethod the text of the idMethod.
*/
- private IDMethod(String idMethod)
+ IDMethod(String idMethod)
{
this.idMethod = idMethod;
}
Modified:
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/OracleAdapter.java
URL:
http://svn.apache.org/viewvc/db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/OracleAdapter.java?rev=1917245&r1=1917244&r2=1917245&view=diff
==============================================================================
---
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/OracleAdapter.java
(original)
+++
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/OracleAdapter.java
Sun Apr 21 14:06:23 2024
@@ -88,7 +88,7 @@ public class OracleAdapter extends Abstr
/**
* @see
org.apache.torque.adapter.AbstractAdapter#getIDMethodSQL(java.lang.Object)
- *
+ *
* Returns the next key from a sequence. Uses the following
* implementation:
*
Modified:
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/avalon/Torque.java
URL:
http://svn.apache.org/viewvc/db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/avalon/Torque.java?rev=1917245&r1=1917244&r2=1917245&view=diff
==============================================================================
---
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/avalon/Torque.java
(original)
+++
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/avalon/Torque.java
Sun Apr 21 14:06:23 2024
@@ -200,7 +200,7 @@ extends Component
* Returns a Map containing all Databases registered to Torque.
* The key of the Map is the name of the database, and the value is the
* database instance.
- *
+ *
* <p>
* Note that in the very special case where a new database which
* is not configured in Torque's configuration gets known to Torque
Modified:
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/criteria/Criterion.java
URL:
http://svn.apache.org/viewvc/db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/criteria/Criterion.java?rev=1917245&r1=1917244&r2=1917245&view=diff
==============================================================================
---
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/criteria/Criterion.java
(original)
+++
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/criteria/Criterion.java
Sun Apr 21 14:06:23 2024
@@ -394,7 +394,7 @@ public class Criterion implements Serial
*
* @param criterion the criterion to and with this criterion,
* not null.
- *
+ *
* @return the modified Criteria object.
*
*/
@@ -410,7 +410,7 @@ public class Criterion implements Serial
*
* @param criterion the criterion to and with this criterion,
* not null.
- *
+ *
* @return the modified Criteria object.
*/
public Criterion or(final Criterion criterion)
@@ -459,7 +459,7 @@ public class Criterion implements Serial
/**
* Appends a debug String representation of the Criterion
* onto the String builder.
- *
+ *
* @param sb the string representation
*/
public void appendTo(final StringBuilder sb)
@@ -541,7 +541,7 @@ public class Criterion implements Serial
/* (non-Javadoc)
* @see java.lang.Object#equals(java.lang.Object)
- *
+ *
* This method checks another Criteria.Criterion to see if they contain
* the same attributes.
*/
@@ -552,11 +552,7 @@ public class Criterion implements Serial
{
return true;
}
- if (obj == null)
- {
- return false;
- }
- if (obj.getClass() != this.getClass())
+ if ((obj == null) || (obj.getClass() != this.getClass()))
{
return false;
}
@@ -577,7 +573,7 @@ public class Criterion implements Serial
/* (non-Javadoc)
* @see java.lang.Object#hashCode()
- *
+ *
* Returns a hash code value for the object.
*/
@Override
Modified:
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/criteria/FromElement.java
URL:
http://svn.apache.org/viewvc/db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/criteria/FromElement.java?rev=1917245&r1=1917244&r2=1917245&view=diff
==============================================================================
---
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/criteria/FromElement.java
(original)
+++
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/criteria/FromElement.java
Sun Apr 21 14:06:23 2024
@@ -73,7 +73,7 @@ public class FromElement implements Seri
* e.g. a simple table name or a table name with an alias,
* <p> table_1 </p>
* <p> table_1 alias_for_table_1 </p>
- *
+ *
* @param joinType the type of the join, e.g. JoinType.LEFT_JOIN,
* or null if no excplicit join is wanted
* @param joinCondition the join condition,
@@ -97,7 +97,7 @@ public class FromElement implements Seri
* e.g. a simple table name or a table name with an alias,
* <p> table_1 </p>
* <p> table_1 alias_for_table_1 </p>
- *
+ *
* @param joinType the type of the join, e.g. JoinType.LEFT_JOIN,
* or null if no explicit join is wanted
* @param joinCondition the join condition,
@@ -131,7 +131,7 @@ public class FromElement implements Seri
* e.g. a simple table name or a table name with an alias,
* <p> table_1 </p>
* <p> table_1 alias_for_table_1 </p>
- *
+ *
* @param joinType the type of the join, e.g. JoinType.LEFT_JOIN,
* or null if no explicit join is wanted
* @param joinCondition the join condition,
@@ -239,11 +239,7 @@ public class FromElement implements Seri
{
return true;
}
- if (obj == null)
- {
- return false;
- }
- if (getClass() != obj.getClass())
+ if ((obj == null) || (getClass() != obj.getClass()))
{
return false;
}
Modified:
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/criteria/JoinType.java
URL:
http://svn.apache.org/viewvc/db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/criteria/JoinType.java?rev=1917245&r1=1917244&r2=1917245&view=diff
==============================================================================
---
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/criteria/JoinType.java
(original)
+++
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/criteria/JoinType.java
Sun Apr 21 14:06:23 2024
@@ -34,14 +34,14 @@ public enum JoinType
INNER_JOIN(" INNER JOIN ");
/** The SQL expression for the join type. */
- private String sql;
+ private final String sql;
/**
* Constructor.
*
* @param sql The SQL expression for the join type.
*/
- private JoinType(String sql)
+ JoinType(String sql)
{
this.sql = sql;
}
Modified:
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/criteria/PreparedStatementPartImpl.java
URL:
http://svn.apache.org/viewvc/db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/criteria/PreparedStatementPartImpl.java?rev=1917245&r1=1917244&r2=1917245&view=diff
==============================================================================
---
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/criteria/PreparedStatementPartImpl.java
(original)
+++
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/criteria/PreparedStatementPartImpl.java
Sun Apr 21 14:06:23 2024
@@ -171,11 +171,7 @@ public class PreparedStatementPartImpl i
{
return true;
}
- if (obj == null)
- {
- return false;
- }
- if (getClass() != obj.getClass())
+ if ((obj == null) || (getClass() != obj.getClass()))
{
return false;
}
Modified:
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/criteria/SqlEnum.java
URL:
http://svn.apache.org/viewvc/db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/criteria/SqlEnum.java?rev=1917245&r1=1917244&r2=1917245&view=diff
==============================================================================
---
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/criteria/SqlEnum.java
(original)
+++
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/criteria/SqlEnum.java
Sun Apr 21 14:06:23 2024
@@ -181,12 +181,7 @@ public final class SqlEnum implements ja
@Override
public boolean equals(final Object o)
{
- if (o == null)
- {
- return false;
- }
-
- if (!(o instanceof SqlEnum))
+ if ((o == null) || !(o instanceof SqlEnum))
{
return false;
}
Modified:
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/dsfactory/AbstractDataSourceFactory.java
URL:
http://svn.apache.org/viewvc/db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/dsfactory/AbstractDataSourceFactory.java?rev=1917245&r1=1917244&r2=1917245&view=diff
==============================================================================
---
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/dsfactory/AbstractDataSourceFactory.java
(original)
+++
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/dsfactory/AbstractDataSourceFactory.java
Sun Apr 21 14:06:23 2024
@@ -65,11 +65,11 @@ implements DataSourceFactory
public static final String DEFAULT_CONNECTION_KEY
= DEFAULTS_KEY + "." + CONNECTION_KEY;
-
- /** if format described in {@link Duration#parse(CharSequence)} should be
used. */
+
+ /** if format described in {@link Duration#parse(CharSequence)} should be
used. */
public static boolean USE_DURATION_TEXT_FORMAT = true;
-
-
+
+
/** The log */
private static final Logger log =
LogManager.getLogger(AbstractDataSourceFactory.class);
@@ -132,13 +132,13 @@ implements DataSourceFactory
else
{
Class<?> propertyType =
-
+
PropertyUtils.getPropertyType(ds, property);
-
+
Object value = null;
// could use also configuration2 converter
- // value = (Duration.class.isInstance( propertyType ))?
value = c.getDuration( property):
- value = ConvertUtils.convert(c.getString(property),
propertyType);
+ // value = (Duration.class.isInstance( propertyType ))?
value = c.getDuration( property):
+ value = ConvertUtils.convert(c.getString(property),
propertyType);
PropertyUtils.setSimpleProperty(ds, property, value);
log.info("setSimpleProperty({}, {}, {})", propertyType,
property, value);
@@ -239,11 +239,11 @@ implements DataSourceFactory
}
else
{
-
+
Configuration conf = c.subset(DEFAULT_POOL_KEY);
-
+
applyAndRemoveGlobal( conf );
-
+
applyConfiguration(conf, dataSource);
}
@@ -256,11 +256,11 @@ implements DataSourceFactory
Configuration global = conf.subset( "global" );
USE_DURATION_TEXT_FORMAT = global.getBoolean( "useDurationTextFormat",
true );
log.info("useDurationTextFormat: {} ", USE_DURATION_TEXT_FORMAT);
-
+
if (ConvertUtils.lookup( Duration.class ) == null) {
ConvertUtils.register(
USE_DURATION_TEXT_FORMAT? new
DurationConverter(USE_DURATION_TEXT_FORMAT): new DurationConverter(),
Duration.class);
- }
+ }
conf.clearProperty( "global" );
}
Modified:
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/dsfactory/converters/DurationConverter.java
URL:
http://svn.apache.org/viewvc/db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/dsfactory/converters/DurationConverter.java?rev=1917245&r1=1917244&r2=1917245&view=diff
==============================================================================
---
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/dsfactory/converters/DurationConverter.java
(original)
+++
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/dsfactory/converters/DurationConverter.java
Sun Apr 21 14:06:23 2024
@@ -70,7 +70,7 @@ public final class DurationConverter ext
* a <code>ConversionException</code> if an error occurs.
*
* @param useTextFormat if values are in ISO8901 formats.
- *
+ *
* @see {@link Duration#parse(CharSequence)}
*/
public DurationConverter(boolean useTextFormat) {
@@ -99,7 +99,7 @@ public final class DurationConverter ext
* @throws Throwable if an error occurs converting to the specified type
*/
@Override
- protected <T> T convertToType(final Class<T> type, final Object value)
throws Throwable {
+ protected <T> T convertToType(final Class<T> type, final Object value)
throws Throwable {
if (Duration.class.equals(type)) {
if (useTextFormat) {
return type.cast( Duration.parse( value.toString() ));
Modified:
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/manager/AbstractBaseManager.java
URL:
http://svn.apache.org/viewvc/db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/manager/AbstractBaseManager.java?rev=1917245&r1=1917244&r2=1917245&view=diff
==============================================================================
---
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/manager/AbstractBaseManager.java
(original)
+++
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/manager/AbstractBaseManager.java
Sun Apr 21 14:06:23 2024
@@ -85,10 +85,10 @@ implements Serializable
private boolean isNew = true;
/** The fields which are valid fields of interest for a listener. */
- private CopyOnWriteArraySet<Column> validFields = new
CopyOnWriteArraySet<>();
+ private final CopyOnWriteArraySet<Column> validFields = new
CopyOnWriteArraySet<>();
/** The listeners for this manager. */
- private ConcurrentMap<Column, CopyOnWriteArrayList<CacheListener<?>>>
listenersMap =
+ private final ConcurrentMap<Column,
CopyOnWriteArrayList<CacheListener<?>>> listenersMap =
new ConcurrentHashMap<>();
/**
@@ -135,15 +135,11 @@ implements Serializable
{
return omClass.getDeclaredConstructor().newInstance();
}
- catch (InstantiationException e)
- {
- throw new TorqueException("Could not instantiate " +
getClassName(), e);
- }
catch (IllegalAccessException e)
{
throw new TorqueException("Could not access " + getClassName(), e);
}
- catch (InvocationTargetException e)
+ catch (InstantiationException | InvocationTargetException e)
{
throw new TorqueException("Could not instantiate " +
getClassName(), e);
}
Modified:
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/manager/MethodCacheKey.java
URL:
http://svn.apache.org/viewvc/db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/manager/MethodCacheKey.java?rev=1917245&r1=1917244&r2=1917245&view=diff
==============================================================================
---
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/manager/MethodCacheKey.java
(original)
+++
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/manager/MethodCacheKey.java
Sun Apr 21 14:06:23 2024
@@ -104,11 +104,7 @@ public class MethodCacheKey implements S
{
return true;
}
- if (obj == null)
- {
- return false;
- }
- if (obj.getClass() != this.getClass())
+ if ((obj == null) || (obj.getClass() != this.getClass()))
{
return false;
}
@@ -140,7 +136,7 @@ public class MethodCacheKey implements S
.append(method)
.append('(')
.append(Arrays.stream(args)
- .map(arg -> arg.toString())
+ .map(Serializable::toString)
.collect(Collectors.joining(", ")))
.append(')');
return sb.toString();
Modified:
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/map/DatabaseMap.java
URL:
http://svn.apache.org/viewvc/db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/map/DatabaseMap.java?rev=1917245&r1=1917244&r2=1917245&view=diff
==============================================================================
---
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/map/DatabaseMap.java
(original)
+++
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/map/DatabaseMap.java
Sun Apr 21 14:06:23 2024
@@ -276,9 +276,7 @@ public class DatabaseMap extends OptionS
return;
}
String initClassName = MessageFormat.format(INIT_CLASS_NAME_FORMAT,
- new Object[] {
- javanameMethod(name)
- });
+ javanameMethod(name));
Class<?> initClass = null;
try
@@ -289,30 +287,21 @@ public class DatabaseMap extends OptionS
{
throw new TorqueException(MessageFormat.format(
ERROR_MESSAGES_CLASS_NOT_FOUND,
- new Object[] {
- name,
- initClassName
- }),
+ name, initClassName),
e);
}
catch (LinkageError e)
{
throw new TorqueException(MessageFormat.format(
ERROR_MESSAGES_DEPENDENT_CLASS_NOT_FOUND,
- new Object[] {
- name,
- initClassName
- }),
+ name, initClassName),
e);
}
catch (Throwable e)
{
throw new TorqueException(MessageFormat.format(
ERROR_MESSAGES_CLASS_FOR_NAME,
- new Object[] {
- name,
- initClassName
- }),
+ name, initClassName),
e);
}
try
@@ -324,10 +313,7 @@ public class DatabaseMap extends OptionS
{
throw new TorqueException(MessageFormat.format(
ERROR_MESSAGES_INIT,
- new Object[] {
- name,
- initClassName
- }),
+ name, initClassName),
e);
}
isInitialized = true;
@@ -379,7 +365,7 @@ public class DatabaseMap extends OptionS
this.isInitialized = databaseMap.isInitialized;
this.clearOptions();
- databaseMap.getOptions().forEach((key, value) -> this.setOption(key,
value));
+ databaseMap.getOptions().forEach(this::setOption);
this.tables.clear();
this.tables.putAll(databaseMap.tables);
@@ -393,7 +379,7 @@ public class DatabaseMap extends OptionS
.append(name)
.append(", tables=(")
.append(tables.values().stream()
- .map(table -> table.getName())
+ .map(TableMap::getName)
.collect(Collectors.joining(",")))
.append(")]");
return result.toString();
Modified:
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/map/TableMap.java
URL:
http://svn.apache.org/viewvc/db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/map/TableMap.java?rev=1917245&r1=1917244&r2=1917245&view=diff
==============================================================================
---
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/map/TableMap.java
(original)
+++
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/map/TableMap.java
Sun Apr 21 14:06:23 2024
@@ -222,8 +222,7 @@ public class TableMap extends OptionSupp
while (it.hasNext())
{
Object theType = it.next().getType();
- if (!(theType instanceof String || theType instanceof Number
- || theType instanceof java.util.Date))
+ if ((!(theType instanceof String) && !(theType instanceof
Number) && !(theType instanceof java.util.Date)))
{
return true;
}
Modified:
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/oid/IDBroker.java
URL:
http://svn.apache.org/viewvc/db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/oid/IDBroker.java?rev=1917245&r1=1917244&r2=1917245&view=diff
==============================================================================
---
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/oid/IDBroker.java
(original)
+++
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/oid/IDBroker.java
Sun Apr 21 14:06:23 2024
@@ -261,9 +261,9 @@ public class IDBroker implements Runnabl
}
/**
- *
+ *
* @see org.apache.torque.oid.IdGenerator#getIdAsInt(java.sql.Connection,
java.lang.Object)
- *
+ *
* Returns an id as a primitive int. Note this method does not
* require a Connection, it just implements the KeyGenerator
* interface. if a Connection is needed one will be requested.
@@ -285,7 +285,7 @@ public class IDBroker implements Runnabl
/**
* @see org.apache.torque.oid.IdGenerator#getIdAsLong(java.sql.Connection,
java.lang.Object)
- *
+ *
* Returns an id as a primitive long. Note this method does not
* require a Connection, it just implements the KeyGenerator
* interface. if a Connection is needed one will be requested.
@@ -457,7 +457,7 @@ public class IDBroker implements Runnabl
}
else
{
- log.debug("Forced id retrieval - {} ids still available for
table {}",
+ log.debug("Forced id retrieval - {} ids still available for
table {}",
availableIds.size(), tableName);
}
storeIDs(tableName, true, connection);
Modified:
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/om/ComboKey.java
URL:
http://svn.apache.org/viewvc/db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/om/ComboKey.java?rev=1917245&r1=1917244&r2=1917245&view=diff
==============================================================================
---
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/om/ComboKey.java
(original)
+++
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/om/ComboKey.java
Sun Apr 21 14:06:23 2024
@@ -145,7 +145,7 @@ public class ComboKey extends ObjectKey<
{
key[i] = tmpKeys.get(i);
}
-
+
setValue(key);
}
@@ -226,8 +226,7 @@ public class ComboKey extends ObjectKey<
// internal keys equivalent.
else if (keyObj instanceof ComboKey)
{
- SimpleKey<?>[] obj = (SimpleKey[])
- ((ComboKey) keyObj).getValue();
+ SimpleKey<?>[] obj = ((ComboKey) keyObj).getValue();
SimpleKey<?>[] keys2 = obj;
isEqual = key.length == keys2.length;
@@ -317,13 +316,13 @@ public class ComboKey extends ObjectKey<
/**
* A String that may consist of one section or multiple sections
* separated by a colon.
- *
+ *
* <p>
- * Each Key is represented by <code>[type N|S|D][value][:]</code>.
- *
+ * Each Key is represented by <code>[type N|S|D][value][:]</code>.
+ *
* <p>
- * <b>Example:</b>
- *
+ * <b>Example:</b>
+ *
* <p>
* the ComboKey(StringKey("key1"), NumberKey(2)) is represented as
* <code><b>Skey1:N2:</b></code>
Modified:
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/om/ObjectKey.java
URL:
http://svn.apache.org/viewvc/db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/om/ObjectKey.java?rev=1917245&r1=1917244&r2=1917245&view=diff
==============================================================================
---
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/om/ObjectKey.java
(original)
+++
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/om/ObjectKey.java
Sun Apr 21 14:06:23 2024
@@ -83,11 +83,7 @@ public abstract class ObjectKey<T> imple
{
return true;
}
- if (obj == null)
- {
- return false;
- }
- if (obj.getClass() != this.getClass())
+ if ((obj == null) || (obj.getClass() != this.getClass()))
{
return false;
}
Modified:
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/om/mapper/IntegerMapper.java
URL:
http://svn.apache.org/viewvc/db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/om/mapper/IntegerMapper.java?rev=1917245&r1=1917244&r2=1917245&view=diff
==============================================================================
---
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/om/mapper/IntegerMapper.java
(original)
+++
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/om/mapper/IntegerMapper.java
Sun Apr 21 14:06:23 2024
@@ -76,8 +76,7 @@ public class IntegerMapper implements Re
{
try
{
- Integer result = Integer.valueOf(
- resultSet.getInt(rowOffset + internalOffset + 1));
+ int result = resultSet.getInt(rowOffset + internalOffset + 1);
if (result == 0 && resultSet.wasNull())
{
return null;
Modified:
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/om/mapper/LongMapper.java
URL:
http://svn.apache.org/viewvc/db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/om/mapper/LongMapper.java?rev=1917245&r1=1917244&r2=1917245&view=diff
==============================================================================
---
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/om/mapper/LongMapper.java
(original)
+++
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/om/mapper/LongMapper.java
Sun Apr 21 14:06:23 2024
@@ -76,8 +76,7 @@ public class LongMapper implements Recor
{
try
{
- Long result = Long.valueOf(
- resultSet.getLong(rowOffset + internalOffset + 1));
+ long result = resultSet.getLong(rowOffset + internalOffset + 1);
if (result == 0 && resultSet.wasNull())
{
return null;
Modified:
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/sql/OrderBy.java
URL:
http://svn.apache.org/viewvc/db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/sql/OrderBy.java?rev=1917245&r1=1917244&r2=1917245&view=diff
==============================================================================
---
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/sql/OrderBy.java
(original)
+++
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/sql/OrderBy.java
Sun Apr 21 14:06:23 2024
@@ -37,10 +37,10 @@ public class OrderBy implements Serializ
private static final long serialVersionUID = 1L;
/** The column to order by. */
- private Column column;
+ private final Column column;
/** The order to order by (ascending or descending). */
- private SqlEnum order;
+ private final SqlEnum order;
/** Whether case should be ignored for String columns. */
private boolean ignoreCase = true;
@@ -135,11 +135,7 @@ public class OrderBy implements Serializ
{
return true;
}
- if (obj == null)
- {
- return false;
- }
- if (getClass() != obj.getClass())
+ if ((obj == null) || (getClass() != obj.getClass()))
{
return false;
}
Modified:
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/sql/SqlBuilder.java
URL:
http://svn.apache.org/viewvc/db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/sql/SqlBuilder.java?rev=1917245&r1=1917244&r2=1917245&view=diff
==============================================================================
---
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/sql/SqlBuilder.java
(original)
+++
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/sql/SqlBuilder.java
Sun Apr 21 14:06:23 2024
@@ -253,11 +253,7 @@ public final class SqlBuilder
final Query query)
throws TorqueException
{
- if (criteria.isComposite())
- {
- return;
- }
- if (criteria.getTopLevelCriterion() == null)
+ if (criteria.isComposite() || (criteria.getTopLevelCriterion() ==
null))
{
return;
}
@@ -831,7 +827,7 @@ public final class SqlBuilder
* @return either the tablename itself if tableOrAliasName is not an alias,
* or a String of the form "tableName tableOrAliasName"
* if tableOrAliasName is an alias for a table name
- *
+ *
* @throws TorqueException if the column is not found.
*/
static Column resolveAliasAndAsColumnAndSchema(
@@ -937,11 +933,7 @@ public final class SqlBuilder
final Query query)
throws TorqueException
{
- if (possibleColumn == null)
- {
- return;
- }
- if (!(possibleColumn instanceof Column))
+ if ((possibleColumn == null) || !(possibleColumn instanceof Column))
{
return;
}
Modified:
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/sql/WhereClauseExpression.java
URL:
http://svn.apache.org/viewvc/db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/sql/WhereClauseExpression.java?rev=1917245&r1=1917244&r2=1917245&view=diff
==============================================================================
---
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/sql/WhereClauseExpression.java
(original)
+++
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/sql/WhereClauseExpression.java
Sun Apr 21 14:06:23 2024
@@ -215,11 +215,7 @@ public class WhereClauseExpression
{
return true;
}
- if (obj == null)
- {
- return false;
- }
- if (getClass() != obj.getClass())
+ if ((obj == null) || (getClass() != obj.getClass()))
{
return false;
}
Modified:
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/util/AbstractPeerImpl.java
URL:
http://svn.apache.org/viewvc/db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/util/AbstractPeerImpl.java?rev=1917245&r1=1917244&r2=1917245&view=diff
==============================================================================
---
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/util/AbstractPeerImpl.java
(original)
+++
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/util/AbstractPeerImpl.java
Sun Apr 21 14:06:23 2024
@@ -104,7 +104,7 @@ public abstract class AbstractPeerImpl<T
* value. Also, columns which have the useDatabaseDefaultValue
* flag set to true are also not added to the returned object
* if they still have their initial value.
- *
+ *
* @param obj the object to build the column values from
* @return ColumnValues object
*
@@ -131,7 +131,7 @@ public abstract class AbstractPeerImpl<T
/**
* Selects at most one object from the database
* which has the same content as the passed object.
- *
+ *
* @param obj the data object
* @return the selected Object, or null if no object was selected.
*
@@ -177,9 +177,9 @@ public abstract class AbstractPeerImpl<T
/**
* Method to do inserts
- *
+ *
* @param obj the data object
- *
+ *
* @throws TorqueException Any exceptions caught during processing will be
* rethrown wrapped into a TorqueException.
*/
@@ -198,7 +198,7 @@ public abstract class AbstractPeerImpl<T
* Method to do inserts. This method is to be used during a transaction,
* otherwise use the doInsert(T) method. It will take
* care of the connection details internally.
- *
+ *
* @param obj the data object to insert into the database.
* @param con the connection to use
* @throws TorqueException Any exceptions caught during processing will be
Modified:
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/util/AvgHelper.java
URL:
http://svn.apache.org/viewvc/db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/util/AvgHelper.java?rev=1917245&r1=1917244&r2=1917245&view=diff
==============================================================================
---
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/util/AvgHelper.java
(original)
+++
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/util/AvgHelper.java
Sun Apr 21 14:06:23 2024
@@ -50,8 +50,8 @@ import org.apache.torque.util.functions.
* Get's the average of a column with entries matching the provided criteria.
*
* This works similarly to the CountHelper when you need to provide
- * additional selection criteria to compute an average.
- *
+ * additional selection criteria to compute an average.
+ *
* For example, limiting the average of a column in a table to a specific user.
*/
public class AvgHelper
@@ -77,7 +77,7 @@ public class AvgHelper
*
* @param c Criteria to get the count for.
* @param column Name of database Column which is averaged.
- *
+ *
* @return average of the column matching the query provided
* @throws TorqueException if the query could not be executed
*/
Modified:
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/util/BasePeerImpl.java
URL:
http://svn.apache.org/viewvc/db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/util/BasePeerImpl.java?rev=1917245&r1=1917244&r2=1917245&view=diff
==============================================================================
---
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/util/BasePeerImpl.java
(original)
+++
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/util/BasePeerImpl.java
Sun Apr 21 14:06:23 2024
@@ -399,7 +399,7 @@ public class BasePeerImpl<T> implements
}
String columnNamesList = insertValues.keySet().stream()
- .map((column) -> column.getColumnName())
+ .map(Column::getColumnName)
.collect(Collectors.joining(",", "(", ")"));
String fullTableName = SqlBuilder.getFullTableName(
@@ -473,7 +473,7 @@ public class BasePeerImpl<T> implements
}
StopWatch stopWatch = new StopWatch();
- log.debug("Executing insert {} using parameters {}",
+ log.debug("Executing insert {} using parameters {}",
() -> query.toString(), () -> replacementObjects);
stopWatch.start();
@@ -691,7 +691,7 @@ public class BasePeerImpl<T> implements
0);
StopWatch stopWatch = new StopWatch();
- log.debug("Executing insert {} using parameters {}",
+ log.debug("Executing insert {} using parameters {}",
() -> query.toString(), () -> replacements);
stopWatch.start();
Modified:
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/util/ExceptionMapperImpl.java
URL:
http://svn.apache.org/viewvc/db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/util/ExceptionMapperImpl.java?rev=1917245&r1=1917244&r2=1917245&view=diff
==============================================================================
---
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/util/ExceptionMapperImpl.java
(original)
+++
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/util/ExceptionMapperImpl.java
Sun Apr 21 14:06:23 2024
@@ -42,18 +42,8 @@ public class ExceptionMapperImpl extends
{
return new ConstraintViolationException(sqlException);
}
- if (StringUtils.equals(sqlException.getSQLState(), "40001"))
- {
- // mysql, derby, mssql
- return new DeadlockException(sqlException);
- }
- if (StringUtils.equals(sqlException.getSQLState(), "40P01"))
- {
- // postgresql
- return new DeadlockException(sqlException);
- }
- if (StringUtils.equals(sqlException.getSQLState(), "61000")
- && sqlException.getErrorCode() == ORACLE_DEADLOCK_ERROR_CODE)
+ if (StringUtils.equals(sqlException.getSQLState(), "40001") ||
StringUtils.equals(sqlException.getSQLState(), "40P01") ||
(StringUtils.equals(sqlException.getSQLState(), "61000")
+ && sqlException.getErrorCode() == ORACLE_DEADLOCK_ERROR_CODE))
{
// oracle
return new DeadlockException(sqlException);
Modified:
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/util/JdbcTypedValue.java
URL:
http://svn.apache.org/viewvc/db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/util/JdbcTypedValue.java?rev=1917245&r1=1917244&r2=1917245&view=diff
==============================================================================
---
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/util/JdbcTypedValue.java
(original)
+++
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/util/JdbcTypedValue.java
Sun Apr 21 14:06:23 2024
@@ -147,11 +147,7 @@ public class JdbcTypedValue
{
return true;
}
- if (obj == null)
- {
- return false;
- }
- if (getClass() != obj.getClass())
+ if ((obj == null) || (getClass() != obj.getClass()))
{
return false;
}
Modified:
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/util/LargeSelect.java
URL:
http://svn.apache.org/viewvc/db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/util/LargeSelect.java?rev=1917245&r1=1917244&r2=1917245&view=diff
==============================================================================
---
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/util/LargeSelect.java
(original)
+++
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/util/LargeSelect.java
Sun Apr 21 14:06:23 2024
@@ -176,7 +176,7 @@ public class LargeSelect<T> implements R
*/
private BasePeerImpl<T> peer = null;
- /** default MessageFormat pattern for the page progress text */
+ /** default MessageFormat pattern for the page progress text */
public static final String DEFAULT_PAGE_PROGRESS_TEXT_PATTERN = "{0} of
{1,choice,0#> |1#}{2}";
/**
@@ -188,9 +188,9 @@ public class LargeSelect<T> implements R
*/
private String pageProgressTextPattern =
DEFAULT_PAGE_PROGRESS_TEXT_PATTERN;
- /** default MessageFormat pattern for the record progress text */
+ /** default MessageFormat pattern for the record progress text */
public static final String DEFAULT_RECORD_PROGRESS_TEXT_PATTERN = "{0} -
{1} of {2,choice,0#> |1#}{3}";
-
+
/**
* The MessageFormat pattern to format a record progress.
* The default <pre>{0} - {1} of {2,choice,0#> |1#}{3}</pre> formats as
<pre>1 - 25 of 100</pre>.
@@ -434,8 +434,8 @@ public class LargeSelect<T> implements R
if (start >= blockBegin && (start + size - 1) <= blockEnd)
{
log.debug("getResults(): Sleeping until "
- + "start+size-1 ({}) > currentlyFilledTo ({}) &&
!queryCompleted (!{})",
- () -> { return start + size - 1; } , () ->
currentlyFilledTo, () -> queryCompleted);
+ + "start+size-1 ({}) > currentlyFilledTo ({}) &&
!queryCompleted (!{})",
+ () -> (start + size - 1) , () -> currentlyFilledTo, () ->
queryCompleted);
while (((start + size - 1) > currentlyFilledTo) && !queryCompleted)
{
try
@@ -488,7 +488,7 @@ public class LargeSelect<T> implements R
// Re-invoke getResults() to provide the wait processing.
return getResults(start, size);
}
-
+
else
{
throw new IllegalArgumentException("Parameter configuration not "
@@ -785,7 +785,7 @@ public class LargeSelect<T> implements R
/**
* Retrieve the MessageFormat pattern for the page progress
* The default is <pre>{0} of {1,choice,0#> |1#}{2}</pre>
- *
+ *
* @return the pattern as a string
*/
public String getPageProgressTextPattern()
@@ -806,7 +806,7 @@ public class LargeSelect<T> implements R
* <p>
* Localized example in German:<br>
* <pre>Seite {0} von {1,choice,0#mehr als |1#}{2}</pre>
- *
+ *
* @param pageProgressTextPattern
*/
public void setPageProgressTextPattern(String pageProgressTextPattern)
@@ -817,14 +817,14 @@ public class LargeSelect<T> implements R
/**
* Retrieve the MessageFormat pattern for the record progress
* The default is <pre>{0} - {1} of {2,choice,0#> |1#}{3}</pre>
- *
+ *
* @return the pattern as a string
*/
public String getRecordProgressTextPattern()
{
return recordProgressTextPattern;
}
-
+
/**
* Set the MessageFormat pattern for the record progress.
* The default is <pre>{0} - {1} of {2,choice,0#> |1#}{3}</pre>
@@ -839,7 +839,7 @@ public class LargeSelect<T> implements R
* <p>
* Localized example in German:<br>
* <pre>Datensätze {0} bis {1} von {2,choice,0#mehr als |1#}{3}</pre>
- *
+ *
* @param recordProgressTextPattern
*/
public void setRecordProgressTextPattern(String recordProgressTextPattern)
@@ -864,7 +864,7 @@ public class LargeSelect<T> implements R
* Retrieves the multiplier that will be used to compute the memory limit
* when a constructor with no memory page limit is used - the memory limit
* will be this number multiplied by the page size.
- *
+ *
* @return memoryPageLimit the maximum number of pages to be in memory
* at one time.
*/
@@ -882,9 +882,9 @@ public class LargeSelect<T> implements R
*/
public String getPageProgressText()
{
- return MessageFormat.format(getPageProgressTextPattern(),
- getCurrentPageNumber(),
- totalsFinalized ? 1 : 0,
+ return MessageFormat.format(getPageProgressTextPattern(),
+ getCurrentPageNumber(),
+ totalsFinalized ? 1 : 0,
getTotalPages());
}
@@ -894,7 +894,7 @@ public class LargeSelect<T> implements R
*
* @return the number of records that are included on the current page of
* results.
- *
+ *
* @throws TorqueException if invoking the <code>populateObjects()</code>
* method runs into problems or a sleep is unexpectedly interrupted.
*/
@@ -925,7 +925,7 @@ public class LargeSelect<T> implements R
* Provide the record number of the last row included on the current page.
*
* @return the record number of the last row of the current page.
- *
+ *
* @throws TorqueException if invoking the <code>populateObjects()</code>
* method runs into problems or a sleep is unexpectedly interrupted.
*/
@@ -945,16 +945,16 @@ public class LargeSelect<T> implements R
*
* @return progress text in the form of "26 - 50 of > 250" where ">"
* can be configured using <code>setMoreIndicator()</code>.
- *
+ *
* @throws TorqueException if invoking the <code>populateObjects()</code>
* method runs into problems or a sleep is unexpectedly interrupted.
*/
public String getRecordProgressText() throws TorqueException
{
- return MessageFormat.format(getRecordProgressTextPattern(),
+ return MessageFormat.format(getRecordProgressTextPattern(),
getFirstRecordNoForPage(),
getLastRecordNoForPage(),
- totalsFinalized ? 1 : 0,
+ totalsFinalized ? 1 : 0,
getTotalRecords());
}
Modified:
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/util/ResultsetSpliterator.java
URL:
http://svn.apache.org/viewvc/db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/util/ResultsetSpliterator.java?rev=1917245&r1=1917244&r2=1917245&view=diff
==============================================================================
---
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/util/ResultsetSpliterator.java
(original)
+++
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/util/ResultsetSpliterator.java
Sun Apr 21 14:06:23 2024
@@ -96,7 +96,7 @@ public class ResultsetSpliterator<T> ext
/* (non-Javadoc)
* @see java.util.Spliterator#tryAdvance(java.util.function.Consumer)
- *
+ *
* Advance ResultSet and map row to entity <T>
*/
@Override
Modified:
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/util/TorqueConnectionImpl.java
URL:
http://svn.apache.org/viewvc/db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/util/TorqueConnectionImpl.java?rev=1917245&r1=1917244&r2=1917245&view=diff
==============================================================================
---
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/util/TorqueConnectionImpl.java
(original)
+++
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/util/TorqueConnectionImpl.java
Sun Apr 21 14:06:23 2024
@@ -54,7 +54,7 @@ public class TorqueConnectionImpl implem
private boolean rolledBack;
/** The wrapped connection instance */
- private Connection connection;
+ private final Connection connection;
/**
* Constructor
Modified:
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/util/TransactionManagerImpl.java
URL:
http://svn.apache.org/viewvc/db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/util/TransactionManagerImpl.java?rev=1917245&r1=1917244&r2=1917245&view=diff
==============================================================================
---
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/util/TransactionManagerImpl.java
(original)
+++
db/torque/trunk/torque-runtime/src/main/java/org/apache/torque/util/TransactionManagerImpl.java
Sun Apr 21 14:06:23 2024
@@ -103,7 +103,7 @@ public class TransactionManagerImpl impl
{
if (con.getMetaData().supportsTransactions())
{
- if (!con.getAutoCommit())
+ if (!con.getAutoCommit())
{
con.commit();
}
Modified:
db/torque/trunk/torque-runtime/src/test/java/org/apache/torque/ColumnImplTest.java
URL:
http://svn.apache.org/viewvc/db/torque/trunk/torque-runtime/src/test/java/org/apache/torque/ColumnImplTest.java?rev=1917245&r1=1917244&r2=1917245&view=diff
==============================================================================
---
db/torque/trunk/torque-runtime/src/test/java/org/apache/torque/ColumnImplTest.java
(original)
+++
db/torque/trunk/torque-runtime/src/test/java/org/apache/torque/ColumnImplTest.java
Sun Apr 21 14:06:23 2024
@@ -34,7 +34,7 @@ import org.junit.jupiter.api.Test;
*/
public class ColumnImplTest
{
-
+
/**
* Test table column constructor
*/
@@ -53,7 +53,7 @@ public class ColumnImplTest
}
/**
- * Test table column constructor with schema in table
+ * Test table column constructor with schema in table
*/
@Test
public void testTableColumnConstructorWithSchemaInTable()
Modified:
db/torque/trunk/torque-runtime/src/test/java/org/apache/torque/MockBaseTestCase.java
URL:
http://svn.apache.org/viewvc/db/torque/trunk/torque-runtime/src/test/java/org/apache/torque/MockBaseTestCase.java?rev=1917245&r1=1917244&r2=1917245&view=diff
==============================================================================
---
db/torque/trunk/torque-runtime/src/test/java/org/apache/torque/MockBaseTestCase.java
(original)
+++
db/torque/trunk/torque-runtime/src/test/java/org/apache/torque/MockBaseTestCase.java
Sun Apr 21 14:06:23 2024
@@ -35,20 +35,21 @@ import org.mockito.MockitoAnnotations;
public abstract class MockBaseTestCase extends BaseTestCase
{
protected AutoCloseable closeable;
-
+
/**
* Re-Initialize Torque and fill supplied data. Subclasses which
* override setUp() must call super.setUp() as their first action.
*
* @throws Exception if initialization fails.
*/
+ @Override
@BeforeEach
public void setUp() throws Exception
{
super.setUp();
closeable = MockitoAnnotations.openMocks(this);
}
-
+
@AfterEach
void closeMocks() throws Exception {
closeable.close();
Modified:
db/torque/trunk/torque-runtime/src/test/java/org/apache/torque/criteria/CriteriaTest.java
URL:
http://svn.apache.org/viewvc/db/torque/trunk/torque-runtime/src/test/java/org/apache/torque/criteria/CriteriaTest.java?rev=1917245&r1=1917244&r2=1917245&view=diff
==============================================================================
---
db/torque/trunk/torque-runtime/src/test/java/org/apache/torque/criteria/CriteriaTest.java
(original)
+++
db/torque/trunk/torque-runtime/src/test/java/org/apache/torque/criteria/CriteriaTest.java
Sun Apr 21 14:06:23 2024
@@ -68,6 +68,7 @@ public class CriteriaTest extends BaseTe
/**
* Initializes the criteria.
*/
+ @Override
@BeforeEach
public void setUp() throws Exception
{
@@ -180,7 +181,7 @@ public class CriteriaTest extends BaseTe
// execute
c.where(column, operator);
-
+
assertTrue(
c.toString().contains( "FROM myTable WHERE myTable.myColumn IS
NOT NULL" ));
@@ -189,7 +190,7 @@ public class CriteriaTest extends BaseTe
assertEquals(null, c.getTopLevelCriterion().getRValue());
assertEquals(operator, c.getTopLevelCriterion().getComparison());
}
-
+
@Test
public void testIsNullOperator()
{
@@ -199,7 +200,7 @@ public class CriteriaTest extends BaseTe
// execute
c.where(column, operator);
-
+
assertTrue(
c.toString().contains( "FROM myTable WHERE myTable.myColumn IS
NULL" ));
@@ -858,11 +859,11 @@ public class CriteriaTest extends BaseTe
cn.setIgnoreCase(true);
assertEquals("author%", cn.getRValue());
assertEquals(Criteria.LIKE, cn.getComparison());
- Criterion cnDirectClone = (Criterion) SerializationUtils.clone(cn);
+ Criterion cnDirectClone = SerializationUtils.clone(cn);
assertEquals(cn, cnDirectClone);
// Clone the object
- Criteria cClone = (Criteria) SerializationUtils.clone(c);
+ Criteria cClone = SerializationUtils.clone(c);
// Check the clone
assertEquals(c.getTopLevelCriterion(), cClone.getTopLevelCriterion());
@@ -1039,7 +1040,7 @@ public class CriteriaTest extends BaseTe
c.addSelectColumn(new ColumnImpl("Author", "NAME"));
c.addSelectColumn(new ColumnImpl("Author", "AUTHOR_ID"));
c.where(new ColumnImpl("Author", "NAME"), "foobar");
- Criteria cClone = (Criteria) SerializationUtils.clone(c);
+ Criteria cClone = SerializationUtils.clone(c);
assertTrue(c.equals(cClone));
}
Modified:
db/torque/trunk/torque-runtime/src/test/java/org/apache/torque/criteria/CriterionTest.java
URL:
http://svn.apache.org/viewvc/db/torque/trunk/torque-runtime/src/test/java/org/apache/torque/criteria/CriterionTest.java?rev=1917245&r1=1917244&r2=1917245&view=diff
==============================================================================
---
db/torque/trunk/torque-runtime/src/test/java/org/apache/torque/criteria/CriterionTest.java
(original)
+++
db/torque/trunk/torque-runtime/src/test/java/org/apache/torque/criteria/CriterionTest.java
Sun Apr 21 14:06:23 2024
@@ -95,12 +95,12 @@ public class CriterionTest extends BaseT
new ColumnImpl("myTable", "myColumn"), null, Criteria.ISNULL);
assertEquals("myTable.myColumn IS NULL",
criterion1.toString());
-
+
Criterion criterion2 = new Criterion(
new ColumnImpl("myTable", "myColumn"), SqlEnum.ISNULL);
assertEquals("myTable.myColumn IS NULL",
criterion2.toString());
-
+
// using new constructor without need to define second value
Criterion criterion3 = new Criterion(
new ColumnImpl("myTable", "myColumn"), Criteria.ISNULL);
Modified:
db/torque/trunk/torque-runtime/src/test/java/org/apache/torque/om/ComboKeyTest.java
URL:
http://svn.apache.org/viewvc/db/torque/trunk/torque-runtime/src/test/java/org/apache/torque/om/ComboKeyTest.java?rev=1917245&r1=1917244&r2=1917245&view=diff
==============================================================================
---
db/torque/trunk/torque-runtime/src/test/java/org/apache/torque/om/ComboKeyTest.java
(original)
+++
db/torque/trunk/torque-runtime/src/test/java/org/apache/torque/om/ComboKeyTest.java
Sun Apr 21 14:06:23 2024
@@ -34,17 +34,17 @@ import org.junit.jupiter.api.Test;
*/
public class ComboKeyTest extends BaseTestCase
{
- private ComboKey c1a = new ComboKey(
+ private final ComboKey c1a = new ComboKey(
new SimpleKey[]{new StringKey("key1"), new StringKey("key2")});
- private ComboKey c1b = new ComboKey(
+ private final ComboKey c1b = new ComboKey(
new SimpleKey[]{new StringKey("key1"), new StringKey("key2")});
- private ComboKey c2a = new ComboKey(
+ private final ComboKey c2a = new ComboKey(
new SimpleKey[]{new StringKey("key3"), new StringKey("key4")});
// complex keys for test
- private java.util.Date now = new java.util.Date();
- private ComboKey c3a = new ComboKey(
+ private final java.util.Date now = new java.util.Date();
+ private final ComboKey c3a = new ComboKey(
new SimpleKey[]{new StringKey("key1"), null, new DateKey(now)});
- private ComboKey c4a = new ComboKey(
+ private final ComboKey c4a = new ComboKey(
new SimpleKey[]{new StringKey("key1"), null, new
NumberKey(123456)});
Modified:
db/torque/trunk/torque-runtime/src/test/java/org/apache/torque/om/NumberKeyTest.java
URL:
http://svn.apache.org/viewvc/db/torque/trunk/torque-runtime/src/test/java/org/apache/torque/om/NumberKeyTest.java?rev=1917245&r1=1917244&r2=1917245&view=diff
==============================================================================
---
db/torque/trunk/torque-runtime/src/test/java/org/apache/torque/om/NumberKeyTest.java
(original)
+++
db/torque/trunk/torque-runtime/src/test/java/org/apache/torque/om/NumberKeyTest.java
Sun Apr 21 14:06:23 2024
@@ -42,13 +42,13 @@ public class NumberKeyTest extends BaseT
{
/** Test value. */
- private NumberKey n1a = new NumberKey(1);
+ private final NumberKey n1a = new NumberKey(1);
/** Test value. */
- private NumberKey n1b = new NumberKey(1);
+ private final NumberKey n1b = new NumberKey(1);
/** Test value. */
- private NumberKey n1c = new NumberKey(1);
+ private final NumberKey n1c = new NumberKey(1);
/** Test value. */
- private NumberKey n2a = new NumberKey(2);
+ private final NumberKey n2a = new NumberKey(2);
/**
* Test a.equals(a)
@@ -119,7 +119,7 @@ public class NumberKeyTest extends BaseT
@Test
public void testList()
{
- Object[] array = new Object[] {n1a, n2a, n1b};
+ Object[] array = {n1a, n2a, n1b};
Arrays.sort(array);
assertEquals(n1a, array[0]);
Modified:
db/torque/trunk/torque-runtime/src/test/java/org/apache/torque/om/mapper/BigDecimalMapperTest.java
URL:
http://svn.apache.org/viewvc/db/torque/trunk/torque-runtime/src/test/java/org/apache/torque/om/mapper/BigDecimalMapperTest.java?rev=1917245&r1=1917244&r2=1917245&view=diff
==============================================================================
---
db/torque/trunk/torque-runtime/src/test/java/org/apache/torque/om/mapper/BigDecimalMapperTest.java
(original)
+++
db/torque/trunk/torque-runtime/src/test/java/org/apache/torque/om/mapper/BigDecimalMapperTest.java
Sun Apr 21 14:06:23 2024
@@ -43,6 +43,7 @@ public class BigDecimalMapperTest extend
@Mock
private ResultSet resultSet;
+ @Override
@BeforeEach
public void setUp() throws Exception
{
Modified:
db/torque/trunk/torque-runtime/src/test/java/org/apache/torque/om/mapper/CompositeMapperTest.java
URL:
http://svn.apache.org/viewvc/db/torque/trunk/torque-runtime/src/test/java/org/apache/torque/om/mapper/CompositeMapperTest.java?rev=1917245&r1=1917244&r2=1917245&view=diff
==============================================================================
---
db/torque/trunk/torque-runtime/src/test/java/org/apache/torque/om/mapper/CompositeMapperTest.java
(original)
+++
db/torque/trunk/torque-runtime/src/test/java/org/apache/torque/om/mapper/CompositeMapperTest.java
Sun Apr 21 14:06:23 2024
@@ -57,8 +57,8 @@ public class CompositeMapperTest extends
private RecordMapper<Long> recordMapper3;
/** The fake criteria which produced the query .*/
- private Criteria criteria = new Criteria();
-
+ private final Criteria criteria = new Criteria();
+
@Override
@BeforeEach
Modified:
db/torque/trunk/torque-runtime/src/test/java/org/apache/torque/om/mapper/IntegerMapperTest.java
URL:
http://svn.apache.org/viewvc/db/torque/trunk/torque-runtime/src/test/java/org/apache/torque/om/mapper/IntegerMapperTest.java?rev=1917245&r1=1917244&r2=1917245&view=diff
==============================================================================
---
db/torque/trunk/torque-runtime/src/test/java/org/apache/torque/om/mapper/IntegerMapperTest.java
(original)
+++
db/torque/trunk/torque-runtime/src/test/java/org/apache/torque/om/mapper/IntegerMapperTest.java
Sun Apr 21 14:06:23 2024
@@ -42,6 +42,7 @@ public class IntegerMapperTest extends M
@Mock
private ResultSet resultSet;
+ @Override
@BeforeEach
public void setUp() throws Exception
{
Modified:
db/torque/trunk/torque-runtime/src/test/java/org/apache/torque/om/mapper/ObjectListMapperTest.java
URL:
http://svn.apache.org/viewvc/db/torque/trunk/torque-runtime/src/test/java/org/apache/torque/om/mapper/ObjectListMapperTest.java?rev=1917245&r1=1917244&r2=1917245&view=diff
==============================================================================
---
db/torque/trunk/torque-runtime/src/test/java/org/apache/torque/om/mapper/ObjectListMapperTest.java
(original)
+++
db/torque/trunk/torque-runtime/src/test/java/org/apache/torque/om/mapper/ObjectListMapperTest.java
Sun Apr 21 14:06:23 2024
@@ -87,8 +87,9 @@ public class ObjectListMapperTest extend
private Ref ref;
/** Object instance. */
- private Object object = new Object();
+ private final Object object = new Object();
+ @Override
@BeforeEach
public void setUp() throws Exception
{
Modified:
db/torque/trunk/torque-runtime/src/test/java/org/apache/torque/om/mapper/StringMapperTest.java
URL:
http://svn.apache.org/viewvc/db/torque/trunk/torque-runtime/src/test/java/org/apache/torque/om/mapper/StringMapperTest.java?rev=1917245&r1=1917244&r2=1917245&view=diff
==============================================================================
---
db/torque/trunk/torque-runtime/src/test/java/org/apache/torque/om/mapper/StringMapperTest.java
(original)
+++
db/torque/trunk/torque-runtime/src/test/java/org/apache/torque/om/mapper/StringMapperTest.java
Sun Apr 21 14:06:23 2024
@@ -42,6 +42,7 @@ public class StringMapperTest extends Mo
@Mock
private ResultSet resultSet;
+ @Override
@BeforeEach
public void setUp() throws Exception
{
Modified:
db/torque/trunk/torque-runtime/src/test/java/org/apache/torque/sql/SqlBuilderTest.java
URL:
http://svn.apache.org/viewvc/db/torque/trunk/torque-runtime/src/test/java/org/apache/torque/sql/SqlBuilderTest.java?rev=1917245&r1=1917244&r2=1917245&view=diff
==============================================================================
---
db/torque/trunk/torque-runtime/src/test/java/org/apache/torque/sql/SqlBuilderTest.java
(original)
+++
db/torque/trunk/torque-runtime/src/test/java/org/apache/torque/sql/SqlBuilderTest.java
Sun Apr 21 14:06:23 2024
@@ -365,7 +365,7 @@ public class SqlBuilderTest extends Base
+ "WHERE foo(table1.x) = bar(table2.y)",
query.toString());
assertEquals(
- new ArrayList<String>(),
+ new ArrayList<>(),
query.getPreparedStatementReplacements());
}
@@ -412,7 +412,7 @@ public class SqlBuilderTest extends Base
+ "WHERE foo(table1.x) = bar(table2.y)",
query.toString());
assertEquals(
- new ArrayList<String>(),
+ new ArrayList<>(),
query.getPreparedStatementReplacements());
}
@@ -2117,7 +2117,7 @@ public class SqlBuilderTest extends Base
{
Criteria criteria = new Criteria();
criteria.addSelectColumn(new ColumnImpl("table.column1"));
- String[] inValue = new String[] {"a", "b", null, null};
+ String[] inValue = {"a", "b", null, null};
criteria.whereIn(new ColumnImpl("table.column2"), inValue.clone());
Query query = SqlBuilder.buildQuery(criteria);
@@ -2135,7 +2135,7 @@ public class SqlBuilderTest extends Base
{
Criteria criteria = new Criteria();
criteria.addSelectColumn(new ColumnImpl("table.column1"));
- String[] inValue = new String[] {"a", "b", null, null};
+ String[] inValue = {"a", "b", null, null};
criteria.whereIn(new ColumnImpl("table.column2"), inValue.clone());
criteria.setIgnoreCase(true);
@@ -2504,7 +2504,7 @@ public class SqlBuilderTest extends Base
}
}
- public static enum EnumWithValueMethod
+ public enum EnumWithValueMethod
{
A,
B,
@@ -2521,7 +2521,7 @@ public class SqlBuilderTest extends Base
}
}
- public static enum EnumWithoutValueMethod
+ public enum EnumWithoutValueMethod
{
A,
B,
Modified:
db/torque/trunk/torque-runtime/src/test/java/org/apache/torque/util/BasePeerImplTest.java
URL:
http://svn.apache.org/viewvc/db/torque/trunk/torque-runtime/src/test/java/org/apache/torque/util/BasePeerImplTest.java?rev=1917245&r1=1917244&r2=1917245&view=diff
==============================================================================
---
db/torque/trunk/torque-runtime/src/test/java/org/apache/torque/util/BasePeerImplTest.java
(original)
+++
db/torque/trunk/torque-runtime/src/test/java/org/apache/torque/util/BasePeerImplTest.java
Sun Apr 21 14:06:23 2024
@@ -93,6 +93,7 @@ public class BasePeerImplTest extends Mo
@Mock
private IdGenerator idGenerator;
+ @Override
@BeforeEach
public void setUp() throws Exception
{
Modified:
db/torque/trunk/torque-runtime/src/test/java/org/apache/torque/util/SummaryHelperTest.java
URL:
http://svn.apache.org/viewvc/db/torque/trunk/torque-runtime/src/test/java/org/apache/torque/util/SummaryHelperTest.java?rev=1917245&r1=1917244&r2=1917245&view=diff
==============================================================================
---
db/torque/trunk/torque-runtime/src/test/java/org/apache/torque/util/SummaryHelperTest.java
(original)
+++
db/torque/trunk/torque-runtime/src/test/java/org/apache/torque/util/SummaryHelperTest.java
Sun Apr 21 14:06:23 2024
@@ -84,12 +84,13 @@ public class SummaryHelperTest extends B
/** Mock result set metadata. */
@Mock
private ResultSetMetaData resultSetMetaData;
-
+
private AutoCloseable closeable;
/**
* Sets up the helper objects and the test.
*/
+ @Override
@BeforeEach
public void setUp() throws Exception
{
@@ -171,7 +172,7 @@ public class SummaryHelperTest extends B
verify(resultSetMetaData).getColumnCount();
verifyNoMoreInteractions(connection, preparedStatement, resultSet,
resultSetMetaData);
}
-
+
@AfterEach
void closeMocks() throws Exception {
closeable.close();
Modified:
db/torque/trunk/torque-runtime/src/test/java/org/apache/torque/util/functions/AbstractFunctionTest.java
URL:
http://svn.apache.org/viewvc/db/torque/trunk/torque-runtime/src/test/java/org/apache/torque/util/functions/AbstractFunctionTest.java?rev=1917245&r1=1917244&r2=1917245&view=diff
==============================================================================
---
db/torque/trunk/torque-runtime/src/test/java/org/apache/torque/util/functions/AbstractFunctionTest.java
(original)
+++
db/torque/trunk/torque-runtime/src/test/java/org/apache/torque/util/functions/AbstractFunctionTest.java
Sun Apr 21 14:06:23 2024
@@ -52,7 +52,7 @@ public class AbstractFunctionTest extend
abstractFunction.getArguments()));
abstractFunction.setArguments(
- new Object[] {new ColumnImpl("fooColumn"), true});
+ new ColumnImpl("fooColumn"), true);
assertTrue(Arrays.equals(
new Object[] {new ColumnImpl("fooColumn"), true},
abstractFunction.getArguments()));
@@ -87,10 +87,7 @@ public class AbstractFunctionTest extend
public void testGetArgument()
{
abstractFunction.setArguments(
- new Object[] {
- new ColumnImpl("fooColumn"),
- new ColumnImpl("barColumn"),
- true});
+ new ColumnImpl("fooColumn"), new ColumnImpl("barColumn"),
true);
assertEquals(
new ColumnImpl("barColumn"),
abstractFunction.getArgument(01));
@@ -103,9 +100,7 @@ public class AbstractFunctionTest extend
public void testGetColumnName()
{
abstractFunction.setArguments(
- new Object[] {
- new ColumnImpl("schema", "table", "column",
"sqlExpression"),
- true});
+ new ColumnImpl("schema", "table", "column", "sqlExpression"),
true);
assertNull(abstractFunction.getColumnName());
}
@@ -115,10 +110,7 @@ public class AbstractFunctionTest extend
public void testGetTableName()
{
abstractFunction.setArguments(
- new Object[] {
- new ColumnImpl("schema", "table", "column",
"sqlExpression"),
- new ColumnImpl("schema", "table", "column",
"sqlExpression"),
- true});
+ new ColumnImpl("schema", "table", "column", "sqlExpression"),
new ColumnImpl("schema", "table", "column", "sqlExpression"), true);
assertEquals("table", abstractFunction.getTableName());
}
@@ -129,10 +121,7 @@ public class AbstractFunctionTest extend
public void testGetTableNameDifferentTables()
{
abstractFunction.setArguments(
- new Object[] {
- new ColumnImpl(null, null, null, "sqlExpression"),
- new ColumnImpl("schema", "table", "column",
"sqlExpression"),
- true});
+ new ColumnImpl(null, null, null, "sqlExpression"), new
ColumnImpl("schema", "table", "column", "sqlExpression"), true);
assertNull(abstractFunction.getTableName());
}
@@ -143,10 +132,7 @@ public class AbstractFunctionTest extend
public void testGetFullTableName()
{
abstractFunction.setArguments(
- new Object[] {
- new ColumnImpl("schema", "table", "column",
"sqlExpression"),
- new ColumnImpl("schema", "table", "column",
"sqlExpression"),
- true});
+ new ColumnImpl("schema", "table", "column", "sqlExpression"),
new ColumnImpl("schema", "table", "column", "sqlExpression"), true);
assertEquals("schema.table", abstractFunction.getFullTableName());
}
@@ -157,10 +143,7 @@ public class AbstractFunctionTest extend
public void testGetFullTableNameDifferentTables()
{
abstractFunction.setArguments(
- new Object[] {
- new ColumnImpl(null, null, null, "sqlExpression"),
- new ColumnImpl("schema", "table", "column",
"sqlExpression"),
- true});
+ new ColumnImpl(null, null, null, "sqlExpression"), new
ColumnImpl("schema", "table", "column", "sqlExpression"), true);
assertNull(abstractFunction.getFullTableName());
}
@@ -171,10 +154,7 @@ public class AbstractFunctionTest extend
public void testGetSchemaName()
{
abstractFunction.setArguments(
- new Object[] {
- new ColumnImpl("schema", "table", "column",
"sqlExpression"),
- new ColumnImpl("schema", "table", "column",
"sqlExpression"),
- true});
+ new ColumnImpl("schema", "table", "column", "sqlExpression"),
new ColumnImpl("schema", "table", "column", "sqlExpression"), true);
assertEquals("schema", abstractFunction.getSchemaName());
}
@@ -185,10 +165,7 @@ public class AbstractFunctionTest extend
public void testGetSchemaNameDifferentTables()
{
abstractFunction.setArguments(
- new Object[] {
- new ColumnImpl(null, null, null, "sqlExpression"),
- new ColumnImpl("schema", "table", "column",
"sqlExpression"),
- true});
+ new ColumnImpl(null, null, null, "sqlExpression"), new
ColumnImpl("schema", "table", "column", "sqlExpression"), true);
assertNull(abstractFunction.getSchemaName());
}
Modified:
db/torque/trunk/torque-runtime/src/test/java/org/apache/torque/util/functions/AggregateFunctionTest.java
URL:
http://svn.apache.org/viewvc/db/torque/trunk/torque-runtime/src/test/java/org/apache/torque/util/functions/AggregateFunctionTest.java?rev=1917245&r1=1917244&r2=1917245&view=diff
==============================================================================
---
db/torque/trunk/torque-runtime/src/test/java/org/apache/torque/util/functions/AggregateFunctionTest.java
(original)
+++
db/torque/trunk/torque-runtime/src/test/java/org/apache/torque/util/functions/AggregateFunctionTest.java
Sun Apr 21 14:06:23 2024
@@ -93,13 +93,13 @@ public class AggregateFunctionTest exten
aggregateFunction.getArguments()));
aggregateFunction.setArguments(
- new Object[] {new ColumnImpl("otherColumn")});
+ new ColumnImpl("otherColumn"));
assertTrue(Arrays.equals(
new Object[] {new ColumnImpl("otherColumn"), false},
aggregateFunction.getArguments()));
aggregateFunction.setArguments(
- new Object[] {new ColumnImpl("fooColumn"), true});
+ new ColumnImpl("fooColumn"), true);
assertTrue(Arrays.equals(
new Object[] {new ColumnImpl("fooColumn"), true},
aggregateFunction.getArguments()));
Modified: db/torque/trunk/torque-runtime/src/test/resources/log4j2-test.xml
URL:
http://svn.apache.org/viewvc/db/torque/trunk/torque-runtime/src/test/resources/log4j2-test.xml?rev=1917245&r1=1917244&r2=1917245&view=diff
==============================================================================
--- db/torque/trunk/torque-runtime/src/test/resources/log4j2-test.xml (original)
+++ db/torque/trunk/torque-runtime/src/test/resources/log4j2-test.xml Sun Apr
21 14:06:23 2024
@@ -17,7 +17,7 @@
specific language governing permissions and limitations
under the License.
-->
-<Configuration status="warn" name="Torque" packages="">
+<Configuration status="warn" name="Torque">
<Appenders>
<Console name="console" target="SYSTEM_OUT">
<PatternLayout pattern="%d [%t] %-5p | %c - %m%n" />
@@ -34,6 +34,9 @@
<Logger name="org.apache.commons.beanutils" additivity="false"
level="WARN">
<AppenderRef ref="console" />
</Logger>
+ <Logger name="org.apache.torque.dsfactory" additivity="false"
level="WARN">
+ <AppenderRef ref="console" />
+ </Logger>
<Root level="INFO"><!-- log4j 1.2 has DEBUG -->
<AppenderRef ref="console" />
</Root>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]