-
CSR
-
Resolution: Unresolved
-
P4
-
None
-
binary
-
minimal
-
Gracefully avoid NullPointerException and create BevelBorder from valid type param
-
Java API
-
SE
Summary
BorderFactory.createBevelBorder and BorderFactory.createSoftBevelBorder should not throw NullPointerException when null value is passed as highlight color and shadow color
Problem
BorderFactory.createBevelBorder and BorderFactory.createSoftBevelBorder throws NullPointerException when null value is passed as highlight color and shadow color
Solution
BorderFactory.createBevelBorder and BorderFactory.createSoftBevelBorder
should fallback to create BevelBorder and SoftBevelBorder from type field if passed highlight and shadow color is null
Specification
javax.swing.BorderFactory
* Creates a beveled border of the specified type, using
* the specified highlighting and shadowing. The outer
* edge of the highlighted area uses a brighter shade of
* the highlight color. The inner edge of the shadow area
* uses a brighter shade of the shadow color.
+ * If highlight and shadow color are null, then it will
+ * fallback to create beveled border of the specified type.
*
public static Border createBevelBorder(int type, Color highlight, Color shadow)
* The outer edge of the highlight area uses
* a brighter shade of the {@code highlight} color.
* The inner edge of the shadow area uses
* a brighter shade of the {@code shadow} color.
+ * If highlight and shadow color are null, then it will
+ * fallback to create beveled border of the specified type with softened corners.
*
public static Border createSoftBevelBorder(int type, Color highlight, Color shadow) {
- csr of
-
JDK-8370467 BorderFactory.createBevelBorder and createSoftBevelBorder throws NPE for null highlight and shadow
-
- Open
-