You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Sebb (JIRA)" <ji...@apache.org> on 2009/02/01 19:33:59 UTC

[jira] Created: (HARMONY-6081) JEditorPane.setPage() generates NPE in DefaultStyledDocument.getParagraphElement() for simple HTML file

JEditorPane.setPage() generates NPE in DefaultStyledDocument.getParagraphElement() for simple HTML file
-------------------------------------------------------------------------------------------------------

                 Key: HARMONY-6081
                 URL: https://issues.apache.org/jira/browse/HARMONY-6081
             Project: Harmony
          Issue Type: Bug
          Components: Classlib
    Affects Versions: 5.0M8
         Environment: Apache Harmony Launcher : (c) Copyright 1991, 2008 The Apache Software Foundation or its licensors, as applicable.
java version "1.5.0"
pre-alpha : not complete or compatible
svn = r713673, (Nov 13 2008), Windows/ia32/msvc 1310, release build

Win XP
            Reporter: Sebb


The following code:

JTextPane tp = new JTextPane();
tp.setPage("file:simple.html");

where simple.html consists of

<html>
</html>

causes the follow NPE:

java.lang.NullPointerException
        at javax.swing.text.DefaultStyledDocument.getParagraphElement(DefaultStyledDocument.java:1044)
        at javax.swing.text.DefaultStyledDocument.getCharacterElement(DefaultStyledDocument.java:1034)
        at javax.swing.text.html.HTMLDocument$HTMLReader.removeDefaultBody(HTMLDocument.java:887)
        at javax.swing.text.html.HTMLDocument$HTMLReader.flushImpl(HTMLDocument.java:862)
        at javax.swing.text.html.HTMLDocument$HTMLReader.flush(HTMLDocument.java:690)
        at javax.swing.text.html.HTMLEditorKit.read(HTMLEditorKit.java:738)
        at javax.swing.text.DefaultEditorKit.read(DefaultEditorKit.java:328)
        at javax.swing.JEditorPane.documentLoading(JEditorPane.java:598)
        at javax.swing.JEditorPane.setPage(JEditorPane.java:698)
        at javax.swing.JEditorPane.setPage(JEditorPane.java:592)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.