--- old/src/share/vm/compiler/compilerOracle.cpp 2015-01-15 19:55:35.611450046 +0100 +++ new/src/share/vm/compiler/compilerOracle.cpp 2015-01-15 19:55:35.515450050 +0100 @@ -689,6 +689,13 @@ return NULL; } +int skip_whitespace(char* line) { + // Skip any leading spaces + int whitespace_read = 0; + sscanf(line, "%*[ \t]%n", &whitespace_read); + return whitespace_read; +} + void CompilerOracle::parse_from_line(char* line) { if (line[0] == '\0') return; if (line[0] == '#') return; @@ -755,15 +762,9 @@ line += bytes_read; - // Skip any leading spaces before signature - int whitespace_read = 0; - sscanf(line, "%*[ \t]%n", &whitespace_read); - if (whitespace_read > 0) { - line += whitespace_read; - } - // there might be a signature following the method. // signatures always begin with ( so match that by hand + line += skip_whitespace(line); if (1 == sscanf(line, "(%254[[);/" RANGEBASE "]%n", sig + 1, &bytes_read)) { sig[0] = '('; line += bytes_read; @@ -786,7 +787,9 @@ // // For future extensions: extend scan_flag_and_value() char option[256]; // stores flag for Type (1) and type of Type (2) - while (sscanf(line, "%*[ \t]%255[a-zA-Z0-9]%n", option, &bytes_read) == 1) { + + line += skip_whitespace(line); + while (sscanf(line, "%255[a-zA-Z0-9]%n", option, &bytes_read) == 1) { if (match != NULL && !_quiet) { // Print out the last match added ttyLocker ttyl; @@ -816,6 +819,7 @@ // Type (1) option match = add_option_string(c_name, c_match, m_name, m_match, signature, option, true); } + line += skip_whitespace(line); } // while( } else { match = add_predicate(command, c_name, c_match, m_name, m_match, signature);