harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexey A. Ivanov (JIRA)" <j...@apache.org>
Subject [jira] Updated: (HARMONY-2776) [classlib][swing] j.s.text.BoxView.childAllocation does not throw NPE whereas RI does
Date Mon, 18 Dec 2006 13:08:22 GMT
     [ http://issues.apache.org/jira/browse/HARMONY-2776?page=all ]

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

    Attachment: H2776-BoxView.patch

The fix: moved the check shape == null from childAllocation() to getChildAllocation(). These
are the methods which were changed.
Also added @Override annotations where applicable.

> [classlib][swing] j.s.text.BoxView.childAllocation does not throw NPE whereas RI does
> -------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2776
>                 URL: http://issues.apache.org/jira/browse/HARMONY-2776
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Alexey A. Ivanov
>            Priority: Minor
>         Attachments: H2776-BoxView.patch, H2776-BoxView_WithChildrenTest.patch
>
>
> Consider the following example:
> import java.awt.Rectangle;
> import javax.swing.text.BoxView;
> import javax.swing.text.Element;
> import javax.swing.text.PlainDocument;
> import javax.swing.text.View;
> public class Test {
>     private static class BV extends BoxView {
>         public BV(final Element element, final int axis) {
>             super(element, axis);
>         }
>         @Override
>         public void childAllocation(final int index, final Rectangle alloc) {
>             super.childAllocation(index, alloc);
>         }
>     }
>     public static void main(String[] args) {
>         BV bv = new BV(new PlainDocument().getDefaultRootElement(), View.Y_AXIS);
>         bv.childAllocation(0, null);
>         System.err.println("silent");
>     }
> }
> ======= end of code =======
> Harmony prints:
> silent
> RI prints:
> java.lang.NullPointerException
> 	at javax.swing.text.BoxView.childAllocation(BoxView.java:669)
> 	at Test$BV.childAllocation(Test.java:59)
> 	at Test.main(Test.java:65)

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