[ http://issues.apache.org/jira/browse/HARMONY-2566?page=all ]
Alexey A. Ivanov updated HARMONY-2566:
--------------------------------------
Patch Info: [Patch Available]
> [classlib][swing] j.s.text.GapContent.getChars throws NPE rather than BadLocationException
> ------------------------------------------------------------------------------------------
>
> Key: HARMONY-2566
> URL: http://issues.apache.org/jira/browse/HARMONY-2566
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Reporter: Alexey A. Ivanov
> Attachments: H2566-GapContent.patch, H2566-GapContentTest.patch
>
>
> Consider the following code:
> import javax.swing.text.GapContent;
> public class Test {
> public static void main(String[] args) {
> GapContent content = new GapContent();
> try {
> content.getChars(1, Integer.MAX_VALUE, null);
> } catch (Exception e) {
> e.printStackTrace();
> }
> }
> }
> ------------ end of code ------------
> Running this application on Harmony produces the output:
> java.lang.NullPointerException
> at javax.swing.text.GapContent.getChars(GapContent.java:152)
> at Test.main(Test.java:7)
> ------------ end of Harmony output ------------
> Whereas RI throws BadLocationException:
> javax.swing.text.BadLocationException: Invalid location
> at javax.swing.text.GapContent.getChars(GapContent.java:169)
> at Test.main(Test.java:7)
> ------------ end of RI output ------------
--
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
|