private static String fixGetFields(String js){
  final Pattern pat=Pattern.compile("[^.]getField\\(");
  final Matcher mat=pat.matcher(js);
  while (mat.find()) {
    final String s=mat.group();
    js=js.replace(s,s.charAt(0) + "Doc.getField(");
  }
  js=js.replace("this.getField(","Doc.getField(");
  return js;
}

private static String fixGetFields ( String js ) { final Pattern pat = Pattern . compile ( "[^.]getField\\(" ) ; final Matcher mat = pat . matcher ( js ) ; while ( mat . find ( ) ) { final String s = mat . group ( ) ; js = js . replace ( s , s . charAt ( 0 ) + "Doc.getField(" ) ; } js = js . replace ( "this.getField(" , "Doc.getField(" ) ; return js ; }
changes references to this . getfield to doc . getfield and also turns references to getfield to doc . getfield
