You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Alexey A. Ivanov (JIRA)" <ji...@apache.org> on 2006/12/15 13:41:21 UTC

[jira] Created: (HARMONY-2745) [classlib][swing] j.s.text.Utilities.getPosition{Above, Below} throw NPE

[classlib][swing] j.s.text.Utilities.getPosition{Above, Below} throw NPE
------------------------------------------------------------------------

                 Key: HARMONY-2745
                 URL: http://issues.apache.org/jira/browse/HARMONY-2745
             Project: Harmony
          Issue Type: Bug
          Components: Classlib
            Reporter: Alexey A. Ivanov


javax.swing.text.Utilities.getPositionAbove and .getPositionBelow throw NullPointerException whereas RI works silently.

To reproduce, use the following code:
JTextComponent tc = new JEditorPane("text/plain", "");
System.out.println(Utilities.getPositionAbove(tc, 1, 0));
System.out.println(Utilities.getPositionBelow(tc, 1, 0));

------- Harmony -------
java.lang.NullPointerException
	at org.apache.harmony.awt.text.TextUtils.getPositionAbove(TextUtils.java:383)
	at javax.swing.text.Utilities.getPositionAbove(Utilities.java:69)

java.lang.NullPointerException
	at org.apache.harmony.awt.text.TextUtils.getPositionBelow(TextUtils.java:417)
	at javax.swing.text.Utilities.getPositionBelow(Utilities.java:79)
------- end of H -------

------- RI -------
-1
-1
------- end of RI -------

-- 
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

        

[jira] Updated: (HARMONY-2745) [classlib][swing] j.s.text.Utilities.getPosition{Above, Below} throw NPE

Posted by "Alexey A. Ivanov (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-2745?page=all ]

Alexey A. Ivanov updated HARMONY-2745:
--------------------------------------

    Attachment: H2745-o.a.h.awt.text.TextUtils.patch

The fix: modified the conditions where -1 can be returned.

> [classlib][swing] j.s.text.Utilities.getPosition{Above, Below} throw NPE
> ------------------------------------------------------------------------
>
>                 Key: HARMONY-2745
>                 URL: http://issues.apache.org/jira/browse/HARMONY-2745
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Alexey A. Ivanov
>         Attachments: H2745-j.s.text.UtilitiesTest.patch, H2745-o.a.h.awt.text.TextUtils.patch
>
>
> javax.swing.text.Utilities.getPositionAbove and .getPositionBelow throw NullPointerException whereas RI works silently.
> To reproduce, use the following code:
> JTextComponent tc = new JEditorPane("text/plain", "");
> System.out.println(Utilities.getPositionAbove(tc, 1, 0));
> System.out.println(Utilities.getPositionBelow(tc, 1, 0));
> ------- Harmony -------
> java.lang.NullPointerException
> 	at org.apache.harmony.awt.text.TextUtils.getPositionAbove(TextUtils.java:383)
> 	at javax.swing.text.Utilities.getPositionAbove(Utilities.java:69)
> java.lang.NullPointerException
> 	at org.apache.harmony.awt.text.TextUtils.getPositionBelow(TextUtils.java:417)
> 	at javax.swing.text.Utilities.getPositionBelow(Utilities.java:79)
> ------- end of H -------
> ------- RI -------
> -1
> -1
> ------- end of RI -------

-- 
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

        

[jira] Commented: (HARMONY-2745) [classlib][swing] j.s.text.Utilities.getPosition{Above, Below} throw NPE

Posted by "Alexey Petrenko (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-2745?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12470576 ] 

Alexey Petrenko commented on HARMONY-2745:
------------------------------------------

All the swing and awt tests are passed on my machine with your test patch...

> [classlib][swing] j.s.text.Utilities.getPosition{Above, Below} throw NPE
> ------------------------------------------------------------------------
>
>                 Key: HARMONY-2745
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2745
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Alexey A. Ivanov
>         Assigned To: Alexey Petrenko
>         Attachments: H2745-j.s.text.UtilitiesTest.patch, H2745-o.a.h.awt.text.TextUtils.patch
>
>
> javax.swing.text.Utilities.getPositionAbove and .getPositionBelow throw NullPointerException whereas RI works silently.
> To reproduce, use the following code:
> JTextComponent tc = new JEditorPane("text/plain", "");
> System.out.println(Utilities.getPositionAbove(tc, 1, 0));
> System.out.println(Utilities.getPositionBelow(tc, 1, 0));
> ------- Harmony -------
> java.lang.NullPointerException
> 	at org.apache.harmony.awt.text.TextUtils.getPositionAbove(TextUtils.java:383)
> 	at javax.swing.text.Utilities.getPositionAbove(Utilities.java:69)
> java.lang.NullPointerException
> 	at org.apache.harmony.awt.text.TextUtils.getPositionBelow(TextUtils.java:417)
> 	at javax.swing.text.Utilities.getPositionBelow(Utilities.java:79)
> ------- end of H -------
> ------- RI -------
> -1
> -1
> ------- end of RI -------

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HARMONY-2745) [classlib][swing] j.s.text.Utilities.getPosition{Above, Below} throw NPE

Posted by "Alexey A. Ivanov (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-2745?page=all ]

Alexey A. Ivanov updated HARMONY-2745:
--------------------------------------

    Attachment: H2745-j.s.text.UtilitiesTest.patch

Regression tests.

> [classlib][swing] j.s.text.Utilities.getPosition{Above, Below} throw NPE
> ------------------------------------------------------------------------
>
>                 Key: HARMONY-2745
>                 URL: http://issues.apache.org/jira/browse/HARMONY-2745
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Alexey A. Ivanov
>         Attachments: H2745-j.s.text.UtilitiesTest.patch
>
>
> javax.swing.text.Utilities.getPositionAbove and .getPositionBelow throw NullPointerException whereas RI works silently.
> To reproduce, use the following code:
> JTextComponent tc = new JEditorPane("text/plain", "");
> System.out.println(Utilities.getPositionAbove(tc, 1, 0));
> System.out.println(Utilities.getPositionBelow(tc, 1, 0));
> ------- Harmony -------
> java.lang.NullPointerException
> 	at org.apache.harmony.awt.text.TextUtils.getPositionAbove(TextUtils.java:383)
> 	at javax.swing.text.Utilities.getPositionAbove(Utilities.java:69)
> java.lang.NullPointerException
> 	at org.apache.harmony.awt.text.TextUtils.getPositionBelow(TextUtils.java:417)
> 	at javax.swing.text.Utilities.getPositionBelow(Utilities.java:79)
> ------- end of H -------
> ------- RI -------
> -1
> -1
> ------- end of RI -------

-- 
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

        

[jira] Commented: (HARMONY-2745) [classlib][swing] j.s.text.Utilities.getPosition{Above, Below} throw NPE

Posted by "Alexey A. Ivanov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-2745?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12470855 ] 

Alexey A. Ivanov commented on HARMONY-2745:
-------------------------------------------

These tests still fail for me:

testGetPositionAbove
java.lang.NullPointerException
	at org.apache.harmony.awt.text.TextUtils.getPositionAbove(TextUtils.java:382)
	at javax.swing.text.Utilities.getPositionAbove(Utilities.java:69)
	at javax.swing.text.UtilitiesTest.testGetPositionAbove(UtilitiesTest.java:637)
	<SNIP>

testGetPositionBelow
java.lang.NullPointerException
	at org.apache.harmony.awt.text.TextUtils.getPositionBelow(TextUtils.java:416)
	at javax.swing.text.Utilities.getPositionBelow(Utilities.java:79)
	at javax.swing.text.UtilitiesTest.testGetPositionBelow(UtilitiesTest.java:643)
	<SNIP>


The UtilitiesTest is now in the exclude list --- this seem to be the reason all AWT and Swing tests passed for you without the fix.

> [classlib][swing] j.s.text.Utilities.getPosition{Above, Below} throw NPE
> ------------------------------------------------------------------------
>
>                 Key: HARMONY-2745
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2745
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Alexey A. Ivanov
>         Assigned To: Alexey Petrenko
>         Attachments: H2745-j.s.text.UtilitiesTest.patch, H2745-o.a.h.awt.text.TextUtils.patch
>
>
> javax.swing.text.Utilities.getPositionAbove and .getPositionBelow throw NullPointerException whereas RI works silently.
> To reproduce, use the following code:
> JTextComponent tc = new JEditorPane("text/plain", "");
> System.out.println(Utilities.getPositionAbove(tc, 1, 0));
> System.out.println(Utilities.getPositionBelow(tc, 1, 0));
> ------- Harmony -------
> java.lang.NullPointerException
> 	at org.apache.harmony.awt.text.TextUtils.getPositionAbove(TextUtils.java:383)
> 	at javax.swing.text.Utilities.getPositionAbove(Utilities.java:69)
> java.lang.NullPointerException
> 	at org.apache.harmony.awt.text.TextUtils.getPositionBelow(TextUtils.java:417)
> 	at javax.swing.text.Utilities.getPositionBelow(Utilities.java:79)
> ------- end of H -------
> ------- RI -------
> -1
> -1
> ------- end of RI -------

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-2745) [classlib][swing] j.s.text.Utilities.getPosition{Above, Below} throw NPE

