openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From p..@apache.org
Subject svn commit: r429535 [2/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
Modified: incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/StoreException.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/StoreException.java?rev=429535&r1=429534&r2=429535&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/StoreException.java (original)
+++ incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/StoreException.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;
+
 /**
  * Base exception for data store errors.
  *
@@ -30,19 +32,16 @@
     public static final int REFERENTIAL_INTEGRITY = 4;
     public static final int OBJECT_EXISTS = 5;
 
-    public StoreException() {
-    }
-
     public StoreException(String msg) {
         super(msg);
     }
 
-    public StoreException(Throwable cause) {
-        super(cause);
+    public StoreException(Message msg) {
+        super(msg.getMessage());
     }
 
-    public StoreException(String msg, Throwable cause) {
-        super(msg, cause);
+    public StoreException(Throwable cause) {
+        super(cause);
     }
 
     public int getType() {

Modified: incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/UnsupportedException.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/UnsupportedException.java?rev=429535&r1=429534&r2=429535&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/UnsupportedException.java (original)
+++ incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/UnsupportedException.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 attempts to perform unsupported operations.
  *
@@ -33,12 +35,12 @@
         setFatal(true);
     }
 
-    public UnsupportedException(Throwable cause) {
-        super(cause);
+    public UnsupportedException(Message msg) {
+        super(msg);
         setFatal(true);
     }
 
-    public UnsupportedException(String msg, Throwable cause) {
+    public UnsupportedException(Message msg, Throwable cause) {
         super(msg, cause);
         setFatal(true);
     }

Modified: incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/UserException.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/UserException.java?rev=429535&r1=429534&r2=429535&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/UserException.java (original)
+++ incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/UserException.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;
+
 /**
  * Base exception type for user errors.
  *
@@ -36,11 +38,19 @@
         super(msg);
     }
 
+    public UserException(Message msg) {
+        super(msg);
+    }
+
     public UserException(Throwable cause) {
         super(cause);
     }
 
     public UserException(String msg, Throwable cause) {
+        super(msg, cause);
+    }
+
+    public UserException(Message msg, Throwable cause) {
         super(msg, cause);
     }
 

Modified: incubator/openjpa/trunk/openjpa-kernel/src/main/resources/org/apache/openjpa/kernel/localizer.properties
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-kernel/src/main/resources/org/apache/openjpa/kernel/localizer.properties?rev=429535&r1=429534&r2=429535&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-kernel/src/main/resources/org/apache/openjpa/kernel/localizer.properties (original)
+++ incubator/openjpa/trunk/openjpa-kernel/src/main/resources/org/apache/openjpa/kernel/localizer.properties Mon Aug  7 18:42:34 2006
@@ -161,6 +161,7 @@
 bad-id-value: The given value "{0}" cannot be converted into an identity \
 	for "{2}".  The value is the wrong type ({1}).
 factory-init: Starting OpenJPA {0}
+factory-properties: Properties: {0}
 inverse-consistency: An inverse inconsistency in the object model was \
 	detected while flushing the field "{0}" of the instance with id "{1}" \
 	in context "{2}".

Modified: incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/ant/AbstractTask.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/ant/AbstractTask.java?rev=429535&r1=429534&r2=429535&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/ant/AbstractTask.java (original)
+++ incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/ant/AbstractTask.java Mon Aug  7 18:42:34 2006
@@ -126,7 +126,7 @@
      */
     protected void assertFiles(String[] files) {
         if (files.length == 0)
-            throw new BuildException(_loc.get("no-filesets"));
+            throw new BuildException(_loc.get("no-filesets").getMessage());
     }
 
     public void setClasspath(Path classPath) {

Modified: incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ConfigurationImpl.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ConfigurationImpl.java?rev=429535&r1=429534&r2=429535&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ConfigurationImpl.java (original)
+++ incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ConfigurationImpl.java Mon Aug  7 18:42:34 2006
@@ -276,7 +276,7 @@
         }
         if (errs != null)
             throw new RuntimeException(_loc.get("get-prop-errs",
-                errs.toString()));
+                errs.toString()).getMessage());
     }
 
     public boolean isReadOnly() {
@@ -503,7 +503,7 @@
         if (scope != null) {
             loc = Localizer.forPackage(scope);
             try {
-                return loc.getFatal(key);
+                return loc.getFatal(key).getMessage();
             } catch (MissingResourceException mse) {
             }
         }
@@ -512,7 +512,7 @@
             cls = cls.getSuperclass()) {
             loc = Localizer.forPackage(cls);
             try {
-                return loc.getFatal(key);
+                return loc.getFatal(key).getMessage();
             } catch (MissingResourceException mse) {
             }
         }
@@ -670,7 +670,8 @@
                 // if we've already found a property with a previous prefix,
                 // then this is a collision.
                 throw new IllegalStateException(
-                    _loc.get("dup-with-different-prefixes", firstKey, key));
+                    _loc.get("dup-with-different-prefixes", firstKey, key)
+                        .getMessage());
             }
         }
         if (firstKey != null && setLoadKey)
