When I fixed RT-23492 I decided that when a property is set to null, (1) the getter returns null, (2) the visual appearance is default.
For example, setting text alignment to null results in left aligned text, get text alignment returns null.
I noticed that Shape this behavior is undefined.
Setting StrokeLineCap to null results in ROUND caps (while the default is SQUARE).
This random and only happen because the way toPGLineCap was coded:
com.sun.javafx.sg.PGShape.StrokeLineCap toPGLineCap(StrokeLineCap t) {
if (t == StrokeLineCap.SQUARE) {
return PGShape.StrokeLineCap.SQUARE;
} else if (t == StrokeLineCap.BUTT) {
return PGShape.StrokeLineCap.BUTT;
} else {
return PGShape.StrokeLineCap.ROUND;
}
}
I open to bug so we can discuss how we want to handle null values or just leave it undefined (as long as doesn't result in a exception).
For example, setting text alignment to null results in left aligned text, get text alignment returns null.
I noticed that Shape this behavior is undefined.
Setting StrokeLineCap to null results in ROUND caps (while the default is SQUARE).
This random and only happen because the way toPGLineCap was coded:
com.sun.javafx.sg.PGShape.StrokeLineCap toPGLineCap(StrokeLineCap t) {
if (t == StrokeLineCap.SQUARE) {
return PGShape.StrokeLineCap.SQUARE;
} else if (t == StrokeLineCap.BUTT) {
return PGShape.StrokeLineCap.BUTT;
} else {
return PGShape.StrokeLineCap.ROUND;
}
}
I open to bug so we can discuss how we want to handle null values or just leave it undefined (as long as doesn't result in a exception).
- relates to
-
JDK-8334883 ☂ Nodes: nullability in properties
- Open