harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nathan Beyer (JIRA)" <j...@apache.org>
Subject [jira] Assigned: (HARMONY-880) AbstractPreferences.exportSubTree(null) throws different exceptions on RI and Harmony
Date Sat, 15 Jul 2006 19:36:14 GMT
     [ http://issues.apache.org/jira/browse/HARMONY-880?page=all ]

Nathan Beyer reassigned HARMONY-880:
------------------------------------

    Assignee: Nathan Beyer

> AbstractPreferences.exportSubTree(null) throws different exceptions on RI and Harmony
> -------------------------------------------------------------------------------------
>
>                 Key: HARMONY-880
>                 URL: http://issues.apache.org/jira/browse/HARMONY-880
>             Project: Harmony
>          Issue Type: Bug
>          Components: Non-bug differences from RI
>         Environment: Windows XP professional
>            Reporter: Anton Luht
>         Assigned To: Nathan Beyer
>            Priority: Minor
>         Attachments: patch.txt
>
>
> Harmony Classlib + VM 421248
> RI throws java.lang.AssertionError while Harmony throws NPE.
> Accodring to specification method must throw:
>     IOException - if writing to the specified output stream results in an IOException.

>     BackingStoreException - if preference data cannot be read from backing store. 
>     IllegalStateException - if this node (or an ancestor) has been removed with the removeNode()
method.
> There is no mention about any exception if null argument is passed.
> import java.util.prefs.*;
> public class Test  { 
>     public static void main (String[] args) {   
>        try {                                                                        
    
>               Preferences localPreferences = Preferences.systemRoot();
>               localPreferences.exportSubtree(null);
>        } catch (Exception e) {
>            e.printStackTrace();
>        }    
>     }
> }
>  
> Output on RI:
> Exception in thread "main" java.lang.AssertionError: javax.xml.transform.TransformerException:
Result object passed to ''{0}'' is invalid.
>         at java.util.prefs.XmlSupport.writeDoc(XmlSupport.java:251)
>         at java.util.prefs.XmlSupport.export(XmlSupport.java:106)
>         at java.util.prefs.AbstractPreferences.exportSubtree(AbstractPreferences.java:1591)
>         at Test.main(Test.java:9)
> Caused by: javax.xml.transform.TransformerException: Result object passed to ''{0}''
is invalid.
>         at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.getOutputHandler(TransformerImpl.java:367)
>         at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:264)
>         at java.util.prefs.XmlSupport.writeDoc(XmlSupport.java:249)
>         ... 3 more
> Output on Harmony:
> java.lang.NullPointerException
>         at java.io.Writer.<init>(Writer.java:54)
>         at java.io.OutputStreamWriter.<init>(OutputStreamWriter.java:84)
>         at java.util.prefs.XMLParser.exportPrefs(XMLParser.java:162)
>         at java.util.prefs.AbstractPreferences.exportSubtree(AbstractPreferences.java:378)
>         at Test.main(Test.java:9)
> please see the patch to JUnit test and classlib code to mimic the RI behaviour attached.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message