private static void checkName(String zoneId){
  int n=zoneId.length();
  if (n < 2) {
    throw new DateTimeException("Invalid ID for region-based ZoneId, invalid format: " + zoneId);
  }
  for (int i=0; i < n; i++) {
    char c=zoneId.charAt(i);
    if (c >= 'a' && c <= 'z')     continue;
    if (c >= 'A' && c <= 'Z')     continue;
    if (c == '/' && i != 0)     continue;
    if (c >= '0' && c <= '9' && i != 0)     continue;
    if (c == '~' && i != 0)     continue;
    if (c == '.' && i != 0)     continue;
    if (c == '_' && i != 0)     continue;
    if (c == '+' && i != 0)     continue;
    if (c == '-' && i != 0)     continue;
    throw new DateTimeException("Invalid ID for region-based ZoneId, invalid format: " + zoneId);
  }
}

private static void checkName ( String zoneId ) { int n = zoneId . length ( ) ; if ( n < 2 ) { throw new DateTimeException ( "Invalid ID for region-based ZoneId, invalid format: " + zoneId ) ; } for ( int i = 0 ; i < n ; i ++ ) { char c = zoneId . charAt ( i ) ; if ( c >= 'a' && c <= 'z' ) continue ; if ( c >= 'A' && c <= 'Z' ) continue ; if ( c == '/' && i != 0 ) continue ; if ( c >= '0' && c <= '9' && i != 0 ) continue ; if ( c == '~' && i != 0 ) continue ; if ( c == '.' && i != 0 ) continue ; if ( c == '_' && i != 0 ) continue ; if ( c == '+' && i != 0 ) continue ; if ( c == '-' && i != 0 ) continue ; throw new DateTimeException ( "Invalid ID for region-based ZoneId, invalid format: " + zoneId ) ; } }
checks that the given string is a legal zondid name .
