You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jdo-commits@db.apache.org by mb...@apache.org on 2005/04/12 10:22:56 UTC

svn commit: r161034 - in incubator/jdo/trunk/ri11/src/java/org/apache/jdo/util: I18NHelper.java JDOJdk14Logger.java JDORIVersion.java Pool.java

Author: mbo
Date: Tue Apr 12 01:22:54 2005
New Revision: 161034

URL: http://svn.apache.org/viewcvs?view=rev&rev=161034
Log:
Remove dependencies of util classes on exception classes from javax.jdo

Modified:
    incubator/jdo/trunk/ri11/src/java/org/apache/jdo/util/I18NHelper.java
    incubator/jdo/trunk/ri11/src/java/org/apache/jdo/util/JDOJdk14Logger.java
    incubator/jdo/trunk/ri11/src/java/org/apache/jdo/util/JDORIVersion.java
    incubator/jdo/trunk/ri11/src/java/org/apache/jdo/util/Pool.java

Modified: incubator/jdo/trunk/ri11/src/java/org/apache/jdo/util/I18NHelper.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/ri11/src/java/org/apache/jdo/util/I18NHelper.java?view=diff&r1=161033&r2=161034
==============================================================================
--- incubator/jdo/trunk/ri11/src/java/org/apache/jdo/util/I18NHelper.java (original)
+++ incubator/jdo/trunk/ri11/src/java/org/apache/jdo/util/I18NHelper.java Tue Apr 12 01:22:54 2005
@@ -21,12 +21,10 @@
 import java.security.AccessController;
 import java.security.PrivilegedAction;
 
-import javax.jdo.JDOFatalInternalException;
-
 /** Helper class for constructing messages from bundles.  The intended usage
  * of this class is to construct a new instance bound to a bundle, as in
  * <P>
- * <code>I18NHelper msg = I18NHelper.getInstance("javax.jdo.Bundle");</code>
+ * <code>I18NHelper msg = I18NHelper.getInstance("org.apache.jdo.util.jdo.Bundle");</code>
  * <P>
  * This call uses the class loader that loaded the I18NHelper class to find
  * the specified Bundle. The class provides two overloaded getInstance
@@ -229,14 +227,14 @@
     /** Assert resources available
      * @param key the message key 
      * @since 1.0.2
-     * @throws JDOFatalInternalException if the resource bundle could not
+     * @throws RuntimeException if the resource bundle could not
      * be loaded during construction.
      */
     private void assertBundle (String key) {
         if (failure != null)
-            throw new JDOFatalInternalException (
+            throw new RuntimeException (
                 "No resources could be found to annotate error message key:\"" + 
-                key + "\"", failure);
+                key + "\" " + failure);
     }
 
     /**

Modified: incubator/jdo/trunk/ri11/src/java/org/apache/jdo/util/JDOJdk14Logger.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/ri11/src/java/org/apache/jdo/util/JDOJdk14Logger.java?view=diff&r1=161033&r2=161034
==============================================================================
--- incubator/jdo/trunk/ri11/src/java/org/apache/jdo/util/JDOJdk14Logger.java (original)
+++ incubator/jdo/trunk/ri11/src/java/org/apache/jdo/util/JDOJdk14Logger.java Tue Apr 12 01:22:54 2005
@@ -24,8 +24,6 @@
 
 import java.util.logging.LogManager;
 
-import javax.jdo.JDOFatalUserException;
-
 import org.apache.commons.logging.impl.Jdk14Logger;
 
 /**
@@ -77,14 +75,14 @@
                     return null;
                 }
                 catch (IOException ex) {
-                    throw new JDOFatalUserException(
+                    throw new RuntimeException(
                         msg.msg("EXC_LoggerSetupIOException", //NOI18N
-                                PROPERIES_FILE), ex); 
+                                PROPERIES_FILE) + ex); 
                 }
                 catch (SecurityException ex) {
-                    throw new JDOFatalUserException(
+                    throw new RuntimeException(
                         msg.msg("EXC_LoggerSetupSecurityException", // NOI18N
-                                PROPERIES_FILE), ex);
+                                PROPERIES_FILE) + ex);
                 }
             }
             });

Modified: incubator/jdo/trunk/ri11/src/java/org/apache/jdo/util/JDORIVersion.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/ri11/src/java/org/apache/jdo/util/JDORIVersion.java?view=diff&r1=161033&r2=161034
==============================================================================
--- incubator/jdo/trunk/ri11/src/java/org/apache/jdo/util/JDORIVersion.java (original)
+++ incubator/jdo/trunk/ri11/src/java/org/apache/jdo/util/JDORIVersion.java Tue Apr 12 01:22:54 2005
@@ -31,9 +31,6 @@
 import java.text.DateFormat;
 import java.text.SimpleDateFormat;
 
-
-import javax.jdo.JDOException;
-
 /**
  * Helper class to handle properties object with version number and vendor name.
  *
@@ -98,7 +95,7 @@
             temp_properties.load(in);
             in.close();
         } catch (java.io.IOException e) {
-            throw new JDOException(null, e);
+            throw new RuntimeException(e.toString());
         }
     
         _properties = new Properties();

Modified: incubator/jdo/trunk/ri11/src/java/org/apache/jdo/util/Pool.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/ri11/src/java/org/apache/jdo/util/Pool.java?view=diff&r1=161033&r2=161034
==============================================================================
--- incubator/jdo/trunk/ri11/src/java/org/apache/jdo/util/Pool.java (original)
+++ incubator/jdo/trunk/ri11/src/java/org/apache/jdo/util/Pool.java Tue Apr 12 01:22:54 2005
@@ -18,9 +18,6 @@
 
 import java.util.Stack;
 
-import javax.jdo.JDOFatalInternalException;
-import javax.jdo.JDOUserException;
-
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
@@ -84,7 +81,7 @@
                test.debug("Pool: count " + count + // NOI18N
                             " out of range 0-" + size); // NOI18N
            }
-           throw new JDOFatalInternalException(
+           throw new RuntimeException(
                msg.msg(
                    "EXC_CountOutOfRange", // NOI18N
                    new Integer(count).toString(),
@@ -95,7 +92,7 @@
            if (debug) {
                test.debug("Pool: duplicate object"); // NOI18N
            }
-           throw new JDOFatalInternalException(
+           throw new RuntimeException(
                msg.msg(
                    "EXC_DuplicateObject", o)); // NOI18N
        }
@@ -116,7 +113,7 @@
      * available, waits until one is.  The waiting is governed by two
      * variables, which are currently fixed: waitMillis and waitNumber.
      * If no object is available from the pool within (waitNumber) times
-     * (waitMillis) milliseconds, then a JDOUserException is thrown.
+     * (waitMillis) milliseconds, then a RuntimeException is thrown.
      * In future, the waitMillis and waitNumber should be configurable.
      * @return An object from the pool.
      */
@@ -129,7 +126,7 @@
                 test.debug("Pool: count " + count + // NOI18N
                            " out of range 0-" + size); // NOI18N
             }
-            throw new JDOFatalInternalException(
+            throw new RuntimeException(
                 msg.msg(
                     "EXC_CountOutOfRange", // NOI18N
                     new Integer(count).toString(),
@@ -144,7 +141,7 @@
             wait(waitMillis);
         }
         if (timeouts >= waitNumber) {
-            throw new JDOUserException(
+            throw new RuntimeException(
                 msg.msg("EXC_PoolGetTimeout")); // NOI18N
         }
         rc = stack.pop();