static void checkIdentifier(final String name,final int start,final int end,final String msg){
  if (name == null || (end == -1 ? name.length() <= start : end <= start)) {
    throw new IllegalArgumentException("Invalid " + msg + " (must not be null or empty)");
  }
  if (!Character.isJavaIdentifierStart(name.charAt(start))) {
    throw new IllegalArgumentException("Invalid " + msg + " (must be a valid Java identifier): "+ name);
  }
  int max=end == -1 ? name.length() : end;
  for (int i=start + 1; i < max; ++i) {
    if (!Character.isJavaIdentifierPart(name.charAt(i))) {
      throw new IllegalArgumentException("Invalid " + msg + " (must be a valid Java identifier): "+ name);
    }
  }
}

static void checkIdentifier ( final String name , final int start , final int end , final String msg ) { if ( name == null || ( end == - 1 ? name . length ( ) <= start : end <= start ) ) { throw new IllegalArgumentException ( "Invalid " + msg + " (must not be null or empty)" ) ; } if ( ! Character . isJavaIdentifierStart ( name . charAt ( start ) ) ) { throw new IllegalArgumentException ( "Invalid " + msg + " (must be a valid Java identifier): " + name ) ; } int max = end == - 1 ? name . length ( ) : end ; for ( int i = start + 1 ; i < max ; ++ i ) { if ( ! Character . isJavaIdentifierPart ( name . charAt ( i ) ) ) { throw new IllegalArgumentException ( "Invalid " + msg + " (must be a valid Java identifier): " + name ) ; } } }
checks that the given substring is a valid java identifier .