Posted by "Alexey Petrenko (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-2745?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12477056 ] 

Alexey Petrenko commented on HARMONY-2745:
------------------------------------------

Yep, I can reproduce it now... Strange...

> [classlib][swing] j.s.text.Utilities.getPosition{Above, Below} throw NPE
> ------------------------------------------------------------------------
>
>                 Key: HARMONY-2745
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2745
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Alexey A. Ivanov
>         Assigned To: Alexey Petrenko
>         Attachments: H2745-j.s.text.UtilitiesTest.patch, H2745-o.a.h.awt.text.TextUtils.patch
>
>
> javax.swing.text.Utilities.getPositionAbove and .getPositionBelow throw NullPointerException whereas RI works silently.
> To reproduce, use the following code:
> JTextComponent tc = new JEditorPane("text/plain", "");
> System.out.println(Utilities.getPositionAbove(tc, 1, 0));
> System.out.println(Utilities.getPositionBelow(tc, 1, 0));
> ------- Harmony -------
> java.lang.NullPointerException
> 	at org.apache.harmony.awt.text.TextUtils.getPositionAbove(TextUtils.java:383)
> 	at javax.swing.text.Utilities.getPositionAbove(Utilities.java:69)
> java.lang.NullPointerException
> 	at org.apache.harmony.awt.text.TextUtils.getPositionBelow(TextUtils.java:417)
> 	at javax.swing.text.Utilities.getPositionBelow(Utilities.java:79)
> ------- end of H -------
> ------- RI -------
> -1
> -1
> ------- end of RI -------

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (HARMONY-2745) [classlib][swing] j.s.text.Utilities.getPosition{Above, Below} throw NPE

Posted by "Alexey A. Ivanov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-2745?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alexey A. Ivanov closed HARMONY-2745.
-------------------------------------

    Estimated Complexity: Moderate

The tests now pass successfully.
Thanks.

> [classlib][swing] j.s.text.Utilities.getPosition{Above, Below} throw NPE
> ------------------------------------------------------------------------
>
>                 Key: HARMONY-2745
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2745
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Alexey A. Ivanov
>         Assigned To: Alexey Petrenko
>         Attachments: H2745-j.s.text.UtilitiesTest.patch, H2745-o.a.h.awt.text.TextUtils.patch
>
>
> javax.swing.text.Utilities.getPositionAbove and .getPositionBelow throw NullPointerException whereas RI works silently.
> To reproduce, use the following code:
> JTextComponent tc = new JEditorPane("text/plain", "");
> System.out.println(Utilities.getPositionAbove(tc, 1, 0));
> System.out.println(Utilities.getPositionBelow(tc, 1, 0));
> ------- Harmony -------
> java.lang.NullPointerException
> 	at org.apache.harmony.awt.text.TextUtils.getPositionAbove(TextUtils.java:383)
> 	at javax.swing.text.Utilities.getPositionAbove(Utilities.java:69)
> java.lang.NullPointerException
> 	at org.apache.harmony.awt.text.TextUtils.getPositionBelow(TextUtils.java:417)
> 	at javax.swing.text.Utilities.getPositionBelow(Utilities.java:79)
> ------- end of H -------
> ------- RI -------
> -1
> -1
> ------- end of RI -------

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-2745) [classlib][swing] j.s.text.Utilities.getPosition{Above, Below} throw NPE

Posted by "Mark Hindess (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-2745?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12464618 ] 

Mark Hindess commented on HARMONY-2745:
---------------------------------------

The new tests fail (even with the fix) with:

