RFR: 6201035: Document NPE for passing null insets to constructors and methods of several Border classes [v4]

Prasanta Sadhukhan psadhukhan at openjdk.org
Mon Oct 31 07:48:39 UTC 2022


On Sat, 29 Oct 2022 21:27:55 GMT, Sergey Bylokhov <serb at openjdk.org> wrote:

>> src/java.desktop/share/classes/javax/swing/border/AbstractBorder.java line 91:
>> 
>>> 89:      *         is {@code null}
>>> 90:      */
>>> 91:     public Insets getBorderInsets(Component c, Insets insets) {
>> 
>> Should the specification be clarified here? The method `getBorderInsets(Component c)` above says the fields of the returned `Insets` object are set to 0. The implementation of `getBorderInsets(Component c, Insets insets)` sets the fields of `Insets` to zero … because it has no other insets.
>> 
>> Should the specification state that this *default implementation* sets the fields of the `Insets` object to zero?
>
> Did we cover all the subclasses?

More classes added

-------------

PR: https://git.openjdk.org/jdk/pull/10740



More information about the client-libs-dev mailing list