Author: tv Date: Fri Sep 8 17:00:40 2006 New Revision: 441695 URL: http://svn.apache.org/viewvc?view=rev&rev=441695 Log: Fixed JavaDoc errors and some FindBugs complaints
Modified: db/torque/generator/trunk/src/java/org/apache/torque/engine/database/model/Table.java db/torque/generator/trunk/src/java/org/apache/torque/engine/platform/PlatformDefaultImpl.java db/torque/generator/trunk/src/java/org/apache/torque/task/TorqueDataDumpTask.java db/torque/generator/trunk/src/java/org/apache/torque/task/TorqueDataModelTask.java db/torque/runtime/trunk/src/java/org/apache/torque/Database.java db/torque/runtime/trunk/src/java/org/apache/torque/Torque.java db/torque/runtime/trunk/src/java/org/apache/torque/TorqueInstance.java db/torque/runtime/trunk/src/java/org/apache/torque/TorqueRuntimeException.java db/torque/runtime/trunk/src/java/org/apache/torque/adapter/DBCloudscape.java db/torque/runtime/trunk/src/java/org/apache/torque/dsfactory/AbstractDataSourceFactory.java db/torque/runtime/trunk/src/java/org/apache/torque/manager/AbstractBaseManager.java db/torque/runtime/trunk/src/java/org/apache/torque/map/ColumnMap.java db/torque/runtime/trunk/src/java/org/apache/torque/map/TableMap.java db/torque/runtime/trunk/src/java/org/apache/torque/oid/SequenceIdGenerator.java db/torque/runtime/trunk/src/java/org/apache/torque/util/BasePeer.java db/torque/runtime/trunk/src/java/org/apache/torque/util/Query.java db/torque/runtime/trunk/src/java/org/apache/torque/util/SQLBuilder.java db/torque/runtime/trunk/src/java/org/apache/torque/util/SqlExpression.java db/torque/runtime/trunk/src/java/org/apache/torque/util/Transaction.java Modified: db/torque/generator/trunk/src/java/org/apache/torque/engine/database/model/Table.java URL: http://svn.apache.org/viewvc/db/torque/generator/trunk/src/java/org/apache/torque/engine/database/model/Table.java?view=diff&rev=441695&r1=441694&r2=441695 ============================================================================== --- db/torque/generator/trunk/src/java/org/apache/torque/engine/database/model/Table.java (original) +++ db/torque/generator/trunk/src/java/org/apache/torque/engine/database/model/Table.java Fri Sep 8 17:00:40 2006 @@ -1139,7 +1139,7 @@ /** * Force all columns to set the correctGetters property. * - * @param correctGetters The new value of the correctGetters property. + * @param value The new value of the correctGetters property. * @since 3.2 */ public void setCorrectGetters(Boolean value) Modified: db/torque/generator/trunk/src/java/org/apache/torque/engine/platform/PlatformDefaultImpl.java URL: http://svn.apache.org/viewvc/db/torque/generator/trunk/src/java/org/apache/torque/engine/platform/PlatformDefaultImpl.java?view=diff&rev=441695&r1=441694&r2=441695 ============================================================================== --- db/torque/generator/trunk/src/java/org/apache/torque/engine/platform/PlatformDefaultImpl.java (original) +++ db/torque/generator/trunk/src/java/org/apache/torque/engine/platform/PlatformDefaultImpl.java Fri Sep 8 17:00:40 2006 @@ -79,7 +79,7 @@ } /** - * @see Platform#getDomainForJdbcType(SchemaType) + * @see Platform#getDomainForSchemaType(SchemaType) */ public Domain getDomainForSchemaType(SchemaType jdbcType) { Modified: db/torque/generator/trunk/src/java/org/apache/torque/task/TorqueDataDumpTask.java URL: http://svn.apache.org/viewvc/db/torque/generator/trunk/src/java/org/apache/torque/task/TorqueDataDumpTask.java?view=diff&rev=441695&r1=441694&r2=441695 ============================================================================== --- db/torque/generator/trunk/src/java/org/apache/torque/task/TorqueDataDumpTask.java (original) +++ db/torque/generator/trunk/src/java/org/apache/torque/task/TorqueDataDumpTask.java Fri Sep 8 17:00:40 2006 @@ -249,7 +249,7 @@ /** * Constructor for the TableTool object * - * @param qds Description of Parameter + * @param rs a query result set * @throws Exception Problem using database record set cursor. */ protected TableTool(ResultSet rs) throws Exception Modified: db/torque/generator/trunk/src/java/org/apache/torque/task/TorqueDataModelTask.java URL: http://svn.apache.org/viewvc/db/torque/generator/trunk/src/java/org/apache/torque/task/TorqueDataModelTask.java?view=diff&rev=441695&r1=441694&r2=441695 ============================================================================== --- db/torque/generator/trunk/src/java/org/apache/torque/task/TorqueDataModelTask.java (original) +++ db/torque/generator/trunk/src/java/org/apache/torque/task/TorqueDataModelTask.java Fri Sep 8 17:00:40 2006 @@ -22,6 +22,7 @@ import java.util.Hashtable; import java.util.Iterator; import java.util.List; +import java.util.Map; import org.apache.commons.lang.StringUtils; import org.apache.tools.ant.BuildException; @@ -348,9 +349,10 @@ // Map the torque.xxx elements from the env to the contextProperties Hashtable env = super.getProject().getProperties(); - for (Iterator i = env.keySet().iterator(); i.hasNext();) + for (Iterator i = env.entrySet().iterator(); i.hasNext();) { - String key = (String) i.next(); + Map.Entry entry = (Map.Entry)i.next(); + String key = (String) entry.getKey(); if (key.startsWith("torque.")) { String newKey = key.substring("torque.".length()); @@ -363,7 +365,7 @@ j = newKey.indexOf("."); } - contextProperties.setProperty(newKey, env.get(key)); + contextProperties.setProperty(newKey, entry.getValue()); } } } Modified: db/torque/runtime/trunk/src/java/org/apache/torque/Database.java URL: http://svn.apache.org/viewvc/db/torque/runtime/trunk/src/java/org/apache/torque/Database.java?view=diff&rev=441695&r1=441694&r2=441695 ============================================================================== --- db/torque/runtime/trunk/src/java/org/apache/torque/Database.java (original) +++ db/torque/runtime/trunk/src/java/org/apache/torque/Database.java Fri Sep 8 17:00:40 2006 @@ -93,8 +93,6 @@ /** * Returns the database map for this database. * If the database map does not exist yet, it is created by this method. - * - * @param adapter The database map for this database, never null. */ public synchronized DatabaseMap getDatabaseMap() { Modified: db/torque/runtime/trunk/src/java/org/apache/torque/Torque.java URL: http://svn.apache.org/viewvc/db/torque/runtime/trunk/src/java/org/apache/torque/Torque.java?view=diff&rev=441695&r1=441694&r2=441695 ============================================================================== --- db/torque/runtime/trunk/src/java/org/apache/torque/Torque.java (original) +++ db/torque/runtime/trunk/src/java/org/apache/torque/Torque.java Fri Sep 8 17:00:40 2006 @@ -89,7 +89,7 @@ /** * C'tor for usage with the Stratum Lifecycle. * - * @todo Should be made private or protected once Stratum is removed. + * TODO: Should be made private or protected once Stratum is removed. */ public Torque() { Modified: db/torque/runtime/trunk/src/java/org/apache/torque/TorqueInstance.java URL: http://svn.apache.org/viewvc/db/torque/runtime/trunk/src/java/org/apache/torque/TorqueInstance.java?view=diff&rev=441695&r1=441694&r2=441695 ============================================================================== --- db/torque/runtime/trunk/src/java/org/apache/torque/TorqueInstance.java (original) +++ db/torque/runtime/trunk/src/java/org/apache/torque/TorqueInstance.java Fri Sep 8 17:00:40 2006 @@ -276,7 +276,12 @@ } } } - catch (Exception e) + catch (InstantiationException e) + { + log.error("Error creating a database adapter instance", e); + throw new TorqueException(e); + } + catch (TorqueException e) { log.error("Error reading configuration seeking database " + "adapters", e); @@ -354,6 +359,11 @@ database.setDataSourceFactory(dsf); } } + } + catch (RuntimeException e) + { + log.error("Runtime Error reading adapter configuration", e); + throw new TorqueRuntimeException(e); } catch (Exception e) { Modified: db/torque/runtime/trunk/src/java/org/apache/torque/TorqueRuntimeException.java URL: http://svn.apache.org/viewvc/db/torque/runtime/trunk/src/java/org/apache/torque/TorqueRuntimeException.java?view=diff&rev=441695&r1=441694&r2=441695 ============================================================================== --- db/torque/runtime/trunk/src/java/org/apache/torque/TorqueRuntimeException.java (original) +++ db/torque/runtime/trunk/src/java/org/apache/torque/TorqueRuntimeException.java Fri Sep 8 17:00:40 2006 @@ -219,6 +219,6 @@ { list.add(st.nextToken()); } - return (String[]) list.toArray(new String[] {}); + return (String[]) list.toArray(); } } Modified: db/torque/runtime/trunk/src/java/org/apache/torque/adapter/DBCloudscape.java URL: http://svn.apache.org/viewvc/db/torque/runtime/trunk/src/java/org/apache/torque/adapter/DBCloudscape.java?view=diff&rev=441695&r1=441694&r2=441695 ============================================================================== --- db/torque/runtime/trunk/src/java/org/apache/torque/adapter/DBCloudscape.java (original) +++ db/torque/runtime/trunk/src/java/org/apache/torque/adapter/DBCloudscape.java Fri Sep 8 17:00:40 2006 @@ -93,7 +93,7 @@ switch (count) { case 0: - return ""; // not valid -- we need the column name and table name + /* return ""; */ // not valid -- we need the column name and table name case 1: return ""; // not valid -- we need the table name to select from Modified: db/torque/runtime/trunk/src/java/org/apache/torque/dsfactory/AbstractDataSourceFactory.java URL: http://svn.apache.org/viewvc/db/torque/runtime/trunk/src/java/org/apache/torque/dsfactory/AbstractDataSourceFactory.java?view=diff&rev=441695&r1=441694&r2=441695 ============================================================================== --- db/torque/runtime/trunk/src/java/org/apache/torque/dsfactory/AbstractDataSourceFactory.java (original) +++ db/torque/runtime/trunk/src/java/org/apache/torque/dsfactory/AbstractDataSourceFactory.java Fri Sep 8 17:00:40 2006 @@ -24,17 +24,14 @@ import org.apache.commons.beanutils.ConvertUtils; import org.apache.commons.beanutils.MappedPropertyDescriptor; import org.apache.commons.beanutils.PropertyUtils; - import org.apache.commons.configuration.Configuration; import org.apache.commons.dbcp.cpdsadapter.DriverAdapterCPDS; - import org.apache.commons.lang.StringUtils; - import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; - import org.apache.torque.Torque; import org.apache.torque.TorqueException; +import org.apache.torque.TorqueRuntimeException; /** * A class that contains common functionality of the factories in this @@ -166,6 +163,11 @@ } } } + } + catch (RuntimeException e) + { + throw new TorqueRuntimeException( + "Runtime error setting property " + property, e); } catch (Exception e) { Modified: db/torque/runtime/trunk/src/java/org/apache/torque/manager/AbstractBaseManager.java URL: http://svn.apache.org/viewvc/db/torque/runtime/trunk/src/java/org/apache/torque/manager/AbstractBaseManager.java?view=diff&rev=441695&r1=441694&r2=441695 ============================================================================== --- db/torque/runtime/trunk/src/java/org/apache/torque/manager/AbstractBaseManager.java (original) +++ db/torque/runtime/trunk/src/java/org/apache/torque/manager/AbstractBaseManager.java Fri Sep 8 17:00:40 2006 @@ -138,7 +138,8 @@ /** * Return an instance of an om based on the id * - * @param id + * @param id the primary key of the object + * @return the object from persistent storage or from cache * @throws TorqueException Any exceptions caught during processing will be * rethrown wrapped into a TorqueException. */ @@ -151,6 +152,9 @@ /** * Return an instance of an om based on the id * + * @param key the primary key of the object + * @param fromCache true if the object should be retrieved from cache + * @return the object from persistent storage or from cache * @throws TorqueException Any exceptions caught during processing will be * rethrown wrapped into a TorqueException. */ @@ -175,6 +179,12 @@ return om; } + /** + * Get an object from cache + * + * @param key the primary key of the object + * @return the object from cache + */ protected Persistent cacheGet(Serializable key) { Persistent om = null; @@ -189,6 +199,7 @@ } /** + * Clears the cache * * @throws TorqueException Any exceptions caught during processing will be * rethrown wrapped into a TorqueException. @@ -211,9 +222,10 @@ } /** - * - * @param key - * @return + * Remove an object from the cache + * + * @param key the cache key for the object + * @return the object one last time * @throws TorqueException Any exceptions caught during processing will be * rethrown wrapped into a TorqueException. */ @@ -242,9 +254,11 @@ } /** - * - * @param om - * @return + * Put an object into the cache + * + * @param om the object + * @return if an object with the same key already is in the cache + * this object will be returned, else null * @throws TorqueException Any exceptions caught during processing will be * rethrown wrapped into a TorqueException. */ @@ -256,10 +270,12 @@ } /** - * - * @param key - * @param om - * @return + * Put an object into the cache + * + * @param key the cache key for the object + * @param om the object + * @return if an object with this key already is in the cache + * this object will be returned, else null * @throws TorqueException Any exceptions caught during processing will be * rethrown wrapped into a TorqueException. */ @@ -294,9 +310,10 @@ } /** - * - * @param id - * @return + * Retrieve an object from persistent storage + * + * @param id the primary key of the object + * @return the object * @throws TorqueException Any exceptions caught during processing will be * rethrown wrapped into a TorqueException. */ @@ -397,9 +414,11 @@ } /** + * Gets a list of om's based on id's. + * This method must be implemented in the drived class * - * @param ids - * @return + * @param ids a <code>List</code> of <code>ObjectKey</code>'s + * @return a <code>List</code> value * @throws TorqueException Any exceptions caught during processing will be * rethrown wrapped into a TorqueException. */ Modified: db/torque/runtime/trunk/src/java/org/apache/torque/map/ColumnMap.java URL: http://svn.apache.org/viewvc/db/torque/runtime/trunk/src/java/org/apache/torque/map/ColumnMap.java?view=diff&rev=441695&r1=441694&r2=441695 ============================================================================== --- db/torque/runtime/trunk/src/java/org/apache/torque/map/ColumnMap.java (original) +++ db/torque/runtime/trunk/src/java/org/apache/torque/map/ColumnMap.java Fri Sep 8 17:00:40 2006 @@ -403,7 +403,7 @@ /** * Sets the Java Name for this column. * - * @return the Java Name. + * @param name the Java Name. */ public void setJavaName(String name) { @@ -515,7 +515,7 @@ /** * Sets the inheritance type. * - * @param inheritance The inheritance type to set. + * @param inheritanceType The inheritance type to set. */ public void setInheritance(String inheritanceType) { Modified: db/torque/runtime/trunk/src/java/org/apache/torque/map/TableMap.java URL: http://svn.apache.org/viewvc/db/torque/runtime/trunk/src/java/org/apache/torque/map/TableMap.java?view=diff&rev=441695&r1=441694&r2=441695 ============================================================================== --- db/torque/runtime/trunk/src/java/org/apache/torque/map/TableMap.java (original) +++ db/torque/runtime/trunk/src/java/org/apache/torque/map/TableMap.java Fri Sep 8 17:00:40 2006 @@ -700,7 +700,7 @@ /** * Sets the Peer class for this table. * - * @param peerClassName The peerClass to set. + * @param peerClass The peerClass to set. */ public void setPeerClass(Class peerClass) { Modified: db/torque/runtime/trunk/src/java/org/apache/torque/oid/SequenceIdGenerator.java URL: http://svn.apache.org/viewvc/db/torque/runtime/trunk/src/java/org/apache/torque/oid/SequenceIdGenerator.java?view=diff&rev=441695&r1=441694&r2=441695 ============================================================================== --- db/torque/runtime/trunk/src/java/org/apache/torque/oid/SequenceIdGenerator.java (original) +++ db/torque/runtime/trunk/src/java/org/apache/torque/oid/SequenceIdGenerator.java Fri Sep 8 17:00:40 2006 @@ -50,7 +50,7 @@ /** * Creates an IdGenerator which will work with the specified database. * - * @param adapter the adapter that knows the correct sql syntax. + * @param dbAdapter the adapter that knows the correct sql syntax. * @param name The name of the datasource to find the correct schema */ public SequenceIdGenerator(final DB dbAdapter, final String name) @@ -174,10 +174,7 @@ } finally { - if (qds != null) - { - qds.close(); - } + qds.close(); } return rec.getValue(1); // Values are 1 based. } Modified: db/torque/runtime/trunk/src/java/org/apache/torque/util/BasePeer.java URL: http://svn.apache.org/viewvc/db/torque/runtime/trunk/src/java/org/apache/torque/util/BasePeer.java?view=diff&rev=441695&r1=441694&r2=441695 ============================================================================== --- db/torque/runtime/trunk/src/java/org/apache/torque/util/BasePeer.java (original) +++ db/torque/runtime/trunk/src/java/org/apache/torque/util/BasePeer.java Fri Sep 8 17:00:40 2006 @@ -188,8 +188,7 @@ */ public static String[] initColumnNames(Column[] columns) { - String[] columnNames = null; - columnNames = new String[columns.length]; + String[] columnNames = new String[columns.length]; for (int i = 0; i < columns.length; i++) { columnNames[i] = columns[i].name().toUpperCase(); Modified: db/torque/runtime/trunk/src/java/org/apache/torque/util/Query.java URL: http://svn.apache.org/viewvc/db/torque/runtime/trunk/src/java/org/apache/torque/util/Query.java?view=diff&rev=441695&r1=441694&r2=441695 ============================================================================== --- db/torque/runtime/trunk/src/java/org/apache/torque/util/Query.java (original) +++ db/torque/runtime/trunk/src/java/org/apache/torque/util/Query.java Fri Sep 8 17:00:40 2006 @@ -191,7 +191,7 @@ * Get the Pre limit String. Oracle and DB2 want to encapsulate * a query into a subquery for limiting. * - * @return A String with the preLimit. + * @param preLimit A String with the preLimit. */ public void setPreLimit(String preLimit) { @@ -202,7 +202,7 @@ * Set the Post limit String. Oracle and DB2 want to encapsulate * a query into a subquery for limiting. * - * @return A String with the preLimit. + * @param postLimit A String with the postLimit. */ public void setPostLimit(String postLimit) { Modified: db/torque/runtime/trunk/src/java/org/apache/torque/util/SQLBuilder.java URL: http://svn.apache.org/viewvc/db/torque/runtime/trunk/src/java/org/apache/torque/util/SQLBuilder.java?view=diff&rev=441695&r1=441694&r2=441695 ============================================================================== --- db/torque/runtime/trunk/src/java/org/apache/torque/util/SQLBuilder.java (original) +++ db/torque/runtime/trunk/src/java/org/apache/torque/util/SQLBuilder.java Fri Sep 8 17:00:40 2006 @@ -46,7 +46,7 @@ implements Serializable { /** Logging */ - protected static Log log = LogFactory.getLog(SQLBuilder.class); + protected static final Log log = LogFactory.getLog(SQLBuilder.class); /** Function Characters */ public static final String[] COLUMN_CHARS = {".", "*"}; @@ -332,12 +332,13 @@ UniqueList querySelectClause = query.getSelectClause(); Map criteriaAsColumns = criteria.getAsColumns(); - for (Iterator it = criteriaAsColumns.keySet().iterator(); it.hasNext(); ) + for (Iterator it = criteriaAsColumns.entrySet().iterator(); it.hasNext(); ) { - String key = (String) it.next(); + Map.Entry entry = (Map.Entry)it.next(); + String key = (String)entry.getKey(); querySelectClause.add( new StringBuffer() - .append(criteriaAsColumns.get(key)) + .append(entry.getValue()) .append(SqlEnum.AS) .append(key) .toString()); Modified: db/torque/runtime/trunk/src/java/org/apache/torque/util/SqlExpression.java URL: http://svn.apache.org/viewvc/db/torque/runtime/trunk/src/java/org/apache/torque/util/SqlExpression.java?view=diff&rev=441695&r1=441694&r2=441695 ============================================================================== --- db/torque/runtime/trunk/src/java/org/apache/torque/util/SqlExpression.java (original) +++ db/torque/runtime/trunk/src/java/org/apache/torque/util/SqlExpression.java Fri Sep 8 17:00:40 2006 @@ -600,7 +600,7 @@ StringBuffer buf = new StringBuffer((int) (rawText.length() * 1.1)); // Some databases do not need escaping. - String escapeString = new String(); + String escapeString; if (db != null && !db.escapeText()) { escapeString = String.valueOf(BACKSLASH); Modified: db/torque/runtime/trunk/src/java/org/apache/torque/util/Transaction.java URL: http://svn.apache.org/viewvc/db/torque/runtime/trunk/src/java/org/apache/torque/util/Transaction.java?view=diff&rev=441695&r1=441694&r2=441695 ============================================================================== --- db/torque/runtime/trunk/src/java/org/apache/torque/util/Transaction.java (original) +++ db/torque/runtime/trunk/src/java/org/apache/torque/util/Transaction.java Fri Sep 8 17:00:40 2006 @@ -195,7 +195,7 @@ * errors are logged at warn level. * * @param con The Connection for the transaction. - * @see rollback + * @see Transaction#rollback(Connection) */ public static void safeRollback(Connection con) { --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]