harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From py...@apache.org
Subject svn commit: r532647 - in /harmony/enhanced/classlib/trunk/modules/beans/src: main/java/java/beans/beancontext/BeanContextSupport.java test/java/org/apache/harmony/beans/tests/java/beans/beancontext/BeanContextSupportTest.java
Date Thu, 26 Apr 2007 08:06:29 GMT
Author: pyang
Date: Thu Apr 26 01:06:29 2007
New Revision: 532647

URL: http://svn.apache.org/viewvc?view=rev&rev=532647
Log:
Apply patch for HARMONY-3757([classlib][beans]java.beans.beancontext.BeanContextServicesSupport
has problem in self-deserialization)

Modified:
    harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextSupport.java
    harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/beancontext/BeanContextSupportTest.java

Modified: harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextSupport.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextSupport.java?view=diff&rev=532647&r1=532646&r2=532647
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextSupport.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextSupport.java
Thu Apr 26 01:06:29 2007
@@ -435,7 +435,7 @@
         while (true) {
             Object l = ois.readObject();
 
-            if (l != null && l.equals("EOS")) { //$NON-NLS-1$
+            if ("EOS".equals(l)) { //$NON-NLS-1$
                 coll.add(l);
             } else {
                 break;

Modified: harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/beancontext/BeanContextSupportTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/beancontext/BeanContextSupportTest.java?view=diff&rev=532647&r1=532646&r2=532647
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/beancontext/BeanContextSupportTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/beancontext/BeanContextSupportTest.java
Thu Apr 26 01:06:29 2007
@@ -2163,5 +2163,16 @@
         p.addPropertyChangeListener(s);
         p.firePropertyChange(null, new Object(), new Object());
     }
+    
+    //Regression Test for HARMONY-3757
+    public void testSelfSerializatoin() throws Exception {
+        BeanContextSupport beanContextSupport = new BeanContextSupport();
+        ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        new ObjectOutputStream(baos).writeObject(beanContextSupport);
+        ObjectInputStream oin = new ObjectInputStream(new ByteArrayInputStream(
+                baos.toByteArray()));
+        Object obj = oin.readObject();
+        assertTrue(obj instanceof BeanContextSupport);
+    }
 
 }



Mime
View raw message