Example usage for org.eclipse.jdt.internal.compiler.classfmt MethodInfo u4At

List of usage examples for org.eclipse.jdt.internal.compiler.classfmt MethodInfo u4At

Introduction

In this page you can find the example usage for org.eclipse.jdt.internal.compiler.classfmt MethodInfo u4At.

Prototype

public long u4At(int relativeOffset) 

Source Link

Usage

From source file:org.eclipse.objectteams.otdt.internal.core.compiler.bytecode.CopyInheritanceSourceAttribute.java

License:Open Source License

/**
 *  Read a CopyInheritanceSrc from byte code.
 *///  ww  w .  j  a  v  a2s  .  c om
public static AbstractAttribute readcopyInherSrc(MethodInfo info, int readOffset, int structOffset,
        int[] constantPoolOffsets) {
    int idx = info.u2At(readOffset);
    int utf8Offset = constantPoolOffsets[idx] - structOffset;
    char[] value = info.utf8At(utf8Offset + 3, info.u2At(utf8Offset + 1));
    int lineOffset = 0;
    if (info.u2At(readOffset - 2) > 2) // old attribute length was 2 (without lineOffset)
        lineOffset = (int) info.u4At(readOffset + 2);
    AbstractAttribute result = new CopyInheritanceSourceAttribute(value, lineOffset);
    result._methodInfo = info;
    return result;
}