8017611: Auto corrector for mistyped vm options

The auto corrector for mistyped vm options fuzzy-matches existing flags based on string similarity (Dice's coefficient).

Reviewed-by: kvn, dsamersoff, hseigel, johnc
This commit is contained in:
Tao Mao 2013-06-28 20:18:04 -07:00
parent f93ee2a9dd
commit 7109e85e43
4 changed files with 128 additions and 4 deletions

View file

@ -220,7 +220,8 @@ struct Flag {
// number of flags
static size_t numFlags;
static Flag* find_flag(char* name, size_t length, bool allow_locked = false);
static Flag* find_flag(const char* name, size_t length, bool allow_locked = false);
static Flag* fuzzy_match(const char* name, size_t length, bool allow_locked = false);
bool is_bool() const { return strcmp(type, "bool") == 0; }
bool get_bool() const { return *((bool*) addr); }