harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From py...@apache.org
Subject svn commit: r553732 - in /harmony/enhanced/classlib/branches/java6/modules: awt/make/ awt/src/main/java/common/java/awt/ awt/src/main/java/common/org/apache/harmony/awt/gl/ awt/src/main/java/common/org/apache/harmony/awt/wtk/ beans/src/main/java/java/b...
Date Fri, 06 Jul 2007 05:09:59 GMT
Author: pyang
Date: Thu Jul  5 22:09:57 2007
New Revision: 553732

URL: http://svn.apache.org/viewvc?view=rev&rev=553732
Log:
Merge updates from classlib trunk@553714 since r552679

Added:
    harmony/enhanced/classlib/branches/java6/modules/beans/src/test/resources/serialization/org/apache/harmony/beans/tests/java/beans/beancontext/BeanContextEventTest.golden.ser
      - copied unchanged from r553714, harmony/enhanced/classlib/trunk/modules/beans/src/test/resources/serialization/org/apache/harmony/beans/tests/java/beans/beancontext/BeanContextEventTest.golden.ser
    harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/InputStreamTest.java
      - copied unchanged from r553714, harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/tests/api/java/io/InputStreamTest.java
    harmony/enhanced/classlib/branches/java6/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/TestMainForDriver.java
      - copied unchanged from r553714, harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/TestMainForDriver.java
Modified:
    harmony/enhanced/classlib/branches/java6/modules/awt/make/exclude.linux.x86_64.drl
    harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/common/java/awt/ToolkitImpl.java
    harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/common/org/apache/harmony/awt/gl/CommonGraphics2DFactory.java
    harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/common/org/apache/harmony/awt/wtk/GraphicsFactory.java
    harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/beancontext/BeanContextServicesSupport.java
    harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/beancontext/BeanContextSupport.java
    harmony/enhanced/classlib/branches/java6/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/beancontext/BeanContextEventTest.java
    harmony/enhanced/classlib/branches/java6/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/beancontext/BeanContextServicesSupportTest.java
    harmony/enhanced/classlib/branches/java6/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/beancontext/BeanContextSupportTest.java
    harmony/enhanced/classlib/branches/java6/modules/luni/.classpath
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/InputStream.java
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/LineNumberReader.java
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/OutputStream.java
    harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/io/ObjectInputStreamTest.java
    harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/ByteArrayOutputStreamTest.java
    harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/DataInputStreamTest.java
    harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/InputStreamReaderTest.java
    harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/LineNumberInputStreamTest.java
    harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/LineNumberReaderTest.java
    harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/NotActiveExceptionTest.java
    harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/ObjectInputStreamTest.java
    harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/ObjectOutputStreamTest.java
    harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/ObjectStreamFieldTest.java
    harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/PipedInputStreamTest.java
    harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/PipedOutputStreamTest.java
    harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/SequenceInputStreamTest.java
    harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/SerializationStressTest.java
    harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/SerializationStressTest1.java
    harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/SerializationStressTest2.java
    harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/SerializationStressTest3.java
    harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/SerializationStressTest4.java
    harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/SerializationStressTest5.java
    harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/StreamTokenizerTest.java
    harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/StringBufferInputStreamTest.java
    harmony/enhanced/classlib/branches/java6/modules/sql/META-INF/MANIFEST.MF
    harmony/enhanced/classlib/branches/java6/modules/sql/src/main/java/java/sql/DriverManager.java
    harmony/enhanced/classlib/branches/java6/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/DriverManagerTest.java

Modified: harmony/enhanced/classlib/branches/java6/modules/awt/make/exclude.linux.x86_64.drl
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/awt/make/exclude.linux.x86_64.drl?view=diff&rev=553732&r1=553731&r2=553732
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/awt/make/exclude.linux.x86_64.drl (original)
+++ harmony/enhanced/classlib/branches/java6/modules/awt/make/exclude.linux.x86_64.drl Thu Jul  5 22:09:57 2007
@@ -16,3 +16,6 @@
 
 #HARMONY-4181
 java/awt/geom/AreaTest.java
+
+#HARMONY-4307
+org/apache/harmony/awt/ListenerListTest.java

Modified: harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/common/java/awt/ToolkitImpl.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/common/java/awt/ToolkitImpl.java?view=diff&rev=553732&r1=553731&r2=553732
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/common/java/awt/ToolkitImpl.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/common/java/awt/ToolkitImpl.java Thu Jul  5 22:09:57 2007
@@ -31,6 +31,7 @@
 import java.util.Hashtable;
 import java.util.Map;
 import java.util.Properties;
+import org.apache.harmony.awt.gl.font.FontMetricsImpl;
 import org.apache.harmony.awt.datatransfer.DTK;
 import org.apache.harmony.awt.gl.*;
 import org.apache.harmony.awt.gl.image.*;
@@ -38,6 +39,8 @@
 class ToolkitImpl extends Toolkit {
     static final Hashtable<Serializable, Image> imageCache = new Hashtable<Serializable, Image>();
 
+    static final FontMetrics cacheFM[] =  new FontMetrics[10];
+
     @Override
     public void sync() {
         lockAWT();
@@ -126,13 +129,37 @@
         }
     }
 
