public final static boolean isJavaFileName(String name){
  int nameLength=name == null ? 0 : name.length();
  int suffixLength=SUFFIX_JAVA.length;
  if (nameLength < suffixLength)   return false;
  for (int i=0; i < suffixLength; i++) {
    char c=name.charAt(nameLength - i - 1);
    int suffixIndex=suffixLength - i - 1;
    if (c != SUFFIX_java[suffixIndex] && c != SUFFIX_JAVA[suffixIndex])     return false;
  }
  return true;
}

public final static boolean isJavaFileName ( String name ) { int nameLength = name == null ? 0 : name . length ( ) ; int suffixLength = SUFFIX_JAVA . length ; if ( nameLength < suffixLength ) return false ; for ( int i = 0 ; i < suffixLength ; i ++ ) { char c = name . charAt ( nameLength - i - 1 ) ; int suffixIndex = suffixLength - i - 1 ; if ( c != SUFFIX_java [ suffixIndex ] && c != SUFFIX_JAVA [ suffixIndex ] ) return false ; } return true ; }
returns true iff str . tolowercase ( ) . endswith ( " . java " ) implementation is not creating extra strings .
