* the bytecode offset of the end instruction in the range
* @return the SourceLineAnnotation, or null if we do not have line number
* information for the instruction
*/
public static SourceLineAnnotation fromVisitedInstructionRange(BytecodeScanningDetector visitor, int startPC, int endPC) {
LineNumberTable lineNumberTable = getLineNumberTable(visitor);
String className = visitor.getDottedClassName();
String sourceFile = visitor.getSourceFile();
if (lineNumberTable == null) {
return createUnknown(className, sourceFile, startPC, endPC);
}
int startLine = lineNumberTable.getSourceLine(startPC);
int endLine = lineNumberTable.getSourceLine(endPC);
return new SourceLineAnnotation(className, sourceFile, startLine, endLine, startPC, endPC);
}