You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Vasily Zakharov (JIRA)" <ji...@apache.org> on 2007/08/29 16:33:30 UTC

[jira] Created: (HARMONY-4696) [classlib][swing][html] JEditorPane doesn't recognize HTML by file name

[classlib][swing][html] JEditorPane doesn't recognize HTML by file name
-----------------------------------------------------------------------

                 Key: HARMONY-4696
                 URL: https://issues.apache.org/jira/browse/HARMONY-4696
             Project: Harmony
          Issue Type: Bug
          Components: Classlib
            Reporter: Vasily Zakharov
            Priority: Minor


The following simple test demonstrates the problem:

import javax.swing.JFrame;
import javax.swing.JEditorPane;
public class Test {
    public static void main(String argv[]) {
        try {
            JFrame frame = new JFrame();
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            frame.add(new JEditorPane("file:test.html"));
            frame.setSize(150, 100);
            frame.setVisible(true);
        } catch (Exception e) {
            e.printStackTrace(System.out);
        }
    }
} 

test.html:
normal <i>italic

test.html contains HTML code not clearly detectable as HTML. However, this code is contained in file having .html extension, and it's enough for RI to use HTML renderer. Harmony doesn't do it. The attached screenshots demonstrate the results on RI and Harmony.


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


[jira] Commented: (HARMONY-4696) [classlib][swing][html] JEditorPane doesn't recognize HTML by file name

Posted by "Vasily Zakharov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-4696?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12524532 ] 

Vasily Zakharov commented on HARMONY-4696:
------------------------------------------

Tim, thank you very much, the patch is just right.


> [classlib][swing][html] JEditorPane doesn't recognize HTML by file name
> -----------------------------------------------------------------------
>
>                 Key: HARMONY-4696
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4696
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Vasily Zakharov
>            Assignee: Tim Ellison
>         Attachments: Harmony-4696-Fix.patch, Harmony.jpg, RI.jpg
>
>
> The following simple test demonstrates the problem:
> import javax.swing.JFrame;
> import javax.swing.JEditorPane;
> public class Test {
>     public static void main(String argv[]) {
>         try {
>             JFrame frame = new JFrame();
>             frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
>             frame.add(new JEditorPane("file:test.html"));
>             frame.setSize(150, 100);
>             frame.setVisible(true);
>         } catch (Exception e) {
>             e.printStackTrace(System.out);
>         }
>     }
> } 
> test.html:
> normal <i>italic
> test.html contains HTML code not clearly detectable as HTML. However, this code is contained in file having .html extension, and it's enough for RI to use HTML renderer. Harmony doesn't do it. The attached screenshots demonstrate the results on RI and Harmony.

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


[jira] Updated: (HARMONY-4696) [classlib][swing][html] JEditorPane doesn't recognize HTML by file name

Posted by "Vasily Zakharov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-4696?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Vasily Zakharov updated HARMONY-4696:
-------------------------------------

    Attachment: Harmony.jpg

> [classlib][swing][html] JEditorPane doesn't recognize HTML by file name
> -----------------------------------------------------------------------
>
>                 Key: HARMONY-4696
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4696
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Vasily Zakharov
>            Priority: Minor
>         Attachments: Harmony.jpg, RI.jpg
>
>
> The following simple test demonstrates the problem:
> import javax.swing.JFrame;
> import javax.swing.JEditorPane;
> public class Test {
>     public static void main(String argv[]) {
>         try {
>             JFrame frame = new JFrame();
>             frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
>             frame.add(new JEditorPane("file:test.html"));
>             frame.setSize(150, 100);
>             frame.setVisible(true);
>         } catch (Exception e) {
>             e.printStackTrace(System.out);
>         }
>     }
> } 
> test.html:
> normal <i>italic
> test.html contains HTML code not clearly detectable as HTML. However, this code is contained in file having .html extension, and it's enough for RI to use HTML renderer. Harmony doesn't do it. The attached screenshots demonstrate the results on RI and Harmony.

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


[jira] Commented: (HARMONY-4696) [classlib][swing][html] JEditorPane doesn't recognize HTML by file name

Posted by "Vasily Zakharov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-4696?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12523882 ] 

Vasily Zakharov commented on HARMONY-4696:
------------------------------------------

Simple black box testing of RI shows the following results for 'new URL("file:fileName").openConnection().getContentType()' and 'new JEditorPane("file:fileName").getEditorKit().getContentType()' respectively:

If file is named *.html, regardless of content: text/html, text/html
If file is named *.rtf, regardless of content: application/rtf, text/rtf
If file is named *.txt, regardless of content: text/plain, text/plain
If file is named differently, but contains HTML code: text/html, text/html
Otherwise: content/unknown, text/plain

In other words, it means RI implementation of JEditorPane() fully relies upon URLConnection.getContentType() for determining content type, and just converts application/rtf to text/rtf and content/unknown to text/plain.


> [classlib][swing][html] JEditorPane doesn't recognize HTML by file name
> -----------------------------------------------------------------------
>
>                 Key: HARMONY-4696
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4696
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Vasily Zakharov
>            Priority: Minor
>         Attachments: Harmony.jpg, RI.jpg
>
>
> The following simple test demonstrates the problem:
> import javax.swing.JFrame;
> import javax.swing.JEditorPane;
> public class Test {
>     public static void main(String argv[]) {
>         try {
>             JFrame frame = new JFrame();
>             frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
>             frame.add(new JEditorPane("file:test.html"));
>             frame.setSize(150, 100);
>             frame.setVisible(true);
>         } catch (Exception e) {
>             e.printStackTrace(System.out);
>         }
>     }
> } 
> test.html:
> normal <i>italic
> test.html contains HTML code not clearly detectable as HTML. However, this code is contained in file having .html extension, and it's enough for RI to use HTML renderer. Harmony doesn't do it. The attached screenshots demonstrate the results on RI and Harmony.

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


[jira] Commented: (HARMONY-4696) [classlib][swing][html] JEditorPane doesn't recognize HTML by file name

Posted by "Alexey A. Ivanov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-4696?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12523601 ] 

Alexey A. Ivanov commented on HARMONY-4696:
-------------------------------------------

It surely doesn't depend on BasicHTML class implementation.

There's some HTML-detection code in JEditorPane. Search for it and fix it.

> [classlib][swing][html] JEditorPane doesn't recognize HTML by file name
> -----------------------------------------------------------------------
>
>                 Key: HARMONY-4696
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4696
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Vasily Zakharov
>            Priority: Minor
>         Attachments: Harmony.jpg, RI.jpg
>
>
> The following simple test demonstrates the problem:
> import javax.swing.JFrame;
> import javax.swing.JEditorPane;
> public class Test {
>     public static void main(String argv[]) {
>         try {
>             JFrame frame = new JFrame();
>             frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
>             frame.add(new JEditorPane("file:test.html"));
>             frame.setSize(150, 100);
>             frame.setVisible(true);
>         } catch (Exception e) {
>             e.printStackTrace(System.out);
>         }
>     }
> } 
> test.html:
> normal <i>italic
> test.html contains HTML code not clearly detectable as HTML. However, this code is contained in file having .html extension, and it's enough for RI to use HTML renderer. Harmony doesn't do it. The attached screenshots demonstrate the results on RI and Harmony.

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


[jira] Commented: (HARMONY-4696) [classlib][swing][html] JEditorPane doesn't recognize HTML by file name

Posted by "Vasily Zakharov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-4696?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12523825 ] 

Vasily Zakharov commented on HARMONY-4696:
------------------------------------------

I suspect JEditorPane.getStream() is a right place to fix. And I wonder if we could use url.openConnection().getContentType() instead of getContentTypeByInputStream() - it alone would probably resolve the problem. I'll test thoroughly.


