Uploaded image for project: 'Commons BCEL'
  1. Commons BCEL
  2. BCEL-192

Verification error when defining an inner class

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 6.0
    • None
    • Verifier
    • None

    Description

      The verification of the following code fails:

          public void test(){
              new Runnable() {
                  
                  @Override
                  public void run() {
                  }
              };
          }
      

      The cause is a wrong verification of field modification on uninitialized object. The modification of an uninitialized object is allowed in a constructor if this object is the receiver of the constructor.
      Here is the explanation from the §4.9.4 of The Java Virtual Machine Specification, Second Edition:

      The instance initialization method (§3.9) for class myClass sees the new uninitialized object as its this argument in local variable 0. Before that method invokes another instance initialization method of myClass or its direct superclass on this, the only operation the method can perform on this is assigning fields declared within myClass.

      Attachments

        1. BCEL-192.patch
          9 kB
          Jérôme Leroux
        2. BCEL-192.zip
          2 kB
          Jérôme Leroux

        Activity

          People

            Unassigned Unassigned
            jejecool Jérôme Leroux
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: