Example usage for org.objectweb.asm Opcodes V1_4

List of usage examples for org.objectweb.asm Opcodes V1_4

Introduction

In this page you can find the example usage for org.objectweb.asm Opcodes V1_4.

Prototype

int V1_4

To view the source code for org.objectweb.asm Opcodes V1_4.

Click Source Link

Usage

From source file:org.formulacompiler.compiler.internal.bytecode.ClassCompiler.java

License:Open Source License

protected Type initializeClass(Class _parentClassOrInterface, Type _parentTypeOrInterface,
        Type _otherInterface) {/*from   www .  j  a  v  a 2 s  .c  o  m*/
    final Type parentType;
    final String[] interfaces;
    if (_parentClassOrInterface == null) {
        parentType = Type.getType(Object.class);
        interfaces = new String[] { _otherInterface.getInternalName() };
    } else if (_parentClassOrInterface.isInterface()) {
        parentType = Type.getType(Object.class);
        interfaces = new String[] { _otherInterface.getInternalName(),
                _parentTypeOrInterface.getInternalName() };
    } else {
        parentType = _parentTypeOrInterface;
        interfaces = new String[] { _otherInterface.getInternalName() };
    }
    final int access = Opcodes.ACC_FINAL | (this.classPublic ? Opcodes.ACC_PUBLIC : 0);
    cw().visit(Opcodes.V1_4, access, classInternalName(), null, parentType.getInternalName(), interfaces);

    if (_parentClassOrInterface != null) {
        compileClassRef(_parentClassOrInterface, _parentTypeOrInterface);
    }

    cw().visitSource(null, null);

    return parentType;
}

From source file:org.jacoco.core.internal.analysis.ContentTypeDetector.java

License:Open Source License

private static int determineType(final InputStream in) throws IOException {
    switch (readInt(in)) {
    case ZIPFILE:
        return ZIPFILE;
    case CLASSFILE:
        // also verify version to distinguish from Mach Object files:
        switch (readInt(in)) {
        case Opcodes.V1_1:
        case Opcodes.V1_2:
        case Opcodes.V1_3:
        case Opcodes.V1_4:
        case Opcodes.V1_5:
        case Opcodes.V1_6:
        case Opcodes.V1_7:
            return CLASSFILE;
        }/*ww w . j  ava2s . c o m*/
    }
    return UNKNOWN;
}

From source file:org.jacoco.core.internal.ContentTypeDetector.java

License:Open Source License

private static int determineType(final InputStream in) throws IOException {
    final int header = readInt(in);
    switch (header) {
    case ZIPFILE:
        return ZIPFILE;
    case PACK200FILE:
        return PACK200FILE;
    case CLASSFILE:
        // also verify version to distinguish from Mach Object files:
        switch (readInt(in)) {
        case Opcodes.V1_1:
        case Opcodes.V1_2:
        case Opcodes.V1_3:
        case Opcodes.V1_4:
        case Opcodes.V1_5:
        case Opcodes.V1_6:
        case Opcodes.V1_7:
            return CLASSFILE;
        }/*from  w w w.j  av  a  2  s.  c  o  m*/
    }
    if ((header & 0xffff0000) == GZFILE) {
        return GZFILE;
    }
    return UNKNOWN;
}

From source file:org.jacoco.core.internal.instr.ProbeArrayStrategyFactoryTest.java

License:Open Source License

@Test
public void testClass4() {
    final IProbeArrayStrategy strategy = test(Opcodes.V1_4, 0, false, true, true);
    assertEquals(ClassFieldProbeArrayStrategy.class, strategy.getClass());
    assertDataField(InstrSupport.DATAFIELD_ACC);
    assertInitMethod(false);/*from w  ww  . j  av a  2 s . c  o m*/
}

From source file:scouter.agent.AgentTransformer.java

License:Apache License

private ClassWriter getClassWriter(final ClassDesc classDesc) {
    ClassWriter cw;//w  w w.  j ava2 s . co m
    switch (classDesc.version) {
    case Opcodes.V1_1:
    case Opcodes.V1_2:
    case Opcodes.V1_3:
    case Opcodes.V1_4:
    case Opcodes.V1_5:
    case Opcodes.V1_6:
        cw = new ScouterClassWriter(ClassWriter.COMPUTE_MAXS);
        break;
    default:
        cw = new ScouterClassWriter(ClassWriter.COMPUTE_FRAMES | ClassWriter.COMPUTE_MAXS);
    }
    return cw;
}