On Wed, 6 Oct 2021 07:43:15 GMT, Marius Hanl <mh...@openjdk.org> wrote:
> This PR fixes a bug where the blend mode will be falsely recognized as a > color and therefore won't be set. > Also a ClassCastException is thrown (The converter expects a String, but gets > a Color). > > Note: There is another similar bug but I can't reproduce it (Tried with > 18-ea+3). > https://bugs.openjdk.java.net/browse/JDK-8268657 > It also looks different so I don't think this PR fixes this, if it is still > there. The fix and the test look fine with one comment below. modules/javafx.graphics/src/main/java/javafx/css/CssParser.java line 822: > 820: int ttype = root.token.getType(); > 821: > 822: if (ttype != CssLexer.STRING && ttype != CssLexer.IDENT || > str == null || str.isEmpty()) { Why did you modify this code? It looks conceptually identical to the previous, but without a check for `root.token == null`. As it is, you will need to prove that `root.token` can never be `null` (I suspect it cannot be, but since `root` is an instance variable you will need to prove that no call earlier in this method can change it as a side effect). I recommend either restoring the previous logic to minimize the diffs of your fix, or else adding a check for `token == null`. ------------- PR: https://git.openjdk.java.net/jfx/pull/640