private static void orderMatches(List<Variable> typeMatches,String paramName){
  if (typeMatches != null)   Collections.sort(typeMatches,new MatchComparator(paramName));
}

private static void orderMatches ( List < Variable > typeMatches , String paramName ) { if ( typeMatches != null ) Collections . sort ( typeMatches , new MatchComparator ( paramName ) ) ; }
determine the best match of all possible type matches . the input into this method is all possible completions that match the type of the argument . the purpose of this method is to choose among them based on the following simple rules : 1 ) local variables > instance / class variables > inherited instance / class variables 2 ) a longer case insensitive substring match will prevail 3 ) variables that have not been used already during this completion will prevail over those that have already been used ( this avoids the same string / int / char from being passed in for multiple arguments ) 4 ) a better source position score will prevail ( the declaration point of the variable , or " how close to the point of completion ? "