@@ -761,7 +762,7 @@
      */
     public void assertNotReadOnly() {
         if (isReadOnly())
-            throw new IllegalStateException(_loc.get("read-only"));
+            throw new IllegalStateException(_loc.get("read-only").getMessage());
     }
 
     /**

Modified: incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/Configurations.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/Configurations.java?rev=429535&r1=429534&r2=429535&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/Configurations.java (original)
+++ incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/Configurations.java Mon Aug  7 18:42:34 2006
@@ -140,7 +140,7 @@
                 throw re;
             Log log = (conf == null) ? null : conf.getConfigurationLog();
             if (log != null && log.isErrorEnabled())
-                log.error(re);
+                log.error(_loc.get("plugin-creation-exception", val), re);
             return null;
         }
 
@@ -148,12 +148,12 @@
             return cls.newInstance();
         } catch (Exception e) {
             RuntimeException re = new NestableRuntimeException(_loc.get
-                ("obj-create", cls), e);
+                ("obj-create", cls).getMessage(), e);
             if (fatal)
                 throw re;
             Log log = (conf == null) ? null : conf.getConfigurationLog();
             if (log != null && log.isErrorEnabled())
-                log.error(re);
+                log.error(_loc.get("plugin-creation-exception", val), re);
             return null;
         }
     }
@@ -279,7 +279,7 @@
             ((GenericConfigurable) obj).setInto(invalidEntries);
 
 		if (!invalidEntries.isEmpty() && configurationName != null) {
-			String msg = null;
+			Localizer.Message msg = null;
 			String first = (String) invalidEntries.keySet().iterator().next();
 			if (invalidEntries.keySet().size() == 1 &&
 				first.indexOf('.') == -1) {
@@ -460,7 +460,7 @@
                 Configurations.class.getName(), "defaults");
         if (providerCount == 0)
             throw new MissingResourceException(_loc.get ("no-providers", 
-                ConfigurationProvider.class.getName()),
+                ConfigurationProvider.class.getName()).getMessage(),
                 Configurations.class.getName(), "defaults"); 
         return null;
     }
@@ -518,9 +518,9 @@
             msg = errs.toString();
         else if (providerCount == 0)
             msg = _loc.get("no-providers", 
-                ConfigurationProvider.class.getName());
+                ConfigurationProvider.class.getName()).getMessage();
         else
-            msg = _loc.get("no-provider", resource);
+            msg = _loc.get("no-provider", resource).getMessage();
         
         throw new MissingResourceException(msg,
             Configurations.class.getName(), resource);
@@ -572,8 +572,8 @@
             ctx = new InitialContext();
             return ctx.lookup(name);
         } catch (NamingException ne) {
-            throw new NestableRuntimeException(_loc.get("naming-err", name),
-                ne);
+            throw new NestableRuntimeException(
+                _loc.get("naming-err", name).getMessage(), ne);
         } finally {
             if (ctx != null)
                 try {

Modified: incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ObjectValue.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ObjectValue.java?rev=429535&r1=429534&r2=429535&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ObjectValue.java (original)
+++ incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ObjectValue.java Mon Aug  7 18:42:34 2006
@@ -107,7 +107,7 @@
             set(null);
         else
             throw new IllegalArgumentException(_loc.get("cant-set-string",
-                getProperty()));
+                getProperty()).getMessage());
     }
 
     protected void setInternalObject(Object obj) {

Modified: incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/PluginValue.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/PluginValue.java?rev=429535&r1=429534&r2=429535&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/PluginValue.java (original)
+++ incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/PluginValue.java Mon Aug  7 18:42:34 2006
@@ -106,7 +106,7 @@
     public void set(Object obj, boolean derived) {
         if (!_singleton)
             throw new IllegalStateException(_loc.get("not-singleton",
-                getProperty()));
+                getProperty()).getMessage());
         super.set(obj, derived);
     }
 

Modified: incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/jdbc/DataSourceLogs.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/jdbc/DataSourceLogs.java?rev=429535&r1=429534&r2=429535&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/jdbc/DataSourceLogs.java (original)
+++ incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/jdbc/DataSourceLogs.java Mon Aug  7 18:42:34 2006
@@ -19,6 +19,7 @@
 
 import org.apache.openjpa.lib.log.Log;
 import org.apache.openjpa.lib.log.NoneLogFactory;
+import org.apache.openjpa.lib.util.Localizer;
 
 /**
  * Provies basic logging facilities to a DataSource.
@@ -28,6 +29,9 @@
  */
 public class DataSourceLogs {
 
+    private static final Localizer _loc =
+        Localizer.forPackage(DataSourceLogs.class);
+
     private Log _jdbcLog = null;
     private Log _sqlLog = null;
 
@@ -136,12 +140,12 @@
             buf.append(", ").append(conn);
         buf.append("> ");
 
-        // in the time != -1, append time profiling information
+        // if the time != -1, append time profiling information
         if (totalTime != -1)
             buf.append("[").append(totalTime).append(" ms] ");
 
         buf.append(msg);
-        log.trace(buf.toString());
+        log.trace(_loc.get("datasource-trace-data", buf.toString()));
     }
 }
 

Modified: incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/jdbc/DelegatingConnection.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/jdbc/DelegatingConnection.java?rev=429535&r1=429534&r2=429535&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/jdbc/DelegatingConnection.java (original)
+++ incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/jdbc/DelegatingConnection.java Mon Aug  7 18:42:34 2006
@@ -557,7 +557,8 @@
 
     private static void assertJDBC3() {
         if (_jdbc3 == null)
-            throw new UnsupportedOperationException(_loc.get("not-jdbc3"));
+            throw new UnsupportedOperationException(_loc.get("not-jdbc3")
+                .getMessage());
     }
 
     private Object invokeJDBC3(Method m, Object[] args) throws SQLException {
@@ -566,7 +567,8 @@
         } catch (Throwable t) {
             if (t instanceof SQLException)
                 throw(SQLException) t;
-            throw new NestableRuntimeException(_loc.get("invoke-jdbc3"), t);
+            throw new NestableRuntimeException(_loc.get("invoke-jdbc3")
+                .getMessage(), t);
         }
     }
 
@@ -577,7 +579,8 @@
             _jdbc3.put(key, m);
             return m;
         } catch (Throwable t) {
-            throw new NestableRuntimeException(_loc.get("error-jdbc3"), t);
+            throw new NestableRuntimeException(_loc.get("error-jdbc3")
+                .getMessage(), t);
         }
     }
 }

Modified: incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/log/AbstractLog.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/log/AbstractLog.java?rev=429535&r1=429534&r2=429535&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/log/AbstractLog.java (original)
+++ incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/log/AbstractLog.java Mon Aug  7 18:42:34 2006
@@ -44,10 +44,6 @@
         return isEnabled(TRACE);
     }
 
-    public boolean isDebugEnabled() {
-        return isEnabled(DEBUG);
-    }
-
     public boolean isInfoEnabled() {
         return isEnabled(INFO);
     }
@@ -71,15 +67,6 @@
     public void trace(Object message, Throwable t) {
         if (isTraceEnabled())
             log(TRACE, toString(message), throwableParam(message, t));
-    }
-
-    public void debug(Object message) {
-        debug(message, throwableParam(message, null));
-    }
-
-    public void debug(Object message, Throwable t) {
-        if (isDebugEnabled())
-            log(DEBUG, toString(message), throwableParam(message, t));
     }
 
     public void info(Object message) {

Modified: incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/log/CommonsLogFactory.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/log/CommonsLogFactory.java?rev=429535&r1=429534&r2=429535&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/log/CommonsLogFactory.java (original)
+++ incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/log/CommonsLogFactory.java Mon Aug  7 18:42:34 2006
@@ -49,10 +49,6 @@
             return _log;
         }
 
