openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From p..@apache.org
Subject svn commit: r429535 [1/2] - in /incubator/openjpa/trunk: openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/ant/ openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/ openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/ openjpa-jdbc/src/main/j...
Date Tue, 08 Aug 2006 01:42:38 GMT
Author: pcl
Date: Mon Aug  7 18:42:34 2006
New Revision: 429535

URL: http://svn.apache.org/viewvc?rev=429535&view=rev
Log:
Changed logging infrastructure to be aware of localization; changed localization to return log-ready Message instances instead of strings. Changed tons of code to use the new logging and localization calls.

Modified:
    incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/ant/MappingToolTask.java
    incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/ant/SchemaToolTask.java
    incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/PreparedStatementManagerImpl.java
    incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/TableJDBCSeq.java
    incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/MappingInfo.java
    incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/ClassNameDiscriminatorStrategy.java
    incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/ValueMapDiscriminatorStrategy.java
    incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/ForeignKey.java
    incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/NameSet.java
    incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/SchemaGenerator.java
    incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/XMLSchemaParser.java
    incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java
    incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SQLExceptions.java
    incubator/openjpa/trunk/openjpa-jdbc/src/main/resources/org/apache/openjpa/jdbc/sql/localizer.properties
    incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/ant/MetaDataToolTask.java
    incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/conf/ProductDerivations.java
    incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/datacache/Caches.java
    incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/datacache/DataCacheScheduler.java
    incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCDataGenerator.java
    incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCEnhancer.java
    incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/event/LogOrphanedKeyAction.java
    incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/AbstractBrokerFactory.java
    incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/BrokerImpl.java
    incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/DetachedStateAttachStrategy.java
    incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/DetachedStateManager.java
    incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/Filters.java
    incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/exps/AbstractExpressionBuilder.java
    incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/jpql/ParseException.java
    incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/Extensions.java
    incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/UpdateStrategies.java
    incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/ValueStrategies.java
    incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/CallbackException.java
    incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/GeneralException.java
    incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/InternalException.java
    incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/InvalidStateException.java
    incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/LockException.java
    incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/MetaDataException.java
    incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/NoTransactionException.java
    incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/ObjectExistsException.java
    incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/ObjectNotFoundException.java
    incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/OpenJPAException.java
    incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/OptimisticException.java
    incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/ReferentialIntegrityException.java
    incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/StoreException.java
    incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/UnsupportedException.java
    incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/UserException.java
    incubator/openjpa/trunk/openjpa-kernel/src/main/resources/org/apache/openjpa/kernel/localizer.properties
    incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/ant/AbstractTask.java
    incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ConfigurationImpl.java
    incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/Configurations.java
    incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ObjectValue.java
    incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/PluginValue.java
    incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/jdbc/DataSourceLogs.java
    incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/jdbc/DelegatingConnection.java
    incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/log/AbstractLog.java
    incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/log/CommonsLogFactory.java
    incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/log/Log.java
    incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/log/Log4JLogFactory.java
    incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/log/LogFactoryImpl.java
    incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/log/LogOutputStream.java
    incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/log/MultiLogFactory.java
    incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/log/NoneLogFactory.java
    incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/meta/CFMetaDataParser.java
    incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/meta/ClassArgParser.java
    incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/meta/FileMetaDataIterator.java
    incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/meta/SourceTrackers.java
    incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/meta/XMLMetaDataParser.java
    incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/rop/AbstractListIterator.java
    incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/rop/AbstractResultList.java
    incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/rop/RangeResultObjectProvider.java
    incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/rop/ResultListIterator.java
    incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/FormatPreservingProperties.java
    incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/Localizer.java
    incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/ParseException.java
    incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/xml/Location.java
    incubator/openjpa/trunk/openjpa-lib/src/main/resources/org/apache/openjpa/lib/conf/localizer.properties
    incubator/openjpa/trunk/openjpa-lib/src/main/resources/org/apache/openjpa/lib/jdbc/localizer.properties
    incubator/openjpa/trunk/openjpa-lib/src/main/resources/org/apache/openjpa/lib/log/localizer.properties
    incubator/openjpa/trunk/openjpa-lib/src/main/resources/org/apache/openjpa/lib/meta/localizer.properties
    incubator/openjpa/trunk/openjpa-lib/src/test/java/org/apache/openjpa/lib/test/AbstractTestCase.java
    incubator/openjpa/trunk/openjpa-lib/src/test/java/org/apache/openjpa/lib/util/TestLocalizer.java
    incubator/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/ArgumentException.java
    incubator/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/ConfigurationProviderImpl.java
    incubator/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/EntityManagerImpl.java
    incubator/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/InvalidStateException.java
    incubator/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceExceptions.java
    incubator/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceUnitInfoImpl.java
    incubator/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/QueryImpl.java
    incubator/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/TransactionRequiredException.java

Modified: incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/ant/MappingToolTask.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/ant/MappingToolTask.java?rev=429535&r1=429534&r2=429535&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/ant/MappingToolTask.java (original)
+++ incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/ant/MappingToolTask.java Mon Aug  7 18:42:34 2006
@@ -185,7 +185,8 @@
         conf.setClassResolver(resolver);
 
         if (!MappingTool.run(conf, files, flags, loader))
-            throw new BuildException(_loc.get("bad-conf", "MappingToolTask"));
+            throw new BuildException(_loc.get("bad-conf", "MappingToolTask")
+                .getMessage());
     }
 
     public static class Action

Modified: incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/ant/SchemaToolTask.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/ant/SchemaToolTask.java?rev=429535&r1=429534&r2=429535&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/ant/SchemaToolTask.java (original)
+++ incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/ant/SchemaToolTask.java Mon Aug  7 18:42:34 2006
@@ -133,7 +133,8 @@
         flags.writer = Files.getWriter(file, loader);
         if (!SchemaTool.run((JDBCConfiguration) getConfiguration(), files,
             flags, loader))
-            throw new BuildException(_loc.get("bad-conf", "SchemaToolTask"));
+            throw new BuildException(_loc.get("bad-conf", "SchemaToolTask")
+                .getMessage());
     }
 
     public static class Action

