Package org.apache.drill.exec.compile
Class DrillCheckClassAdapter
java.lang.Object
org.objectweb.asm.ClassVisitor
org.apache.drill.exec.compile.RetargetableClassVisitor
org.apache.drill.exec.compile.DrillCheckClassAdapter
There's a bug in ASM's CheckClassAdapter. It chokes on classes that
have the access bits for ACC_PROTECTED, ACC_PRIVATE, or ACC_FINAL set;
it appears to be assuming that it is only called on top-level classes.
However, when we compile classes, nested classes come out as byte arrays
that are otherwise indistinguishable from top-level classes', except for
the possible appearance of those access bits.
In order to get around this, we use the DrillCheckClassAdapter instead. This strips off the offending bits before passing the class to CheckClassAdapter, and then restores them before passing the class on to whatever delegate the DrillCheckClassAdapter is created with.
-
Field Summary
Fields inherited from class org.objectweb.asm.ClassVisitor
api, cv
-
Constructor Summary
ModifierConstructorDescriptionDrillCheckClassAdapter
(int api, org.objectweb.asm.ClassVisitor cv) SeeCheckClassAdapter(ClassVisitor)
.protected
DrillCheckClassAdapter
(int api, org.objectweb.asm.ClassVisitor cv, boolean checkDataFlow) SeeCheckClassAdapter(ClassVisitor, boolean)
.DrillCheckClassAdapter
(org.objectweb.asm.ClassVisitor cv) SeeCheckClassAdapter(ClassVisitor)
. -
Method Summary
Modifier and TypeMethodDescriptionstatic void
verify
(org.objectweb.asm.ClassReader cr, boolean dump, PrintWriter pw) SeeCheckClassAdapter.verify(ClassReader, boolean, PrintWriter)
.Methods inherited from class org.apache.drill.exec.compile.RetargetableClassVisitor
setDelegate
Methods inherited from class org.objectweb.asm.ClassVisitor
getDelegate, visit, visitAnnotation, visitAttribute, visitEnd, visitField, visitInnerClass, visitMethod, visitModule, visitNestHost, visitNestMember, visitOuterClass, visitPermittedSubclass, visitRecordComponent, visitSource, visitTypeAnnotation
-
Constructor Details
-
DrillCheckClassAdapter
public DrillCheckClassAdapter(org.objectweb.asm.ClassVisitor cv) SeeCheckClassAdapter(ClassVisitor)
. -
DrillCheckClassAdapter
public DrillCheckClassAdapter(int api, org.objectweb.asm.ClassVisitor cv) SeeCheckClassAdapter(ClassVisitor)
.- Parameters:
api
- the api version
-
DrillCheckClassAdapter
protected DrillCheckClassAdapter(int api, org.objectweb.asm.ClassVisitor cv, boolean checkDataFlow) SeeCheckClassAdapter(ClassVisitor, boolean)
.- Parameters:
api
- the api version
-
-
Method Details
-
verify
SeeCheckClassAdapter.verify(ClassReader, boolean, PrintWriter)
.
-