On Wed, 21 Sep 2022 08:38:19 GMT, Adam Sotona <asot...@openjdk.org> wrote:
>> src/java.base/share/classes/java/lang/constant/ConstantUtils.java line 217: >> >>> 215: } >>> 216: case '/' -> { >>> 217: if (!legal) return 0; >> >> IIUC that works to reject `//` and trailing `/`, but does not reject leading >> `/`? which the previous code rejected. > > `legal` is initially set to false, so leading `/` is also rejected Doh! Could you add a comment with the case block, something like? // Rejects a leading `/`, any "//", and a trailing '/' (by exit from the loop) ------------- PR: https://git.openjdk.org/jdk/pull/10358