db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kahat...@apache.org
Subject svn commit: r1088491 - /db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/RAFContainer.java
Date Mon, 04 Apr 2011 07:49:09 GMT
Author: kahatlen
Date: Mon Apr  4 07:49:09 2011
New Revision: 1088491

URL: http://svn.apache.org/viewvc?rev=1088491&view=rev
Log:
DERBY-5073: RAFContainer.privGetRandomAccessFile() unwraps wrong exception type

Made run() wrap IOExceptions in StandardExceptions to prevent ClassCastException in the error
handler.

Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/RAFContainer.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/RAFContainer.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/RAFContainer.java?rev=1088491&r1=1088490&r2=1088491&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/RAFContainer.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/RAFContainer.java
Mon Apr  4 07:49:09 2011
@@ -54,6 +54,7 @@ import java.util.Vector;
 import java.io.DataInput;
 import java.io.IOException;
 import java.io.File;
+import java.io.FileNotFoundException;
 import java.io.RandomAccessFile;
 import java.security.AccessController;
 import java.security.PrivilegedExceptionAction;
@@ -1373,7 +1374,7 @@ class RAFContainer extends FileContainer
 
 
      // PrivilegedExceptionAction method
-    public Object run() throws StandardException, IOException
+    public Object run() throws StandardException
      {
          switch( actionCode)
          {
@@ -1686,7 +1687,15 @@ class RAFContainer extends FileContainer
 		 } // end of case BACKUP_CONTAINER_ACTION
 
          case GET_RANDOM_ACCESS_FILE_ACTION: {
-             return actionFile.getRandomAccessFile("rw");
+             try
+             {
+                 return actionFile.getRandomAccessFile("rw");
+             }
+             catch (FileNotFoundException fnfe)
+             {
+                 throw StandardException.newException(
+                     SQLState.FILE_CREATE, fnfe, actionFile.getPath());
+             }
 		 } // end of case BACKUP_CONTAINER_ACTION
 
 		 



Mime
View raw message