public LocationRangeImpl(LocationRange a, LocationRange b) { mStart = (a.getStartLocation().compareTo(b.getStartLocation()) <= 0) ? a.getStartLocation() : b.getStartLocation(); mEnd = (b.getEndLocation().compareTo(a.getEndLocation()) >= 0) ? b.getEndLocation() : a.getEndLocation(); }
Location endLocation = range.getEndLocation();
public void writeDataTo(DataOutput dout) throws IOException { dout.writeShort(mRangeCount); int size = mCleanEntries.size(); for (int i=0; i<size; i++) { Entry entry = mCleanEntries.get(i); LocalVariable localVar = entry.mLocalVar; Set<LocationRange> ranges = localVar.getLocationRangeSet(); if (ranges == null) { continue; } int name_index = entry.mName.getIndex(); int descriptor_index = entry.mDescriptor.getIndex(); int index = localVar.getNumber(); check("local variable table entry name index", name_index); check("local variable table entry descriptor index", descriptor_index); check("local variable table entry index", index); for (LocationRange range : ranges) { Location startLocation = range.getStartLocation(); Location endLocation = range.getEndLocation(); int start_pc = startLocation.getLocation(); int length = endLocation.getLocation() - start_pc - 1; check("local variable table entry start PC", start_pc); dout.writeShort(start_pc); dout.writeShort(length); dout.writeShort(name_index); dout.writeShort(descriptor_index); dout.writeShort(index); } } }
public LocalVariable getLocalVariable(int useLocation, int number) { // TODO: Build some sort of index to improve performance. for (Entry entry : mEntries) { LocalVariable var = entry.mLocalVar; if (var.getNumber() == number) { for (LocationRange range : var.getLocationRangeSet()) { int start = range.getStartLocation().getLocation(); int end = range.getEndLocation().getLocation(); if (start >= 0 && end >= 0) { if (start <= useLocation && useLocation < end) { return var; } } } } } return null; }
public LocationRangeImpl(LocationRange a, LocationRange b) { mStart = (a.getStartLocation().compareTo(b.getStartLocation()) <= 0) ? a.getStartLocation() : b.getStartLocation(); mEnd = (b.getEndLocation().compareTo(a.getEndLocation()) >= 0) ? b.getEndLocation() : a.getEndLocation(); }
Location endLocation = range.getEndLocation();
public void writeDataTo(DataOutput dout) throws IOException { dout.writeShort(mRangeCount); int size = mCleanEntries.size(); for (int i=0; i<size; i++) { Entry entry = mCleanEntries.get(i); LocalVariable localVar = entry.mLocalVar; Set<LocationRange> ranges = localVar.getLocationRangeSet(); if (ranges == null) { continue; } int name_index = entry.mName.getIndex(); int descriptor_index = entry.mDescriptor.getIndex(); int index = localVar.getNumber(); check("local variable table entry name index", name_index); check("local variable table entry descriptor index", descriptor_index); check("local variable table entry index", index); for (LocationRange range : ranges) { Location startLocation = range.getStartLocation(); Location endLocation = range.getEndLocation(); int start_pc = startLocation.getLocation(); int length = endLocation.getLocation() - start_pc - 1; check("local variable table entry start PC", start_pc); dout.writeShort(start_pc); dout.writeShort(length); dout.writeShort(name_index); dout.writeShort(descriptor_index); dout.writeShort(index); } } }
public LocalVariable getLocalVariable(int useLocation, int number) { // TODO: Build some sort of index to improve performance. for (Entry entry : mEntries) { LocalVariable var = entry.mLocalVar; if (var.getNumber() == number) { for (LocationRange range : var.getLocationRangeSet()) { int start = range.getStartLocation().getLocation(); int end = range.getEndLocation().getLocation(); if (start >= 0 && end >= 0) { if (start <= useLocation && useLocation < end) { return var; } } } } } return null; }