Class DrillCheckClassAdapter

java.lang.Object
org.objectweb.asm.ClassVisitor
org.apache.drill.exec.compile.RetargetableClassVisitor
org.apache.drill.exec.compile.DrillCheckClassAdapter

public class DrillCheckClassAdapter extends RetargetableClassVisitor
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

    Constructors
    Modifier
    Constructor
    Description
     
    DrillCheckClassAdapter(int api, org.objectweb.asm.ClassVisitor cv)
    See CheckClassAdapter(ClassVisitor).
    protected
    DrillCheckClassAdapter(int api, org.objectweb.asm.ClassVisitor cv, boolean checkDataFlow)
    See CheckClassAdapter(ClassVisitor, boolean).
     
    DrillCheckClassAdapter(org.objectweb.asm.ClassVisitor cv)
    See CheckClassAdapter(ClassVisitor).
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    verify(org.objectweb.asm.ClassReader cr, boolean dump, PrintWriter pw)
    See CheckClassAdapter.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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • DrillCheckClassAdapter

      public DrillCheckClassAdapter(org.objectweb.asm.ClassVisitor cv)
      See CheckClassAdapter(ClassVisitor).
    • DrillCheckClassAdapter

      public DrillCheckClassAdapter(int api, org.objectweb.asm.ClassVisitor cv)
      See CheckClassAdapter(ClassVisitor).
      Parameters:
      api - the api version
    • DrillCheckClassAdapter

      protected DrillCheckClassAdapter(int api, org.objectweb.asm.ClassVisitor cv, boolean checkDataFlow)
      See CheckClassAdapter(ClassVisitor, boolean).
      Parameters:
      api - the api version
  • Method Details

    • verify

      public static void verify(org.objectweb.asm.ClassReader cr, boolean dump, PrintWriter pw)
      See CheckClassAdapter.verify(ClassReader, boolean, PrintWriter).