public static String addAsterisk(String s,int index){
  if (s != null) {
    index=Math.min(index,s.length());
    s=s.substring(0,index) + "[*]" + s.substring(index);
  }
  return s;
}

public static String addAsterisk ( String s , int index ) { if ( s != null ) { index = Math . min ( index , s . length ( ) ) ; s = s . substring ( 0 , index ) + "[*]" + s . substring ( index ) ; } return s ; }
add an asterisk ( ' [ * ] ' ) at the given position . this format is used to show where parsing failed in a statement .