> [classlib][swing][html] JEditorPane doesn't recognize HTML by file name
> -----------------------------------------------------------------------
>
>                 Key: HARMONY-4696
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4696
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Vasily Zakharov
>            Priority: Minor
>         Attachments: Harmony.jpg, RI.jpg
>
>
> The following simple test demonstrates the problem:
> import javax.swing.JFrame;
> import javax.swing.JEditorPane;
> public class Test {
>     public static void main(String argv[]) {
>         try {
>             JFrame frame = new JFrame();
>             frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
>             frame.add(new JEditorPane("file:test.html"));
>             frame.setSize(150, 100);
>             frame.setVisible(true);
>         } catch (Exception e) {
>             e.printStackTrace(System.out);
>         }
>     }
> } 
> test.html:
> normal <i>italic
> test.html contains HTML code not clearly detectable as HTML. However, this code is contained in file having .html extension, and it's enough for RI to use HTML renderer. Harmony doesn't do it. The attached screenshots demonstrate the results on RI and Harmony.

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


[jira] Commented: (HARMONY-4696) [classlib][swing][html] JEditorPane doesn't recognize HTML by file name

Posted by "Vasily Zakharov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-4696?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12523589 ] 

Vasily Zakharov commented on HARMONY-4696:
------------------------------------------

The proper place for a fix seems to be in JEditorPane.getStream().


> [classlib][swing][html] JEditorPane doesn't recognize HTML by file name
> -----------------------------------------------------------------------
>
>                 Key: HARMONY-4696
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4696
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Vasily Zakharov
>            Priority: Minor
>         Attachments: Harmony.jpg, RI.jpg
>
>
> The following simple test demonstrates the problem:
> import javax.swing.JFrame;
> import javax.swing.JEditorPane;
> public class Test {
>     public static void main(String argv[]) {
>         try {
>             JFrame frame = new JFrame();
>             frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
>             frame.add(new JEditorPane("file:test.html"));
>             frame.setSize(150, 100);
>             frame.setVisible(true);
>         } catch (Exception e) {
>             e.printStackTrace(System.out);
>         }
>     }
> } 
> test.html:
> normal <i>italic
> test.html contains HTML code not clearly detectable as HTML. However, this code is contained in file having .html extension, and it's enough for RI to use HTML renderer. Harmony doesn't do it. The attached screenshots demonstrate the results on RI and Harmony.

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


[jira] Updated: (HARMONY-4696) [classlib][swing][html] JEditorPane doesn't recognize HTML by file name

Posted by "Vasily Zakharov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-4696?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Vasily Zakharov updated HARMONY-4696:
-------------------------------------

    Attachment: Harmony-4696-Fix.patch

> [classlib][swing][html] JEditorPane doesn't recognize HTML by file name
> -----------------------------------------------------------------------
>
>                 Key: HARMONY-4696
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4696
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Vasily Zakharov
>            Priority: Minor
>         Attachments: Harmony-4696-Fix.patch, Harmony.jpg, RI.jpg
>
>
> The following simple test demonstrates the problem:
> import javax.swing.JFrame;
> import javax.swing.JEditorPane;
> public class Test {
>     public static void main(String argv[]) {
>         try {
>             JFrame frame = new JFrame();
>             frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
>             frame.add(new JEditorPane("file:test.html"));
>             frame.setSize(150, 100);
>             frame.setVisible(true);
>         } catch (Exception e) {
>             e.printStackTrace(System.out);
>         }
>     }
> } 
> test.html:
> normal <i>italic
> test.html contains HTML code not clearly detectable as HTML. However, this code is contained in file having .html extension, and it's enough for RI to use HTML renderer. Harmony doesn't do it. The attached screenshots demonstrate the results on RI and Harmony.

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


[jira] Updated: (HARMONY-4696) [classlib][swing][html] JEditorPane doesn't recognize HTML by file name

Posted by "Vasily Zakharov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-4696?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Vasily Zakharov updated HARMONY-4696:
-------------------------------------

    Attachment: Harmony-4696-Test.patch

> [classlib][swing][html] JEditorPane doesn't recognize HTML by file name
> -----------------------------------------------------------------------
>
>                 Key: HARMONY-4696
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4696
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Vasily Zakharov
>            Assignee: Tim Ellison
>         Attachments: Harmony-4696-Fix.patch, Harmony-4696-Test.patch, Harmony.jpg, RI.jpg
>
>
> The following simple test demonstrates the problem:
> import javax.swing.JFrame;
> import javax.swing.JEditorPane;
> public class Test {
>     public static void main(String argv[]) {
>         try {
>             JFrame frame = new JFrame();
>             frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
>             frame.add(new JEditorPane("file:test.html"));
>             frame.setSize(150, 100);
>             frame.setVisible(true);
>         } catch (Exception e) {
>             e.printStackTrace(System.out);
>         }
>     }
> } 
> test.html:
> normal <i>italic
> test.html contains HTML code not clearly detectable as HTML. However, this code is contained in file having .html extension, and it's enough for RI to use HTML renderer. Harmony doesn't do it. The attached screenshots demonstrate the results on RI and Harmony.

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


[jira] Commented: (HARMONY-4696) [classlib][swing][html] JEditorPane doesn't recognize HTML by file name

Posted by "Vasily Zakharov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-4696?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12523588 ] 

Vasily Zakharov commented on HARMONY-4696:
------------------------------------------

Here's another reproducer:

import javax.swing.JEditorPane;
import javax.swing.text.EditorKit;
public class Test {
    public static void main(String argv[]) {
        try {
            JEditorPane editorPane = new JEditorPane();
            EditorKit editorKit = editorPane.getEditorKit();
            System.out.println("BEFORE:");
            System.out.println("EditorKit:" + editorKit);
            System.out.println("DefaultDocument: " + editorKit.createDefaultDocument());
            System.out.println("ContentType: " + editorKit.getContentType());
            System.out.println("ViewFactory: " + editorKit.getViewFactory());
            editorPane.setPage("file:test.html");
            editorKit = editorPane.getEditorKit();
            System.out.println("AFTER:");
            System.out.println("EditorKit:" + editorKit);
            System.out.println("DefaultDocument: " + editorKit.createDefaultDocument());
            System.out.println("ContentType: " + editorKit.getContentType());
            System.out.println("ViewFactory: " + editorKit.getViewFactory());
        } catch (Exception e) {
            e.printStackTrace(System.out);
        }
    }
} 

Output on RI:

BEFORE:
EditorKit:javax.swing.JEditorPane$PlainEditorKit@1198891
DefaultDocument: javax.swing.text.PlainDocument@1551d7f
ContentType: text/plain
ViewFactory: javax.swing.JEditorPane$PlainEditorKit@1198891
AFTER:
EditorKit:javax.swing.text.html.HTMLEditorKit@1712b3a
DefaultDocument: javax.swing.text.html.HTMLDocument@ba5c7a
ContentType: text/html
ViewFactory: javax.swing.text.html.HTMLEditorKit$HTMLFactory@10d593e

Output on Harmony:

BEFORE:
EditorKit:javax.swing.JEditorPane$PlainEditorKit@6b646b64
DefaultDocument: javax.swing.text.PlainDocument@59c659c6
ContentType: text/plain
ViewFactory: javax.swing.JEditorPane$PlainEditorKit@6b646b64
AFTER:
EditorKit:javax.swing.JEditorPane$PlainEditorKit@6b646b64
DefaultDocument: javax.swing.text.PlainDocument@78787878
ContentType: text/plain
ViewFactory: javax.swing.JEditorPane$PlainEditorKit@6b646b64


> [classlib][swing][html] JEditorPane doesn't recognize HTML by file name
> -----------------------------------------------------------------------
>
>                 Key: HARMONY-4696
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4696
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Vasily Zakharov
>            Priority: Minor
>         Attachments: Harmony.jpg, RI.jpg
>
>
> The following simple test demonstrates the problem:
> import javax.swing.JFrame;
> import javax.swing.JEditorPane;
> public class Test {
>     public static void main(String argv[]) {
>         try {
>             JFrame frame = new JFrame();
>             frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
>             frame.add(new JEditorPane("file:test.html"));
>             frame.setSize(150, 100);
>             frame.setVisible(true);
>         } catch (Exception e) {
>             e.printStackTrace(System.out);
>         }
>     }
> } 
> test.html:
> normal <i>italic
> test.html contains HTML code not clearly detectable as HTML. However, this code is contained in file having .html extension, and it's enough for RI to use HTML renderer. Harmony doesn't do it. The attached screenshots demonstrate the results on RI and Harmony.

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


[jira] Commented: (HARMONY-4696) [classlib][swing][html] JEditorPane doesn't recognize HTML by file name

Posted by "Tim Ellison (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-4696?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12524798 ] 

Tim Ellison commented on HARMONY-4696:
--------------------------------------

Regression test committed in SWING module at repo revision r572749.


> [classlib][swing][html] JEditorPane doesn't recognize HTML by file name
> -----------------------------------------------------------------------
>
>                 Key: HARMONY-4696
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4696
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Vasily Zakharov
>            Assignee: Tim Ellison
>         Attachments: Harmony-4696-Fix.patch, Harmony-4696-Test.patch, Harmony.jpg, RI.jpg
>
>
> The following simple test demonstrates the problem:
> import javax.swing.JFrame;
> import javax.swing.JEditorPane;
> public class Test {
>     public static void main(String argv[]) {
>         try {
>             JFrame frame = new JFrame();
>             frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
>             frame.add(new JEditorPane("file:test.html"));
>             frame.setSize(150, 100);
>             frame.setVisible(true);
>         } catch (Exception e) {
>             e.printStackTrace(System.out);
>         }
>     }
> } 
> test.html:
> normal <i>italic
> test.html contains HTML code not clearly detectable as HTML. However, this code is contained in file having .html extension, and it's enough for RI to use HTML renderer. Harmony doesn't do it. The attached screenshots demonstrate the results on RI and Harmony.

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


[jira] Commented: (HARMONY-4696) [classlib][swing][html] JEditorPane doesn't recognize HTML by file name

Posted by "Vasily Zakharov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-4696?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12524093 ] 

Vasily Zakharov commented on HARMONY-4696:
------------------------------------------

URLConnection.getContentType() performed wrong (see HARMONY-4699), and relying upon it was difficult.

Now when HARMONY-4699 is fixed, we can provide the proper behavior for JEditorPane.getStream(). The attached patch contains the following changes:

- Added correct content type determining through URLConnection.getContentType() in getStream() and setContentType(). This way, checking file names and content is only done in one place.

- Just in case the content types table changes in future, added support for both text/rtf and application/rtf (see HARMONY-4699).

- Removed contentType field, getContentType() method now returns editorKit.getContentType() - this way, the content type in JEditorPane and EditorKit is always consistent, and content type for RTF would always be "text/rtf" (as in RI), even if initial content type from URLConnection.getContentType() was "application/rtf" (this feature would only be visible after RTFEditorKit is implemented, but it's good anyway).

- Method getContentTypeByInputStream() is removed, as URLConnection.guessContentTypeFromStream() does the same.

- Method getContentTypeByEditorKit() is removed, as EditorKit.getContentType() does the same in simpler way.


> [classlib][swing][html] JEditorPane doesn't recognize HTML by file name
> -----------------------------------------------------------------------
>
>                 Key: HARMONY-4696
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4696
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Vasily Zakharov
>            Priority: Minor
>         Attachments: Harmony-4696-Fix.patch, Harmony.jpg, RI.jpg
>
>
> The following simple test demonstrates the problem:
> import javax.swing.JFrame;
> import javax.swing.JEditorPane;
> public class Test {
>     public static void main(String argv[]) {
>         try {
>             JFrame frame = new JFrame();
>             frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
>             frame.add(new JEditorPane("file:test.html"));
>             frame.setSize(150, 100);
>             frame.setVisible(true);
>         } catch (Exception e) {
>             e.printStackTrace(System.out);
>         }
>     }
> } 
> test.html:
> normal <i>italic
> test.html contains HTML code not clearly detectable as HTML. However, this code is contained in file having .html extension, and it's enough for RI to use HTML renderer. Harmony doesn't do it. The attached screenshots demonstrate the results on RI and Harmony.

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


[jira] Updated: (HARMONY-4696) [classlib][swing][html] JEditorPane doesn't recognize HTML by file name

Posted by "Vasily Zakharov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-4696?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Vasily Zakharov updated HARMONY-4696:
-------------------------------------

    Attachment: RI.jpg

> [classlib][swing][html] JEditorPane doesn't recognize HTML by file name
> -----------------------------------------------------------------------
>
>                 Key: HARMONY-4696
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4696
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Vasily Zakharov
>            Priority: Minor
>         Attachments: Harmony.jpg, RI.jpg
>
>
> The following simple test demonstrates the problem:
> import javax.swing.JFrame;
> import javax.swing.JEditorPane;
> public class Test {
>     public static void main(String argv[]) {
>         try {
>             JFrame frame = new JFrame();
>             frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
>             frame.add(new JEditorPane("file:test.html"));
>             frame.setSize(150, 100);
>             frame.setVisible(true);
>         } catch (Exception e) {
>             e.printStackTrace(System.out);
>         }
>     }
> } 
> test.html:
> normal <i>italic
> test.html contains HTML code not clearly detectable as HTML. However, this code is contained in file having .html extension, and it's enough for RI to use HTML renderer. Harmony doesn't do it. The attached screenshots demonstrate the results on RI and Harmony.

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


[jira] Resolved: (HARMONY-4696) [classlib][swing][html] JEditorPane doesn't recognize HTML by file name

Posted by "Tim Ellison (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-4696?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tim Ellison resolved HARMONY-4696.
----------------------------------

    Resolution: Fixed

Thanks Vasily.

Patch applied to SWING module at repo revision r572253.

Please verify it was applied as you expected.


> [classlib][swing][html] JEditorPane doesn't recognize HTML by file name
> -----------------------------------------------------------------------
>
>                 Key: HARMONY-4696
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4696
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Vasily Zakharov
>            Assignee: Tim Ellison
>         Attachments: Harmony-4696-Fix.patch, Harmony.jpg, RI.jpg
>
>
> The following simple test demonstrates the problem:
> import javax.swing.JFrame;
> import javax.swing.JEditorPane;
> public class Test {
>     public static void main(String argv[]) {
>         try {
>             JFrame frame = new JFrame();
>             frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
>             frame.add(new JEditorPane("file:test.html"));
>             frame.setSize(150, 100);
>             frame.setVisible(true);
>         } catch (Exception e) {
>             e.printStackTrace(System.out);
>         }
>     }
> } 
> test.html:
> normal <i>italic
> test.html contains HTML code not clearly detectable as HTML. However, this code is contained in file having .html extension, and it's enough for RI to use HTML renderer. Harmony doesn't do it. The attached screenshots demonstrate the results on RI and Harmony.

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


[jira] Closed: (HARMONY-4696) [classlib][swing][html] JEditorPane doesn't recognize HTML by file name

Posted by "Tim Ellison (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-4696?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tim Ellison closed HARMONY-4696.
--------------------------------


Verified by Vasily


> [classlib][swing][html] JEditorPane doesn't recognize HTML by file name
> -----------------------------------------------------------------------
>
>                 Key: HARMONY-4696
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4696
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Vasily Zakharov
>            Assignee: Tim Ellison
>         Attachments: Harmony-4696-Fix.patch, Harmony.jpg, RI.jpg
>
>
> The following simple test demonstrates the problem:
> import javax.swing.JFrame;
> import javax.swing.JEditorPane;
> public class Test {
>     public static void main(String argv[]) {
>         try {
>             JFrame frame = new JFrame();
>             frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
>             frame.add(new JEditorPane("file:test.html"));
>             frame.setSize(150, 100);
>             frame.setVisible(true);
>         } catch (Exception e) {
>             e.printStackTrace(System.out);
>         }
>     }
> } 
> test.html:
> normal <i>italic
> test.html contains HTML code not clearly detectable as HTML. However, this code is contained in file having .html extension, and it's enough for RI to use HTML renderer. Harmony doesn't do it. The attached screenshots demonstrate the results on RI and Harmony.

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


[jira] Commented: (HARMONY-4696) [classlib][swing][html] JEditorPane doesn't recognize HTML by file name

Posted by "Vasily Zakharov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-4696?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12523866 ] 

Vasily Zakharov commented on HARMONY-4696:
------------------------------------------

Simple black box testing of RI shows the following results for 'new URL("file:fileName").openConnection().getContentType()' and 'new JEditorPane("file:fileName").getEditorKit().getContentType()' respectively:

If file is named *.html, regardless of content: text/html, text/html
If file is named *.rtf, regardless of content: application/rtf, text/rtf
If file is named *.txt, regardless of content: text/plain
If file is named differently, but contains HTML code: text/html, text/html
Otherwise: content/unknown, text/plain

In other words, it means RI implementation of JEditorPane() fully relies upon URLConnection.getContentType() for determining content type, and just converts application/rtf to text/rtf and content/unknown to text/plain.


> [classlib][swing][html] JEditorPane doesn't recognize HTML by file name
> -----------------------------------------------------------------------
>
>                 Key: HARMONY-4696
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4696
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Vasily Zakharov
>            Priority: Minor
>         Attachments: Harmony.jpg, RI.jpg
>
>
> The following simple test demonstrates the problem:
> import javax.swing.JFrame;
> import javax.swing.JEditorPane;
> public class Test {
>     public static void main(String argv[]) {
>         try {
>             JFrame frame = new JFrame();
>             frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
>             frame.add(new JEditorPane("file:test.html"));
>             frame.setSize(150, 100);
>             frame.setVisible(true);
>         } catch (Exception e) {
>             e.printStackTrace(System.out);
>         }
>     }
> } 
> test.html:
> normal <i>italic
> test.html contains HTML code not clearly detectable as HTML. However, this code is contained in file having .html extension, and it's enough for RI to use HTML renderer. Harmony doesn't do it. The attached screenshots demonstrate the results on RI and Harmony.

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


[jira] Assigned: (HARMONY-4696) [classlib][swing][html] JEditorPane doesn't recognize HTML by file name

Posted by "Tim Ellison (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-4696?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tim Ellison reassigned HARMONY-4696:
------------------------------------

    Assignee: Tim Ellison

> [classlib][swing][html] JEditorPane doesn't recognize HTML by file name
> -----------------------------------------------------------------------
>
>                 Key: HARMONY-4696
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4696
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Vasily Zakharov
>            Assignee: Tim Ellison
>         Attachments: Harmony-4696-Fix.patch, Harmony.jpg, RI.jpg
>
>
> The following simple test demonstrates the problem:
> import javax.swing.JFrame;
> import javax.swing.JEditorPane;
> public class Test {
>     public static void main(String argv[]) {
>         try {
>             JFrame frame = new JFrame();
>             frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
>             frame.add(new JEditorPane("file:test.html"));
>             frame.setSize(150, 100);
>             frame.setVisible(true);
>         } catch (Exception e) {
>             e.printStackTrace(System.out);
>         }
>     }
> } 
> test.html:
> normal <i>italic
> test.html contains HTML code not clearly detectable as HTML. However, this code is contained in file having .html extension, and it's enough for RI to use HTML renderer. Harmony doesn't do it. The attached screenshots demonstrate the results on RI and Harmony.

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


[jira] Updated: (HARMONY-4696) [classlib][swing][html] JEditorPane doesn't recognize HTML by file name

Posted by "Vasily Zakharov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-4696?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Vasily Zakharov updated HARMONY-4696:
-------------------------------------

    Priority: Major  (was: Minor)

> [classlib][swing][html] JEditorPane doesn't recognize HTML by file name
> -----------------------------------------------------------------------
>
>                 Key: HARMONY-4696
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4696
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Vasily Zakharov
>         Attachments: Harmony-4696-Fix.patch, Harmony.jpg, RI.jpg
>
>
> The following simple test demonstrates the problem:
> import javax.swing.JFrame;
> import javax.swing.JEditorPane;
> public class Test {
>     public static void main(String argv[]) {
>         try {
>             JFrame frame = new JFrame();
>             frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
>             frame.add(new JEditorPane("file:test.html"));
>             frame.setSize(150, 100);
>             frame.setVisible(true);
>         } catch (Exception e) {
>             e.printStackTrace(System.out);
>         }
>     }
> } 
> test.html:
> normal <i>italic
> test.html contains HTML code not clearly detectable as HTML. However, this code is contained in file having .html extension, and it's enough for RI to use HTML renderer. Harmony doesn't do it. The attached screenshots demonstrate the results on RI and Harmony.

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


[jira] Updated: (HARMONY-4696) [classlib][swing][html] JEditorPane doesn't recognize HTML by file name

Posted by "Vasily Zakharov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-4696?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Vasily Zakharov updated HARMONY-4696:
-------------------------------------

    Patch Info: [Patch Available]

> [classlib][swing][html] JEditorPane doesn't recognize HTML by file name
> -----------------------------------------------------------------------
>
>                 Key: HARMONY-4696
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4696
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Vasily Zakharov
>            Priority: Minor
>         Attachments: Harmony-4696-Fix.patch, Harmony.jpg, RI.jpg
>
>
> The following simple test demonstrates the problem:
> import javax.swing.JFrame;
> import javax.swing.JEditorPane;
> public class Test {
>     public static void main(String argv[]) {
>         try {
>             JFrame frame = new JFrame();
>             frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
>             frame.add(new JEditorPane("file:test.html"));
>             frame.setSize(150, 100);
>             frame.setVisible(true);
>         } catch (Exception e) {
>             e.printStackTrace(System.out);
>         }
>     }
> } 
> test.html:
> normal <i>italic
> test.html contains HTML code not clearly detectable as HTML. However, this code is contained in file having .html extension, and it's enough for RI to use HTML renderer. Harmony doesn't do it. The attached screenshots demonstrate the results on RI and Harmony.

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


[jira] Commented: (HARMONY-4696) [classlib][swing][html] JEditorPane doesn't recognize HTML by file name

Posted by "Vasily Zakharov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-4696?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12525122 ] 

Vasily Zakharov commented on HARMONY-4696:
------------------------------------------

Thanks, Tim, the test patch is ok.


> [classlib][swing][html] JEditorPane doesn't recognize HTML by file name
> -----------------------------------------------------------------------
>
>                 Key: HARMONY-4696
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4696
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Vasily Zakharov
>            Assignee: Tim Ellison
>         Attachments: Harmony-4696-Fix.patch, Harmony-4696-Test.patch, Harmony.jpg, RI.jpg
>
>
> The following simple test demonstrates the problem:
> import javax.swing.JFrame;
> import javax.swing.JEditorPane;
> public class Test {
>     public static void main(String argv[]) {
>         try {
>             JFrame frame = new JFrame();
>             frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
>             frame.add(new JEditorPane("file:test.html"));
>             frame.setSize(150, 100);
>             frame.setVisible(true);
>         } catch (Exception e) {
>             e.printStackTrace(System.out);
>         }
>     }
> } 
> test.html:
> normal <i>italic
> test.html contains HTML code not clearly detectable as HTML. However, this code is contained in file having .html extension, and it's enough for RI to use HTML renderer. Harmony doesn't do it. The attached screenshots demonstrate the results on RI and Harmony.

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


[jira] Updated: (HARMONY-4696) [classlib][swing][html] JEditorPane doesn't recognize HTML by file name

Posted by "Vasily Zakharov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-4696?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Vasily Zakharov updated HARMONY-4696:
-------------------------------------

    Comment: was deleted

> [classlib][swing][html] JEditorPane doesn't recognize HTML by file name
> -----------------------------------------------------------------------
>
>                 Key: HARMONY-4696
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4696
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Vasily Zakharov
>            Priority: Minor
>         Attachments: Harmony.jpg, RI.jpg
>
>
> The following simple test demonstrates the problem:
> import javax.swing.JFrame;
> import javax.swing.JEditorPane;
> public class Test {
>     public static void main(String argv[]) {
>         try {
>             JFrame frame = new JFrame();
>             frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
>             frame.add(new JEditorPane("file:test.html"));
>             frame.setSize(150, 100);
>             frame.setVisible(true);
>         } catch (Exception e) {
>             e.printStackTrace(System.out);
>         }
>     }
> } 
> test.html:
> normal <i>italic
> test.html contains HTML code not clearly detectable as HTML. However, this code is contained in file having .html extension, and it's enough for RI to use HTML renderer. Harmony doesn't do it. The attached screenshots demonstrate the results on RI and Harmony.

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