-        public boolean isDebugEnabled() {
-            return _log.isDebugEnabled();
-        }
-
         public boolean isErrorEnabled() {
             return _log.isErrorEnabled();
         }
@@ -79,14 +75,6 @@
 
         public void trace(Object o, Throwable t) {
             _log.trace(o, t);
-        }
-
-        public void debug(Object o) {
-            _log.debug(o);
-        }
-
-        public void debug(Object o, Throwable t) {
-            _log.debug(o, t);
         }
 
         public void info(Object o) {

Modified: incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/log/Log.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/log/Log.java?rev=429535&r1=429534&r2=429535&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/log/Log.java (original)
+++ incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/log/Log.java Mon Aug  7 18:42:34 2006
@@ -24,7 +24,7 @@
 public interface Log {
 
     public static final short TRACE = 1;
-    public static final short DEBUG = 2;
+    // the old DEBUG constant was 2. Leaving a hole for compatibility.
     public static final short INFO = 3;
     public static final short WARN = 4;
     public static final short ERROR = 5;
@@ -36,11 +36,6 @@
     public boolean isTraceEnabled();
 
     /**
-     * Returns if the {@link #DEBUG} log level is enabled.
-     */
-    public boolean isDebugEnabled();
-
-    /**
      * Returns if the {@link #INFO} log level is enabled.
      */
     public boolean isInfoEnabled();
@@ -73,20 +68,6 @@
      * of the message, also outputting <code>t</code> to the log.
      */
     public void trace(Object o, Throwable t);
-
-    /**
-     * Write out a log message at the {@link #DEBUG}
-     * level with the stringification of <code>o</code> as the body
-     * of the message, also outputting <code>t</code> to the log.
-     */
-    public void debug(Object o);
-
-    /**
-     * Write out a log message at the {@link #DEBUG}
-     * level with the stringification of <code>o</code> as the body
-     * of the message, also outputting <code>t</code> to the log.
-     */
-    public void debug(Object o, Throwable t);
 
     /**
      * Write out a log message at the {@link #INFO}

Modified: incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/log/Log4JLogFactory.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/log/Log4JLogFactory.java?rev=429535&r1=429534&r2=429535&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/log/Log4JLogFactory.java (original)
+++ incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/log/Log4JLogFactory.java Mon Aug  7 18:42:34 2006
@@ -46,10 +46,6 @@
         }
 
         public boolean isTraceEnabled() {
-            return isDebugEnabled();
-        }
-
-        public boolean isDebugEnabled() {
             return _log.getEffectiveLevel().toInt() >= Level.DEBUG_INT;
         }
 
@@ -74,14 +70,6 @@
         }
 
         public void trace(Object o, Throwable t) {
-            _log.debug(o, t);
-        }
-
-        public void debug(Object o) {
-            _log.debug(o);
-        }
-
-        public void debug(Object o, Throwable t) {
             _log.debug(o, t);
         }
 

Modified: incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/log/LogFactoryImpl.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/log/LogFactoryImpl.java?rev=429535&r1=429534&r2=429535&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/log/LogFactoryImpl.java (original)
+++ incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/log/LogFactoryImpl.java Mon Aug  7 18:42:34 2006
@@ -42,12 +42,11 @@
 
     private static Localizer _loc = Localizer.forPackage(LogFactoryImpl.class);
 
-    public static final String TRACE_STR = _loc.get("log-trace");
-    public static final String DEBUG_STR = _loc.get("log-debug");
-    public static final String INFO_STR = _loc.get("log-info");
-    public static final String WARN_STR = _loc.get("log-warn");
-    public static final String ERROR_STR = _loc.get("log-error");
-    public static final String FATAL_STR = _loc.get("log-fatal");
+    public static final String TRACE_STR = _loc.get("log-trace").getMessage();
+    public static final String INFO_STR = _loc.get("log-info").getMessage();
+    public static final String WARN_STR = _loc.get("log-warn").getMessage();
+    public static final String ERROR_STR = _loc.get("log-error").getMessage();
+    public static final String FATAL_STR = _loc.get("log-fatal").getMessage();
 
     public static final String STDOUT = "stdout";
     public static final String STDERR = "stderr";
@@ -187,8 +186,6 @@
         switch (level) {
             case Log.TRACE:
                 return TRACE_STR;
-            case Log.DEBUG:
-                return DEBUG_STR;
             case Log.INFO:
                 return INFO_STR;
             case Log.WARN:
@@ -198,7 +195,7 @@
             case Log.FATAL:
                 return FATAL_STR;
             default:
-                return _loc.get("log-unknown");
+                return _loc.get("log-unknown").getMessage();
         }
     }
 
@@ -208,15 +205,14 @@
     public static short getLevel(String str) {
         str = str.toUpperCase().trim();
         short val = TRACE_STR.equals(str) ? Log.TRACE :
-            DEBUG_STR.equals(str) ? Log.DEBUG :
-                INFO_STR.equals(str) ? Log.INFO :
-                    WARN_STR.equals(str) ? Log.WARN :
-                        ERROR_STR.equals(str) ? Log.ERROR :
-                            FATAL_STR.equals(str) ? Log.FATAL : -1;
+            INFO_STR.equals(str) ? Log.INFO :
+                WARN_STR.equals(str) ? Log.WARN :
+                    ERROR_STR.equals(str) ? Log.ERROR :
+                        FATAL_STR.equals(str) ? Log.FATAL : -1;
 
         if (val == -1)
             throw new IllegalArgumentException
-                (_loc.get("log-bad-constant", str));
+                (_loc.get("log-bad-constant", str).getMessage());
 
         return val;
     }

Modified: incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/log/LogOutputStream.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/log/LogOutputStream.java?rev=429535&r1=429534&r2=429535&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/log/LogOutputStream.java (original)
+++ incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/log/LogOutputStream.java Mon Aug  7 18:42:34 2006
@@ -69,9 +69,6 @@
             case Log.TRACE:
                 _log.trace(msg);
                 break;
-            case Log.DEBUG:
-                _log.debug(msg);
-                break;
             case Log.INFO:
                 _log.info(msg);
                 break;

Modified: incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/log/MultiLogFactory.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/log/MultiLogFactory.java?rev=429535&r1=429534&r2=429535&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/log/MultiLogFactory.java (original)
+++ incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/log/MultiLogFactory.java Mon Aug  7 18:42:34 2006
@@ -122,16 +122,6 @@
                 _logs[i].info(msg, t);
         }
 
-        public void debug(Object msg) {
-            for (int i = 0; i < _logs.length; i++)
-                _logs[i].debug(msg);
-        }
-
-        public void debug(Object msg, Throwable t) {
-            for (int i = 0; i < _logs.length; i++)
-                _logs[i].debug(msg, t);
-        }
-
         public void warn(Object msg) {
             for (int i = 0; i < _logs.length; i++)
                 _logs[i].warn(msg);
@@ -179,13 +169,6 @@
         public boolean isWarnEnabled() {
             for (int i = 0; i < _logs.length; i++)
                 if (_logs[i].isWarnEnabled())
-                    return true;
-            return false;
-        }
-
-        public boolean isDebugEnabled() {
-            for (int i = 0; i < _logs.length; i++)
-                if (_logs[i].isDebugEnabled())
                     return true;
             return false;
         }

Modified: incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/log/NoneLogFactory.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/log/NoneLogFactory.java?rev=429535&r1=429534&r2=429535&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/log/NoneLogFactory.java (original)
+++ incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/log/NoneLogFactory.java Mon Aug  7 18:42:34 2006
@@ -38,10 +38,6 @@
             return s_log;
         }
 
-        public final boolean isDebugEnabled() {
-            return false;
-        }
-
         public final boolean isErrorEnabled() {
             return false;
         }
@@ -66,12 +62,6 @@
         }
 
         public final void trace(Object o, Throwable t) {
-        }
-
-        public final void debug(Object o) {
-        }
-
-        public final void debug(Object o, Throwable t) {
         }
 
         public final void info(Object o) {

Modified: incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/meta/CFMetaDataParser.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/meta/CFMetaDataParser.java?rev=429535&r1=429534&r2=429535&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/meta/CFMetaDataParser.java (original)
+++ incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/meta/CFMetaDataParser.java Mon Aug  7 18:42:34 2006
@@ -279,7 +279,7 @@
             return null;
         Class cls = classForName(name, _package, resolve, currentClassLoader());
         if (cls == null)
-            throw getException(_loc.get("invalid-class", name));
+            throw getException(_loc.get("invalid-class", name).getMessage());
         return cls;
     }
 

Modified: incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/meta/ClassArgParser.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/meta/ClassArgParser.java?rev=429535&r1=429534&r2=429535&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/meta/ClassArgParser.java (original)
+++ incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/meta/ClassArgParser.java Mon Aug  7 18:42:34 2006
@@ -101,12 +101,12 @@
                 if (i == 0) {
                     if (charIdx == packageElementName.length())
                         throw new UnsupportedOperationException(_loc.get
-                            ("cant-diff-elems"));
+                            ("cant-diff-elems").getMessage());
                     buf[i] = packageElementName.charAt(charIdx);
                 } else {
                     if (charIdx == classElementNames[i - 1].length())
                         throw new UnsupportedOperationException(_loc.get
-                            ("cant-diff-elems"));
+                            ("cant-diff-elems").getMessage());
                     buf[i] = classElementNames[i - 1].charAt(charIdx);
                 }
             }
@@ -212,7 +212,8 @@
                 return (String[]) col.toArray(new String[col.size()]);
             }
         } catch (Exception e) {
-            throw new NestableRuntimeException(_loc.get("class-arg", arg), e);
+            throw new NestableRuntimeException(
+                _loc.get("class-arg", arg).getMessage(), e);
         }
 
         // must be a class name
@@ -234,8 +235,8 @@
                 appendTypeNames(source, itr.getInputStream(), names);
             }
         } catch (Exception e) {
-            throw new NestableRuntimeException(_loc.get("class-arg", source),
-                e);
+            throw new NestableRuntimeException(
+                _loc.get("class-arg", source).getMessage(), e);
         }
         return (String[]) names.toArray(new String[names.size()]);
     }
@@ -279,8 +280,8 @@
                 names.clear();
             }
         } catch (Exception e) {
-            throw new NestableRuntimeException(_loc.get("class-arg", source),
-                e);
+            throw new NestableRuntimeException(
+                _loc.get("class-arg", source).getMessage(), e);
         }
         return map;
     }

Modified: incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/meta/FileMetaDataIterator.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/meta/FileMetaDataIterator.java?rev=429535&r1=429534&r2=429535&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/meta/FileMetaDataIterator.java (original)
+++ incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/meta/FileMetaDataIterator.java Mon Aug  7 18:42:34 2006
@@ -74,7 +74,7 @@
         Collection metas, int scanned) throws IOException {
         if (scanned > SCAN_LIMIT)
             throw new IllegalStateException(_loc.get("too-many-files",
-                String.valueOf(SCAN_LIMIT)));
+                String.valueOf(SCAN_LIMIT)).getMessage());
         scanned++;
 
         if (filter == null)

Modified: incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/meta/SourceTrackers.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/meta/SourceTrackers.java?rev=429535&r1=429534&r2=429535&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/meta/SourceTrackers.java (original)
+++ incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/meta/SourceTrackers.java Mon Aug  7 18:42:34 2006
@@ -42,7 +42,7 @@
         String sourceFilePath;
         for (int i = 0; i < trackers.length; i++) {
             sourceFilePath = (trackers[i].getSourceFile() == null ?
-                _loc.get("source-tracker-file-unknown") :
+                _loc.get("source-tracker-file-unknown").getMessage() :
                 trackers[i].getSourceFile().getAbsolutePath());
             buf.append("  ").append(_loc.get(
                 "source-trackers-location-line-item",

Modified: incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/meta/XMLMetaDataParser.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/meta/XMLMetaDataParser.java?rev=429535&r1=429534&r2=429535&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/meta/XMLMetaDataParser.java (original)
+++ incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/meta/XMLMetaDataParser.java Mon Aug  7 18:42:34 2006
@@ -40,6 +40,7 @@
 import org.xml.sax.helpers.DefaultHandler;
 import org.apache.openjpa.lib.log.Log;
 import org.apache.openjpa.lib.util.JavaVersions;
+import org.apache.openjpa.lib.util.Localizer.Message;
 import org.apache.openjpa.lib.util.Localizer;
 import org.apache.openjpa.lib.xml.Commentable;
 import org.apache.openjpa.lib.xml.DocTypeReader;
@@ -655,9 +656,19 @@
      * Returns a SAXException with the source file name and the given error
      * message.
      */
-    protected SAXException getException(String msg, Throwable cause) {
+    protected SAXException getException(Message msg) {
+        return new SAXException(getSourceName() + currentLocation() +
+            ": " + msg.getMessage());
+    }
+
+    /**
+     * Returns a SAXException with the source file name and the given error
+     * message.
+     */
+    protected SAXException getException(Message msg, Throwable cause) {
         if (cause != null && _log != null && _log.isTraceEnabled())
-            _log.trace(cause);
+            _log.trace(_loc.get("sax-exception",
+                getSourceName(), _location.getLocation()), cause);
         return new SAXException(getSourceName() + currentLocation() +
             ": " + msg + " [" + cause + "]");
     }

Modified: incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/rop/AbstractListIterator.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/rop/AbstractListIterator.java?rev=429535&r1=429534&r2=429535&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/rop/AbstractListIterator.java (original)
+++ incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/rop/AbstractListIterator.java Mon Aug  7 18:42:34 2006
@@ -31,14 +31,17 @@
         (AbstractListIterator.class);
 
     public void add(Object o) {
-        throw new UnsupportedOperationException(_loc.get("read-only"));
+        throw new UnsupportedOperationException(_loc.get("read-only")
+            .getMessage());
     }
 
     public void set(Object o) {
-        throw new UnsupportedOperationException(_loc.get("read-only"));
+        throw new UnsupportedOperationException(_loc.get("read-only")
+            .getMessage());
     }
 
     public void remove() {
-        throw new UnsupportedOperationException(_loc.get("read-only"));
+        throw new UnsupportedOperationException(_loc.get("read-only")
+            .getMessage());
     }
 }

Modified: incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/rop/AbstractResultList.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/rop/AbstractResultList.java?rev=429535&r1=429534&r2=429535&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/rop/AbstractResultList.java (original)
+++ incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/rop/AbstractResultList.java Mon Aug  7 18:42:34 2006
@@ -33,43 +33,48 @@
         (AbstractResultList.class);
 
     public void add(int index, Object element) {
-        throw new UnsupportedOperationException(_loc.get("read-only"));
+        throw readOnly();
+    }
+
+    private UnsupportedOperationException readOnly() {
+        return new UnsupportedOperationException(_loc.get("read-only")
+            .getMessage());
     }
 
     public boolean add(Object o) {
-        throw new UnsupportedOperationException(_loc.get("read-only"));
+        throw readOnly();
     }
 
     public boolean addAll(Collection c) {
-        throw new UnsupportedOperationException(_loc.get("read-only"));
+        throw readOnly();
     }
 
     public boolean addAll(int index, Collection c) {
-        throw new UnsupportedOperationException(_loc.get("read-only"));
+        throw readOnly();
     }
 
     public Object remove(int index) {
-        throw new UnsupportedOperationException(_loc.get("read-only"));
+        throw readOnly();
     }
 
     public boolean remove(Object o) {
-        throw new UnsupportedOperationException(_loc.get("read-only"));
+        throw readOnly();
     }
 
     public boolean removeAll(Collection c) {
-        throw new UnsupportedOperationException(_loc.get("read-only"));
+        throw readOnly();
     }
 
     public boolean retainAll(Collection c) {
-        throw new UnsupportedOperationException(_loc.get("read-only"));
+        throw readOnly();
     }
 
     public Object set(int index, Object element) {
-        throw new UnsupportedOperationException(_loc.get("read-only"));
+        throw readOnly();
     }
 
     public void clear() {
-        throw new UnsupportedOperationException(_loc.get("read-only"));
+        throw readOnly();
     }
 
     public List subList(int from, int to) {
@@ -83,6 +88,6 @@
 
     protected void assertOpen() {
         if (isClosed())
-            throw new NoSuchElementException(_loc.get("closed"));
+            throw new NoSuchElementException(_loc.get("closed").getMessage());
     }
 }

Modified: incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/rop/RangeResultObjectProvider.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/rop/RangeResultObjectProvider.java?rev=429535&r1=429534&r2=429535&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/rop/RangeResultObjectProvider.java (original)
+++ incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/rop/RangeResultObjectProvider.java Mon Aug  7 18:42:34 2006
@@ -57,7 +57,7 @@
         _delegate = delegate;
         if (startIdx > Integer.MAX_VALUE || endIdx > Integer.MAX_VALUE)
             throw new IllegalArgumentException(_loc.get("range-too-high",
-                String.valueOf(startIdx), String.valueOf(endIdx)));
+                String.valueOf(startIdx), String.valueOf(endIdx)).getMessage());
 
         _startIdx = (int) startIdx;
         _endIdx = (int) endIdx;

