geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vamsic...@apache.org
Subject svn commit: r482713 - in /geronimo/specs: branches/1_1/geronimo-spec-j2ee-connector/src/main/java/javax/resource/ branches/1_1/geronimo-spec-j2ee-connector/src/test/java/javax/resource/ trunk/geronimo-j2ee-connector_1.5_spec/src/main/java/javax/resourc...
Date Tue, 05 Dec 2006 17:10:38 GMT
Author: vamsic007
Date: Tue Dec  5 09:10:35 2006
New Revision: 482713

URL: http://svn.apache.org/viewvc?view=rev&rev=482713
Log:
GERONIMO-1519 ResourceException.toString() can return null
  o Fixes toString() to return non-null string

Modified:
    geronimo/specs/branches/1_1/geronimo-spec-j2ee-connector/src/main/java/javax/resource/ResourceException.java
    geronimo/specs/branches/1_1/geronimo-spec-j2ee-connector/src/test/java/javax/resource/ResourceExceptionTest.java
    geronimo/specs/trunk/geronimo-j2ee-connector_1.5_spec/src/main/java/javax/resource/ResourceException.java
    geronimo/specs/trunk/geronimo-j2ee-connector_1.5_spec/src/test/java/javax/resource/ResourceExceptionTest.java

Modified: geronimo/specs/branches/1_1/geronimo-spec-j2ee-connector/src/main/java/javax/resource/ResourceException.java
URL: http://svn.apache.org/viewvc/geronimo/specs/branches/1_1/geronimo-spec-j2ee-connector/src/main/java/javax/resource/ResourceException.java?view=diff&rev=482713&r1=482712&r2=482713
==============================================================================
--- geronimo/specs/branches/1_1/geronimo-spec-j2ee-connector/src/main/java/javax/resource/ResourceException.java
(original)
+++ geronimo/specs/branches/1_1/geronimo-spec-j2ee-connector/src/main/java/javax/resource/ResourceException.java
Tue Dec  5 09:10:35 2006
@@ -79,6 +79,8 @@
 
     public String toString() {
         // unit tests revealed that the errorCode is not included
-        return getMessage();
+        String className = getClass().getName();
+        String msg = getMessage();
+        return msg != null ? className + ": "+msg : className;
     }
 }

Modified: geronimo/specs/branches/1_1/geronimo-spec-j2ee-connector/src/test/java/javax/resource/ResourceExceptionTest.java
URL: http://svn.apache.org/viewvc/geronimo/specs/branches/1_1/geronimo-spec-j2ee-connector/src/test/java/javax/resource/ResourceExceptionTest.java?view=diff&rev=482713&r1=482712&r2=482713
==============================================================================
--- geronimo/specs/branches/1_1/geronimo-spec-j2ee-connector/src/test/java/javax/resource/ResourceExceptionTest.java
(original)
+++ geronimo/specs/branches/1_1/geronimo-spec-j2ee-connector/src/test/java/javax/resource/ResourceExceptionTest.java
Tue Dec  5 09:10:35 2006
@@ -54,9 +54,9 @@
 
     public void testToString() {
         ResourceException exception = new ResourceException("problem");
-        assertEquals("problem", exception.toString());
+        assertEquals(ResourceException.class.getName()+": "+"problem", exception.toString());
 
         ResourceException other = new ResourceException("other problem", "123");
-        assertEquals("other problem", other.toString());
+        assertEquals(ResourceException.class.getName()+": "+"other problem", other.toString());
     }
 }

Modified: geronimo/specs/trunk/geronimo-j2ee-connector_1.5_spec/src/main/java/javax/resource/ResourceException.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-j2ee-connector_1.5_spec/src/main/java/javax/resource/ResourceException.java?view=diff&rev=482713&r1=482712&r2=482713
==============================================================================
--- geronimo/specs/trunk/geronimo-j2ee-connector_1.5_spec/src/main/java/javax/resource/ResourceException.java
(original)
+++ geronimo/specs/trunk/geronimo-j2ee-connector_1.5_spec/src/main/java/javax/resource/ResourceException.java
Tue Dec  5 09:10:35 2006
@@ -78,6 +78,8 @@
 
     public String toString() {
         // unit tests revealed that the errorCode is not included
-        return getMessage();
+        String className = getClass().getName();
+        String msg = getMessage();
+        return msg != null ? className + ": "+msg : className;
     }
 }

Modified: geronimo/specs/trunk/geronimo-j2ee-connector_1.5_spec/src/test/java/javax/resource/ResourceExceptionTest.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-j2ee-connector_1.5_spec/src/test/java/javax/resource/ResourceExceptionTest.java?view=diff&rev=482713&r1=482712&r2=482713
==============================================================================
--- geronimo/specs/trunk/geronimo-j2ee-connector_1.5_spec/src/test/java/javax/resource/ResourceExceptionTest.java
(original)
+++ geronimo/specs/trunk/geronimo-j2ee-connector_1.5_spec/src/test/java/javax/resource/ResourceExceptionTest.java
Tue Dec  5 09:10:35 2006
@@ -53,9 +53,9 @@
 
     public void testToString() {
         ResourceException exception = new ResourceException("problem");
-        assertEquals("problem", exception.toString());
+        assertEquals(ResourceException.class.getName()+": "+"problem", exception.toString());
 
         ResourceException other = new ResourceException("other problem", "123");
-        assertEquals("other problem", other.toString());
+        assertEquals(ResourceException.class.getName()+": "+"other problem", other.toString());
     }
 }



Mime
View raw message