Uploaded image for project: 'OpenJPA'
  1. OpenJPA
  2. OPENJPA-2800

StateManager field in enhanced entities are not "synthetic"

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.4.3
    • Fix Version/s: None
    • Component/s: Enhance
    • Labels:
      None

      Description

      I'm using reflection to do various things on an entity-class during my unit tests. Because my tests are not interested in any of OpenJPAs internals, I'm trying to skip any field generated during enhancement. Basically I skip every field with where Field#isSynthetic] is true. The pcStateManager however does not have the flag ACC_SYNTHETIC set:

      $ javap -verbose MyEntity.class
      [...]
        protected transient org.apache.openjpa.enhance.StateManager pcStateManager;
          descriptor: Lorg/apache/openjpa/enhance/StateManager;
          flags: ACC_PROTECTED, ACC_TRANSIENT
      [...]
      

      According to the JVM Specs

      [...]A class member that does not appear in the source code must be marked using a Synthetic attribute, or else it must have its ACC_SYNTHETIC flag set.[...]

      Is this flag intentionally not set?
       

        Attachments

        1. image-2020-01-15-08-12-02-066.png
          7 kB
          Alexander Falb

          Activity

            People

            • Assignee:
              struberg Mark Struberg
              Reporter:
              elexx Alexander Falb
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: