Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 51247 invoked from network); 25 Jul 2007 04:50:53 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 25 Jul 2007 04:50:53 -0000 Received: (qmail 26934 invoked by uid 500); 25 Jul 2007 04:50:54 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 26836 invoked by uid 500); 25 Jul 2007 04:50:53 -0000 Mailing-List: contact commits-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list commits@harmony.apache.org Received: (qmail 26805 invoked by uid 99); 25 Jul 2007 04:50:53 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 24 Jul 2007 21:50:53 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 24 Jul 2007 21:50:51 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 58FE27141ED for ; Tue, 24 Jul 2007 21:50:31 -0700 (PDT) Message-ID: <24919454.1185339031362.JavaMail.jira@brutus> Date: Tue, 24 Jul 2007 21:50:31 -0700 (PDT) From: "Vasily Zakharov (JIRA)" To: commits@harmony.apache.org Subject: [jira] Updated: (HARMONY-4529) [classlib][swing][html] Relative links in HTML are resolved incorrectly In-Reply-To: <928594.1185321151242.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HARMONY-4529?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Vasily Zakharov updated HARMONY-4529: ------------------------------------- Attachment: Harmony-4529-Fix.patch > [classlib][swing][html] Relative links in HTML are resolved incorrectly > ----------------------------------------------------------------------- > > Key: HARMONY-4529 > URL: https://issues.apache.org/jira/browse/HARMONY-4529 > Project: Harmony > Issue Type: Bug > Components: Classlib > Reporter: Vasily Zakharov > Attachments: Harmony-4529-Fix.patch, Harmony-4529-Test.patch, testhtml.jar > > > Here's the test to reproduce the problem: > import java.net.URL; > import javax.swing.JEditorPane; > class Test { > public static void main(String[] args) { > try { > URL url = new URL("jar:file:testhtml.jar!/index.html"); > new JEditorPane(url); > System.out.println("SUCCESS"); > } catch (Throwable e) { > System.out.print("ERROR: "); > e.printStackTrace(System.out); > } > } > } > Don't forget to put the attached testhtml.jar file to the same directory as the test. > Output on RI: > SUCCESS > Ouput on Harmony: > ERROR: java.lang.IllegalArgumentException: URI is not absolute: test.gif > at java.net.URI.toURL(URI.java:1526) > at javax.swing.text.html.HTML.resolveURL(HTML.java:582) > at javax.swing.text.html.HTML.resolveURL(HTML.java:564) > at javax.swing.text.html.ImageView.getImageURL(ImageView.java:76) > at javax.swing.text.html.ImageView.createImage(ImageView.java:246) > at javax.swing.text.html.ImageView.setPropertiesFromAttributes(ImageView.java:239) > at javax.swing.text.html.ImageView.(ImageView.java:65) > at javax.swing.text.html.HTMLEditorKit$HTMLFactory.create(HTMLEditorKit.java:111) > at javax.swing.text.CompositeView.loadChildren(CompositeView.java:235) > at javax.swing.text.FlowView$LogicalView.loadChildren(FlowView.java:259) > at javax.swing.text.CompositeView.setParent(CompositeView.java:116) > at javax.swing.text.FlowView.createLogicalView(FlowView.java:44) > at javax.swing.text.FlowView.loadChildren(FlowView.java:393) > at javax.swing.text.CompositeView.setParent(CompositeView.java:116) > at javax.swing.text.html.ParagraphView.setParent(ParagraphView.java:78) > at javax.swing.text.CompositeView.replace(CompositeView.java:90) > at javax.swing.text.BoxView.replace(BoxView.java:150) > at javax.swing.text.CompositeView.loadChildren(CompositeView.java:238) > at javax.swing.text.CompositeView.setParent(CompositeView.java:116) > at javax.swing.text.html.BlockView.setParent(BlockView.java:61) > at javax.swing.text.CompositeView.replace(CompositeView.java:90) > at javax.swing.text.BoxView.replace(BoxView.java:150) > at javax.swing.text.CompositeView.loadChildren(CompositeView.java:238) > at javax.swing.text.CompositeView.setParent(CompositeView.java:116) > at javax.swing.text.html.BlockView.setParent(BlockView.java:61) > at javax.swing.text.RootView.replace(RootView.java:266) > at javax.swing.text.View.append(View.java:273) > at javax.swing.plaf.basic.BasicTextUI.setView(BasicTextUI.java:864) > at javax.swing.plaf.basic.BasicTextUI.modelChanged(BasicTextUI.java:767) > at javax.swing.plaf.basic.BasicTextUI$Listener.propertyChange(BasicTextUI.java:293) > at java.beans.PropertyChangeSupport.doFirePropertyChange(PropertyChangeSupport.java:263) > at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:54) > at java.awt.Component.firePropertyChangeImpl(Component.java:1668) > at java.awt.Component.firePropertyChange(Component.java:1682) > at javax.swing.text.JTextComponent.setDocument(JTextComponent.java:143) > at javax.swing.JEditorPane.setPage(JEditorPane.java:747) > at javax.swing.JEditorPane.(JEditorPane.java:310) > at Test.main(Test.java:8) > The reason for this problem is javax.swing.text.html.HTML.resolveURL() method uses URI.resolve(String) method to resolve links in HTML, and that method doesn't handle JAR URLs correctly. > The attached patch uses URL(URL, String) constructor instead. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.