Fix ConstantUtils.skipOverFieldSignature void case return value

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P4
    • 21
    • Affects Version/s: 19.0.2, 21
    • Component/s: core-libs
    • None
    • b17

      In ConstantUtils.skipOverFieldSignature, the current index instead of 0 is incorrectly returned if an invalid V is encountered.

      https://github.com/openjdk/jdk/blob/5726d31e56530bbe7dee61ae04b126e20cb3611d/src/java.base/share/classes/java/lang/constant/ConstantUtils.java#L196

      This issue doesn't directly permit creation of malformed ClassDesc or MethodTypeDesc, but it leads to ambiguous exceptions on certain inputs:

      jshell> java.lang.constant.MethodTypeDesc.ofDescriptor("(IIIIIIII[[[[V)V")

            Assignee:
            Adam Sotona
            Reporter:
            Chen Liang
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: