private static void checkKey(String key) throws MalformedObjectNameException {
  if (key == null)   throw new NullPointerException("Invalid key (null)");
  final int len=key.length();
  if (len == 0)   throw new MalformedObjectNameException("Invalid key (empty)");
  final char[] k=key.toCharArray();
  final int endKey=parseKey(k,0);
  if (endKey < len)   throw new MalformedObjectNameException("Invalid character in value: `" + k[endKey] + "'");
}

private static void checkKey ( String key ) throws MalformedObjectNameException { if ( key == null ) throw new NullPointerException ( "Invalid key (null)" ) ; final int len = key . length ( ) ; if ( len == 0 ) throw new MalformedObjectNameException ( "Invalid key (empty)" ) ; final char [ ] k = key . toCharArray ( ) ; final int endKey = parseKey ( k , 0 ) ; if ( endKey < len ) throw new MalformedObjectNameException ( "Invalid character in value: `" + k [ endKey ] + "'" ) ; }
check if the supplied key is a valid key .
