harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From py...@apache.org
Subject svn commit: r438803 - in /incubator/harmony/enhanced/classlib/trunk/modules/sql: ./ src/main/java/java/sql/ src/main/java/org/apache/harmony/sql/internal/nls/ src/test/java/org/apache/harmony/sql/tests/java/sql/ src/test/resources/serialization/org/apa...
Date Thu, 31 Aug 2006 05:25:49 GMT
Author: pyang
Date: Wed Aug 30 22:25:49 2006
New Revision: 438803

URL: http://svn.apache.org/viewvc?rev=438803&view=rev
Log:
Patch applied for HARMONY-1345 ([classlib][sql] java.sql.SQLWarning#setNextWarning(SQLWarning
ex) should add the SQLWarning ex to the end of the SQLWarning chain rather than replacing
the next exception directly)

Added:
    incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/resources/serialization/org/apache/harmony/sql/tests/java/sql/SQLWarningTest.golden.ser
  (with props)
Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/sql/.classpath
    incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/java/sql/SQLWarning.java
    incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/org/apache/harmony/sql/internal/nls/messages.properties
    incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/SQLWarningTest.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/sql/.classpath
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sql/.classpath?rev=438803&r1=438802&r2=438803&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sql/.classpath (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sql/.classpath Wed Aug 30 22:25:49 2006
@@ -2,6 +2,7 @@
 <classpath>
 	<classpathentry path="src/main/java" kind="src" output="bin/main"/>
 	<classpathentry path="src/test/java" kind="src" output="bin/test"/>
+	<classpathentry path="src/test/resources"  kind="src" output="bin/test"/>
 	<classpathentry path="org.eclipse.pde.core.requiredPlugins" kind="con"/>
 	<classpathentry path="JUNIT_HOME/junit.jar" kind="var" sourcepath="JUNIT_SRC_HOME/junitsrc.zip"/>
 	<classpathentry path="bin/main" kind="output"/>

Modified: incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/java/sql/SQLWarning.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/java/sql/SQLWarning.java?rev=438803&r1=438802&r2=438803&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/java/sql/SQLWarning.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/java/sql/SQLWarning.java
Wed Aug 30 22:25:49 2006
@@ -1,4 +1,4 @@
-/* Copyright 2004 The Apache Software Foundation or its licensors, as applicable
+/* Copyright 2004, 2006 The Apache Software Foundation or its licensors, as applicable
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -17,6 +17,8 @@
 
 import java.io.Serializable;
 
+import org.apache.harmony.sql.internal.nls.Messages;
+
 /**
  * An exception class that holds information about Database access warnings.
  */
@@ -24,8 +26,6 @@
 
     private static final long serialVersionUID = 3917336774604784856L;
 
-    private SQLWarning chainedWarning = null;
-
     /**
      * Creates an SQLWarning object. The Reason string is set to null, the
      * SQLState string is set to null and the Error Code is set to 0.
@@ -79,7 +79,14 @@
      *         is chained to this SQLWarning.
      */
     public SQLWarning getNextWarning() {
-        return chainedWarning;
+        SQLException next = super.getNextException();
+        if (next == null) {
+            return null;
+        }
+        if (next instanceof SQLWarning) {
+            return (SQLWarning) next;
+        }
+        throw new Error(Messages.getString("sql.8")); //$NON-NLS-1$
     }
 
     /**
@@ -89,7 +96,6 @@
      *            the SQLWarning to chain to this SQLWarning.
      */
     public void setNextWarning(SQLWarning w) {
-        chainedWarning = w;
-        return;
+        super.setNextException(w);
     }
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/org/apache/harmony/sql/internal/nls/messages.properties
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/org/apache/harmony/sql/internal/nls/messages.properties?rev=438803&r1=438802&r2=438803&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/org/apache/harmony/sql/internal/nls/messages.properties
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/org/apache/harmony/sql/internal/nls/messages.properties
Wed Aug 30 22:25:49 2006
@@ -22,3 +22,4 @@
 sql.5=The url cannot be null
 sql.6=No suitable driver
 sql.7=Userid and/or password not supplied
+sql.8=SQLWarning chain holds value that is not a SQLWarning

Modified: incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/SQLWarningTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/SQLWarningTest.java?rev=438803&r1=438802&r2=438803&view=diff
==============================================================================
Binary files /tmp/tmpMaoAnt and /tmp/tmpLrOCWT differ

Added: incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/resources/serialization/org/apache/harmony/sql/tests/java/sql/SQLWarningTest.golden.ser
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/resources/serialization/org/apache/harmony/sql/tests/java/sql/SQLWarningTest.golden.ser?rev=438803&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/resources/serialization/org/apache/harmony/sql/tests/java/sql/SQLWarningTest.golden.ser
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream



Mime
View raw message