+    /**
+     * Returns FontMetrics object that keeps metrics of the specified font.
+     * 
+     * @param font specified Font
+     * @return FontMetrics object corresponding to the specified Font object
+     */
     @SuppressWarnings("deprecation")
     @Override
     @Deprecated
     public FontMetrics getFontMetrics(Font font) {
         lockAWT();
         try {
-            return getGraphicsFactory().getFontMetrics(font);
+            FontMetrics fm;
+            for (FontMetrics element : cacheFM) {
+                fm = element;
+                if (fm == null){
+                    break;
+                }
+
+                if (fm.getFont().equals(font)){
+                    return fm;
+                }
+            }
+            fm = new FontMetricsImpl(font);
+
+            System.arraycopy(cacheFM, 0, cacheFM, 1, cacheFM.length -1);
+            cacheFM[0] = fm;
+
+            return fm;
+
+//            return getGraphicsFactory().getFontMetrics(font);
         } finally {
             unlockAWT();
         }

Modified: harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/common/org/apache/harmony/awt/gl/CommonGraphics2DFactory.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/common/org/apache/harmony/awt/gl/CommonGraphics2DFactory.java?view=diff&rev=553732&r1=553731&r2=553732
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/common/org/apache/harmony/awt/gl/CommonGraphics2DFactory.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/common/org/apache/harmony/awt/gl/CommonGraphics2DFactory.java Thu Jul  5 22:09:57 2007
@@ -24,7 +24,6 @@
 import java.awt.FontMetrics;
 import java.awt.peer.FontPeer;
 
-import org.apache.harmony.awt.gl.font.FontMetricsImpl;
 import org.apache.harmony.awt.wtk.GraphicsFactory;
 
 /**
@@ -36,33 +35,7 @@
     // static instance of CommonGraphics2DFactory
     public static CommonGraphics2DFactory inst;
 
-    /**
-     * Returns FontMetrics object that keeps metrics of the specified font.
-     * 
-     * @param font specified Font
-     * @return FontMetrics object corresponding to the specified Font object
-     */
-    public FontMetrics getFontMetrics(Font font) {
-        FontMetrics fm;
-        for (FontMetrics element : cacheFM) {
-            fm = element;
-            if (fm == null){
-                break;
-            }
-
-            if (fm.getFont().equals(font)){
-                return fm;
-            }
-        }
-        fm = new FontMetricsImpl(font);
-
-        System.arraycopy(cacheFM, 0, cacheFM, 1, cacheFM.length -1);
-        cacheFM[0] = fm;
-
-        return fm;
-    }
     // Font methods
-
     public FontPeer getFontPeer(Font font) {
         return getFontManager().getFontPeer(font.getName(), font.getStyle(), font.getSize());
     }

Modified: harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/common/org/apache/harmony/awt/wtk/GraphicsFactory.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/common/org/apache/harmony/awt/wtk/GraphicsFactory.java?view=diff&rev=553732&r1=553731&r2=553732
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/common/org/apache/harmony/awt/wtk/GraphicsFactory.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/common/org/apache/harmony/awt/wtk/GraphicsFactory.java Thu Jul  5 22:09:57 2007
@@ -34,7 +34,6 @@
  * and font stuff instances factories.
  */
 public interface GraphicsFactory {
-    static final FontMetrics cacheFM[] =  new FontMetrics[10];
     
     /**
      * This method creates Graphics2D instance for specified native window.
@@ -70,7 +69,6 @@
     GraphicsEnvironment createGraphicsEnvironment(WindowFactory wf);
     
     // Font methods
-    FontMetrics getFontMetrics(Font font);
     FontManager getFontManager();
     FontPeer getFontPeer(Font font);
     Font embedFont(String fontFilePath);

Modified: harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/beancontext/BeanContextServicesSupport.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/beancontext/BeanContextServicesSupport.java?view=diff&rev=553732&r1=553731&r2=553732
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/beancontext/BeanContextServicesSupport.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/beancontext/BeanContextServicesSupport.java Thu Jul  5 22:09:57 2007
@@ -919,6 +919,9 @@
         if (null == event) {
             throw new NullPointerException(Messages.getString("beans.1C")); //$NON-NLS-1$
         }
+        if(services.containsKey(event.serviceClass)) {
+        	return;
+        }
         fireServiceAdded(event);
         Object childs[] = copyChildren();
         for (int i = 0; i < childs.length; i++) {
@@ -937,6 +940,9 @@
     public void serviceRevoked(BeanContextServiceRevokedEvent event) {
         if (null == event) {
             throw new NullPointerException(Messages.getString("beans.1C")); //$NON-NLS-1$
+        }
+        if(services.containsKey(event.serviceClass)) {
+        	return;
         }
         fireServiceRevoked(event);
         Object childs[] = copyChildren();

Modified: harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/beancontext/BeanContextSupport.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/beancontext/BeanContextSupport.java?view=diff&rev=553732&r1=553731&r2=553732
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/beancontext/BeanContextSupport.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/beancontext/BeanContextSupport.java Thu Jul  5 22:09:57 2007
@@ -425,6 +425,9 @@
      * @return true if two class objects are equal or their class names are equal.
      */
     protected static final boolean classEquals(Class clz1, Class clz2) {
+        if (clz1 == null || clz2 == null) {
+            throw new NullPointerException();
+        }
         return clz1 == clz2 || clz1.getName().equals(clz2.getName());
     }
 

Modified: harmony/enhanced/classlib/branches/java6/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/beancontext/BeanContextEventTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/beancontext/BeanContextEventTest.java?view=diff&rev=553732&r1=553731&r2=553732
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/beancontext/BeanContextEventTest.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/beancontext/BeanContextEventTest.java Thu Jul  5 22:09:57 2007
@@ -19,10 +19,21 @@
 
 import java.beans.beancontext.BeanContext;
 import java.beans.beancontext.BeanContextEvent;
+import java.beans.beancontext.BeanContextServicesSupport;
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Locale;
 
 import junit.framework.TestCase;
 
+import org.apache.harmony.beans.tests.support.beancontext.Utils;
 import org.apache.harmony.beans.tests.support.beancontext.mock.MockBeanContext;
+import org.apache.harmony.beans.tests.support.beancontext.mock.MockBeanContextServiceProviderS;
+import org.apache.harmony.beans.tests.support.beancontext.mock.MockBeanContextServicesListenerS;
+import org.apache.harmony.testframework.serialization.SerializationTest;
+import org.apache.harmony.testframework.serialization.SerializationTest.SerializableAssert;
 
 /**
  * Test BeanContextEvent
@@ -43,7 +54,7 @@
             assertSame(bc, getBeanContext());
             assertNull(this.propagatedFrom);
         }
-
+        
     }
 
     public static void main(String[] args) {
@@ -120,5 +131,91 @@
 
         event.setPropagatedFrom(null);
         assertNull(event.getPropagatedFrom());
+    }
+    
+    public void testSerialization() throws Exception {
+        final BeanContextServicesSupport ctx = new BeanContextServicesSupport(
+                null, Locale.FRANCE, false, false);
+        final BeanContextServicesSupport ctx2 = new BeanContextServicesSupport(
+                ctx, Locale.ITALY, true, true);
+        BeanContextEvent event = new MockBeanContextEvent(ctx2);
+        event.setPropagatedFrom(ctx);
+        SerializationTest.verifySelf(event, new SerializableAssert(){
+            public void assertDeserialized(Serializable arg0, Serializable arg1) {
+                BeanContextEvent e1 = (BeanContextEvent)arg0;
+                BeanContextEvent e2 = (BeanContextEvent)arg1;
+                assertNull((BeanContextServicesSupport)e2.getSource());
+                assertNotNull((BeanContextServicesSupport)e1.getSource());
+                assertEqualsSerially((BeanContextServicesSupport)e1.getPropagatedFrom(), (BeanContextServicesSupport)e2.getPropagatedFrom());
+                assertEqualsSerially(ctx, (BeanContextServicesSupport)e2.getPropagatedFrom());
+            }
+        });
+    }
+    
+    public static void assertEqualsSerially(BeanContextServicesSupport orig,
+            BeanContextServicesSupport ser) {
+
+        // check bcsListeners
+        ArrayList origBcsListeners = (ArrayList) Utils.getField(orig,
+                "bcsListeners");
+        ArrayList serBcsListeners = (ArrayList) Utils.getField(ser,
+                "bcsListeners");
+        int i = 0, j = 0;
+        while (i < origBcsListeners.size()) {
+            Object l1 = origBcsListeners.get(i);
+            if (l1 instanceof Serializable) {
+                Object l2 = serBcsListeners.get(j);
+                assertSame(l1.getClass(), l2.getClass());
+                if (l1 instanceof MockBeanContextServicesListenerS) {
+                    assertEquals(((MockBeanContextServicesListenerS) l1).id,
+                            ((MockBeanContextServicesListenerS) l2).id);
+                }
+                j++;
+            }
+            i++;
+        }
+        assertEquals(j, serBcsListeners.size());
+
+        // check services
+        HashMap origServices = (HashMap) Utils.getField(orig, "services");
+        HashMap serServices = (HashMap) Utils.getField(ser, "services");
+        int count = 0;
+        for (Iterator iter = origServices.keySet().iterator(); iter.hasNext();) {
+            Object serviceClass = iter.next();
+            Object bcssProvider = origServices.get(serviceClass);
+            Object provider = Utils.getField(bcssProvider, "serviceProvider");
+            if (provider instanceof Serializable) {
+                assertTrue(serServices.containsKey(serviceClass));
+                if (provider instanceof MockBeanContextServiceProviderS) {
+                    Object serProvider = Utils.getField(serServices
+                            .get(serviceClass), "serviceProvider");
+                    assertEquals(
+                            ((MockBeanContextServiceProviderS) provider).id,
+                            ((MockBeanContextServiceProviderS) serProvider).id);
+                }
+                count++;
+            }
+        }
+        assertEquals(count, serServices.size());
+    }    
+
+    public void testSerializationComptibility() throws Exception {
+        final BeanContextServicesSupport ctx = new BeanContextServicesSupport(
+                null, Locale.ITALY, true, true);
+        final BeanContextServicesSupport ctx2 = new BeanContextServicesSupport(
+                null, Locale.CHINA, true, true);
+        
+        BeanContextEvent event = new MockBeanContextEvent(ctx);
+        event.setPropagatedFrom(ctx2);
+        SerializationTest.verifyGolden(this, event, new SerializableAssert(){
+            public void assertDeserialized(Serializable arg0, Serializable arg1) {
+                BeanContextEvent e1 = (BeanContextEvent)arg0;
+                BeanContextEvent e2 = (BeanContextEvent)arg1;
+                assertNull((BeanContextServicesSupport)e2.getSource());
+                assertNotNull((BeanContextServicesSupport)e1.getSource());
+                assertEqualsSerially((BeanContextServicesSupport)e1.getPropagatedFrom(), (BeanContextServicesSupport)e2.getPropagatedFrom());
+                assertEqualsSerially(ctx2, (BeanContextServicesSupport)e2.getPropagatedFrom());
+            }
+        });
     }
 }

Modified: harmony/enhanced/classlib/branches/java6/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/beancontext/BeanContextServicesSupportTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/beancontext/BeanContextServicesSupportTest.java?view=diff&rev=553732&r1=553731&r2=553732
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/beancontext/BeanContextServicesSupportTest.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/beancontext/BeanContextServicesSupportTest.java Thu Jul  5 22:09:57 2007
@@ -1312,7 +1312,93 @@
                 (BeanContextServicesSupport) SerializationTester
                         .getDeserilizedObject(support));
     }
+    
+
+    static int serviceRevoked = 0;
+
+	static int serviceAvailable = 0;
+
+	private static class MyListener implements BeanContextServicesListener {
+
+		public void serviceRevoked(BeanContextServiceRevokedEvent event) {
+			serviceRevoked++;
+		}
+
+		public void serviceAvailable(BeanContextServiceAvailableEvent event) {
+			serviceAvailable++;
+		}
+
+	}
+
+	private static class MySupport extends BeanContextServicesSupport {
+
+		public void serviceRevoked(BeanContextServiceRevokedEvent event) {
+			serviceRevoked++;
+		}
+		
+		public void serviceAvailable(BeanContextServiceAvailableEvent event) {
+			serviceAvailable++;
+		}
+	}
+
+	private static class MyProvider implements BeanContextServiceProvider {
+
+		public void releaseService(BeanContextServices s, Object requestor,
+				Object service) {
+		}
+
+		public Iterator getCurrentServiceSelectors(BeanContextServices s,
+				Class serviceClass) {
+
+			return null;
+		}
+
+		public Object getService(BeanContextServices s, Object requestor,
+				Class serviceClass, Object serviceSelector) {
 
+			return null;
+
+		}
+
+	}
+
+	public void test_serviceRevoked_LBeanContextServiceRevokedEvent() {
+		BeanContextServicesSupport support = new BeanContextServicesSupport();
+
+		support.add(new MySupport());
+		support.addBeanContextServicesListener(new MyListener());
+		Class c = Object.class;
+
+		support.addService(c, new MyProvider());
+
+		BeanContextServiceRevokedEvent revokeEvent = new BeanContextServiceRevokedEvent(
+				support, c, false);
+
+		support.serviceRevoked(revokeEvent);
+        assertEquals(0, serviceRevoked);
+        assertEquals(2, serviceAvailable);
+        
+	}
+
+	public void test_serviceAvailable_LBeanContextServiceRevokedEvent() {
+		BeanContextServicesSupport support = new BeanContextServicesSupport();
+
+		support.add(new MySupport());
+		support.addBeanContextServicesListener(new MyListener());
+		Class c = Object.class;
+
+		support.addService(c, new MyProvider());
+
+		BeanContextServiceAvailableEvent availableEvent = new BeanContextServiceAvailableEvent(
+				support, c);
+	    support.serviceAvailable(availableEvent);
+        assertEquals(0, serviceRevoked);
+        assertEquals(2, serviceAvailable);
+        
+	}
+	
+    
+	
      public void testSerialization_Compatibility() throws Exception {
          BeanContextServicesSupport support = new BeanContextServicesSupport(
                  null, Locale.ITALY, true, true);
@@ -1427,5 +1513,15 @@
         public void releaseService(BeanContextServices arg0, Object arg1,
                 Object arg2) {
         }
+    }
+    
+    /*
+     * @see TestCase#setUp()
+     */
+    @Override
+    protected void setUp() throws Exception {
+        super.setUp();
+        serviceRevoked = 0;
+        serviceAvailable = 0;
     }
 }

Modified: harmony/enhanced/classlib/branches/java6/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/beancontext/BeanContextSupportTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/beancontext/BeanContextSupportTest.java?view=diff&rev=553732&r1=553731&r2=553732
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/beancontext/BeanContextSupportTest.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/beancontext/BeanContextSupportTest.java Thu Jul  5 22:09:57 2007
@@ -823,6 +823,12 @@
                 Integer.class));
         assertFalse(MockBeanContextSupport.publicClassEquals(Integer.class,
                 Double.class));
