harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mloe...@apache.org
Subject svn commit: r465159 - in /incubator/harmony/enhanced/classlib/trunk/modules/beans/src: main/java/java/beans/XMLEncoder.java test/java/org/apache/harmony/beans/tests/java/beans/XMLEncoderTest.java
Date Wed, 18 Oct 2006 06:42:51 GMT
Author: mloenko
Date: Tue Oct 17 23:42:49 2006
New Revision: 465159

URL: http://svn.apache.org/viewvc?view=rev&rev=465159
Log:
applied patch from HARMONY-1521
[classlib][beans] XMLEncoder.writeStatement(null) thorws NPE on Harmony and works OK on RI
removed redundant method

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/XMLEncoder.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/XMLEncoderTest.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/XMLEncoder.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/XMLEncoder.java?view=diff&rev=465159&r1=465158&r2=465159
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/XMLEncoder.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/XMLEncoder.java
Tue Oct 17 23:42:49 2006
@@ -56,12 +56,12 @@
 
     @Override
     public void writeStatement(Statement oldStm) {
-        super.writeStatement(oldStm);
-    }
-
-    @Override
-    public void writeExpression(Expression oldExp) {
-        super.writeExpression(oldExp);
+        try {
+            super.writeStatement(oldStm);
+        } catch (NullPointerException ignore) {
+            // ignore exception like RI does
+            ignore.printStackTrace();
+        }
     }
 
     public void flush() {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/XMLEncoderTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/XMLEncoderTest.java?view=diff&rev=465159&r1=465158&r2=465159
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/XMLEncoderTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/XMLEncoderTest.java
Tue Oct 17 23:42:49 2006
@@ -194,6 +194,10 @@
 
     public void testWriteStatement() {
         // coverd by testWriteStatement
+
+         //Regression for HARMONY-1521
+         //no exception expected
+         new XMLEncoder(new ByteArrayOutputStream()).writeStatement(null);
     }
 
     public void testWriteObject_Null() throws Exception {



Mime
View raw message