harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r583297 - in /harmony/enhanced/classlib/branches/java6/modules/sql/src: main/java/javax/sql/rowset/serial/SerialBlob.java test/java/org/apache/harmony/sql/tests/javax/sql/rowset/serial/SerialBlobTest.java
Date Tue, 09 Oct 2007 20:54:18 GMT
Author: tellison
Date: Tue Oct  9 13:54:17 2007
New Revision: 583297

URL: http://svn.apache.org/viewvc?rev=583297&view=rev
Log:
Apply patch HARMONY-4548 ([classlib][sql][java6] compatible problems with ri in javax.sql.rowset.serial.SerialBlob)

Modified:
    harmony/enhanced/classlib/branches/java6/modules/sql/src/main/java/javax/sql/rowset/serial/SerialBlob.java
    harmony/enhanced/classlib/branches/java6/modules/sql/src/test/java/org/apache/harmony/sql/tests/javax/sql/rowset/serial/SerialBlobTest.java

Modified: harmony/enhanced/classlib/branches/java6/modules/sql/src/main/java/javax/sql/rowset/serial/SerialBlob.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/sql/src/main/java/javax/sql/rowset/serial/SerialBlob.java?rev=583297&r1=583296&r2=583297&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/sql/src/main/java/javax/sql/rowset/serial/SerialBlob.java
(original)
+++ harmony/enhanced/classlib/branches/java6/modules/sql/src/main/java/javax/sql/rowset/serial/SerialBlob.java
Tue Oct  9 13:54:17 2007
@@ -235,7 +235,7 @@
     }
 
     public void free() throws SQLException {
-        throw new SQLFeatureNotSupportedException();
+        throw new UnsupportedOperationException("Not supported");
     }
 
     public InputStream getBinaryStream(long pos, long length)
@@ -246,6 +246,6 @@
         if (pos < 1 || pos + length > len) {
             throw new SerialException(Messages.getString("sql.22"));
         }
-        return new ByteArrayInputStream(buf, (int) pos, (int) length);
+        return new ByteArrayInputStream(buf, (int) (pos - 1), (int) length);
     }
 }

Modified: harmony/enhanced/classlib/branches/java6/modules/sql/src/test/java/org/apache/harmony/sql/tests/javax/sql/rowset/serial/SerialBlobTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/sql/src/test/java/org/apache/harmony/sql/tests/javax/sql/rowset/serial/SerialBlobTest.java?rev=583297&r1=583296&r2=583297&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/sql/src/test/java/org/apache/harmony/sql/tests/javax/sql/rowset/serial/SerialBlobTest.java
(original)
+++ harmony/enhanced/classlib/branches/java6/modules/sql/src/test/java/org/apache/harmony/sql/tests/javax/sql/rowset/serial/SerialBlobTest.java
Tue Oct  9 13:54:17 2007
@@ -22,7 +22,6 @@
 import java.io.OutputStream;
 import java.sql.Blob;
 import java.sql.SQLException;
-import java.sql.SQLFeatureNotSupportedException;
 import java.util.Arrays;
 
 import javax.sql.rowset.serial.SerialBlob;
@@ -357,8 +356,8 @@
         SerialBlob serialBlob = new SerialBlob(mockBlob);
         try {
             serialBlob.free();
-            fail("should throw SQLFeatureNotSupportedException");
-        } catch (SQLFeatureNotSupportedException e) {
+            fail("should throw UnsupportedOperationException");
+        } catch (UnsupportedOperationException e) {
             // expected
         }
     }
@@ -393,7 +392,7 @@
             if (i > 4) {
                 fail("returned input stream contains too much data");
             }
-            assertEquals(buf[2 + i++], b);
+            assertEquals(buf[1 + i++], b);
         }
     }
 



Mime
View raw message