Author: tfischer
Date: Fri May 11 02:01:25 2012
New Revision: 1337001
URL: http://svn.apache.org/viewvc?rev=1337001&view=rev
Log:
- Class is not serializable because instance field contains a non-serializable
class
- fixed checkstyle errors
Modified:
db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/map/DatabaseMap.java
Modified:
db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/map/DatabaseMap.java
URL:
http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/map/DatabaseMap.java?rev=1337001&r1=1337000&r2=1337001&view=diff
==============================================================================
---
db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/map/DatabaseMap.java
(original)
+++
db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/map/DatabaseMap.java
Fri May 11 02:01:25 2012
@@ -39,7 +39,7 @@ import org.apache.torque.TorqueException
* @author <a href="mailto:[email protected]">Greg Monroe</a>
* @version $Id$
*/
-public class DatabaseMap implements java.io.Serializable
+public class DatabaseMap
{
/**
* The character used by most implementations as the separator
@@ -59,31 +59,34 @@ public class DatabaseMap implements java
public static final String INIT_CLASS_NAME_FORMAT =
"org.apache.torque.linkage.{0}DatabaseMapInit";
- /**
- * Error Messages for initialisation.
- */
- protected static final String[] ERROR_MESSAGES_INIT = {
- "Invalid Torque OM setup for Database \"{0}\".\n"
- + "Database Map initialization class, \"{1}\"," + " "
- + "could not be found in your classpath.",
- "Invalid Torque OM setup for Database \"{0}\".\n"
- + "A class that the Database Map initialization class, \"{1}\", "
- + "depends on could not be found.",
+ /** Error Message for class not found. */
+ private static final String ERROR_MESSAGES_CLASS_NOT_FOUND
+ = "Invalid Torque OM setup for Database \"{0}\".\n"
+ + "Database Map initialization class, \"{1}\"," + " "
+ + "could not be found in your classpath.";
+
+ /** Error Message for dependent class not found. */
+ private static final String ERROR_MESSAGES_DEPENDENT_CLASS_NOT_FOUND
+ = "Invalid Torque OM setup for Database \"{0}\".\n"
+ + "A class that the Database Map initialization class, \"{1}\", "
+ + "depends on could not be found.";
+
+ /** Error Message for class for name error. */
+ private static final String ERROR_MESSAGES_CLASS_FOR_NAME =
"Invalid Torque OM setup for Database \"{0}\".\n"
+ "Something unexpected happened doing Class.forName(\"{1}\"). "
- + "See the nested exception for details.",
- "Invalid Torque OM setup for Database \"{0}\".\n"
- + "An error occured invoking the init() method in class, \"{1}\""
- };
+ + "See the nested exception for details.";
- /** The serialVersionUID for this class. */
- private static final long serialVersionUID = 955251837095032274L;
+ /** Error Message for class for init error. */
+ private static final String ERROR_MESSAGES_INIT =
+ "Invalid Torque OM setup for Database \"{0}\".\n"
+ + "An error occured invoking the init() method in class, \"{1}\"";
/** The database where this databaseMap belongs to. */
- private Database database;
+ private final Database database;
/** Name of the tables in the database. */
- private Map<String, TableMap> tables
+ private final Map<String, TableMap> tables
= Collections.synchronizedMap(new LinkedHashMap<String, TableMap>());
/** The id Table. */
@@ -93,7 +96,7 @@ public class DatabaseMap implements java
private boolean isInitialized = false;
/** Associated options. */
- private Map<String, String> optionsMap
+ private final Map<String, String> optionsMap
= Collections.synchronizedMap(new LinkedHashMap<String, String>());
/**
@@ -319,7 +322,7 @@ public class DatabaseMap implements java
catch (ClassNotFoundException e)
{
throw new TorqueException(MessageFormat.format(
- ERROR_MESSAGES_INIT[0],
+ ERROR_MESSAGES_CLASS_NOT_FOUND,
new Object[] {
getDatabase().getName(),
initClassName
@@ -329,7 +332,7 @@ public class DatabaseMap implements java
catch (LinkageError e)
{
throw new TorqueException(MessageFormat.format(
- ERROR_MESSAGES_INIT[1],
+ ERROR_MESSAGES_DEPENDENT_CLASS_NOT_FOUND,
new Object[] {
getDatabase().getName(), initClassName
}),
@@ -338,7 +341,7 @@ public class DatabaseMap implements java
catch (Throwable e)
{
throw new TorqueException(MessageFormat.format(
- ERROR_MESSAGES_INIT[2],
+ ERROR_MESSAGES_CLASS_FOR_NAME,
new Object[] {
getDatabase().getName(), initClassName
}),
@@ -352,7 +355,7 @@ public class DatabaseMap implements java
catch (Exception e)
{
throw new TorqueException(MessageFormat.format(
- ERROR_MESSAGES_INIT[3],
+ ERROR_MESSAGES_INIT,
new Object[] {
getDatabase().getName(), initClassName
}),
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]