static public SourcePosition findSourcePosition(File javaFile,int lineNumber,int columnNumber) throws IOException {
  String[] lines=new String[3];
  int currentLineNumber=1;
  try (BufferedReader br=new BufferedReader(new FileReader(javaFile))){
    for (String line; (line=br.readLine()) != null; ) {
      lines[0]=lines[1];
      lines[1]=lines[2];
      lines[2]=line;
      if (lineNumber == currentLineNumber) {
        break;
      }
      currentLineNumber++;
    }
  }
   if (lineNumber != currentLineNumber) {
    return null;
  }
  SourcePosition pos0=findSourcePositionInComment(lines[1]);
  if (pos0 != null) {
    return pos0;
  }
  SourcePosition pos1=findSourcePositionInComment(lines[0]);
  return pos1;
}

static public SourcePosition findSourcePosition ( File javaFile , int lineNumber , int columnNumber ) throws IOException { String [ ] lines = new String [ 3 ] ; int currentLineNumber = 1 ; try ( BufferedReader br = new BufferedReader ( new FileReader ( javaFile ) ) ) { for ( String line ; ( line = br . readLine ( ) ) != null ; ) { lines [ 0 ] = lines [ 1 ] ; lines [ 1 ] = lines [ 2 ] ; lines [ 2 ] = line ; if ( lineNumber == currentLineNumber ) { break ; } currentLineNumber ++ ; } } if ( lineNumber != currentLineNumber ) { return null ; } SourcePosition pos0 = findSourcePositionInComment ( lines [ 1 ] ) ; if ( pos0 != null ) { return pos0 ; } SourcePosition pos1 = findSourcePositionInComment ( lines [ 0 ] ) ; return pos1 ; }
finds the template source reference embedded within the the prior two lines from the generate java source . allows matching compilation errors from the generate java source to the underlying rocker template .
