harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r570840 - in /harmony/enhanced/classlib/branches/java6/modules/sql: ./ src/main/java/javax/sql/rowset/RowSetMetaDataImpl.java src/test/java/org/apache/harmony/sql/tests/javax/sql/rowset/RowSetMetaDataImplTest.java src/test/resources/
Date Wed, 29 Aug 2007 15:39:11 GMT
Author: tellison
Date: Wed Aug 29 08:39:10 2007
New Revision: 570840

URL: http://svn.apache.org/viewvc?rev=570840&view=rev
Log:
Fix for HARMONY-4545 ([classlib][sql][java6] javax.sql.rowset.RowSetMetaDataImpl#unWrap(Class<T>)
should not always return null)

Modified:
    harmony/enhanced/classlib/branches/java6/modules/sql/   (props changed)
    harmony/enhanced/classlib/branches/java6/modules/sql/src/main/java/javax/sql/rowset/RowSetMetaDataImpl.java
    harmony/enhanced/classlib/branches/java6/modules/sql/src/test/java/org/apache/harmony/sql/tests/javax/sql/rowset/RowSetMetaDataImplTest.java
    harmony/enhanced/classlib/branches/java6/modules/sql/src/test/resources/   (props changed)

Propchange: harmony/enhanced/classlib/branches/java6/modules/sql/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Wed Aug 29 08:39:10 2007
@@ -1,2 +1,2 @@
-
 bin
+derby.log

Modified: harmony/enhanced/classlib/branches/java6/modules/sql/src/main/java/javax/sql/rowset/RowSetMetaDataImpl.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/sql/src/main/java/javax/sql/rowset/RowSetMetaDataImpl.java?rev=570840&r1=570839&r2=570840&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/sql/src/main/java/javax/sql/rowset/RowSetMetaDataImpl.java
(original)
+++ harmony/enhanced/classlib/branches/java6/modules/sql/src/main/java/javax/sql/rowset/RowSetMetaDataImpl.java
Wed Aug 29 08:39:10 2007
@@ -41,6 +41,8 @@
 
     private static final long serialVersionUID = 6893806403181801867L;
 
+    private static RowSetMetaDataImpl instance = new RowSetMetaDataImpl();
+
     private int colCount;
 
     private ColInfo[] colInfo;
@@ -548,7 +550,8 @@
      * 
      * @see java.sql.Wrapper#unwrap(Class)
      */
+    @SuppressWarnings("unchecked")
     public <T> T unwrap(Class<T> iface) throws SQLException {
-        return null;
+        return (T) instance;
     }
 }

Modified: harmony/enhanced/classlib/branches/java6/modules/sql/src/test/java/org/apache/harmony/sql/tests/javax/sql/rowset/RowSetMetaDataImplTest.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/RowSetMetaDataImplTest.java?rev=570840&r1=570839&r2=570840&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/sql/src/test/java/org/apache/harmony/sql/tests/javax/sql/rowset/RowSetMetaDataImplTest.java
(original)
+++ harmony/enhanced/classlib/branches/java6/modules/sql/src/test/java/org/apache/harmony/sql/tests/javax/sql/rowset/RowSetMetaDataImplTest.java
Wed Aug 29 08:39:10 2007
@@ -1068,6 +1068,23 @@
         SerializationTest.verifyGolden(this, impl, ROWSET_METADATA_COMPARATOR);
     }
 
+    /**
+     *  @test {@link javax.sql.rowset.RowSetMetaDataImpl#unWrap(Class<T>)}
+     */
+    public void test_unWrap_CClass() throws Exception {
+        Object o = metaDataImpl.unwrap(Integer.class);
+        assertNotNull(o);
+        assertTrue(o instanceof RowSetMetaDataImpl);
+        
+        o = metaDataImpl.unwrap(Comparable.class);
+        assertNotNull(o);
+        assertTrue(o instanceof RowSetMetaDataImpl);
+        
+        o = metaDataImpl.unwrap(null);
+        assertNotNull(o);
+        assertTrue(o instanceof RowSetMetaDataImpl);
+    }
+    
     @Override
     protected void setUp() throws Exception {
         super.setUp();

Propchange: harmony/enhanced/classlib/branches/java6/modules/sql/src/test/resources/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Wed Aug 29 08:39:10 2007
@@ -0,0 +1 @@
+TESTDB



Mime
View raw message