Java Code Examples for org.objectweb.asm.Opcodes#ASM8

The following examples show how to use org.objectweb.asm.Opcodes#ASM8 . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: RuntimeEntityResolver.java    From bazel with Apache License 2.0 6 votes vote down vote up
private static ClassNode findClassNode(String jarEntryPathName, ImmutableList<Path> jars)
    throws IOException, ClassNotFoundException {
  for (Path jar : jars) {
    JarFile jarFile = new JarFile(jar.toFile());
    JarEntry jarEntry = jarFile.getJarEntry(jarEntryPathName);
    if (jarEntry != null) {
      try (InputStream inputStream = jarFile.getInputStream(jarEntry)) {
        ClassReader cr = new ClassReader(inputStream);
        ClassNode classNode = new ClassNode(Opcodes.ASM8);
        cr.accept(classNode, 0);
        return classNode;
      }
    }
  }
  throw new ClassNotFoundException(jarEntryPathName);
}
 
Example 2
Source File: NestBridgeRefConverter.java    From bazel with Apache License 2.0 5 votes vote down vote up
NestBridgeRefConverter(
    @Nullable MethodVisitor methodVisitor, MethodKey methodKey, NestDigest nestDigest) {
  super(Opcodes.ASM8, methodVisitor);
  this.enclosingMethodKey = methodKey;
  this.nestDigest = nestDigest;

  directFieldAccessReplacer = new FieldAccessToBridgeRedirector();
  methodToBridgeRedirector = new MethodToBridgeRedirector(nestDigest);
}
 
Example 3
Source File: TryWithResourcesRewriter.java    From bazel with Apache License 2.0 5 votes vote down vote up
public TryWithResourcesRewriter(
    ClassVisitor classVisitor,
    ClassLoader classLoader,
    Set<String> visitedExceptionTypes,
    AtomicInteger numOfTryWithResourcesInvoked,
    boolean hasCloseResourceMethod) {
  super(Opcodes.ASM8, classVisitor);
  this.classLoader = classLoader;
  this.visitedExceptionTypes = visitedExceptionTypes;
  this.numOfTryWithResourcesInvoked = numOfTryWithResourcesInvoked;
  this.hasCloseResourceMethod = hasCloseResourceMethod;
}
 
Example 4
Source File: Java7Compatibility.java    From bazel with Apache License 2.0 4 votes vote down vote up
public InlineOneMethod(String methodName, MethodVisitor dest) {
  super(Opcodes.ASM8);
  this.methodName = methodName;
  this.dest = dest;
}
 
Example 5
Source File: PrefixReferenceScanner.java    From bazel with Apache License 2.0 4 votes vote down vote up
public PrefixReferenceScanner(String prefix) {
  super(Opcodes.ASM8);
  this.prefix = prefix;
}
 
Example 6
Source File: ClassMemberRetargetRewriter.java    From bazel with Apache License 2.0 4 votes vote down vote up
ClassMemberRetargetMethodVisitor(MethodVisitor visitor) {
  super(Opcodes.ASM8, visitor);
}
 
Example 7
Source File: InterfaceDesugaring.java    From bazel with Apache License 2.0 4 votes vote down vote up
public MultiplexAnnotationVisitor(
    @Nullable AnnotationVisitor dest, AnnotationVisitor... moreDestinations) {
  super(Opcodes.ASM8, dest);
  this.moreDestinations = moreDestinations;
}
 
Example 8
Source File: NestDesugaring.java    From bazel with Apache License 2.0 4 votes vote down vote up
public NestDesugaring(ClassVisitor classVisitor, NestDigest nestDigest) {
  super(Opcodes.ASM8, classVisitor);
  this.nestDigest = nestDigest;
}
 
Example 9
Source File: BytecodeTypeInference.java    From bazel with Apache License 2.0 4 votes vote down vote up
BytecodeTypeInference(int access, String owner, String name, String methodDescriptor) {
  super(Opcodes.ASM8);
  localVariableSlots = createInitialLocalVariableTypes(access, owner, name, methodDescriptor);
  previousFrame = FrameInfo.create(ImmutableList.copyOf(localVariableSlots), ImmutableList.of());
  this.methodSignature = owner + "." + name + methodDescriptor;
}
 
Example 10
Source File: PrefixReferenceScanner.java    From bazel with Apache License 2.0 4 votes vote down vote up
public PrefixReferenceMethodVisitor() {
  super(Opcodes.ASM8);
}
 
Example 11
Source File: DefaultMethodClassFixer.java    From bazel with Apache License 2.0 4 votes vote down vote up
public InstanceMethodRecorder(boolean ignoreEmulatedMethods) {
  super(Opcodes.ASM8);
  this.ignoreEmulatedMethods = ignoreEmulatedMethods;
}
 
Example 12
Source File: InterfaceDesugaring.java    From bazel with Apache License 2.0 4 votes vote down vote up
public MultiplexAnnotations(@Nullable MethodVisitor dest, MethodVisitor annotationOnlyDest) {
  super(Opcodes.ASM8, dest);
  this.annotationOnlyDest = annotationOnlyDest;
}
 
Example 13
Source File: ObjectsRequireNonNullMethodRewriter.java    From bazel with Apache License 2.0 4 votes vote down vote up
public ObjectsRequireNonNullMethodRewriter(ClassVisitor cv, CoreLibraryRewriter rewriter) {
  super(Opcodes.ASM8, cv);
  this.rewriter = rewriter;
}
 
Example 14
Source File: Java7Compatibility.java    From bazel with Apache License 2.0 4 votes vote down vote up
public InlineMethodBody(MethodVisitor dest) {
  // We'll set the destination visitor in visitCode() to reduce the risk of copying anything
  // we didn't mean to copy
  super(Opcodes.ASM8, (MethodVisitor) null);
  this.dest = dest;
}
 
Example 15
Source File: DefaultMethodClassFixer.java    From bazel with Apache License 2.0 4 votes vote down vote up
public InterfaceInitializationNecessityDetector(String internalName) {
  super(Opcodes.ASM8);
  this.internalName = internalName;
}
 
Example 16
Source File: McVersionLookup.java    From fabric-loader with Apache License 2.0 4 votes vote down vote up
public FieldStringConstantVisitor(String fieldName) {
	super(Opcodes.ASM8);

	this.fieldName = fieldName;
}
 
Example 17
Source File: LongCompareMethodRewriter.java    From bazel with Apache License 2.0 4 votes vote down vote up
public LongCompareMethodRewriter(ClassVisitor cv, CoreLibraryRewriter rewriter) {
  super(Opcodes.ASM8, cv);
  this.rewriter = rewriter;
}
 
Example 18
Source File: HeaderClassLoader.java    From bazel with Apache License 2.0 4 votes vote down vote up
public CodeStubber(ClassVisitor cv, ImmutableList<FieldInfo> interfaceFields) {
  super(Opcodes.ASM8, cv);
  this.interfaceFields = interfaceFields;
}
 
Example 19
Source File: InterfaceDesugaring.java    From bazel with Apache License 2.0 4 votes vote down vote up
public InterfaceFieldWriteCollector(MethodVisitor mv) {
  super(Opcodes.ASM8, mv);
}
 
Example 20
Source File: LambdaClassFixer.java    From bazel with Apache License 2.0 4 votes vote down vote up
public AvoidJacocoInit(MethodVisitor dest) {
  super(Opcodes.ASM8, dest);
}