Modified: incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/rop/ResultListIterator.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/rop/ResultListIterator.java?rev=429535&r1=429534&r2=429535&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/rop/ResultListIterator.java (original)
+++ incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/rop/ResultListIterator.java Mon Aug  7 18:42:34 2006
@@ -56,7 +56,7 @@
 
     public Object next() {
         if (_rl.isClosed())
-            throw new NoSuchElementException(_loc.get("closed"));
+            throw new NoSuchElementException(_loc.get("closed").getMessage());
         return _li.next();
     }
 

Modified: incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/FormatPreservingProperties.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/FormatPreservingProperties.java?rev=429535&r1=429534&r2=429535&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/FormatPreservingProperties.java (original)
+++ incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/FormatPreservingProperties.java Mon Aug  7 18:42:34 2006
@@ -557,7 +557,7 @@
 
         public DuplicateKeyException(String key, Object firstVal,
             String secondVal) {
-            super(_loc.get("dup-key", key, firstVal, secondVal));
+            super(_loc.get("dup-key", key, firstVal, secondVal).getMessage());
         }
     }
 

Modified: incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/Localizer.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/Localizer.java?rev=429535&r1=429534&r2=429535&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/Localizer.java (original)
+++ incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/Localizer.java Mon Aug  7 18:42:34 2006
@@ -56,6 +56,9 @@
     // the local file name and class' classloader
     private ResourceBundle _bundle = null;
 