+        try {
+            MockBeanContextSupport.publicClassEquals(null, null);
+            fail("should throw NullPointerException");
+        } catch (NullPointerException e) {
+            // expected.
+        }
     }
 
     public void testClear() {

Modified: harmony/enhanced/classlib/branches/java6/modules/luni/.classpath
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/.classpath?view=diff&rev=553732&r1=553731&r2=553732
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/.classpath (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/.classpath Thu Jul  5 22:09:57 2007
@@ -6,7 +6,7 @@
 	<classpathentry output="bin/test" kind="src" path="src/test/api/unix"/>
 	<classpathentry output="bin/main" kind="src" path="src/main/resources"/>
 	<classpathentry output="bin/test" kind="src" path="src/test/resources"/>
-    <classpathentry kind="src" path="src/test/impl"/>
+    <classpathentry output="bin/test" kind="src" path="src/test/impl"/>
 	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
 		<accessrules>
 			<accessrule kind="accessible" pattern="**/*"/>

Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/InputStream.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/InputStream.java?view=diff&rev=553732&r1=553731&r2=553732
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/InputStream.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/InputStream.java Thu Jul  5 22:09:57 2007
@@ -141,7 +141,7 @@
      */
     public int read(byte b[], int offset, int length) throws IOException {
         // avoid int overflow, check null b
-        if (offset < 0 || offset > b.length || length < 0
+        if (offset > b.length || offset < 0 || length < 0
                 || length > b.length - offset) {
             throw new ArrayIndexOutOfBoundsException();
         }

Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/LineNumberReader.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/LineNumberReader.java?view=diff&rev=553732&r1=553731&r2=553732
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/LineNumberReader.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/LineNumberReader.java Thu Jul  5 22:09:57 2007
@@ -196,18 +196,8 @@
     @Override
     public String readLine() throws IOException {
         synchronized (lock) {
-            /* Typical Line Length */
-            StringBuilder result = new StringBuilder(80);
-            while (true) {
-                int character = read();
-                if (character == -1) {
-                    return result.length() != 0 ? result.toString() : null;
-                }
-                if (character == '\n') {
-                    return result.toString();
-                }
-                result.append((char) character);
-            }
+            lineNumber++;
+            return super.readLine();
         }
     }
 

Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/OutputStream.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/OutputStream.java?view=diff&rev=553732&r1=553731&r2=553732
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/OutputStream.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/OutputStream.java Thu Jul  5 22:09:57 2007
@@ -90,7 +90,7 @@
      */
     public void write(byte buffer[], int offset, int count) throws IOException {
         // avoid int overflow, check null buffer
-        if (offset < 0 || offset > buffer.length || count < 0
+        if (offset > buffer.length || offset < 0 || count < 0
                 || count > buffer.length - offset) {
             throw new IndexOutOfBoundsException(Msg.getString("K002f")); //$NON-NLS-1$
         }

Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/io/ObjectInputStreamTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/io/ObjectInputStreamTest.java?view=diff&rev=553732&r1=553731&r2=553732
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/io/ObjectInputStreamTest.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/io/ObjectInputStreamTest.java Thu Jul  5 22:09:57 2007
@@ -84,7 +84,8 @@
 		SerializationTest.verifySelf(longString);
 	}
 	
-	private static class LongString implements Serializable{
+	@SuppressWarnings("serial")
+    private static class LongString implements Serializable{
 		String lString;
 		
 		public LongString() {
@@ -160,6 +161,7 @@
             super(in);
         }
 
+        @SuppressWarnings("unchecked")
         protected Class resolveClass(ObjectStreamClass desc)
                 throws IOException, ClassNotFoundException {
             if (desc.getName().endsWith("ObjectInputStreamTest$TestClass1")) {
@@ -196,7 +198,7 @@
         ois = new TestObjectInputStream(bais);
 
         try {
-            TestClass2 to2 = (TestClass2) ois.readObject();
+            ois.readObject();
 
             fail("Should throw InvalidClassException");
         } catch (InvalidClassException ice) {

Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/ByteArrayOutputStreamTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/ByteArrayOutputStreamTest.java?view=diff&rev=553732&r1=553731&r2=553732
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/ByteArrayOutputStreamTest.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/ByteArrayOutputStreamTest.java Thu Jul  5 22:09:57 2007
@@ -164,7 +164,8 @@
 	/**
 	 * @tests java.io.ByteArrayOutputStream#toString(int)
 	 */
-	public void test_toStringI() {
+	@SuppressWarnings("deprecation")
+    public void test_toStringI() {
 		// Test for method java.lang.String
 		// java.io.ByteArrayOutputStream.toString(int)
 		java.io.ByteArrayOutputStream bos = null;

Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/DataInputStreamTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/DataInputStreamTest.java?view=diff&rev=553732&r1=553731&r2=553732
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/DataInputStreamTest.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/DataInputStreamTest.java Thu Jul  5 22:09:57 2007
@@ -457,7 +457,8 @@
 	/**
 	 * @tests java.io.DataInputStream#readLine()
 	 */
-	public void test_readLine() {
+	@SuppressWarnings("deprecation")
+    public void test_readLine() {
 		// Test for method java.lang.String java.io.DataInputStream.readLine()
 		try {
 			os.writeBytes("Hello");

Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/InputStreamReaderTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/InputStreamReaderTest.java?view=diff&rev=553732&r1=553731&r2=553732
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/InputStreamReaderTest.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/InputStreamReaderTest.java Thu Jul  5 22:09:57 2007
@@ -25,7 +25,6 @@
 import java.io.InputStreamReader;
 import java.io.OutputStreamWriter;
 import java.io.UnsupportedEncodingException;
-import java.nio.ByteBuffer;
 import java.nio.charset.Charset;
 import java.nio.charset.CharsetDecoder;
 import java.nio.charset.CodingErrorAction;

Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/LineNumberInputStreamTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/LineNumberInputStreamTest.java?view=diff&rev=553732&r1=553731&r2=553732
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/LineNumberInputStreamTest.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/LineNumberInputStreamTest.java Thu Jul  5 22:09:57 2007
@@ -21,13 +21,14 @@
 import java.io.IOException;
 import java.io.LineNumberInputStream;
 
+@SuppressWarnings("deprecation")
 public class LineNumberInputStreamTest extends junit.framework.TestCase {
 
 	String text = "0\n1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n42\n43\n44\n45\n46\n47\n48\n49\n50\n51\n52\n53\n54\n55\n56\n57\n58\n59\n60\n61\n62\n63\n64\n65\n66\n67\n68\n69\n70\n71\n72\n73\n74\n75\n76\n77\n78\n79\n80\n81\n82\n83\n84\n85\n86\n87\n88\n89\n90\n91\n92\n93\n94\n95\n96\n97\n98\n99\n100\n101\n102\n103\n104\n105\n106\n107\n108\n109\n110\n111\n112\n113\n114\n115\n116\n117\n118\n119\n120\n121\n122\n123\n124\n125\n126\n127\n128\n129\n130\n131\n132\n133\n134\n135\n136\n137\n138\n139\n140\n141\n142\n143\n144\n145\n146\n147\n148\n149\n150\n151\n152\n153\n154\n155\n156\n157\n158\n159\n160\n161\n162\n163\n164\n165\n166\n167\n168\n169\n170\n171\n172\n173\n174\n175\n176\n177\n178\n179\n180\n181\n182\n183\n184\n185\n186\n187\n188\n189\n190\n191\n192\n193\n194\n195\n196\n197\n198\n199\n200\n201\n202\n203\n204\n205\n206\n207\n208\n209\n210\n211\n212\n213\n214\n215\n216
 \n217\n218\n219\n220\n221\n222\n223\n224\n225\n226\n227\n228\n229\n230\n231\n232\n233\n234\n235\n236\n237\n238\n239\n240\n241\n242\n243\n244\n245\n246\n247\n248\n249\n250\n251\n252\n253\n254\n255\n256\n257\n258\n259\n260\n261\n262\n263\n264\n265\n266\n267\n268\n269\n270\n271\n272\n273\n274\n275\n276\n277\n278\n279\n280\n281\n282\n283\n284\n285\n286\n287\n288\n289\n290\n291\n292\n293\n294\n295\n296\n297\n298\n299\n300\n301\n302\n303\n304\n305\n306\n307\n308\n309\n310\n311\n312\n313\n314\n315\n316\n317\n318\n319\n320\n321\n322\n323\n324\n325\n326\n327\n328\n329\n330\n331\n332\n333\n334\n335\n336\n337\n338\n339\n340\n341\n342\n343\n344\n345\n346\n347\n348\n349\n350\n351\n352\n353\n354\n355\n356\n357\n358\n359\n360\n361\n362\n363\n364\n365\n366\n367\n368\n369\n370\n371\n372\n373\n374\n375\n376\n377\n378\n379\n380\n381\n382\n383\n384\n385\n386\n387\n388\n389\n390\n391\n392\n393\n394\n395\n396\n397\n398\n399\n400\n401\n402\n403\n404\n405\n406\n407\n408\n409\n410\n411\n412\n413\n41
 4\n415\n416\n417\n418\n419\n420\n421\n422\n423\n424\n425\n426\n427\n428\n429\n430\n431\n432\n433\n434\n435\n436\n437\n438\n439\n440\n441\n442\n443\n444\n445\n446\n447\n448\n449\n450\n451\n452\n453\n454\n455\n456\n457\n458\n459\n460\n461\n462\n463\n464\n465\n466\n467\n468\n469\n470\n471\n472\n473\n474\n475\n476\n477\n478\n479\n480\n481\n482\n483\n484\n485\n486\n487\n488\n489\n490\n491\n492\n493\n494\n495\n496\n497\n498\n499\n500\n501";
 
 	String dosText = "0\r\n1\r\n2";
 
-	LineNumberInputStream lnis;
+    LineNumberInputStream lnis;
 
 	LineNumberInputStream lnis2;
 

Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/LineNumberReaderTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/LineNumberReaderTest.java?view=diff&rev=553732&r1=553731&r2=553732
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/LineNumberReaderTest.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/LineNumberReaderTest.java Thu Jul  5 22:09:57 2007
@@ -17,7 +17,9 @@
 
 package tests.api.java.io;
 
+import java.io.ByteArrayInputStream;
 import java.io.IOException;
+import java.io.InputStreamReader;
 import java.io.LineNumberReader;
 import java.io.StringReader;
 
@@ -125,9 +127,10 @@
 	}
 
 	/**
+	 * @throws IOException 
 	 * @tests java.io.LineNumberReader#readLine()
 	 */
-	public void test_readLine() {
+	public void test_readLine() throws IOException {
 		// Test for method java.lang.String java.io.LineNumberReader.readLine()
 		lnr = new LineNumberReader(new StringReader(text));
 		assertEquals("Returned incorrect line number", 0, lnr.getLineNumber());
@@ -141,6 +144,17 @@
 		assertEquals("Returned incorrect string", "1", line);
 		assertTrue("Returned incorrect line number :" + lnr.getLineNumber(),
 				lnr.getLineNumber() == 2);
+        
+        //Regression for HARMONY-4294
+        byte[] buffer = new byte[] { '\r', '\n' };
+        LineNumberReader reader = new LineNumberReader(new InputStreamReader(
+                new ByteArrayInputStream(buffer)));
+        assertEquals('\n',reader.read());
+        assertEquals(-1,reader.read());
+        reader = new LineNumberReader(new InputStreamReader(
+                new ByteArrayInputStream(buffer)));
+        assertNotNull(reader.readLine());
+        assertNull(reader.readLine());
 	}
 
 	/**

Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/NotActiveExceptionTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/NotActiveExceptionTest.java?view=diff&rev=553732&r1=553731&r2=553732
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/NotActiveExceptionTest.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/NotActiveExceptionTest.java Thu Jul  5 22:09:57 2007
@@ -17,9 +17,7 @@
 
 package tests.api.java.io;
 
-import java.io.ByteArrayOutputStream;
 import java.io.NotActiveException;
-import java.io.ObjectOutputStream;
 
 public class NotActiveExceptionTest extends junit.framework.TestCase {
 

Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/ObjectInputStreamTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/ObjectInputStreamTest.java?view=diff&rev=553732&r1=553731&r2=553732
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/ObjectInputStreamTest.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/ObjectInputStreamTest.java Thu Jul  5 22:09:57 2007
@@ -40,10 +40,10 @@
 import java.util.Hashtable;
 import java.util.Vector;
 
-import org.apache.harmony.luni.tests.java.lang.ClassTest;
 import org.apache.harmony.testframework.serialization.SerializationTest;
 import org.apache.harmony.testframework.serialization.SerializationTest.SerializableAssert;
 
+@SuppressWarnings("serial")
 public class ObjectInputStreamTest extends junit.framework.TestCase implements
         Serializable {
 
@@ -408,6 +408,7 @@
     /**
      * @tests java.io.ObjectInputStream#readLine()
      */
+    @SuppressWarnings("deprecation")
     public void test_readLine() throws IOException {
         // Test for method java.lang.String java.io.ObjectInputStream.readLine()
         oos.writeBytes("HelloWorld\nSecondLine");
@@ -747,6 +748,7 @@
             super(in);
         }
 
+        @SuppressWarnings("unchecked")
         protected Class resolveClass(ObjectStreamClass desc)
                 throws IOException, ClassNotFoundException {
             if (desc.getName().equals(
@@ -947,6 +949,7 @@
     }
     
     private static class RegisterValidationClass implements Serializable {
+        @SuppressWarnings("unused")
         private A a = new A();
         private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException {
             stream.defaultReadObject();

Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/ObjectOutputStreamTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/ObjectOutputStreamTest.java?view=diff&rev=553732&r1=553731&r2=553732
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/ObjectOutputStreamTest.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/ObjectOutputStreamTest.java Thu Jul  5 22:09:57 2007
@@ -39,6 +39,7 @@
 import java.security.Permission;
 import java.util.Arrays;
 
+@SuppressWarnings( { "unused", "serial" })
 public class ObjectOutputStreamTest extends junit.framework.TestCase implements
 		Serializable {
 
@@ -100,7 +101,7 @@
 		}
 	}
 
-	private static class SerializationTestSubclass1 extends SerializationTest
+    private static class SerializationTestSubclass1 extends SerializationTest
 			implements Serializable {
 		String aString = INIT_STR_VALUE;
 

Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/ObjectStreamFieldTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/ObjectStreamFieldTest.java?view=diff&rev=553732&r1=553731&r2=553732
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/ObjectStreamFieldTest.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/ObjectStreamFieldTest.java Thu Jul  5 22:09:57 2007
@@ -19,8 +19,6 @@
 
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.NotActiveException;

Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/PipedInputStreamTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/PipedInputStreamTest.java?view=diff&rev=553732&r1=553731&r2=553732
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/PipedInputStreamTest.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/PipedInputStreamTest.java Thu Jul  5 22:09:57 2007
@@ -340,7 +340,7 @@
 
             public void run() {
                 try {
-                    int one = pis.read();
+                    pis.read();
                     pass = true;
                 } catch (IOException e) {}
             }

Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/PipedOutputStreamTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/PipedOutputStreamTest.java?view=diff&rev=553732&r1=553731&r2=553732
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/PipedOutputStreamTest.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/PipedOutputStreamTest.java Thu Jul  5 22:09:57 2007
@@ -199,6 +199,16 @@
                     "IndexOutOfBoundsException rather than a subclass expected",
                     IndexOutOfBoundsException.class, t.getClass());
         }
+        
+        // Regression for HARMONY-4311
+        try {
+            pis = new PipedInputStream();
+            PipedOutputStream out = new PipedOutputStream(pis);
+            out.write(null, -10, 10);
+            fail("should throw NullPointerException.");
+        } catch (NullPointerException e) {
+            // expected
+        } 
     }
 
 	/**

Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/SequenceInputStreamTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/SequenceInputStreamTest.java?view=diff&rev=553732&r1=553731&r2=553732
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/SequenceInputStreamTest.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/SequenceInputStreamTest.java Thu Jul  5 22:09:57 2007
@@ -61,7 +61,8 @@
 	/**
 	 * @tests java.io.SequenceInputStream#SequenceInputStream(java.util.Enumeration)
 	 */
-	public void test_ConstructorLjava_util_Enumeration() {
+	@SuppressWarnings("unchecked")
+    public void test_ConstructorLjava_util_Enumeration() {
 		// Test for method java.io.SequenceInputStream(java.util.Enumeration)
 		class StreamEnumerator implements Enumeration {
 			InputStream streams[] = new InputStream[2];

Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/SerializationStressTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/SerializationStressTest.java?view=diff&rev=553732&r1=553731&r2=553732
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/SerializationStressTest.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/SerializationStressTest.java Thu Jul  5 22:09:57 2007
@@ -62,6 +62,7 @@
  * Automated Test Suite for class java.io.ObjectOutputStream
  * 
  */
+@SuppressWarnings("serial")
 public class SerializationStressTest extends junit.framework.TestCase implements
 		Serializable {
 
@@ -92,14 +93,14 @@
 	// -----------------------------------------------------------------------------------
 
 	private static class ObjectInputStreamSubclass extends ObjectInputStream {
-		private Vector resolvedClasses = new Vector();
+		private Vector<Class> resolvedClasses = new Vector<Class>();
 
 		public ObjectInputStreamSubclass(InputStream in) throws IOException,
 				StreamCorruptedException {
 			super(in);
 		}
 
-		public Class resolveClass(ObjectStreamClass osClass)
+		public Class<?> resolveClass(ObjectStreamClass osClass)
 				throws IOException, ClassNotFoundException {
 			Class result = super.resolveClass(osClass);
 			resolvedClasses.addElement(result);
@@ -111,25 +112,24 @@
 					.size()]);
 		}
 	}
+	static final Map<String , String> TABLE = new Hashtable<String , String>();
 
-	static final Map TABLE = new Hashtable();
+	static final Map<String , String> MAP = new HashMap<String , String>();
 
-	static final Map MAP = new HashMap();
+	static final SortedMap<String , String> TREE = new TreeMap<String , String>();
 
-	static final SortedMap TREE = new TreeMap();
+	static final LinkedHashMap<String , String> LINKEDMAP = new LinkedHashMap<String , String>();
 
-	static final LinkedHashMap LINKEDMAP = new LinkedHashMap();
+	static final LinkedHashSet<String> LINKEDSET = new LinkedHashSet<String>();
 
-	static final LinkedHashSet LINKEDSET = new LinkedHashSet();
+	static final IdentityHashMap<String , String> IDENTITYMAP = new IdentityHashMap<String , String>();
 
-	static final IdentityHashMap IDENTITYMAP = new IdentityHashMap();
-
-	static final List ALIST = Arrays.asList(new String[] { "a", "list", "of",
+	static final List<String> ALIST = Arrays.asList(new String[] { "a", "list", "of",
 			"strings" });
 
-	static final List LIST = new ArrayList(ALIST);
+	static final List<String> LIST = new ArrayList<String>(ALIST);
 
-	static final Set SET = new HashSet(Arrays.asList(new String[] { "one",
+	static final Set<String> SET = new HashSet<String>(Arrays.asList(new String[] { "one",
 			"two", "three" }));
 
 	static final Permission PERM = new PropertyPermission("file.encoding",
@@ -137,7 +137,7 @@
 
 	static final PermissionCollection PERMCOL = PERM.newPermissionCollection();
 
-	static final SortedSet SORTSET = new TreeSet(Arrays.asList(new String[] {
+	static final SortedSet<String> SORTSET = new TreeSet<String>(Arrays.asList(new String[] {
 			"one", "two", "three" }));
 
 	static final java.text.DateFormat DATEFORM = java.text.DateFormat
@@ -152,7 +152,7 @@
 	static final java.text.MessageFormat MESSAGE = new java.text.MessageFormat(
 			"the time: {0,time} and date {0,date}");
 
-	static final LinkedList LINKEDLIST = new LinkedList(Arrays
+	static final LinkedList<String> LINKEDLIST = new LinkedList<String>(Arrays
 			.asList(new String[] { "a", "linked", "list", "of", "strings" }));
 
 	static final SimpleTimeZone TIME_ZONE = new SimpleTimeZone(3600000,
@@ -396,7 +396,6 @@
 	public void test_7_write() {
 		// Test for method void java.io.ObjectOutputStream.write(int)
 		try {
-			byte[] buf = new byte[10];
 			oos.write('T');
 			oos.close();
 			ois = new ObjectInputStream(loadStream());
@@ -945,7 +944,7 @@
 
 	public void test_1_writeReplace() {
 		try {
-			Vector v = new Vector();
+			Vector<Object> v = new Vector<Object>();
 			v.addElement(new WriteReplaceTestA());
 			v.addElement(new WriteReplaceTestB());
 			v.addElement(new WriteReplaceTestB());

Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/SerializationStressTest1.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/SerializationStressTest1.java?view=diff&rev=553732&r1=553731&r2=553732
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/SerializationStressTest1.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/SerializationStressTest1.java Thu Jul  5 22:09:57 2007
@@ -20,7 +20,10 @@
 import java.io.NotSerializableException;
 import java.io.Serializable;
 import java.util.Arrays;
+import java.util.Hashtable;
+import java.util.Vector;
 
+@SuppressWarnings( { "serial", "unused" })
 public class SerializationStressTest1 extends SerializationStressTest {
 
 	// The purpose of these two classes is to test if serialization, when
@@ -110,7 +113,7 @@
 		private void readObject(java.io.ObjectInputStream in)
 				throws java.io.IOException, ClassNotFoundException {
 			calledReadObject = true;
-			String s = ((String) in.readObject());
+			in.readObject();
 		}
 
 		private void writeObject(java.io.ObjectOutputStream out)
@@ -135,7 +138,7 @@
 		public void readObject(java.io.ObjectInputStream in)
 				throws java.io.IOException, ClassNotFoundException {
 			calledReadObject = true;
-			String s = ((String) in.readObject());
+			in.readObject();
 		}
 
 		public void writeObject(java.io.ObjectOutputStream out)
@@ -638,7 +641,7 @@
 		// java.io.ObjectOutputStream.writeObject(java.lang.Object)
 
 		Object objToSave = null;
-		Object objLoaded;
+        Object objLoaded;
 
 		try {
 
@@ -1089,7 +1092,7 @@
 		Object objLoaded;
 
 		try {
-			java.util.Vector vector = new java.util.Vector(1);
+			Vector<String> vector = new Vector<String>(1);
 			vector.add(FOO);
 			objToSave = vector;
 			if (DEBUG)
@@ -1119,10 +1122,11 @@
 		Object objLoaded;
 
 		try {
-			java.util.Hashtable hashTable = new java.util.Hashtable(5);
-			hashTable.put(FOO, FOO);
-			objToSave = hashTable;
-			if (DEBUG)
+			Hashtable<String, String> hashTable = new Hashtable<String, String>(
+                    5);
+            hashTable.put(FOO, FOO);
+            objToSave = hashTable;
+            if (DEBUG)
 				System.out.println("Obj = " + objToSave);
 			objLoaded = dumpAndReload(objToSave);
 			java.util.Hashtable loadedHashTable = (java.util.Hashtable) objLoaded;

Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/SerializationStressTest2.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/SerializationStressTest2.java?view=diff&rev=553732&r1=553731&r2=553732
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/SerializationStressTest2.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/SerializationStressTest2.java Thu Jul  5 22:09:57 2007
@@ -35,6 +35,7 @@
 import java.util.Date;
 import java.util.Locale;
 
+@SuppressWarnings( { "serial", "unused" })
 public class SerializationStressTest2 extends SerializationStressTest {
 
 	private static class ReadWriteObjectAndPrimitiveData implements
@@ -402,7 +403,7 @@
 
 			InitializerFieldsTest inst = (InitializerFieldsTest) obj;
 			return inst.toBeSerialized.equals(this.toBeSerialized)
-					&& inst.toBeNotSerialized.equals(this.toBeNotSerialized2);
+					&& InitializerFieldsTest.toBeNotSerialized.equals(toBeNotSerialized2);
 		}
 	}
 
@@ -444,7 +445,7 @@
 					&& inst.toBeSerialized3.equals(this.toBeSerialized3)
 					&& inst.toBeSerialized4.equals(this.toBeSerialized4)
 					&& inst.toBeSerialized5.equals(this.toBeSerialized5)
-					&& inst.toBeNotSerialized.equals(this.toBeNotSerialized2);
+					&& InitializerFieldsTest2.toBeNotSerialized.equals(toBeNotSerialized2);
 		}
 	}
 
@@ -490,8 +491,8 @@
 							.equals(this.sub_toBeSerialized4)
 					&& inst.sub_toBeSerialized5
 							.equals(this.sub_toBeSerialized5)
-					&& inst.sub_toBeNotSerialized
-							.equals(this.sub_toBeNotSerialized2);
+					&& InitializerFieldsTest3.sub_toBeNotSerialized
+							.equals(sub_toBeNotSerialized2);
 		}
 	}
 
@@ -1156,7 +1157,7 @@
 
 		try {
 
-			ArrayList list = new ArrayList(Arrays.asList(new String[] { "a",
+			ArrayList list = new ArrayList<String>(Arrays.asList(new String[] { "a",
 					"list", "of", "strings" }));
 			objToSave = list;
 			if (DEBUG)

Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/SerializationStressTest3.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/SerializationStressTest3.java?view=diff&rev=553732&r1=553731&r2=553732
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/SerializationStressTest3.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/SerializationStressTest3.java Thu Jul  5 22:09:57 2007
@@ -36,6 +36,7 @@
 import java.util.TimeZone;
 import java.util.Vector;
 
+@SuppressWarnings( { "serial", "unused" })
 public class SerializationStressTest3 extends SerializationStressTest {
 
 	// -----------------------------------------------------------------------------------
@@ -322,7 +323,7 @@
 				new ObjectStreamField("object1", Vector.class),
 				new ObjectStreamField("int1", Integer.TYPE) };
 
-		private static Vector v1 = new Vector(Arrays.asList(new String[] {
+		private static Vector v1 = new Vector<String>(Arrays.asList(new String[] {
 				"1st", "2nd" }));
 
 		private boolean passed = false;
@@ -342,7 +343,8 @@
 			passed = int1 == 0xA9 && object1.equals(v1);
 		}
 
-		private void writeObject(java.io.ObjectOutputStream out)
+		@SuppressWarnings("deprecation")
+        private void writeObject(java.io.ObjectOutputStream out)
 				throws java.io.IOException, ClassNotFoundException {
 			ObjectOutputStream.PutField fields = out.putFields();
 			fields.put("object1", v1);

Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/SerializationStressTest4.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/SerializationStressTest4.java?view=diff&rev=553732&r1=553731&r2=553732
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/SerializationStressTest4.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/SerializationStressTest4.java Thu Jul  5 22:09:57 2007
@@ -32,22 +32,13 @@
 import java.text.DateFormat;
 import java.text.MessageFormat;
 import java.text.NumberFormat;
-import java.util.Arrays;
-import java.util.Comparator;
-import java.util.Date;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.IdentityHashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Locale;
-import java.util.Map;
-import java.util.Set;
-import java.util.TimeZone;
+import java.util.*;
+
 
 import tests.support.Support_Configuration;
 import tests.support.Support_Proxy_I1;
 
+@SuppressWarnings( { "serial", "unused" })
 public class SerializationStressTest4 extends SerializationStressTest {
 	// -----------------------------------------------------------------------------------
 	private static class GuardImplementation implements java.security.Guard,
@@ -104,15 +95,15 @@
 
 		try {
 			objToSave = null;
-			objToSave = new java.security.PermissionCollection() {
+			objToSave = new PermissionCollection() {
 				boolean added = false;
 
 				public void add(java.security.Permission p1) {
 					added = true;
 				}
 
-				public java.util.Enumeration elements() {
-					return (new java.util.Vector()).elements();
+				public Enumeration elements() {
+					return (new Vector()).elements();
 				}
 
 				public boolean implies(java.security.Permission p1) {
@@ -329,7 +320,7 @@
 		Object objLoaded = null;
 
 		try {
-			objToSave = java.util.Collections.unmodifiableCollection(SET);
+			objToSave = Collections.unmodifiableCollection(SET);
 			if (DEBUG)
 				System.out.println("Obj = " + objToSave);
 			objLoaded = dumpAndReload(objToSave);
@@ -587,7 +578,8 @@
 
 	}
 
-	public void test_writeObject_String_CaseInsensitiveComparator() {
+	@SuppressWarnings("unchecked")
+    public void test_writeObject_String_CaseInsensitiveComparator() {
 		// Test for method void
 		// java.io.ObjectOutputStream.writeObject(java.lang.String.CaseInsensitiveComparator)
 
@@ -1731,7 +1723,8 @@
 
 	}
 
-	public void test_writeObject_Permissions() {
+	@SuppressWarnings("unchecked")
+    public void test_writeObject_Permissions() {
 		// Test for method void
 		// java.io.ObjectOutputStream.writeObject(java.security.Permissions)
 
@@ -1776,8 +1769,8 @@
 					}
 				};
 
-				java.util.Arrays.sort(perms1, comparator);
-				java.util.Arrays.sort(perms2, comparator);
+				Arrays.sort(perms1, comparator);
+				Arrays.sort(perms2, comparator);
 
 				for (int i = 0; i < length && equals; ++i)
 					equals = perms1[i].equals(perms2[i]);
@@ -1930,7 +1923,7 @@
 
 	}
 
-	public void test_writeObject_Stack() {
+    public void test_writeObject_Stack() {
 		// Test for method void
 		// java.io.ObjectOutputStream.writeObject(java.util.Stack)
 
@@ -1939,8 +1932,8 @@
 
 		try {
 			objToSave = new java.util.Stack();
-			((java.util.Stack) objToSave).push("String 1");
-			((java.util.Stack) objToSave).push("String 2");
+			((Stack) objToSave).push("String 1");
+			((Stack) objToSave).push("String 2");
 			if (DEBUG)
 				System.out.println("Obj = " + objToSave);
 			objLoaded = dumpAndReload(objToSave);

Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/SerializationStressTest5.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/SerializationStressTest5.java?view=diff&rev=553732&r1=553731&r2=553732
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/SerializationStressTest5.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/SerializationStressTest5.java Thu Jul  5 22:09:57 2007
@@ -27,13 +27,14 @@
 import java.util.zip.ZipEntry;
 import java.util.zip.ZipInputStream;
 
+@SuppressWarnings( { "serial", "unused" })
 public class SerializationStressTest5 extends SerializationStressTest {
 
 	transient Throwable current;
 
 	// Use this for retrieving a list of any Throwable Classes that did not get
 	// tested.
-	transient Vector missedV = new Vector();
+	transient Vector<Class> missedV = new Vector<Class>();
 
 	transient Class[][] params = new Class[][] { { String.class },
 			{ Throwable.class }, { Exception.class },
@@ -66,7 +67,7 @@
 
 		File javaDir = findJavaDir();
 
-		Vector classFilesVector = new Vector();
+		Vector<File> classFilesVector = new Vector<File>();
 		if (javaDir != null)
 			findClassFiles(javaDir, classFilesVector);
 		else
@@ -100,7 +101,7 @@
 		int instanceOfSep = -1;
 		int nextInstance = classPath.indexOf(File.pathSeparatorChar,
 				instanceOfSep + 1);
-		Vector elms = new Vector();
+		Vector<File> elms = new Vector<File>();
 		while (nextInstance != -1) {
 			elms.add(new File(classPath.substring(instanceOfSep + 1,
 					nextInstance)));
@@ -138,7 +139,7 @@
 		return null;
 	}
 
-	private void findClassFiles(File dir, Vector v) {
+	private void findClassFiles(File dir, Vector<File> v) {
 		String[] classFileNames = dir.list();
 		for (int i = 0; i < classFileNames.length; i++) {
 			File file = new File(dir, classFileNames[i]);
@@ -150,8 +151,8 @@
 	}
 
 	private Class[] findThrowableClasses(File[] files) {
-		Class thrClass = Throwable.class;
-		Vector resultVector = new Vector();
+		Class<Throwable> thrClass = Throwable.class;
+		Vector<Class> resultVector = new Vector<Class>();
 		String slash = System.getProperty("file.separator");
 		String begTarget = slash + "java" + slash;
 		String endTarget = ".class";
@@ -284,7 +285,7 @@
 		}
 	}
 
-	private void findClassFilesFromZip(Vector v) {
+	private void findClassFilesFromZip(Vector<File> v) {
 		String slash = System.getProperty("file.separator");
 		String javaHome = System.getProperty("java.home");
 		if (!javaHome.endsWith(slash))

Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/StreamTokenizerTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/StreamTokenizerTest.java?view=diff&rev=553732&r1=553731&r2=553732
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/StreamTokenizerTest.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/StreamTokenizerTest.java Thu Jul  5 22:09:57 2007
@@ -26,10 +26,6 @@
 import java.io.StringBufferInputStream;
 
 import tests.support.Support_StringReader;
-// TODO: most of the assertTrue calls in this test case should be
-// replaced with assertEquals (possibly two assertEquals) see
-// test_ConstructorLjava_io_InputStream for example.
-// This gives much more helpful error messages.
 
 public class StreamTokenizerTest extends junit.framework.TestCase {
 	Support_StringReader r;
@@ -41,7 +37,8 @@
 	/**
 	 * @tests java.io.StreamTokenizer#StreamTokenizer(java.io.InputStream)
 	 */
-	public void test_ConstructorLjava_io_InputStream() throws IOException {
+	@SuppressWarnings("deprecation")
+    public void test_ConstructorLjava_io_InputStream() throws IOException {
 		st = new StreamTokenizer(new StringBufferInputStream(
 				"/comments\n d 8 'h'"));
 
@@ -151,7 +148,8 @@
 	/**
 	 * @tests java.io.StreamTokenizer#nextToken()
 	 */
-	public void test_nextToken() throws IOException {
+	@SuppressWarnings("deprecation")
+    public void test_nextToken() throws IOException {
 		// SM.
 		setTest("\r\n/* fje fje 43.4 f \r\n f g */  456.459 \r\n"
 				+ "Hello  / 	\r\n \r\n \n \r \257 Hi \'Hello World\'");

Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/StringBufferInputStreamTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/StringBufferInputStreamTest.java?view=diff&rev=553732&r1=553731&r2=553732
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/StringBufferInputStreamTest.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/io/StringBufferInputStreamTest.java Thu Jul  5 22:09:57 2007
@@ -19,9 +19,10 @@
 
 import java.io.StringBufferInputStream;
 
+@SuppressWarnings("deprecation")
 public class StringBufferInputStreamTest extends junit.framework.TestCase {
 
-	StringBufferInputStream sbis;
+    StringBufferInputStream sbis;
 
 	/**
 	 * @tests java.io.StringBufferInputStream#StringBufferInputStream(java.lang.String)

Modified: harmony/enhanced/classlib/branches/java6/modules/sql/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/sql/META-INF/MANIFEST.MF?view=diff&rev=553732&r1=553731&r2=553732
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/sql/META-INF/MANIFEST.MF (original)
+++ harmony/enhanced/classlib/branches/java6/modules/sql/META-INF/MANIFEST.MF Thu Jul  5 22:09:57 2007
@@ -28,7 +28,8 @@
  javax.xml.transform,
  org.apache.harmony.kernel.vm,
  org.apache.harmony.luni.util,
- org.apache.harmony.testframework.serialization;hy_usage=test;resolution:=optional
+ org.apache.harmony.testframework.serialization;hy_usage=test;resolution:=optional,
+ tests.support;hy_usage=test;resolution:=optional
 Export-Package: java.sql,
  javax.sql,
  javax.sql.rowset,

Modified: harmony/enhanced/classlib/branches/java6/modules/sql/src/main/java/java/sql/DriverManager.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/sql/src/main/java/java/sql/DriverManager.java?view=diff&rev=553732&r1=553731&r2=553732
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/sql/src/main/java/java/sql/DriverManager.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/sql/src/main/java/java/sql/DriverManager.java Thu Jul  5 22:09:57 2007
@@ -22,11 +22,11 @@
 import java.util.Properties;
 import java.util.Enumeration;
 import java.util.Iterator;
-import java.util.Set;
 import java.io.PrintStream;
 import java.io.PrintWriter;
-import java.util.HashSet;
 import java.util.Vector;
+import java.security.AccessController;
+import org.apache.harmony.luni.util.PriviAction;
 import org.apache.harmony.sql.internal.nls.Messages;
 import org.apache.harmony.kernel.vm.VM;
 
@@ -70,7 +70,9 @@
      * it is defined.
      */
     private static void loadInitialDrivers() {
-        String theDriverList = System.getProperty("jdbc.drivers", null); //$NON-NLS-1$
+        String theDriverList = AccessController
+                .doPrivileged(new PriviAction<String>("jdbc.drivers", null)); //$NON-NLS-1$
+
         if (theDriverList == null) {
             return;
         }

Modified: harmony/enhanced/classlib/branches/java6/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/DriverManagerTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/DriverManagerTest.java?view=diff&rev=553732&r1=553731&r2=553732
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/DriverManagerTest.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/DriverManagerTest.java Thu Jul  5 22:09:57 2007
@@ -18,6 +18,7 @@
 package org.apache.harmony.sql.tests.java.sql;
 
 import java.io.ByteArrayOutputStream;
+import java.io.IOException;
 import java.io.PrintStream;
 import java.io.PrintWriter;
 import java.lang.reflect.Method;
@@ -30,6 +31,7 @@
 import java.sql.SQLPermission;
 import java.util.Enumeration;
 import java.util.Properties;
+import tests.support.Support_Exec;
 
 import junit.framework.TestCase;
 
@@ -601,6 +603,16 @@
         }
         Driver d = DriverManager.getDriver("jdbc:dummy_protocol:dummy_subname");
         assertNotNull(d);
+    }
+    
+    /**
+     * Regression for HARMONY-4303
+     */
+    public void test_initClass() throws Exception {
+        String[] arg = new String[1];
+        arg[0] = "org/apache/harmony/sql/tests/java/sql/TestMainForDriver";
+        String result = Support_Exec.execJava(arg, null, true);
+        assertEquals("", result);
     }
     
     private static class BadDummyDriver extends DummyDriver {



Mime
View raw message