RFR: 8370467: BorderFactory.createBevelBorder and createSoftBevelBorder throws NPE for null highlight and shadow [v5]
Sergey Bylokhov
serb at openjdk.org
Tue Nov 4 00:49:05 UTC 2025
On Mon, 3 Nov 2025 10:05:12 GMT, Prasanta Sadhukhan <psadhukhan at openjdk.org> wrote:
>> If we pass null as highlight and shadow color to `BorderFactory.createBevelBorder` and `createSoftBevelBorder`
>> it throws NPE which is not mentioned in the spec as the expected outcome.
>> Fixed the NPE and the spec
>
> Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision:
>
> javadoc
src/java.desktop/share/classes/javax/swing/border/BevelBorder.java line 107:
> 105: public BevelBorder(int bevelType, Color highlight, Color shadow) {
> 106: this(bevelType, (highlight != null) ? highlight.brighter() : null,
> 107: highlight, shadow, (shadow != null) ? shadow.brighter() : null);
The case where the code skips all these parameters and uses the component colors is not documented in this constructor and in the factory methods?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/27949#discussion_r2488277395
More information about the client-libs-dev
mailing list