int offset = sourceFile.getLineOffset(startLine - 1); if (offset >= 0) { InputStreamReader reader = new InputStreamReader(sourceFile.getInputStreamFromOffset(offset)); Tokenizer tokenizer = new Tokenizer(reader);
  private boolean catchBlockHasComment(SourceLineAnnotation srcLine) {    if (!IGNORE_COMMENTED_CATCH_BLOCKS)	return false;    AnalysisContext analysisContext = AnalysisContext.instance();    SourceFinder sourceFinder = analysisContext.getSourceFinder();    try {	SourceFile sourceFile = sourceFinder.findSourceFile(srcLine.getPackageName(), srcLine.getSourceFile());	int startLine = srcLine.getStartLine();	int offset = sourceFile.getLineOffset(startLine - 1);	if (offset >= 0) {	    InputStreamReader reader = new InputStreamReader(sourceFile.getInputStreamFromOffset(offset));	    Tokenizer tokenizer = new Tokenizer(reader);	    boolean done = false;	    int numLines = 0;	    int state = START;	    int level = 0;	    do {		Token token = tokenizer.next();		int type = token.getKind();		String value = token.getLexeme();		switch (type) {		case Token.EOL:		    if (DEBUG) System.out.println("Saw token: [EOL]");		    ++numLines;		    if (numLines >= MAX_LINES)			done = true;		    break;		case Token.EOF:		    if (DEBUG) System.out.println("Saw token: [EOF]");		    done = true;		    break;		default:		    if (DEBUG) System.out.println("Got token: " + value);		    switch (state) {		    case START:			if (value.equals("catch"))			    state = CATCH;			break;		    case CATCH:			if (value.equals("("))			    state = OPEN_PAREN;			break;		    case OPEN_PAREN:			if (value.equals(")")) {			    if (level == 0)				state = CLOSE_PAREN;			    else				--level;			} else if (value.equals("(")) {			    ++level;			}			break;		    case CLOSE_PAREN:			if (value.equals("{"))			    state = OPEN_BRACE;			break;		    case OPEN_BRACE:			boolean closeBrace = value.equals("}");			if (DEBUG && !closeBrace) System.out.println("Found a comment in catch block: " + value);			return !closeBrace;		    }		    break;		}	    } while (!done);	}    } catch (IOException e) {	// Ignored; we'll just assume there is no comment	if (DEBUG) e.printStackTrace();    }    return false;  }