testGetPositionAbove                        Error    N/A
                       java.lang.NullPointerException at
                       org.apache.harmony.awt.text.TextUtils.getPositionAbove
                       (TextUtils.java:382) at
                       javax.swing.text.Utilities.getPositionAbove
                       (Utilities.java:69) at
                       javax.swing.text.UtilitiesTest.testGetPositionAbove
                       (UtilitiesTest.java:636) at
                 java.lang.reflect.AccessibleObject.invokeV
                 (AccessibleObject.java:25) at
                 javax.swing.BasicSwingTestCase.runBareSuper
                 (BasicSwingTestCase.java:117) at
                 javax.swing.SwingTestCase$1.run(SwingTestCase.java:45)
                 at java.awt.event.InvocationEvent.runAndNotify
                 (InvocationEvent.java:92) at
                 java.awt.event.InvocationEvent.dispatch
                 (InvocationEvent.java:81) at
                 java.awt.EventQueueCore.dispatchEventImpl
                 (EventQueueCore.java:138) at
                 java.awt.EventQueue.dispatchEvent(EventQueue.java:144)
                 at java.awt.EventDispatchThread.runModalLoop
                 (EventDispatchThread.java:74) at
                 java.awt.EventDispatchThread.run
                 (EventDispatchThread.java:48)

and:

testGetPositionBelow                        Error    N/A                        
                          java.lang.NullPointerException at
                          org.apache.harmony.awt.text.TextUtils.getPositionBelow
                          (TextUtils.java:416) at
                          javax.swing.text.Utilities.getPositionBelow
                          (Utilities.java:79) at
                          javax.swing.text.UtilitiesTest.testGetPositionBelow
                          (UtilitiesTest.java:642) at
                          java.lang.reflect.AccessibleObject.invokeV
                          (AccessibleObject.java:25) at
                          javax.swing.BasicSwingTestCase.runBareSuper
                          (BasicSwingTestCase.java:117) at
                          javax.swing.SwingTestCase$1.run(SwingTestCase.java:45)
                          at java.awt.event.InvocationEvent.runAndNotify
                          (InvocationEvent.java:92) at
                          java.awt.event.InvocationEvent.dispatch
                          (InvocationEvent.java:81) at
                          java.awt.EventQueueCore.dispatchEventImpl
                          (EventQueueCore.java:138) at
                          java.awt.EventQueue.dispatchEvent(EventQueue.java:144)
                          at java.awt.EventDispatchThread.runModalLoop
                          (EventDispatchThread.java:74) at
                          java.awt.EventDispatchThread.run
                          (EventDispatchThread.java:48)


> [classlib][swing] j.s.text.Utilities.getPosition{Above, Below} throw NPE
> ------------------------------------------------------------------------
>
>                 Key: HARMONY-2745
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2745
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Alexey A. Ivanov
>         Attachments: H2745-j.s.text.UtilitiesTest.patch, H2745-o.a.h.awt.text.TextUtils.patch
>
>
> javax.swing.text.Utilities.getPositionAbove and .getPositionBelow throw NullPointerException whereas RI works silently.
> To reproduce, use the following code:
> JTextComponent tc = new JEditorPane("text/plain", "");
> System.out.println(Utilities.getPositionAbove(tc, 1, 0));
> System.out.println(Utilities.getPositionBelow(tc, 1, 0));
> ------- Harmony -------
> java.lang.NullPointerException
> 	at org.apache.harmony.awt.text.TextUtils.getPositionAbove(TextUtils.java:383)
> 	at javax.swing.text.Utilities.getPositionAbove(Utilities.java:69)
> java.lang.NullPointerException
> 	at org.apache.harmony.awt.text.TextUtils.getPositionBelow(TextUtils.java:417)
> 	at javax.swing.text.Utilities.getPositionBelow(Utilities.java:79)
> ------- end of H -------
> ------- RI -------
> -1
> -1
> ------- end of RI -------

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

        

[jira] Resolved: (HARMONY-2745) [classlib][swing] j.s.text.Utilities.getPosition{Above, Below} throw NPE

Posted by "Alexey Petrenko (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-2745?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alexey Petrenko resolved HARMONY-2745.
--------------------------------------

    Resolution: Fixed

The patch has been applied. Please verify.

> [classlib][swing] j.s.text.Utilities.getPosition{Above, Below} throw NPE
> ------------------------------------------------------------------------
>
>                 Key: HARMONY-2745
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2745
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Alexey A. Ivanov
>         Assigned To: Alexey Petrenko
>         Attachments: H2745-j.s.text.UtilitiesTest.patch, H2745-o.a.h.awt.text.TextUtils.patch
>
>
> javax.swing.text.Utilities.getPositionAbove and .getPositionBelow throw NullPointerException whereas RI works silently.
> To reproduce, use the following code:
> JTextComponent tc = new JEditorPane("text/plain", "");
> System.out.println(Utilities.getPositionAbove(tc, 1, 0));
> System.out.println(Utilities.getPositionBelow(tc, 1, 0));
> ------- Harmony -------
> java.lang.NullPointerException
> 	at org.apache.harmony.awt.text.TextUtils.getPositionAbove(TextUtils.java:383)
> 	at javax.swing.text.Utilities.getPositionAbove(Utilities.java:69)
> java.lang.NullPointerException
> 	at org.apache.harmony.awt.text.TextUtils.getPositionBelow(TextUtils.java:417)
> 	at javax.swing.text.Utilities.getPositionBelow(Utilities.java:79)
> ------- end of H -------
> ------- RI -------
> -1
> -1
> ------- end of RI -------

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-2745) [classlib][swing] j.s.text.Utilities.getPosition{Above, Below} throw NPE

Posted by "Alexey A. Ivanov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-2745?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12465184 ] 

Alexey A. Ivanov commented on HARMONY-2745:
-------------------------------------------

Since the fix resides at AWT module, org.apache.harmony.*AWT*.text.TextUtils, you should have updated the module before running the test.
Without updating the AWT module, the command

ant -Dbuild.module=swing -Dtest.case=javax.swing.text.UtilitiesTest test

will report the same failures as you posted in the comment above.

Please try again.
Thank you in advance.

> [classlib][swing] j.s.text.Utilities.getPosition{Above, Below} throw NPE
> ------------------------------------------------------------------------
>
>                 Key: HARMONY-2745
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2745
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Alexey A. Ivanov
>         Attachments: H2745-j.s.text.UtilitiesTest.patch, H2745-o.a.h.awt.text.TextUtils.patch
>
>
> javax.swing.text.Utilities.getPositionAbove and .getPositionBelow throw NullPointerException whereas RI works silently.
> To reproduce, use the following code:
> JTextComponent tc = new JEditorPane("text/plain", "");
> System.out.println(Utilities.getPositionAbove(tc, 1, 0));
> System.out.println(Utilities.getPositionBelow(tc, 1, 0));
> ------- Harmony -------
> java.lang.NullPointerException
> 	at org.apache.harmony.awt.text.TextUtils.getPositionAbove(TextUtils.java:383)
> 	at javax.swing.text.Utilities.getPositionAbove(Utilities.java:69)
> java.lang.NullPointerException
> 	at org.apache.harmony.awt.text.TextUtils.getPositionBelow(TextUtils.java:417)
> 	at javax.swing.text.Utilities.getPositionBelow(Utilities.java:79)
> ------- end of H -------
> ------- RI -------
> -1
> -1
> ------- end of RI -------

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

        

[jira] Assigned: (HARMONY-2745) [classlib][swing] j.s.text.Utilities.getPosition{Above, Below} throw NPE

Posted by "Alexey Petrenko (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-2745?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alexey Petrenko reassigned HARMONY-2745:
----------------------------------------

    Assignee: Alexey Petrenko

> [classlib][swing] j.s.text.Utilities.getPosition{Above, Below} throw NPE
> ------------------------------------------------------------------------
>
>                 Key: HARMONY-2745
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2745
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Alexey A. Ivanov
>         Assigned To: Alexey Petrenko
>         Attachments: H2745-j.s.text.UtilitiesTest.patch, H2745-o.a.h.awt.text.TextUtils.patch
>
>
> javax.swing.text.Utilities.getPositionAbove and .getPositionBelow throw NullPointerException whereas RI works silently.
> To reproduce, use the following code:
> JTextComponent tc = new JEditorPane("text/plain", "");
> System.out.println(Utilities.getPositionAbove(tc, 1, 0));
> System.out.println(Utilities.getPositionBelow(tc, 1, 0));
> ------- Harmony -------
> java.lang.NullPointerException
> 	at org.apache.harmony.awt.text.TextUtils.getPositionAbove(TextUtils.java:383)
> 	at javax.swing.text.Utilities.getPositionAbove(Utilities.java:69)
> java.lang.NullPointerException
> 	at org.apache.harmony.awt.text.TextUtils.getPositionBelow(TextUtils.java:417)
> 	at javax.swing.text.Utilities.getPositionBelow(Utilities.java:79)
> ------- end of H -------
> ------- RI -------
> -1
> -1
> ------- end of RI -------

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.