The change that I committed to trunk utilizes the PCEnhancer.checkEnhancementLevel() method which was added in
OPENJPA-151 but as far as I can tell was never used. I believe the intent of this field was to be used for changes to enhanced bytecode that may break serialization. Since this field was never utilized, I took the liberty to repurpose the method.
I added some magic to the build which now will write the revision of the PCEnhancer to META-INF/org.apache.openjpa.revision.properties. This value will be read into PCEnhancer in a static initializer which will be used for validation, and will be written to enhanced bytecode. This way we won't have to manually update the PCEnhancer.ENHANCER_VERSION every time a change is made to that file.
Currently I have it so that when trace IS NOT enabled, we will only log one message when a down level Entity is encountered. If trace is enabled we will log a message for each down level Entity that is encountered.
I flipped back and forth on whether or not this should be an INFO or WARN message. I ended up going with an INFO message because for the time being any Entity that was enhanced prior to this commit will result in a message being logged.