<Swing Dev> Bug Report (with fix): NPE in CompoundBorder.getInsets()

Alexander Potochkin Alexander.Potochkin at Sun.COM
Tue Jun 15 13:35:53 UTC 2010


Hello Jon

in the description of this bug
http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=477

we can read that
"It functions correctly when using the JDK from Sun."

Do you have an idea why it happens?

I checked that we don't have the null check in that method
either in the Sun JDK

Thanks
alexp

> Hi,
>
> Downstream in IcedTea there was a report of this NPE:
>
> http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=477
>
> The problem being that, while it checks that each of insideBorder and outsideBorder are non-null before trying to call their getBorderInsets() methods, there is no check that a non-null Insets object is returned before attempting to access its members.  See CR for simple fix:
>
> http://icedtea.classpath.org/~vanaltj/webrevs/swing/bordernpe/webrev/
>
> Comments?
>
> Thanks!
>
> jon




More information about the swing-dev mailing list