jakarta-bsf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r925045 - in /jakarta/bsf/branches/bsf3.x: RELEASE_NOTES bsf-api/src/main/java/javax/script/ScriptException.java bsf-api/src/test/java/org/apache/bsf/ScriptExceptionTest.java
Date Thu, 18 Mar 2010 23:46:32 GMT
Author: sebb
Date: Thu Mar 18 23:46:32 2010
New Revision: 925045

URL: http://svn.apache.org/viewvc?rev=925045&view=rev
Log:
BSF-29 ScriptException constructed via chained constructor ScriptException(Exception) always
returns String "null" for getMessage()

Modified:
    jakarta/bsf/branches/bsf3.x/RELEASE_NOTES
    jakarta/bsf/branches/bsf3.x/bsf-api/src/main/java/javax/script/ScriptException.java
    jakarta/bsf/branches/bsf3.x/bsf-api/src/test/java/org/apache/bsf/ScriptExceptionTest.java

Modified: jakarta/bsf/branches/bsf3.x/RELEASE_NOTES
URL: http://svn.apache.org/viewvc/jakarta/bsf/branches/bsf3.x/RELEASE_NOTES?rev=925045&r1=925044&r2=925045&view=diff
==============================================================================
--- jakarta/bsf/branches/bsf3.x/RELEASE_NOTES (original)
+++ jakarta/bsf/branches/bsf3.x/RELEASE_NOTES Thu Mar 18 23:46:32 2010
@@ -1,5 +1,5 @@
-Apache BSF 3 Beta3 Release Notes
---------------------------------
+Apache BSF 3.1 Release Notes
+----------------------------
 
 Apache BSF 3 is an open-source implementation of JSR-223, 
          "Scripting for the Java Platform".
@@ -12,8 +12,8 @@ Apache BSF 3 is an open-source implement
 
 However, the implementation is believed to be complete.
 
-* BSF-3.0 is not compatible with BSF-2.4 - the API is completely different.
-* BSF-3.0 can be deployed and used on Java 1.4+ - it does not require Java 1.6
+* BSF-3.x is not compatible with BSF-2.4 - the API is completely different.
+* BSF-3.x can be deployed and used on Java 1.4+ - it does not require Java 1.6
 
 Incomplete packages
 -------------------
@@ -24,8 +24,13 @@ They are not needed in order to use the 
 Changes from previous releases
 ------------------------------
 
-This 3.0 release is a maintenance release update to support the latest releases
-of various script language engines.
+This 3.1 release is a maintenance release update to fix a few bugs.
+
+Compared with 3.0, the 3.1 release fixes the following:
+* BSF-29 ScriptException constructed via chained constructor 
+  ScriptException(Exception) always returns String "null" for getMessage()
+
+----
 
 Compared with 3.0-beta3, the 3.0 release fixes the following:
 * updated test application.

Modified: jakarta/bsf/branches/bsf3.x/bsf-api/src/main/java/javax/script/ScriptException.java
URL: http://svn.apache.org/viewvc/jakarta/bsf/branches/bsf3.x/bsf-api/src/main/java/javax/script/ScriptException.java?rev=925045&r1=925044&r2=925045&view=diff
==============================================================================
--- jakarta/bsf/branches/bsf3.x/bsf-api/src/main/java/javax/script/ScriptException.java (original)
+++ jakarta/bsf/branches/bsf3.x/bsf-api/src/main/java/javax/script/ScriptException.java Thu
Mar 18 23:46:32 2010
@@ -43,20 +43,16 @@ public class ScriptException extends Exc
      */
     private final int columnNumber; // default = -1;
 
-    /** Stores the message which describes the cause of error */
-    private final String message; // default null
-
     /**
      * Constructs a new exception with the specified cause.
      * 
      * @param exception the cause of exception
      */
     public ScriptException(Exception exception) {
-              super(exception);
-            this.message = null;
-            this.fileName = null;
-            this.lineNumber = -1;
-            this.columnNumber = -1;
+        super(exception);
+        this.fileName = null;
+        this.lineNumber = -1;
+        this.columnNumber = -1;
     }
 
     /**
@@ -100,7 +96,6 @@ public class ScriptException extends Exc
      */
     public ScriptException(String message, String fileName, int lineNumber, int columnNumber)
{
         super(message);
-        this.message = message;
         this.fileName = fileName;
         this.lineNumber = lineNumber;
         this.columnNumber = columnNumber;
@@ -144,7 +139,7 @@ public class ScriptException extends Exc
      */
     public String getMessage(){
         StringBuffer buffer = new StringBuffer();
-        buffer.append(message);
+        buffer.append(super.getMessage());
         if (fileName != null) {
             buffer.append("in: " + fileName);
         }

Modified: jakarta/bsf/branches/bsf3.x/bsf-api/src/test/java/org/apache/bsf/ScriptExceptionTest.java
URL: http://svn.apache.org/viewvc/jakarta/bsf/branches/bsf3.x/bsf-api/src/test/java/org/apache/bsf/ScriptExceptionTest.java?rev=925045&r1=925044&r2=925045&view=diff
==============================================================================
--- jakarta/bsf/branches/bsf3.x/bsf-api/src/test/java/org/apache/bsf/ScriptExceptionTest.java
(original)
+++ jakarta/bsf/branches/bsf3.x/bsf-api/src/test/java/org/apache/bsf/ScriptExceptionTest.java
Thu Mar 18 23:46:32 2010
@@ -78,4 +78,11 @@ public class ScriptExceptionTest extends
             assertFalse(-1 == message.indexOf(""+30));
         }
     }
+
+    public void testBSF29(){
+        final Exception exception = new Exception("exception message");
+        final String expectedMessage =exception.toString();
+        final Exception scriptException = new ScriptException(exception);
+        assertEquals(expectedMessage, scriptException.getMessage());
+    }
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: bsf-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: bsf-dev-help@jakarta.apache.org


Mime
View raw message