Modified: incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/PreparedStatementManagerImpl.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/PreparedStatementManagerImpl.java?rev=429535&r1=429534&r2=429535&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/PreparedStatementManagerImpl.java (original)
+++ incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/PreparedStatementManagerImpl.java Mon Aug  7 18:42:34 2006
@@ -97,7 +97,7 @@
                 else if (row.getAction() == Row.ACTION_INSERT)
                     throw new SQLException(_loc.get(
                         "update-failed-no-failed-obj", String.valueOf(count),
-                        sql));
+                        sql).getMessage());
             }
         } catch (SQLException se) {
             throw SQLExceptions.getStore(se, row.getFailedObject(), _dict);

Modified: incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/TableJDBCSeq.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/TableJDBCSeq.java?rev=429535&r1=429534&r2=429535&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/TableJDBCSeq.java (original)
+++ incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/TableJDBCSeq.java Mon Aug  7 18:42:34 2006
@@ -322,7 +322,7 @@
                 if (!setSequence(mapping, stat, alloc, updateStatSeq,
                     getConnection(store)))
                     throw(err != null) ? err : new SQLException(_loc.get
-                        ("no-seq-row", mapping, _table));
+                        ("no-seq-row", mapping, _table).getMessage());
             }
         }
         catch (SQLException se2) {

Modified: incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/MappingInfo.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/MappingInfo.java?rev=429535&r1=429534&r2=429535&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/MappingInfo.java (original)
+++ incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/MappingInfo.java Mon Aug  7 18:42:34 2006
@@ -34,9 +34,11 @@
 import org.apache.openjpa.jdbc.sql.DBDictionary;
 import org.apache.openjpa.lib.log.Log;
 import org.apache.openjpa.lib.util.Localizer;
+import org.apache.openjpa.lib.util.Localizer.Message;
 import org.apache.openjpa.meta.JavaTypes;
 import org.apache.openjpa.meta.MetaDataContext;
 import org.apache.openjpa.util.MetaDataException;
+
 import serp.util.Strings;
 
 /**
@@ -315,7 +317,7 @@
             return;
         }
 
-        String msg = _loc.get("unexpected-cols", context);
+        Message msg = _loc.get("unexpected-cols", context);
         if (die)
             throw new MetaDataException(msg);
         context.getRepository().getLog().warn(msg);
@@ -344,7 +346,7 @@
         else
             strat = contextStrat.getClass().getName();
 
-        String msg = _loc.get("unexpected-strategy", context, expected,
+        Message msg = _loc.get("unexpected-strategy", context, expected,
             strat);
         if (die)
             throw new MetaDataException(msg);
@@ -358,7 +360,7 @@
         if (_idx == null)
             return;
 
-        String msg = _loc.get("unexpected-index", context);
+        Message msg = _loc.get("unexpected-index", context);
         if (die)
             throw new MetaDataException(msg);
         context.getRepository().getLog().warn(msg);
@@ -372,7 +374,7 @@
         if (_unq == null)
             return;
 
-        String msg = _loc.get("unexpected-unique", context);
+        Message msg = _loc.get("unexpected-unique", context);
         if (die)
             throw new MetaDataException(msg);
         context.getRepository().getLog().warn(msg);
@@ -385,7 +387,7 @@
         if (_fk == null)
             return;
 
-        String msg = _loc.get("unexpected-fk", context);
+        Message msg = _loc.get("unexpected-fk", context);
         if (die)
             throw new MetaDataException(msg);
         context.getRepository().getLog().warn(msg);
@@ -407,7 +409,7 @@
         if (!join)
             return;
 
-        String msg = _loc.get("unexpected-join", context);
+        Message msg = _loc.get("unexpected-join", context);
         if (die)
             throw new MetaDataException(msg);
         context.getRepository().getLog().warn(msg);
@@ -643,7 +645,7 @@
         } else if ((compat || !ttype) && !col.isCompatible(type, size)) {
             // if existing column isn't compatible with desired type, die if
             // can't adapt, else warn and change the existing column type
-            String msg = _loc.get(prefix + "-bad-col", context,
+            Message msg = _loc.get(prefix + "-bad-col", context,
                 Schemas.getJDBCName(type), col.getDescription());
             if (!adapt)
                 throw new MetaDataException(msg);

Modified: incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/ClassNameDiscriminatorStrategy.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/ClassNameDiscriminatorStrategy.java?rev=429535&r1=429534&r2=429535&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/ClassNameDiscriminatorStrategy.java (original)
+++ incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/ClassNameDiscriminatorStrategy.java Mon Aug  7 18:42:34 2006
@@ -90,7 +90,7 @@
                 className = dict.getString(rs, 1);
                 if (className == null || className.length() == 0)
                     throw new ClassNotFoundException(_loc.get("no-class-name",
-                        disc.getClassMapping(), col));
+                        disc.getClassMapping(), col).getMessage());
                 Class.forName(className, true, loader);
             }
             disc.setSubclassesLoaded(true);

Modified: incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/ValueMapDiscriminatorStrategy.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/ValueMapDiscriminatorStrategy.java?rev=429535&r1=429534&r2=429535&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/ValueMapDiscriminatorStrategy.java (original)
+++ incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/ValueMapDiscriminatorStrategy.java Mon Aug  7 18:42:34 2006
@@ -95,7 +95,7 @@
         throw new ClassNotFoundException(_loc.get("unknown-discrim-value",
             new Object[]{ str,
                 disc.getClassMapping().getDescribedType().getName(),
-                new TreeSet(_vals.keySet()) }));
+                new TreeSet(_vals.keySet()) }).getMessage());
     }
 
     /**

Modified: incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/ForeignKey.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/ForeignKey.java?rev=429535&r1=429534&r2=429535&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/ForeignKey.java (original)
+++ incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/ForeignKey.java Mon Aug  7 18:42:34 2006
@@ -113,9 +113,10 @@
 
         String msg;
         if (closest != null)
-            msg = _loc.get("bad-fk-action-hint", name, closest, recognized);
+            msg = _loc.get("bad-fk-action-hint", name, closest, recognized)
+                .getMessage();
         else
-            msg = _loc.get("bad-fk-action", name, recognized);
+            msg = _loc.get("bad-fk-action", name, recognized).getMessage();
         throw new IllegalArgumentException(msg);
     }
 

Modified: incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/NameSet.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/NameSet.java?rev=429535&r1=429534&r2=429535&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/NameSet.java (original)
+++ incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/NameSet.java Mon Aug  7 18:42:34 2006
@@ -51,7 +51,8 @@
     protected void addName(String name, boolean validate) {
         if (name == null || name.length() == 0) {
             if (validate)
-                throw new IllegalArgumentException(_loc.get("bad-name", name));
+                throw new IllegalArgumentException(_loc.get("bad-name", name)
+                    .getMessage());
             return;
         }
 

Modified: incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/SchemaGenerator.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/SchemaGenerator.java?rev=429535&r1=429534&r2=429535&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/SchemaGenerator.java (original)
+++ incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/SchemaGenerator.java Mon Aug  7 18:42:34 2006
@@ -772,7 +772,7 @@
             pkTable = group.findTable(pkTableName);
             if (pkTable == null)
                 throw new SQLException(_loc.get("gen-nofktable",
-                    table, pkTableName));
+                    table, pkTableName).getMessage());
 
             // this sucks, because it is *not* guaranteed to work;
             // the fk resultset is ordered by primary key table, then
@@ -870,7 +870,8 @@
         for (Iterator i = _listeners.iterator(); i.hasNext();) {
             Listener l = (Listener) i.next();
             if (!l.schemaObjectGenerated(e))
-                throw new SQLException(_loc.get("refresh-cancelled"));
+                throw new SQLException(_loc.get("refresh-cancelled")
+                    .getMessage());
         }
     }
 

Modified: incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/XMLSchemaParser.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/XMLSchemaParser.java?rev=429535&r1=429534&r2=429535&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/XMLSchemaParser.java (original)
+++ incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/XMLSchemaParser.java Mon Aug  7 18:42:34 2006
@@ -28,6 +28,7 @@
 import org.apache.openjpa.jdbc.sql.DBDictionary;
 import org.apache.openjpa.lib.meta.XMLMetaDataParser;
 import org.apache.openjpa.lib.util.Localizer;
+import org.apache.openjpa.lib.util.Localizer.Message;
 import org.apache.openjpa.util.UserException;
 
 /**
@@ -553,8 +554,8 @@
         return new Double(val);
     }
 
-    private void throwUserException(String msg) {
-        throw new UserException(getSourceName() + ": " + msg);
+    private void throwUserException(Message msg) {
+        throw new UserException(getSourceName() + ": " + msg.getMessage());
     }
 
     /**

Modified: incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java?rev=429535&r1=429534&r2=429535&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java (original)
+++ incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java Mon Aug  7 18:42:34 2006
@@ -81,6 +81,7 @@
 import org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator;
 import org.apache.openjpa.lib.log.Log;
 import org.apache.openjpa.lib.util.Localizer;
+import org.apache.openjpa.lib.util.Localizer.Message;
 import org.apache.openjpa.meta.FieldMetaData;
 import org.apache.openjpa.meta.JavaTypes;
 import org.apache.openjpa.util.GeneralException;
@@ -1362,7 +1363,7 @@
 
         if (storageLimitationsFatal || (warn && log.isWarnEnabled())
             || (!warn && log.isTraceEnabled())) {
-            String msg = _loc.get("storage-restriction", new Object[]{
+            Message msg = _loc.get("storage-restriction", new Object[]{
                 platform,
                 orig,
                 orig.getClass().getName(),

Modified: incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SQLExceptions.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SQLExceptions.java?rev=429535&r1=429534&r2=429535&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SQLExceptions.java (original)
+++ incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SQLExceptions.java Mon Aug  7 18:42:34 2006
@@ -19,6 +19,7 @@
 import java.util.LinkedList;
 import java.util.List;
 
+import org.apache.openjpa.lib.util.Localizer.Message;
 import org.apache.openjpa.util.OpenJPAException;
 import org.apache.openjpa.util.StoreException;
 
@@ -61,6 +62,14 @@
     public static OpenJPAException getStore(SQLException se, Object failed,
         DBDictionary dict) {
         return getStore(se.getMessage(), se, failed, dict);
+    }
+
+    /**
+     * Convert the specified exception into a {@link StoreException}.
+     */
+    public static OpenJPAException getStore(Message msg, SQLException se,
+        DBDictionary dict) {
+        return getStore(msg.getMessage(), se, null, dict);
     }
 
     /**

Modified: incubator/openjpa/trunk/openjpa-jdbc/src/main/resources/org/apache/openjpa/jdbc/sql/localizer.properties
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-jdbc/src/main/resources/org/apache/openjpa/jdbc/sql/localizer.properties?rev=429535&r1=429534&r2=429535&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-jdbc/src/main/resources/org/apache/openjpa/jdbc/sql/localizer.properties (original)
+++ incubator/openjpa/trunk/openjpa-jdbc/src/main/resources/org/apache/openjpa/jdbc/sql/localizer.properties Mon Aug  7 18:42:34 2006
@@ -140,3 +140,4 @@
 column-not-mapped: SQLResultSetMapping "{0}" does not map the columns "{1}" \
 	that are selected by the SQL query\r\n "{2}"
 batch-license: Your license does not have SQL batching capabilities.
+dictionary-configuration: DBDictionary configuration: \n{0}

Modified: incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/ant/MetaDataToolTask.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/ant/MetaDataToolTask.java?rev=429535&r1=429534&r2=429535&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/ant/MetaDataToolTask.java (original)
+++ incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/ant/MetaDataToolTask.java Mon Aug  7 18:42:34 2006
@@ -73,7 +73,8 @@
             flags.file = Files.getFile(fileName, loader);
         if (!MetaDataTool.run((OpenJPAConfiguration) getConfiguration(), files,
             flags, null, loader))
-            throw new BuildException(_loc.get("bad-conf", "MetaDataToolTask"));
+            throw new BuildException(_loc.get("bad-conf", "MetaDataToolTask")
+                .getMessage());
     }
 
     public static class Action

Modified: incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/conf/ProductDerivations.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/conf/ProductDerivations.java?rev=429535&r1=429534&r2=429535&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/conf/ProductDerivations.java (original)
+++ incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/conf/ProductDerivations.java Mon Aug  7 18:42:34 2006
@@ -51,7 +51,7 @@
         if (derivations.isEmpty()) {
             Localizer loc = Localizer.forPackage(ProductDerivations.class);
             throw new MissingResourceException(loc.get("no-product-derivations",
-                ProductDerivation.class.getName()),
+                ProductDerivation.class.getName()).getMessage(),
                 ProductDerivations.class.getName(), "derivations");
         }
 

Modified: incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/datacache/Caches.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/datacache/Caches.java?rev=429535&r1=429534&r2=429535&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/datacache/Caches.java (original)
+++ incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/datacache/Caches.java Mon Aug  7 18:42:34 2006
@@ -47,7 +47,7 @@
                     classes = new HashSet();
                 classes.add(cls);
             } catch (Throwable t) {
-                conf.getLog(OpenJPAConfiguration.LOG_RUNTIME).warn(t, t);
+                conf.getLog(OpenJPAConfiguration.LOG_RUNTIME).warn(null, t);
             }
         }
         return classes;

Modified: incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/datacache/DataCacheScheduler.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/datacache/DataCacheScheduler.java?rev=429535&r1=429534&r2=429535&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/datacache/DataCacheScheduler.java (original)
+++ incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/datacache/DataCacheScheduler.java Mon Aug  7 18:42:34 2006
@@ -96,7 +96,7 @@
         _caches.put(cache, schedule);
         _stop = false;
         if (_thread == null) {
-            _thread = new Thread(this, _loc.get("scheduler-name"));
+            _thread = new Thread(this, _loc.get("scheduler-name").getMessage());
             _thread.start();
             if (_log.isTraceEnabled())
                 _log.trace(_loc.get("scheduler-start", _thread.getName()));
@@ -191,7 +191,7 @@
         }
 
         private int[] parse(String token, int min, int max) {
-            if (token.trim().equals("*"))
+            if ("*".equals(token.trim()))
                 return WILDCARD;
             String[] tokens = Strings.split(token, ",", 0);
             int [] times = new int[tokens.length];

Modified: incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCDataGenerator.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCDataGenerator.java?rev=429535&r1=429534&r2=429535&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCDataGenerator.java (original)
+++ incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCDataGenerator.java Mon Aug  7 18:42:34 2006
@@ -89,8 +89,8 @@
         if (storage == null) {
             storage = generateStorage(meta);
             _generated.put(type, storage);
-            if (_log.isDebugEnabled())
-                _log.debug(_loc.get("pcdata-created", type.getName(), meta));
+            if (_log.isTraceEnabled())
+                _log.trace(_loc.get("pcdata-created", type.getName(), meta));
         }
         DynamicPCData data = (DynamicPCData) storage.newInstance();
         data.setId(oid);
@@ -103,8 +103,8 @@
      * Actually generate the factory instance.
      */
     private DynamicStorage generateStorage(ClassMetaData meta) {
-        if (_log.isDebugEnabled())
-            _log.debug(_loc.get("pcdata-generate", meta));
+        if (_log.isTraceEnabled())
+            _log.trace(_loc.get("pcdata-generate", meta));
 
         FieldMetaData[] fields = meta.getFields();
         int[] types = new int[fields.length];

Modified: incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCEnhancer.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCEnhancer.java?rev=429535&r1=429534&r2=429535&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCEnhancer.java (original)
+++ incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCEnhancer.java Mon Aug  7 18:42:34 2006
@@ -51,6 +51,7 @@
 import org.apache.openjpa.lib.util.Options;
 import org.apache.openjpa.lib.util.Services;
 import org.apache.openjpa.lib.util.TemporaryClassLoader;
+import org.apache.openjpa.lib.util.Localizer.Message;
 import org.apache.openjpa.meta.ClassMetaData;
 import org.apache.openjpa.meta.FieldMetaData;
 import org.apache.openjpa.meta.JavaTypes;
@@ -513,7 +514,7 @@
             if (itr.hasNext())
                 buf.append(sep);
         }
-        String msg = _loc.get("property-violations", buf);
+        Message msg = _loc.get("property-violations", buf);
 
         if (_fail)
             throw new UserException(msg);
@@ -730,7 +731,7 @@
             if (fmds[i].getManagement() != FieldMetaData.MANAGE_PERSISTENT)
                 continue;
 
-            loadManagedInstance(code, false, false);
+            loadManagedInstance(code, false);
             switch (fmds[i].getDeclaredTypeCode()) {
                 case JavaTypes.BOOLEAN:
                 case JavaTypes.BYTE:
@@ -884,11 +885,11 @@
             // <field> = pcStateManager.provided<type>Field
             //     (this, fieldNumber);
             for (int i = 0; i < fmds.length; i++) {
-                tabins.addTarget(loadManagedInstance(code, false, false));
+                tabins.addTarget(loadManagedInstance(code, false));
                 code.getfield().setField(SM, SMTYPE);
-                loadManagedInstance(code, false, false);
+                loadManagedInstance(code, false);
                 code.iload().setParam(0);
-                loadManagedInstance(code, true, false);
+                loadManagedInstance(code, false);
                 addGetManagedValueCode(code, fmds[i]);
                 code.invokeinterface().setMethod(getStateManagerMethod
                     (fmds[i].getDeclaredType(), "provided", false, false));
@@ -935,11 +936,11 @@
             //  (this, fieldNumber);
             for (int i = 0; i < fmds.length; i++) {
                 // for the addSetManagedValueCode call below.
-                tabins.addTarget(loadManagedInstance(code, true, false));
+                tabins.addTarget(loadManagedInstance(code, false));
 
-                loadManagedInstance(code, false, false);
+                loadManagedInstance(code, false);
                 code.getfield().setField(SM, SMTYPE);
-                loadManagedInstance(code, false, false);
+                loadManagedInstance(code, false);
                 code.iload().setParam(0);
                 code.invokeinterface().setMethod(getStateManagerMethod
                     (fmds[i].getDeclaredType(), "replace", true, false));
@@ -990,7 +991,7 @@
             for (int i = 0; i < fmds.length; i++) {
                 // <field> = other.<field>;
                 // or set<field> (other.get<field>);
-                tabins.addTarget(loadManagedInstance(code, true, false));
+                tabins.addTarget(loadManagedInstance(code, false));
                 code.aload().setParam(0);
                 addGetManagedValueCode(code, fmds[i]);
                 addSetManagedValueCode(code, fmds[i]);
@@ -1035,7 +1036,7 @@
         // no super: if (rel < 0) throw new IllegalArgumentException ();
         JumpInstruction ifins = code.ifge();
         if (_meta.getPCSuperclass() != null) {
-            loadManagedInstance(code, false, false);
+            loadManagedInstance(code, false);
             String[] args;
             if (copy) {
                 args = new String[]{ _meta.getPCSuperclass().getName(),
@@ -1087,7 +1088,7 @@
             //	throw new IllegalArgumentException
             code.aload().setLocal(inst);
             code.getfield().setField(SM, SMTYPE);
-            loadManagedInstance(code, false, false);
+            loadManagedInstance(code, false);
             code.getfield().setField(SM, SMTYPE);
             JumpInstruction ifins = code.ifacmpeq();
             throwException(code, IllegalArgumentException.class);
@@ -1095,7 +1096,7 @@
 
             // if (pcStateManager == null)
             //  throw new IllegalStateException
-            loadManagedInstance(code, false, false);
+            loadManagedInstance(code, false);
             code.getfield().setField(SM, SMTYPE);
             ifins = code.ifnonnull();
             throwException(code, IllegalStateException.class);
@@ -1109,7 +1110,7 @@
         JumpInstruction testins = code.go2();
 
         // <method> (fields[i]);
-        Instruction bodyins = loadManagedInstance(code, false, false);
+        Instruction bodyins = loadManagedInstance(code, false);
         if (copy)
             code.aload().setLocal(inst);
         code.aload().setParam(fieldNumbers);
@@ -1178,7 +1179,7 @@
         BCMethod meth = _pc.declareMethod(PRE + "GetStateManager",
             StateManager.class, null);
         Code code = meth.getCode(true);
-        loadManagedInstance(code, false, false);
+        loadManagedInstance(code, false);
         code.getfield().setField(SM, StateManager.class);
         code.areturn();
         code.calculateMaxStack();
@@ -1202,7 +1203,7 @@
         Code code = method.getCode(true);
 
         // if (pcStateManager == null) return <default>;
-        loadManagedInstance(code, false, false);
+        loadManagedInstance(code, false);
         code.getfield().setField(SM, SMTYPE);
         JumpInstruction ifins = code.ifnonnull();
         if (returnType.equals(boolean.class))
@@ -1212,7 +1213,7 @@
         code.xreturn().setType(returnType);
 
         // return pcStateManager.<method> (<args>);
-        ifins.setTarget(loadManagedInstance(code, false, false));
+        ifins.setTarget(loadManagedInstance(code, false));
         code.getfield().setField(SM, SMTYPE);
         for (int i = 0; i < params.length; i++)
             code.xload().setParam(i);
@@ -1233,7 +1234,7 @@
         Code code = method.getCode(true);
 
         // if (pcStateManager == null)
-        loadManagedInstance(code, false, false);
+        loadManagedInstance(code, false);
         code.getfield().setField(SM, SMTYPE);
         JumpInstruction ifins = code.ifnonnull();
         FieldMetaData versionField = _meta.getVersionField();
@@ -1247,7 +1248,7 @@
                 code.anew().setType(wrapper);
                 code.dup();
             }
-            loadManagedInstance(code, true, false);
+            loadManagedInstance(code, false);
             addGetManagedValueCode(code, versionField);
             if (wrapper != null)
                 code.invokespecial().setMethod(wrapper, "<init>", void.class,
@@ -1256,7 +1257,7 @@
         code.areturn();
 
         // return pcStateManager.getVersion ();
-        ifins.setTarget(loadManagedInstance(code, false, false));
+        ifins.setTarget(loadManagedInstance(code, false));
         code.getfield().setField(SM, SMTYPE);
         code.invokeinterface().setMethod(SMTYPE, "getVersion", Object.class,
             null);
@@ -1297,14 +1298,14 @@
         Code code = method.getCode(true);
 
         // if (pcStateManager != null)
-        loadManagedInstance(code, false, false);
+        loadManagedInstance(code, false);
         code.getfield().setField(SM, SMTYPE);
         JumpInstruction ifins = code.ifnonnull();
         code.vreturn();
 
         // pcFlags = pcStateManager.replaceFlags ();
-        ifins.setTarget(loadManagedInstance(code, false, false));
-        loadManagedInstance(code, false, false);
+        ifins.setTarget(loadManagedInstance(code, false));
+        loadManagedInstance(code, false);
         code.getfield().setField(SM, SMTYPE);
         code.invokeinterface().setMethod(SMTYPE, "replaceFlags",
             byte.class, null);
@@ -1329,11 +1330,11 @@
 
         // if (pcStateManager != null)
         //	pcStateManager = pcStateManager.replaceStateManager(sm);
-        loadManagedInstance(code, false, false);
+        loadManagedInstance(code, false);
         code.getfield().setField(SM, SMTYPE);
         JumpInstruction ifins = code.ifnull();
-        loadManagedInstance(code, false, false);
-        loadManagedInstance(code, false, false);
+        loadManagedInstance(code, false);
+        loadManagedInstance(code, false);
         code.getfield().setField(SM, SMTYPE);
         code.aload().setParam(0);
         code.invokeinterface().setMethod(SMTYPE, "replaceStateManager",
@@ -1348,7 +1349,7 @@
             "getSecurityManager", SecurityManager.class, null));
 
         // pcStateManager = sm;
-        ifins.setTarget(loadManagedInstance(code, false, false));
+        ifins.setTarget(loadManagedInstance(code, false));
         code.aload().setParam(0);
         code.putfield().setField(SM, SMTYPE);
         code.vreturn();
@@ -1438,7 +1439,7 @@
 
         // call superclass method
         if (_meta.getPCSuperclass() != null) {
-            loadManagedInstance(code, false, false);
+            loadManagedInstance(code, false);
             for (int i = 0; i < args.length; i++)
                 code.aload().setParam(i);
             code.invokespecial().setMethod(_meta.getPCSuperclass().getName(),
@@ -1496,7 +1497,7 @@
                     && !type.getName().equals(String.class.getName()))
                     code.checkcast().setType(type);
             } else {
-                loadManagedInstance(code, true, false);
+                loadManagedInstance(code, false);
                 addGetManagedValueCode(code, fmds[i]);
             }
 
@@ -1531,7 +1532,7 @@
 
         // call superclass method
         if (_meta.getPCSuperclass() != null) {
-            loadManagedInstance(code, false, false);
+            loadManagedInstance(code, false);
             for (int i = 0; i < args.length; i++)
                 code.aload().setParam(i);
             code.invokespecial().setMethod(_meta.getPCSuperclass().getName(),
@@ -1585,7 +1586,7 @@
                 code.iload().setLocal(inherited);
                 code.iadd();
             } else
-                loadManagedInstance(code, true, false);
+                loadManagedInstance(code, false);
 
             if (unwrapped != type) {
                 code.anew().setType(type);
@@ -1710,7 +1711,7 @@
         if (obj && usesClsString == null) {
             // throw new IllegalArgumentException (...);
             String msg = _loc.get("str-cons", oidType,
-                _meta.getDescribedType());
+                _meta.getDescribedType()).getMessage();
             code.anew().setType(IllegalArgumentException.class);
             code.dup();
             code.constant().setValue(msg);
@@ -1745,7 +1746,7 @@
                 args = new Class[]{ String.class };
         } else if (_meta.isOpenJPAIdentity()) {
             // new <type>Identity (XXX.class, <pk>);
-            loadManagedInstance(code, true, false);
+            loadManagedInstance(code, false);
             FieldMetaData pk = _meta.getPrimaryKeyFields()[0];
             addGetManagedValueCode(code, pk);
             if (_meta.getObjectIdType() == ObjectId.class)
@@ -2112,7 +2113,7 @@
         code.beforeFirst();
 
         // bool clear = pcSerializing ();
-        loadManagedInstance(code, false, false);
+        loadManagedInstance(code, false);
         code.invokevirtual().setMethod(PRE + "Serializing",
             boolean.class, null);
         int clear = code.getNextLocalsIndex();
@@ -2135,7 +2136,7 @@
             // if (clear) pcSetDetachedState (null);
             code.iload().setLocal(clear);
             toret = code.ifeq();
-            loadManagedInstance(code, false, false);
+            loadManagedInstance(code, false);
             code.constant().setNull();
             code.invokevirtual().setMethod(PRE + "SetDetachedState",
                 void.class, new Class[]{ Object.class });
@@ -2157,7 +2158,7 @@
         // if this instance uses synthetic detached state, note that it has
         // been deserialized
         if (ClassMetaData.SYNTHETIC.equals(_meta.getDetachedState())) {
-            loadManagedInstance(code, false, false);
+            loadManagedInstance(code, false);
             code.getstatic().setField(PersistenceCapable.class,
                 "DESERIALIZED", Object.class);
             code.invokevirtual().setMethod(PRE + "SetDetachedState",
@@ -2207,10 +2208,10 @@
 
         // if (sm != null)
         //		return (sm.isDetached ()) ? Boolean.TRUE : Boolean.FALSE;
-        loadManagedInstance(code, false, false);
+        loadManagedInstance(code, false);
         code.getfield().setField(SM, SMTYPE);
         JumpInstruction ifins = code.ifnull();
-        loadManagedInstance(code, false, false);
+        loadManagedInstance(code, false);
         code.getfield().setField(SM, SMTYPE);
         code.invokeinterface().setMethod(SMTYPE, "isDetached",
             boolean.class, null);
@@ -2229,11 +2230,11 @@
         JumpInstruction notdeser = null;
         Instruction target;
         if (state != Boolean.FALSE) {
-            ifins.setTarget(loadManagedInstance(code, false, false));
+            ifins.setTarget(loadManagedInstance(code, false));
             code.invokevirtual().setMethod(PRE + "GetDetachedState",
                 Object.class, null);
             ifins = code.ifnull();
-            loadManagedInstance(code, false, false);
+            loadManagedInstance(code, false);
             code.invokevirtual().setMethod(PRE + "GetDetachedState",
                 Object.class, null);
             code.getstatic().setField(PersistenceCapable.class,
@@ -2269,7 +2270,7 @@
         if (state != Boolean.TRUE && version != null) {
             // if (<version> != <default>)
             //		return true;
-            loadManagedInstance(code, false, false);
+            loadManagedInstance(code, false);
             addGetManagedValueCode(code, version);
             ifins = ifDefaultValue(code, version);
             code.getstatic().setField(Boolean.class, "TRUE", Boolean.class);
@@ -2300,7 +2301,7 @@
         if (state == null) {
             // if (pcGetDetachedState () == null) // instead of DESERIALIZED
             //     return Boolean.FALSE;
-            loadManagedInstance(code, false, false);
+            loadManagedInstance(code, false);
             code.invokevirtual().setMethod(PRE + "GetDetachedState",
                 Object.class, null);
             ifins = code.ifnonnull();
@@ -2322,7 +2323,7 @@
                 if (pks[i].getValueStrategy() == ValueStrategies.NONE)
                     continue;
 
-                target = loadManagedInstance(code, false, false);
+                target = loadManagedInstance(code, false);
                 if (ifins != null)
                     ifins.setTarget(target);
                 if (ifins2 != null)
@@ -2333,7 +2334,7 @@
                 ifins = ifDefaultValue(code, pks[i]);
                 if (pks[i].getDeclaredTypeCode() == JavaTypes.STRING) {
                     code.constant().setValue("");
-                    loadManagedInstance(code, false, false);
+                    loadManagedInstance(code, false);
                     addGetManagedValueCode(code, pks[i]);
                     code.invokevirtual().setMethod(String.class, "equals",
                         boolean.class, new Class[]{ Object.class });
@@ -2451,7 +2452,7 @@
             code = clone.getCode(true);
 
             // return super.clone ();
-            loadManagedInstance(code, true, false);
+            loadManagedInstance(code, false);
             code.invokespecial().setMethod(_pc.getSuperclassName(),
                 "clone", Object.class.getName(), null);
             code.areturn();
@@ -2681,7 +2682,7 @@
         byte fieldFlag = getFieldFlag(fmd);
         if ((fieldFlag & PersistenceCapable.CHECK_READ) == 0
             && (fieldFlag & PersistenceCapable.MEDIATE_READ) == 0) {
-            loadManagedInstance(code, true, true);
+            loadManagedInstance(code, true);
             addGetManagedValueCode(code, fmd);
             code.xreturn().setType(fmd.getDeclaredType());
 
@@ -2693,21 +2694,21 @@
         // dfg: if (inst.pcFlags <= 0) return inst.<field>;
         JumpInstruction ifins = null;
         if ((fieldFlag & PersistenceCapable.CHECK_READ) > 0) {
-            loadManagedInstance(code, false, true);
+            loadManagedInstance(code, true);
             code.getfield().setField(PRE + "Flags", byte.class);
             ifins = code.ifgt();
-            loadManagedInstance(code, true, true);
+            loadManagedInstance(code, true);
             addGetManagedValueCode(code, fmd);
             code.xreturn().setType(fmd.getDeclaredType());
         }
 
         // if (inst.pcStateManager == null) return inst.<field>;
-        Instruction ins = loadManagedInstance(code, false, true);
+        Instruction ins = loadManagedInstance(code, true);
         if (ifins != null)
             ifins.setTarget(ins);
         code.getfield().setField(SM, SMTYPE);
         ifins = code.ifnonnull();
-        loadManagedInstance(code, true, true);
+        loadManagedInstance(code, true);
         addGetManagedValueCode(code, fmd);
         code.xreturn().setType(fmd.getDeclaredType());
 
@@ -2720,12 +2721,12 @@
 
         // inst.pcStateManager.accessingField (field);
         // return inst.<field>;
-        loadManagedInstance(code, false, true);
+        loadManagedInstance(code, true);
         code.getfield().setField(SM, SMTYPE);
         code.iload().setLocal(fieldLocal);
         code.invokeinterface().setMethod(SMTYPE, "accessingField", void.class,
             new Class[]{ int.class });
-        loadManagedInstance(code, true, true);
+        loadManagedInstance(code, true);
         addGetManagedValueCode(code, fmd);
         code.xreturn().setType(fmd.getDeclaredType());
 
@@ -2753,35 +2754,35 @@
         JumpInstruction ifins = null;
         byte fieldFlag = getFieldFlag(fmd);
         if ((fieldFlag & PersistenceCapable.CHECK_WRITE) > 0) {
-            loadManagedInstance(code, false, true);
+            loadManagedInstance(code, true);
             code.getfield().setField(PRE + "Flags", byte.class);
             ifins = code.ifne();
-            loadManagedInstance(code, true, true);
+            loadManagedInstance(code, true);
             code.xload().setParam(firstParamOffset);
             addSetManagedValueCode(code, fmd);
             code.vreturn();
         }
 
         // if (inst.pcStateManager == null) inst.<field> = value;
-        Instruction ins = loadManagedInstance(code, false, true);
+        Instruction ins = loadManagedInstance(code, true);
         if (ifins != null)
             ifins.setTarget(ins);
         code.getfield().setField(SM, SMTYPE);
         ifins = code.ifnonnull();
-        loadManagedInstance(code, true, true);
+        loadManagedInstance(code, true);
         code.xload().setParam(firstParamOffset);
         addSetManagedValueCode(code, fmd);
         code.vreturn();
 
         // inst.pcStateManager.setting<fieldType>Field (inst,
         //	pcInheritedFieldCount + <index>, inst.<field>, value, 0);
-        ifins.setTarget(loadManagedInstance(code, false, true));
+        ifins.setTarget(loadManagedInstance(code, true));
         code.getfield().setField(SM, SMTYPE);
-        loadManagedInstance(code, false, true);
+        loadManagedInstance(code, true);
         code.getstatic().setField(INHERIT, int.class);
         code.constant().setValue(index);
         code.iadd();
-        loadManagedInstance(code, true, true);
+        loadManagedInstance(code, true);
         addGetManagedValueCode(code, fmd);
         code.xload().setParam(firstParamOffset);
         code.constant().setValue(0);
@@ -2860,7 +2861,7 @@
         Code code = method.getCode(true);
         if (impl) {
             // return pcDetachedState;
-            loadManagedInstance(code, true, false);
+            loadManagedInstance(code, false);
             code.getfield().setField(declarer, name, Object.class.getName());
         } else
             code.constant().setNull();
@@ -2875,7 +2876,7 @@
         code = method.getCode(true);
         if (impl) {
             // pcDetachedState = state;
-            loadManagedInstance(code, false, false);
+            loadManagedInstance(code, false);
             code.aload().setParam(0);
             code.putfield().setField(declarer, name,
                 Object.class.getName());
@@ -2941,21 +2942,21 @@
         // super.readExternal (in);
         Class sup = _meta.getDescribedType().getSuperclass();
         if (!parentDetachable && Externalizable.class.isAssignableFrom(sup)) {
-            loadManagedInstance(code, false, false);
+            loadManagedInstance(code, false);
             code.aload().setParam(0);
             code.invokespecial().setMethod(sup, "readExternal",
                 void.class, inargs);
         }
 
         // readUnmanaged (in);
-        loadManagedInstance(code, false, false);
+        loadManagedInstance(code, false);
         code.aload().setParam(0);
         code.invokevirtual().setMethod(_meta.getDescribedType(),
             PRE + "ReadUnmanaged", void.class, inargs);
 
         if (detachedState) {
             // pcSetDetachedState (in.readObject ());
-            loadManagedInstance(code, false, false);
+            loadManagedInstance(code, false);
             code.aload().setParam(0);
             code.invokeinterface().setMethod(ObjectInput.class, "readObject",
                 Object.class, null);
@@ -2963,7 +2964,7 @@
                 void.class, new Class[]{ Object.class });
 
             // pcReplaceStateManager ((StateManager) in.readObject ());
-            loadManagedInstance(code, false, false);
+            loadManagedInstance(code, false);
             code.aload().setParam(0);
             code.invokeinterface().setMethod(ObjectInput.class, "readObject",
                 Object.class, null);
@@ -3000,7 +3001,7 @@
 
         // super.readUnmanaged (in);
         if (parentDetachable) {
-            loadManagedInstance(code, false, false);
+            loadManagedInstance(code, false);
             code.aload().setParam(0);
             code.invokespecial().setMethod(_meta.getPCSuperclass(),
                 PRE + "ReadUnmanaged", void.class, inargs);
@@ -3033,7 +3034,7 @@
             methName = "readObject";
 
         // <field> = in.read<type> ();
-        loadManagedInstance(code, true, false);
+        loadManagedInstance(code, false);
         code.aload().setParam(0);
         Class ret = (type.isPrimitive()) ? type : Object.class;
         code.invokeinterface().setMethod(ObjectInput.class, methName,
@@ -3053,10 +3054,10 @@
                 case JavaTypes.CALENDAR:
                     // if (sm != null)
                     //   sm.proxyDetachedDeserialized (<index>);
-                    loadManagedInstance(code, false, false);
+                    loadManagedInstance(code, false);
                     code.getfield().setField(SM, SMTYPE);
                     IfInstruction ifins = code.ifnull();
-                    loadManagedInstance(code, false, false);
+                    loadManagedInstance(code, false);
                     code.getfield().setField(SM, SMTYPE);
                     code.constant().setValue(fmd.getIndex());
                     code.invokeinterface().setMethod(SMTYPE,
@@ -3082,14 +3083,14 @@
         // super.writeExternal (out);
         Class sup = _meta.getDescribedType().getSuperclass();
         if (!parentDetachable && Externalizable.class.isAssignableFrom(sup)) {
-            loadManagedInstance(code, false, false);
+            loadManagedInstance(code, false);
             code.aload().setParam(0);
             code.invokespecial().setMethod(sup, "writeExternal",
                 void.class, outargs);
         }
 
         // writeUnmanaged (out);
-        loadManagedInstance(code, false, false);
+        loadManagedInstance(code, false);
         code.aload().setParam(0);
         code.invokevirtual().setMethod(_meta.getDescribedType(),
             PRE + "WriteUnmanaged", void.class, outargs);
@@ -3099,10 +3100,10 @@
             // if (sm != null)
             //   if (sm.writeDetached (out))
             //      return;
-            loadManagedInstance(code, false, false);
+            loadManagedInstance(code, false);
             code.getfield().setField(SM, SMTYPE);
             IfInstruction ifnull = code.ifnull();
-            loadManagedInstance(code, false, false);
+            loadManagedInstance(code, false);
             code.getfield().setField(SM, SMTYPE);
             code.aload().setParam(0);
             code.invokeinterface().setMethod(SMTYPE, "writeDetached",
@@ -3114,7 +3115,7 @@
             //   out.writeObject (pcGetDetachedState ());
             Class[] objargs = new Class[]{ Object.class };
             ifnull.setTarget(code.aload().setParam(0));
-            loadManagedInstance(code, false, false);
+            loadManagedInstance(code, false);
             code.invokevirtual().setMethod(PRE + "GetDetachedState",
                 Object.class, null);
             code.invokeinterface().setMethod(ObjectOutput.class,
@@ -3133,7 +3134,7 @@
         for (int i = 0; i < fmds.length; i++)
             if (!fmds[i].isTransient())
                 writeExternal(code, fmds[i].getName(),
-                    fmds[i].getDeclaredType(), i, fmds[i]);
+                    fmds[i].getDeclaredType(), fmds[i]);
 
         // return
         code.vreturn();
@@ -3156,7 +3157,7 @@
 
         // super.writeUnmanaged (out);
         if (parentDetachable) {
-            loadManagedInstance(code, false, false);
+            loadManagedInstance(code, false);
             code.aload().setParam(0);
             code.invokespecial().setMethod(_meta.getPCSuperclass(),
                 PRE + "WriteUnmanaged", void.class, outargs);
@@ -3166,7 +3167,7 @@
         BCField field;
         for (Iterator itr = unmgd.iterator(); itr.hasNext();) {
             field = (BCField) itr.next();
-            writeExternal(code, field.getName(), field.getType(), -1, null);
+            writeExternal(code, field.getName(), field.getType(), null);
         }
         code.vreturn();
         code.calculateMaxStack();
@@ -3177,7 +3178,7 @@
      * Helper method to write a field to an externalization output stream.
      */
     private void writeExternal(Code code, String fieldName, Class type,
-        int idx, FieldMetaData fmd)
+        FieldMetaData fmd)
         throws NoSuchMethodException {
         String methName;
         if (type.isPrimitive()) {
@@ -3190,7 +3191,7 @@
 
         // out.write<type> (<field>);
         code.aload().setParam(0);
-        loadManagedInstance(code, true, false);
+        loadManagedInstance(code, false);
         if (fmd == null)
             code.getfield().setField(fieldName, type);
         else
@@ -3256,7 +3257,7 @@
      *
      * @return the first instruction added to <code>code</code>.
      */
-    private Instruction loadManagedInstance(Code code, boolean userObject,
+    private Instruction loadManagedInstance(Code code,
         boolean forAccessor) {
         if (_meta.getAccessType() == ClassMetaData.ACCESS_FIELD && forAccessor)
             return code.aload().setParam(0);

Modified: incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/event/LogOrphanedKeyAction.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/event/LogOrphanedKeyAction.java?rev=429535&r1=429534&r2=429535&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/event/LogOrphanedKeyAction.java (original)
+++ incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/event/LogOrphanedKeyAction.java Mon Aug  7 18:42:34 2006
@@ -82,10 +82,6 @@
                 if (log.isTraceEnabled())
                     log.trace(_loc.get(msg, oid, vmd, owner));
                 break;
-            case Log.DEBUG:
-                if (log.isDebugEnabled())
-                    log.debug(_loc.get(msg, oid, vmd, owner));
-                break;
             case Log.INFO:
                 if (log.isInfoEnabled())
                     log.info(_loc.get(msg, oid, vmd, owner));

Modified: incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/AbstractBrokerFactory.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/AbstractBrokerFactory.java?rev=429535&r1=429534&r2=429535&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/AbstractBrokerFactory.java (original)
+++ incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/AbstractBrokerFactory.java Mon Aug  7 18:42:34 2006
@@ -235,7 +235,8 @@
                 try {
                     Class.forName((String) itr.next(), true, loader);
                 } catch (Throwable t) {
-                    _conf.getLog(OpenJPAConfiguration.LOG_RUNTIME).warn(t, t);
+                    _conf.getLog(OpenJPAConfiguration.LOG_RUNTIME)
+                        .warn(null, t);
                 }
             }
         }
@@ -515,7 +516,7 @@
                     if (itr.hasNext())
                         buf.append(lineSep);
                 }
-                log.trace(buf.toString());
+                log.trace(_loc.get("factory-properties", buf.toString()));
             }
 
             // setup transient state

Modified: incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/BrokerImpl.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/BrokerImpl.java?rev=429535&r1=429534&r2=429535&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/BrokerImpl.java (original)
+++ incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/BrokerImpl.java Mon Aug  7 18:42:34 2006
@@ -3989,7 +3989,7 @@
         //### JDO2
         if (cls.isInterface() || Modifier.isAbstract(cls.getModifiers()))
             throw new UnsupportedOperationException(_loc.get
-                ("new-abstract", cls));
+                ("new-abstract", cls).getMessage());
 
         // 1.5 doesn't initialize classes without a true Class.forName
         if (!PCRegistry.isRegistered(cls)) {

Modified: incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/DetachedStateAttachStrategy.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/DetachedStateAttachStrategy.java?rev=429535&r1=429534&r2=429535&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/DetachedStateAttachStrategy.java (original)
+++ incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/DetachedStateAttachStrategy.java Mon Aug  7 18:42:34 2006
@@ -18,7 +18,6 @@
 import java.util.BitSet;
 
 import org.apache.openjpa.enhance.PersistenceCapable;
-import org.apache.openjpa.event.LifecycleEvent;
 import org.apache.openjpa.lib.util.Localizer;
 import org.apache.openjpa.meta.ClassMetaData;
 import org.apache.openjpa.meta.FieldMetaData;

Modified: incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/DetachedStateManager.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/DetachedStateManager.java?rev=429535&r1=429534&r2=429535&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/DetachedStateManager.java (original)
+++ incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/DetachedStateManager.java Mon Aug  7 18:42:34 2006
@@ -378,7 +378,7 @@
     public void accessingField(int idx) {
         if (!_access && !_loaded.get(idx))
             throw new IllegalStateException(_loc.get("unloaded-detached",
-                _pc));
+                _pc).getMessage());
     }
 
     public boolean serializing() {

Modified: incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/Filters.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/Filters.java?rev=429535&r1=429534&r2=429535&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/Filters.java (original)
+++ incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/Filters.java Mon Aug  7 18:42:34 2006
@@ -276,7 +276,7 @@
         }
         if (!num)
             throw new ClassCastException(_loc.get("cant-convert", o,
-                o.getClass(), type));
+                o.getClass(), type).getMessage());
 
         if (type == Integer.class) {
             return Numbers.valueOf(((Number) o).intValue());

Modified: incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/exps/AbstractExpressionBuilder.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/exps/AbstractExpressionBuilder.java?rev=429535&r1=429534&r2=429535&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/exps/AbstractExpressionBuilder.java (original)
+++ incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/exps/AbstractExpressionBuilder.java Mon Aug  7 18:42:34 2006
@@ -24,6 +24,7 @@
 
 import org.apache.openjpa.kernel.Filters;
 import org.apache.openjpa.lib.util.Localizer;
+import org.apache.openjpa.lib.util.Localizer.Message;
 import org.apache.openjpa.meta.ClassMetaData;
 import org.apache.openjpa.meta.FieldMetaData;
 import org.apache.openjpa.util.InternalException;
@@ -97,11 +98,11 @@
         Exception nest) {
         String argStr;
         if (args == null)
-            argStr = getLocalizer().get(token);
+            argStr = getLocalizer().get(token).getMessage();
         else
-            argStr = getLocalizer().get(token, args);
+            argStr = getLocalizer().get(token, args).getMessage();
 
-        String msg = _loc.get("parse-error", argStr, currentQuery());
+        Message msg = _loc.get("parse-error", argStr, currentQuery());
 
         switch (e) {
             case EX_FATAL:
@@ -361,14 +362,14 @@
         String right;
         if (val1 instanceof Path && ((Path) val1).last() != null)
             left = _loc.get("non-numeric-path", ((Path) val1).last().
-                getName(), t1.getName());
+                getName(), t1.getName()).getMessage();
         else
-            left = _loc.get("non-numeric-value", t1.getName());
+            left = _loc.get("non-numeric-value", t1.getName()).getMessage();
         if (val2 instanceof Path && ((Path) val2).last() != null)
             right = _loc.get("non-numeric-path", ((Path) val2).last().
-                getName(), t2.getName());
+                getName(), t2.getName()).getMessage();
         else
-            right = _loc.get("non-numeric-value", t2.getName());
+            right = _loc.get("non-numeric-value", t2.getName()).getMessage();
         throw new UserException(_loc.get("non-numeric-comparison",
             left, right));
     }

Modified: incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/jpql/ParseException.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/jpql/ParseException.java?rev=429535&r1=429534&r2=429535&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/jpql/ParseException.java (original)
+++ incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/jpql/ParseException.java Mon Aug  7 18:42:34 2006
@@ -18,6 +18,7 @@
 import java.util.TreeSet;
 
 import org.apache.openjpa.lib.util.Localizer;
+import org.apache.openjpa.lib.util.Localizer.Message;
 import org.apache.openjpa.util.UserException;
 
 /**
@@ -28,7 +29,8 @@
 public class ParseException
     extends UserException {
 
-    private static Localizer _loc = Localizer.forPackage(ParseException.class);
+    private static final Localizer _loc =
+        Localizer.forPackage(ParseException.class);
 
     /**
      * This constructor is used by the method "generateParseException"
@@ -59,10 +61,6 @@
         super();
     }
 
-    public ParseException(String message) {
-        super(message);
-    }
-
     /**
      * This method has the standard behavior when this object has been
      * created using the standard constructors. Otherwise, it uses
@@ -73,7 +71,7 @@
      * of the final stack trace, and hence the correct error message
      * gets displayed.
      */
-    private static String initMessage(Token currentToken,
+    private static Message initMessage(Token currentToken,
         int[][]expectedTokenSequences, String[]tokenImage) {
         TreeSet expected = new TreeSet();
 

Modified: incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/Extensions.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/Extensions.java?rev=429535&r1=429534&r2=429535&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/Extensions.java (original)
+++ incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/Extensions.java Mon Aug  7 18:42:34 2006
@@ -320,7 +320,7 @@
         // way a new vendor could theoretically add in their
         // own prefix into the localizer.properties file and
         // not have to issue warnings for their extensions
-        String prefixes = _loc.get("extension-datastore-prefix");
+        String prefixes = _loc.get("extension-datastore-prefix").getMessage();
         String[] allowedPrefixes = null;
         if (prefixes != null)
             allowedPrefixes = Strings.split(prefixes, ",", 0);

Modified: incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/UpdateStrategies.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/UpdateStrategies.java?rev=429535&r1=429534&r2=429535&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/UpdateStrategies.java (original)
+++ incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/UpdateStrategies.java Mon Aug  7 18:42:34 2006
@@ -80,9 +80,10 @@
         String msg;
         if (closest != null)
             msg = _loc.get("bad-update-strategy-hint", new Object[]{
-                context, val, closest, opts });
+                context, val, closest, opts }).getMessage();
         else
-            msg = _loc.get("bad-update-strategy", context, val, opts);
+            msg = _loc.get("bad-update-strategy", context, val, opts)
+                .getMessage();
         throw new IllegalArgumentException(msg);
 	}
 }

Modified: incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/ValueStrategies.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/ValueStrategies.java?rev=429535&r1=429534&r2=429535&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/ValueStrategies.java (original)
+++ incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/ValueStrategies.java Mon Aug  7 18:42:34 2006
@@ -108,9 +108,10 @@
         String msg;
         if (closest != null)
             msg = _loc.get("bad-value-strategy-hint", new Object[]{
-                context, val, closest, _map.keySet() });
+                context, val, closest, _map.keySet() }).getMessage();
         else
-            msg = _loc.get("bad-value-strategy", context, val, _map.keySet());
+            msg = _loc.get("bad-value-strategy", context, val, _map.keySet())
+                .getMessage();
         throw new IllegalArgumentException(msg);
     }
 

Modified: incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/CallbackException.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/CallbackException.java?rev=429535&r1=429534&r2=429535&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/CallbackException.java (original)
+++ incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/CallbackException.java Mon Aug  7 18:42:34 2006
@@ -15,6 +15,8 @@
  */
 package org.apache.openjpa.util;
 
+import org.apache.openjpa.lib.util.Localizer.Message;
+
 /**
  * Exception type thrown when an error occurs in a callback.
  *
@@ -24,16 +26,8 @@
 public class CallbackException
     extends UserException {
 
-    public CallbackException() {
-    }
-
-    public CallbackException(String msg) {
-        super(msg);
-    }
-
-    public CallbackException(String msg, Object failed) {
+    public CallbackException(Message msg) {
         super(msg);
-        setFailedObject(failed);
     }
 
     public int getSubtype() {

Modified: incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/GeneralException.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/GeneralException.java?rev=429535&r1=429534&r2=429535&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/GeneralException.java (original)
+++ incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/GeneralException.java Mon Aug  7 18:42:34 2006
@@ -15,6 +15,8 @@
  */
 package org.apache.openjpa.util;
 
+import org.apache.openjpa.lib.util.Localizer.Message;
+
 /**
  * General exception type.
  *
@@ -30,11 +32,15 @@
         super(msg);
     }
 
+    public GeneralException(Message msg) {
+        super(msg);
+    }
+
     public GeneralException(Throwable cause) {
         super(cause);
     }
 
-    public GeneralException(String msg, Throwable cause) {
+    public GeneralException(Message msg, Throwable cause) {
         super(msg, cause);
     }
 

Modified: incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/InternalException.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/InternalException.java?rev=429535&r1=429534&r2=429535&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/InternalException.java (original)
+++ incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/InternalException.java Mon Aug  7 18:42:34 2006
@@ -15,6 +15,8 @@
  */
 package org.apache.openjpa.util;
 
+import org.apache.openjpa.lib.util.Localizer.Message;
+
 /**
  * Exception type for internal errors.
  *
@@ -33,12 +35,22 @@
         setFatal(true);
     }
 
+    public InternalException(Message msg) {
+        super(msg);
+        setFatal(true);
+    }
+
     public InternalException(Throwable cause) {
         super(cause);
         setFatal(true);
     }
 
     public InternalException(String msg, Throwable cause) {
+        super(msg, cause);
+        setFatal(true);
+    }
+
+    public InternalException(Message msg, Throwable cause) {
         super(msg, cause);
         setFatal(true);
     }

Modified: incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/InvalidStateException.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/InvalidStateException.java?rev=429535&r1=429534&r2=429535&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/InvalidStateException.java (original)
+++ incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/InvalidStateException.java Mon Aug  7 18:42:34 2006
@@ -15,6 +15,8 @@
  */
 package org.apache.openjpa.util;
 
+import org.apache.openjpa.lib.util.Localizer.Message;
+
 /**
  * Exception type thrown when attempting to execute an operation that
  * is not allowed by the current state.
@@ -25,14 +27,11 @@
 public class InvalidStateException
     extends UserException {
 
-    public InvalidStateException() {
-    }
-
-    public InvalidStateException(String msg) {
+    public InvalidStateException(Message msg) {
         super(msg);
     }
 
-    public InvalidStateException(String msg, Object failed) {
+    public InvalidStateException(Message msg, Object failed) {
         super(msg);
         setFailedObject(failed);
     }

Modified: incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/LockException.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/LockException.java?rev=429535&r1=429534&r2=429535&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/LockException.java (original)
+++ incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/LockException.java Mon Aug  7 18:42:34 2006
@@ -35,13 +35,6 @@
 
     private int timeout = -1;
 
-    public LockException() {
-    }
-
-    public LockException(String msg) {
-        super(msg);
-    }
-
     public LockException(Object failed) {
         super(_loc.get("lock-failed", Exceptions.toString(failed)));
         setFailedObject(failed);

Modified: incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/MetaDataException.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/MetaDataException.java?rev=429535&r1=429534&r2=429535&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/MetaDataException.java (original)
+++ incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/MetaDataException.java Mon Aug  7 18:42:34 2006
@@ -15,6 +15,8 @@
  */
 package org.apache.openjpa.util;
 
+import org.apache.openjpa.lib.util.Localizer.Message;
+
 /**
  * Exception type reserved for missing or invalid metadata.
  *
@@ -33,7 +35,12 @@
         setFatal(true);
     }
 
-    public MetaDataException(String msg, Object failed) {
+    public MetaDataException(Message msg) {
+        super(msg);
+        setFatal(true);
+    }
+
+    public MetaDataException(Message msg, Object failed) {
         super(msg);
         setFatal(true);
         setFailedObject(failed);

Modified: incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/NoTransactionException.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/NoTransactionException.java?rev=429535&r1=429534&r2=429535&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/NoTransactionException.java (original)
+++ incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/NoTransactionException.java Mon Aug  7 18:42:34 2006
@@ -15,6 +15,8 @@
  */
 package org.apache.openjpa.util;
 
+import org.apache.openjpa.lib.util.Localizer.Message;
+
 /**
  * Exception type thrown when attempting a transactional operation without
  * an active transaction.
@@ -25,16 +27,8 @@
 public class NoTransactionException
     extends InvalidStateException {
 
-    public NoTransactionException() {
-    }
-
-    public NoTransactionException(String msg) {
-        super(msg);
-    }
-
-    public NoTransactionException(String msg, Object failed) {
+    public NoTransactionException(Message msg) {
         super(msg);
-        setFailedObject(failed);
     }
 
     public int getSubtype() {

Modified: incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/ObjectExistsException.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/ObjectExistsException.java?rev=429535&r1=429534&r2=429535&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/ObjectExistsException.java (original)
+++ incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/ObjectExistsException.java Mon Aug  7 18:42:34 2006
@@ -15,7 +15,7 @@
  */
 package org.apache.openjpa.util;
 
-import org.apache.openjpa.lib.util.Localizer;
+import org.apache.openjpa.lib.util.Localizer.Message;
 
 /**
  * Exception type reserved for conflicts with existing objects.
@@ -25,19 +25,8 @@
 public class ObjectExistsException
     extends StoreException {
 
-    private static final transient Localizer _loc = Localizer.forPackage
-        (ObjectExistsException.class);
-
-    public ObjectExistsException() {
-    }
-
-    public ObjectExistsException(String msg) {
+    public ObjectExistsException(Message msg) {
         super(msg);
-    }
-
-    public ObjectExistsException(Object failed) {
-        super(_loc.get("obj-exists", Exceptions.toString(failed)));
-        setFailedObject(failed);
     }
 
     public int getSubtype() {

Modified: incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/ObjectNotFoundException.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/ObjectNotFoundException.java?rev=429535&r1=429534&r2=429535&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/ObjectNotFoundException.java (original)
+++ incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/ObjectNotFoundException.java Mon Aug  7 18:42:34 2006
@@ -18,6 +18,7 @@
 import java.util.Collection;
 
 import org.apache.openjpa.lib.util.Localizer;
+import org.apache.openjpa.lib.util.Localizer.Message;
 
 /**
  * Exception type reserved for failed object lookups.
@@ -30,10 +31,7 @@
     private static final transient Localizer _loc = Localizer.forPackage
         (ObjectNotFoundException.class);
 
-    public ObjectNotFoundException() {
-    }
-
-    public ObjectNotFoundException(String msg) {
+    public ObjectNotFoundException(Message msg) {
         super(msg);
     }
 

Modified: incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/OpenJPAException.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/OpenJPAException.java?rev=429535&r1=429534&r2=429535&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/OpenJPAException.java (original)
+++ incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/OpenJPAException.java Mon Aug  7 18:42:34 2006
@@ -22,6 +22,8 @@
 import java.io.PrintWriter;
 import java.io.Serializable;
 
+import org.apache.openjpa.lib.util.Localizer.Message;
+
 /**
  * Exception type for all OpenJPA exceptions. Meant to be easily
  * transformed into an appropriate exception at the API layer, since most APIs
@@ -52,6 +54,13 @@
     }
 
     /**
+     * Constructor; supply message.
+     */
+    public OpenJPAException(Message msg) {
+        super(msg.getMessage());
+    }
+
+    /**
      * Construct with cause.
      */
     public OpenJPAException(Throwable cause) {
@@ -63,6 +72,14 @@
      */
     public OpenJPAException(String msg, Throwable cause) {
         super(msg);
+        setCause(cause);
+    }
+
+    /**
+     * Construct with message and cause.
+     */
+    public OpenJPAException(Message msg, Throwable cause) {
+        super(msg.getMessage());
         setCause(cause);
     }
 

Modified: incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/OptimisticException.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/OptimisticException.java?rev=429535&r1=429534&r2=429535&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/OptimisticException.java (original)
+++ incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/OptimisticException.java Mon Aug  7 18:42:34 2006
@@ -18,6 +18,7 @@
 import java.util.Collection;
 
 import org.apache.openjpa.lib.util.Localizer;
+import org.apache.openjpa.lib.util.Localizer.Message;
 
 /**
  * Exception type for optimistic concurrency violations.
@@ -32,10 +33,7 @@
     private static final transient Localizer _loc = Localizer.forPackage
         (OptimisticException.class);
 
-    public OptimisticException() {
-    }
-
-    public OptimisticException(String msg) {
+    public OptimisticException(Message msg) {
         super(msg);
     }
 

Modified: incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/ReferentialIntegrityException.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/ReferentialIntegrityException.java?rev=429535&r1=429534&r2=429535&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/ReferentialIntegrityException.java (original)
+++ incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/ReferentialIntegrityException.java Mon Aug  7 18:42:34 2006
@@ -40,9 +40,6 @@
 
     private int _iv = IV_UNKNOWN;
 
-    public ReferentialIntegrityException() {
-    }
-
     public ReferentialIntegrityException(String msg) {
         super(msg);
     }
@@ -55,11 +52,11 @@
     private static String getMessage(int iv) {
         switch (iv) {
             case IV_DUPLICATE_OID:
-                return _loc.get("dup-oid");
+                return _loc.get("dup-oid").getMessage();
             case IV_UNIQUE:
-                return _loc.get("unique");
+                return _loc.get("unique").getMessage();
             default:
-                return _loc.get("ref-integrity");
+                return _loc.get("ref-integrity").getMessage();
         }
     }
 



Mime
View raw message