+    // the package that this localizer was created for.
+    private Package _package;
+
     /**
      * Return a Localizer instance that will access the properties file
      * in the package of the given class using the system default locale.
@@ -106,7 +109,7 @@
         }
 
         // cache the localizer
-        loc = new Localizer();
+        loc = new Localizer(cls == null ? null : cls.getPackage());
         loc._bundle = bundle;
         _localizers.put(key, loc);
         return loc;
@@ -126,18 +129,22 @@
         return _providers.remove(provider);
     }
 
+    private Localizer(Package p) {
+        _package = p;
+    }
+
     /**
      * Return the localized string matching the given key.
      */
-    public String get(String key) {
-        return get(key, false);
+    public Message get(String key) {
+        return get(key, null);
     }
 
     /**
      * Return the localized string matching the given key.
      */
-    public String getFatal(String key) {
-        return get(key, true);
+    public Message getFatal(String key) {
+        return getFatal(key, null);
     }
 
     /**
@@ -148,7 +155,7 @@
      *
      * @see #get(String)
      */
-    public String get(String key, Object sub) {
+    public Message get(String key, Object sub) {
         return get(key, new Object[]{ sub });
     }
 
@@ -160,7 +167,7 @@
      *
      * @see #getFatal(String)
      */
-    public String getFatal(String key, Object sub) {
+    public Message getFatal(String key, Object sub) {
         return getFatal(key, new Object[]{ sub });
     }
 
@@ -169,7 +176,7 @@
      *
      * @see #get(String,Object)
      */
-    public String get(String key, Object sub1, Object sub2) {
+    public Message get(String key, Object sub1, Object sub2) {
         return get(key, new Object[]{ sub1, sub2 });
     }
 
@@ -178,7 +185,7 @@
      *
      * @see #getFatal(String,Object)
      */
-    public String getFatal(String key, Object sub1, Object sub2) {
+    public Message getFatal(String key, Object sub1, Object sub2) {
         return getFatal(key, new Object[]{ sub1, sub2 });
     }
 
@@ -187,7 +194,7 @@
      *
      * @see #get(String,Object)
      */
-    public String get(String key, Object sub1, Object sub2, Object sub3) {
+    public Message get(String key, Object sub1, Object sub2, Object sub3) {
         return get(key, new Object[]{ sub1, sub2, sub3 });
     }
 
@@ -199,9 +206,8 @@
      *
      * @see #get(String)
      */
-    public String get(String key, Object[] subs) {
-        String str = get(key);
-        return MessageFormat.format(str, subs);
+    public Message get(String key, Object[] subs) {
+        return new Message(key, subs, false);
     }
 
     /**
@@ -212,24 +218,70 @@
      *
      * @see #getFatal(String)
      */
-    public String getFatal(String key, Object[] subs) {
-        String str = getFatal(key);
-        return MessageFormat.format(str, subs);
+    public Message getFatal(String key, Object[] subs) {
+        return new Message(key, subs, true);
     }
 
-    private String get(String key, boolean fatal) {
-        if (_bundle == null) {
-            if (fatal)
-                throw new MissingResourceException(key, key, key);
-            return key;
+    /**
+     * A <code>Message</code> can provide a localized message via the 
+     * {@link #getMessage} method call, and can also provide the original key,
+     * package, and substitution array that were used to assemble the message.
+     */
+    public class Message {
+
+        private final String key;
+        private final Object[] subs;
+        private String localizedMessage;
+        private boolean messageFound = false;
+
+        private Message(String key, Object[] subs, boolean fatal) {
+            this.key = key;
+            this.subs = subs;
+
+            if (_bundle == null) {
+                if (fatal)
+                    throw new MissingResourceException(key, key, key);
+                else {
+                    localizedMessage = key;
+                    messageFound = false;
+                }
+            } else {
+                try {
+                    localizedMessage = _bundle.getString(key);
+                    messageFound = true;
+                } catch (MissingResourceException mre) {
+                    if (!fatal)
+                        localizedMessage = key;
+                    else
+                        throw mre;
+                }
+            }
         }
 
-        try {
-            return _bundle.getString(key);
-        } catch (MissingResourceException mre) {
-            if (!fatal)
+        /**
+         * The localized message.
+         */
+        public String getMessage() {
+            if (messageFound)
+                return MessageFormat.format(localizedMessage, subs);
+            else
                 return key;
-            throw mre;
+        }
+
+        public String getKey() {
+            return key;
+        }
+
+        public Object[] getSubstitutions() {
+            return subs;
+        }
+
+        public Package getPackage() {
+            return _package;
+        }
+        
+        public String toString() {
+            return getMessage();
         }
     }
 }

Modified: incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/ParseException.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/ParseException.java?rev=429535&r1=429534&r2=429535&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/ParseException.java (original)
+++ incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/ParseException.java Mon Aug  7 18:42:34 2006
@@ -33,11 +33,19 @@
         super(msg);
     }
 
+    public ParseException(Localizer.Message msg) {
+        super(msg.getMessage());
+    }
+
     public ParseException(Throwable cause) {
         super(cause);
     }
 
     public ParseException(String msg, Throwable cause) {
         super(msg, cause);
+    }
+
+    public ParseException(Localizer.Message msg, Throwable cause) {
+        super(msg.getMessage(), cause);
     }
 }

Modified: incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/xml/Location.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/xml/Location.java?rev=429535&r1=429534&r2=429535&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/xml/Location.java (original)
+++ incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/xml/Location.java Mon Aug  7 18:42:34 2006
@@ -47,17 +47,16 @@
         if (_locator == null) {
             if (_nullOnNoLocator)
                 return null;
-            return _loc.get("no-locator");
+            return _loc.get("no-locator").getMessage();
         }
-        String forma = MessageFormat.format(format, new Object []{
+        return MessageFormat.format(format, new Object []{
             Numbers.valueOf(_locator.getLineNumber()),
             Numbers.valueOf(_locator.getColumnNumber()), _locator.getPublicId(),
             _locator.getSystemId() });
-        return forma;
     }
 
     public String getLocation() {
-        return getLocation(_loc.get("location-format"));
+        return getLocation(_loc.get("location-format").getMessage());
     }
 
     public void setLocator(Locator locator) {

Modified: incubator/openjpa/trunk/openjpa-lib/src/main/resources/org/apache/openjpa/lib/conf/localizer.properties
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-lib/src/main/resources/org/apache/openjpa/lib/conf/localizer.properties?rev=429535&r1=429534&r2=429535&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-lib/src/main/resources/org/apache/openjpa/lib/conf/localizer.properties (original)
+++ incubator/openjpa/trunk/openjpa-lib/src/main/resources/org/apache/openjpa/lib/conf/localizer.properties Mon Aug  7 18:42:34 2006
@@ -60,6 +60,8 @@
 	exception will be consumed.
 dup-with-different-prefixes: Found multiple properties with different valid \
 	prefixes. Properties: {0}, {1}.
+plugin-creation-exception: An exception occurred while creating a plugin for \
+    value {0}. This exception will be consumed.
 
 Log-name: Log factory
 Log-desc: LogFactory and configuration

Modified: incubator/openjpa/trunk/openjpa-lib/src/main/resources/org/apache/openjpa/lib/jdbc/localizer.properties
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-lib/src/main/resources/org/apache/openjpa/lib/jdbc/localizer.properties?rev=429535&r1=429534&r2=429535&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-lib/src/main/resources/org/apache/openjpa/lib/jdbc/localizer.properties (original)
+++ incubator/openjpa/trunk/openjpa-lib/src/main/resources/org/apache/openjpa/lib/jdbc/localizer.properties Mon Aug  7 18:42:34 2006
@@ -84,3 +84,4 @@
 	login.
 close-pool: Shutting down connection pool.
 close-pool-fail: Error caught when issuing close pool SQL: {0}
+datasource-trace-data: {0}
\ No newline at end of file

Modified: incubator/openjpa/trunk/openjpa-lib/src/main/resources/org/apache/openjpa/lib/log/localizer.properties
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-lib/src/main/resources/org/apache/openjpa/lib/log/localizer.properties?rev=429535&r1=429534&r2=429535&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-lib/src/main/resources/org/apache/openjpa/lib/log/localizer.properties (original)
+++ incubator/openjpa/trunk/openjpa-lib/src/main/resources/org/apache/openjpa/lib/log/localizer.properties Mon Aug  7 18:42:34 2006
@@ -1,14 +1,14 @@
 log-trace: TRACE
-log-debug: DEBUG
 log-info: INFO
 log-warn: WARN
 log-error: ERROR
 log-fatal: FATAL
 log-unknown: UNKNOWN
 log-bad-constant: The log level string "{0}" is not valid. Valid values are \
-	TRACE, DEBUG, INFO, WARN, ERROR or FATAL.
+	TRACE, INFO, WARN, ERROR or FATAL.
 log-bad-file: The file name "{0}" is not valid.
 could-not-create-factory: An error occurred while trying to create a \
 	LogFactory of type "{0}", as specified by the \
-	org.apache.openjpa.lib.log.LogFactory system property. Created a \
+	openjpa.Log system property. Created a \
 	org.apache.openjpa.lib.log.LogFactoryImpl instead.
+log-output-stream-data: {0}

Modified: incubator/openjpa/trunk/openjpa-lib/src/main/resources/org/apache/openjpa/lib/meta/localizer.properties
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-lib/src/main/resources/org/apache/openjpa/lib/meta/localizer.properties?rev=429535&r1=429534&r2=429535&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-lib/src/main/resources/org/apache/openjpa/lib/meta/localizer.properties (original)
+++ incubator/openjpa/trunk/openjpa-lib/src/main/resources/org/apache/openjpa/lib/meta/localizer.properties Mon Aug  7 18:42:34 2006
@@ -23,3 +23,6 @@
 source-tracker-file-unknown: <file location unknown>
 parser-schema-bug: XML schema validation is disabled due to bugs detected \
 	in the SAX parser.
+sax-exception: An exception occurred while parsing {0} at location {1}. \
+    This exception has been translated to a SAXException, and will be \
+    re-thrown. The original exception is being logged along with this message.
\ No newline at end of file

Modified: incubator/openjpa/trunk/openjpa-lib/src/test/java/org/apache/openjpa/lib/test/AbstractTestCase.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-lib/src/test/java/org/apache/openjpa/lib/test/AbstractTestCase.java?rev=429535&r1=429534&r2=429535&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-lib/src/test/java/org/apache/openjpa/lib/test/AbstractTestCase.java (original)
+++ incubator/openjpa/trunk/openjpa-lib/src/test/java/org/apache/openjpa/lib/test/AbstractTestCase.java Mon Aug  7 18:42:34 2006
@@ -61,6 +61,7 @@
 import org.apache.tools.ant.ProjectHelper;
 import org.apache.openjpa.lib.log.Log;
 import org.apache.openjpa.lib.log.LogFactoryImpl;
+import org.apache.openjpa.lib.util.Localizer;
 
 /**
  * TestCase framework to run various tests against solarmetric code.
@@ -85,6 +86,9 @@
     public static final String SKIP_TOKEN = "SOLARSKIP";
     public static final String SKIP_DELIMITER = "|";
 
+    private static final Localizer _loc =
+        Localizer.forPackage(AbstractTestCase.class);
+
     protected String multiThreadExecuting = null;
     protected boolean inTimeoutThread = false;
 
@@ -148,7 +152,7 @@
             try {
                 _lastTest.tearDownTestClass();
             } catch (Throwable t) {
-                getLog().error(t);
+                getLog().error(null, t);
             }
         }
 
@@ -156,7 +160,7 @@
             try {
                 setUpTestClass();
             } catch (Throwable t) {
-                getLog().error(t);
+                getLog().error(null, t);
             }
         }
 
@@ -875,8 +879,8 @@
         if (time != null)
             elapsed = System.currentTimeMillis() - time.longValue();
 
-        getLog()
-            .info(name + ": " + (time == null ? "???" : "" + elapsed) + "ms");
+        getLog().info(_loc.get("profile-info", name,
+            (time == null ? "???" : "" + elapsed)));
         return elapsed;
     }
 
@@ -1234,9 +1238,10 @@
         long used = total - free;
 
         NumberFormat nf = NumberFormat.getInstance();
-        getLog().warn("memory:" + " used: " + nf.format(used)
-            + " total: " + nf.format(total)
-            + " free: " + nf.format(free));
+        getLog().warn(_loc.get("mem-info",
+            nf.format(used),
+            nf.format(total),
+            nf.format(free)));
     }
 
     /**

Modified: incubator/openjpa/trunk/openjpa-lib/src/test/java/org/apache/openjpa/lib/util/TestLocalizer.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-lib/src/test/java/org/apache/openjpa/lib/util/TestLocalizer.java?rev=429535&r1=429534&r2=429535&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-lib/src/test/java/org/apache/openjpa/lib/util/TestLocalizer.java (original)
+++ incubator/openjpa/trunk/openjpa-lib/src/test/java/org/apache/openjpa/lib/util/TestLocalizer.java Mon Aug  7 18:42:34 2006
@@ -19,6 +19,8 @@
 import junit.framework.TestCase;
 import junit.framework.TestSuite;
 import junit.textui.TestRunner;
+
+import org.apache.openjpa.lib.util.Localizer.Message;
 import org.apache.openjpa.lib.util.testlocalizer.LocalizerTestHelper;
 
 /**
@@ -107,6 +109,10 @@
             fail("No exception for fatal get on missing key.");
         } catch (MissingResourceException mre) {
         }
+    }
+    
+    public static void assertEquals(String s, Message m) {
+        assertEquals(s, m.getMessage());
     }
 
     public static Test suite() {

Modified: incubator/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/ArgumentException.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/ArgumentException.java?rev=429535&r1=429534&r2=429535&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/ArgumentException.java (original)
+++ incubator/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/ArgumentException.java Mon Aug  7 18:42:34 2006
@@ -25,6 +25,8 @@
 import org.apache.openjpa.util.ExceptionInfo;
 import org.apache.openjpa.util.Exceptions;
 
+import org.apache.openjpa.lib.util.Localizer.Message;
+
 /**
  * Extended {@link IllegalArgumentException}.
  *
@@ -46,6 +48,11 @@
         _nested = nested;
         _failed = failed;
         _fatal = fatal;
+    }
+
+    public ArgumentException(Message msg, Throwable[] nested, Object failed,
+        boolean fatal) {
+        this(msg.getMessage(), nested, failed, fatal);
     }
 
     public int getType() {

Modified: incubator/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/ConfigurationProviderImpl.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/ConfigurationProviderImpl.java?rev=429535&r1=429534&r2=429535&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/ConfigurationProviderImpl.java (original)
+++ incubator/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/ConfigurationProviderImpl.java Mon Aug  7 18:42:34 2006
@@ -180,7 +180,7 @@
             String msg = (pinfo == null) ? "missing-xml-config"
                 : "cantload-xml-config";
             throw new MissingResourceException(_loc.get(msg, rsrc,
-                String.valueOf(name)), getClass().getName(), rsrc);
+                String.valueOf(name)).getMessage(), getClass().getName(), rsrc);
         }
         return true;
     }

Modified: incubator/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/EntityManagerImpl.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/EntityManagerImpl.java?rev=429535&r1=429534&r2=429535&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/EntityManagerImpl.java (original)
+++ incubator/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/EntityManagerImpl.java Mon Aug  7 18:42:34 2006
@@ -386,7 +386,8 @@
 
     public boolean getRollbackOnly() {
         if (!isActive())
-            throw new IllegalStateException(_loc.get("no-transaction"));
+            throw new IllegalStateException(_loc.get("no-transaction")
+                .getMessage());
 
         return _broker.getRollbackOnly();
     }

Modified: incubator/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/InvalidStateException.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/InvalidStateException.java?rev=429535&r1=429534&r2=429535&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/InvalidStateException.java (original)
+++ incubator/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/InvalidStateException.java Mon Aug  7 18:42:34 2006
@@ -25,6 +25,7 @@
 import org.apache.openjpa.util.ExceptionInfo;
 import org.apache.openjpa.util.Exceptions;
 import org.apache.openjpa.util.UserException;
+import org.apache.openjpa.lib.util.Localizer.Message;
 
 /**
  * Extended {@link IllegalStateException}.
@@ -40,6 +41,11 @@
     private transient boolean _fatal = false;
     private transient Object _failed = null;
     private transient Throwable[] _nested = null;
+
+    public InvalidStateException(Message msg, Throwable[] nested, Object failed,
+        boolean fatal) {
+        this(msg.getMessage(), nested, failed, fatal);
+    }
 
     public InvalidStateException(String msg, Throwable[] nested, Object failed,
         boolean fatal) {

Modified: incubator/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceExceptions.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceExceptions.java?rev=429535&r1=429534&r2=429535&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceExceptions.java (original)
+++ incubator/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceExceptions.java Mon Aug  7 18:42:34 2006
@@ -168,8 +168,8 @@
         Exception e;
         switch (ke.getSubtype()) {
             case UserException.NO_TRANSACTION:
-                e =
-                    new org.apache.openjpa.persistence.TransactionRequiredException
+                e = new 
+                    org.apache.openjpa.persistence.TransactionRequiredException
                         (ke.getMessage(), getNestedThrowables(ke),
                             getFailedObject(ke), ke.isFatal());
                 break;

Modified: incubator/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceUnitInfoImpl.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceUnitInfoImpl.java?rev=429535&r1=429534&r2=429535&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceUnitInfoImpl.java (original)
+++ incubator/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceUnitInfoImpl.java Mon Aug  7 18:42:34 2006
@@ -215,7 +215,8 @@
                 }
             }
         }
-        throw new IllegalArgumentException(s_loc.get("bad-jar-name", name));
+        throw new IllegalArgumentException(s_loc.get("bad-jar-name", name)
+            .getMessage());
     }
 
     public List<String> getManagedClassNames() {

Modified: incubator/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/QueryImpl.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/QueryImpl.java?rev=429535&r1=429534&r2=429535&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/QueryImpl.java (original)
+++ incubator/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/QueryImpl.java Mon Aug  7 18:42:34 2006
@@ -278,11 +278,11 @@
             Iterator itr = res.iterator();
             if (!itr.hasNext())
                 throw new NoResultException(_loc.get("no-results",
-                    _query.getQueryString()), null, null, false);
+                    _query.getQueryString()).getMessage(), null, null, false);
             Object ret = itr.next();
             if (itr.hasNext())
                 throw new NonUniqueResultException(_loc.get("mult-results",
-                    _query.getQueryString()), null, null, false);
+                    _query.getQueryString()).getMessage(), null, null, false);
             return ret;
         } finally {
             OpenJPAPersistence.close(res);

Modified: incubator/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/TransactionRequiredException.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/TransactionRequiredException.java?rev=429535&r1=429534&r2=429535&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/TransactionRequiredException.java (original)
+++ incubator/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/TransactionRequiredException.java Mon Aug  7 18:42:34 2006
@@ -22,6 +22,7 @@
 import java.io.PrintWriter;
 import java.io.Serializable;
 
+import org.apache.openjpa.lib.util.Localizer.Message;
 import org.apache.openjpa.util.ExceptionInfo;
 import org.apache.openjpa.util.Exceptions;
 import org.apache.openjpa.util.UserException;
@@ -40,6 +41,11 @@
     private transient boolean _fatal = false;
     private transient Object _failed = null;
     private transient Throwable[] _nested = null;
+
+    public TransactionRequiredException(Message msg, Throwable[] nested,
+        Object failed, boolean fatal) {
+        this(msg.getMessage(), nested, failed, fatal);
+    }
 
     public TransactionRequiredException(String msg, Throwable[] nested,
         Object failed, boolean fatal) {



Mime
View raw message