Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8233854

4.8: Clarify which checks occur during format checking


    • Type: Bug
    • Status: Open
    • Priority: P3
    • Resolution: Unresolved
    • Affects Version/s: 8
    • Fix Version/s: tbd_major
    • Component/s: specification
    • Labels:
    • Subcomponent:


      JVMS 4.8 attempts to describe the validation that occurs on class file contents during class loading (under the umbrella of "format checking"), but its list of checks is incomplete.

      A better approach is to identify *throughout* Chapter 4 the assertions about the class file format that constitute format checks. My suggested approach is to carefully use the word "must" in Chapter 4 iff a format check is being described.

      Based on some testing of Hotspot behavior and desire to keep things simple, some suggested behavioral changes:

      - Eliminating checks on CONSTANT_NameAndType structures involving restricted method names (names that include < or >) and name/descriptor coordination (4.4.6). These checks should only occur when the constant is referenced from a context that requires a method.

      - Ensuring that a CONSTANT_InvokeDynamic structure never uses method name <init> (4.4.10), rather than delaying the check until an invokedynamic instruction is verified.

      - Rejecting class or interface declarations with Module, ModulePackages, or ModuleMainClass attributes (4.7.25, 4.7.26, 4.7.27), and non-static field declarations with ConstantValue attributes (4.7.2).


          Issue Links



              • Assignee:
                abuckley Alex Buckley
                dlsmith Dan Smith
              • Votes:
                0 Vote for this issue
                1 Start watching this issue


                • Created: