Bug 647674

Summary: JTextPane produces incorrect content after parsing the html text
Product: [Fedora] Fedora Reporter: cnsturgeon2000
Component: java-1.6.0-openjdkAssignee: Denis Lila <dlila>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: rawhideCC: ahughes, dbhole, jvanek, langel, lkundrak, mark, mmatejov, omajid
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: java-1.6.0-openjdk-1.6.0.0-48.1.8.4.fc13 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-12-08 15:55:40 EST Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Attachments:
Description Flags
Java source file none

Description cnsturgeon2000 2010-10-29 00:49:35 EDT
Description of problem:
JTextPane produces incorrect content after parsing the html text

Version-Release number of selected component (if applicable):
java version "1.6.0_18"
OpenJDK Runtime Environment (IcedTea6 1.8.2) (fedora-41.1.8.2.fc12-x86_64)
OpenJDK 64-Bit Server VM (build 14.0-b16, mixed mode)


How reproducible:
TestTextPane.java

import javax.swing.JTextPane;
import javax.swing.text.BadLocationException;


public class TestTextPane {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		JTextPane pane = new JTextPane();
		pane.setContentType("text/html");
		String content = "<html><body>http://www.nationmaster.com/red/country/as-australia/mil-military&all=1 Heelhoo</body></html>";
		pane.setText(content);
		
		try {
			System.out.println(pane.getDocument().getText(0, pane.getDocument().getLength()));
		} catch (BadLocationException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

}

Steps to Reproduce:
1. javac TestTextPane.java
2. java TestTextPane
3.
  
Actual results:
http://www.nationmaster.com/red/country/as-australia/mil-military&all;=1 Heelhoo

Expected results:
http://www.nationmaster.com/red/country/as-australia/mil-military&all=1 Heelhoo

Additional info:
The Oracle JDK doesn't have this issue
Comment 1 cnsturgeon2000 2010-10-29 00:50:19 EDT
Created attachment 456375 [details]
Java source file
Comment 2 Fedora Update System 2011-01-18 11:26:01 EST
java-1.6.0-openjdk-1.6.0.0-50.1.9.4.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/java-1.6.0-openjdk-1.6.0.0-50.1.9.4.fc14
Comment 3 Fedora Update System 2011-01-18 11:27:35 EST
java-1.6.0-openjdk-1.6.0.0-48.1.8.4.fc13 has been submitted as an update for Fedora 13.
https://admin.fedoraproject.org/updates/java-1.6.0-openjdk-1.6.0.0-48.1.8.4.fc13
Comment 4 Fedora Update System 2011-01-19 16:05:55 EST
java-1.6.0-openjdk-1.6.0.0-50.1.9.4.fc14 has been pushed to the Fedora 14 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 5 Fedora Update System 2011-01-19 16:09:32 EST
java-1.6.0-openjdk-1.6.0.0-48.1.8.4.fc13 has been pushed to the Fedora 13 stable repository.  If problems still persist, please make note of it in this bug report.