In message <[email protected]>, Tim Ellison writes:
>
> On 26/Nov/2009 13:14, Mark Hindess wrote:
> > In message <[email protected]>,
> > Mark Hindess writes:
> >> In message <[email protected]>, Oliver Deakin writes:
> >>> I have updated this morning and I only see 1 consistent failure on
> >>> Windows x86 now:
> >>>
> >>> Name Tests
> >>> Errors Failures
> >>> javax.swing.text.html.HTMLDocument_Reader_ActionsTest
> >>> 58 1 1
> >>>
> >>> The bad news is that running this test against the M11 build passes
> >>> for me, so it's something we have broken since the last milestone. I
> >>> have created HARMONY-6392 for these failures.
> >> I see this on Linux too. I'm running a binary chop to try to narrow
> >> down the breaking commit. It is currently testing r822219 which fails
> >> between r820621 (which passes) and r823576 (which fails).
> >
> > It has finished running now and shows the bad commit as:
> >
> > r822846 | tellison | 2009-10-07 19:54:08 +0100 (Wed, 07 Oct 2009)
> > Apply part of patch from HARMONY-6346 ([classlib] [archive] Several
> > archive bugfixes and optimizations)
>
> Thanks Mark. It's not immediately clear how that is connected to the
> failure, so running debug now.
Indeed.
> The simple reproducer is:
>
> public void test() throws IOException, BadLocationException {
>
> StringReader sr = new StringReader("<html><body><pre>line1\n"
> + "<font color='red'>line2 \n line3</font>"
> + "line3</pre>line4 \n line4</body></html>");
>
> HTMLDocument doc = new HTMLDocument();
> new HTMLEditorKit().read(sr, doc, 0);
>
> String range = doc.getText(26, 11);
> assertEquals("line4 line4", range);
> }
>
>
> which passes on the RI, but on Harmony the range is returned as
> "\nline4 line"
While trying to find a smaller reproducer I noticed that:
new HTMLEditorKit().read(new StringReader(
"<html><body><pre></pre></body></html>"), doc, 0);
throws a NullPointerException[0] on r822846 but not before that commit.
I assume it is related but of course it might not be.
Regards,
Mark.
[0] ...
Exception in thread "main" java.lang.NullPointerException
at
javax.swing.text.DefaultStyledDocument$ElementBuffer.insertEndTag(DefaultStyledDocument.java:602)
at
javax.swing.text.DefaultStyledDocument$ElementBuffer.performSpecs(DefaultStyledDocument.java:341)
at
javax.swing.text.DefaultStyledDocument$ElementBuffer.create(DefaultStyledDocument.java:327)
at
javax.swing.text.DefaultStyledDocument.create(DefaultStyledDocument.java:1206)
at javax.swing.text.html.HTMLDocument.access$2(HTMLDocument.java:1)
at
javax.swing.text.html.HTMLDocument$HTMLReader.flushImpl(HTMLDocument.java:864)
at
javax.swing.text.html.HTMLDocument$HTMLReader.flush(HTMLDocument.java:689)
at javax.swing.text.html.HTMLEditorKit.read(HTMLEditorKit.java:737)