IScanner scanner = ToolFactory.createScanner(false, false, false, true); scanner.setSource(cu.getContents()); try { while (scanner.getNextToken() != ITerminalSymbols.TokenNameEOF) {  } } catch (InvalidInputException e) { FindbugsPlugin.getDefault().logException(e, "Could not find line number for Java type"); }
	public static int getLineStart(SourceType source) throws JavaModelException {		IOpenable op = source.getOpenable();		if (op instanceof CompilationUnit) {			CompilationUnit cu = (CompilationUnit) op;			ISourceRange range = source.getSourceRange();			IScanner scanner =				ToolFactory.createScanner(false, false, false, true);			scanner.setSource(cu.getContents());			try {				while (scanner.getNextToken() != ITerminalSymbols.TokenNameEOF) {					// do nothing, just wait for the end of stream				}			}			catch (InvalidInputException e) {				FindbugsPlugin.getDefault().logException(e, "Could not find line number for Java type");			}			return scanner.getLineNumber(range.getOffset());		}		// start line of enclosing type		return 1;	}