Package kilim.analysis

Source Code of kilim.analysis.ClassWriter

package kilim.analysis;

import kilim.mirrors.Detector;
import kilim.mirrors.RuntimeClassMirrors;

public class ClassWriter extends org.objectweb.asm.ClassWriter {
  private final Detector detector;
 
  public ClassWriter(final int flags, final ClassLoader classLoader) {
    super(flags);
    this.detector = new Detector(new RuntimeClassMirrors(classLoader));
  }

  public ClassWriter(final int flags, final Detector detector) {
    super(flags);
    this.detector = detector;
  }

  protected String getCommonSuperClass(final String type1, final String type2) {
    try {
      return detector.commonSuperType(type1, type2);
    } catch (kilim.mirrors.ClassMirrorNotFoundException e) {
      return "java/lang/Object";
    }
  }
 
}
TOP

Related Classes of kilim.analysis.ClassWriter

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.