harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Aleksey Victorivich Yantsen (JIRA)" <j...@apache.org>
Subject [jira] Created: (HARMONY-1745) [classlib][swing] javax.swing.text.CompositeView.getView(int n) throws unspecified ArrayIndexOutOfBoundsException
Date Fri, 06 Oct 2006 10:59:20 GMT
[classlib][swing] javax.swing.text.CompositeView.getView(int n) throws unspecified ArrayIndexOutOfBoundsException
-----------------------------------------------------------------------------------------------------------------

                 Key: HARMONY-1745
                 URL: http://issues.apache.org/jira/browse/HARMONY-1745
             Project: Harmony
          Issue Type: Bug
          Components: Classlib
            Reporter: Aleksey Victorivich Yantsen
            Priority: Minor


Problem: CompositeView.getView(int) throws unspecified ArrayIndexOutOfBoundsException while
RI does not.

Test to reproduce:
import junit.framework.TestCase;

import javax.swing.text.Element;
import javax.swing.text.ParagraphView;
import javax.swing.text.View;
import javax.swing.text.html.HTMLDocument;

public class Test extends TestCase {

	public void testcase() {
		HTMLDocument doc = new HTMLDocument();
		Element localElement = doc.getDefaultRootElement();
		ParagraphView pv = new ParagraphView(localElement);
		View v = null;
		try {
			v = pv.getView(0);
		} catch (ArrayIndexOutOfBoundsException e) {
			e.printStackTrace();
			fail("Got unexpected ArrayIndexOutOfBoundsException : " + e);
		}
	}
}

Output on Sun 1.5: 
================== 
java version "1.5.0_06"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05)
Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode)
.
Time: 0.125

OK (1 test)


Output on Harmony: 
================== 
Apache Harmony Launcher : (c) Copyright 1991, 2006 The Apache Software Foundation or its licensors,
as applicable.
java version "1.5.0" 
pre-alpha : not complete or compatible
svn = r453471, (Oct  6 2006), Windows/ia32/msvc 1310, release build
http://incubator.apache.org/harmony
.java.lang.ArrayIndexOutOfBoundsException: Array index out of range: 0
	at javax.swing.text.CompositeView.getView(CompositeView.java:56)
	at Test.testcase(Test.java:16)
	at java.lang.reflect.AccessibleObject.invokeV(AccessibleObject.java:25)
	at java.lang.reflect.Method.invoke(Method.java:258)
	at junit.framework.TestCase.runTest(TestCase.java:154)
	at junit.framework.TestCase.runBare(TestCase.java:127)
	at junit.framework.TestResult$1.protect(TestResult.java:16)
	at junit.framework.TestResult.runProtected(TestResult.java:124)
	at junit.framework.TestResult.run(TestResult.java:19)
	at junit.framework.TestCase.run(TestCase.java:118)
	at junit.framework.TestSuite.runTest(TestSuite.java:28)
	at junit.framework.TestSuite.run(TestSuite.java:23)
	at junit.textui.TestRunner.doRun(TestRunner.java:116)
	at junit.textui.TestRunner.start(TestRunner.java:172)
	at junit.textui.TestRunner.main(TestRunner.java:138)
F
Time: 0.407
There was 1 failure:
1) testcase(Test)junit.framework.AssertionFailedError: Got unexpected ArrayIndexOutOfBoundsException
: java.lang.ArrayIndexOutOfBoundsException: Array index out of range: 0
	at Test.testcase(Test.java:19)
	at java.lang.reflect.AccessibleObject.invokeV(AccessibleObject.java:25)

FAILURES!!!
Tests run: 1,  Failures: 1,  Errors: 0



-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message