8024650: Don't adjust MaxMetaspaceSize up to MetaspaceSize

Reviewed-by: jwilhelm, brutisso, tschatzl
This commit is contained in:
Stefan Karlsson 2013-09-13 22:22:14 +02:00
parent d2d4036f85
commit 860b5dcec7
5 changed files with 180 additions and 16 deletions

View file

@ -211,13 +211,13 @@ public final class OutputAnalyzer {
if (matcher.find()) {
reportDiagnosticSummary();
throw new RuntimeException("'" + pattern
+ "' found in stdout \n");
+ "' found in stdout: '" + matcher.group() + "' \n");
}
matcher = Pattern.compile(pattern, Pattern.MULTILINE).matcher(stderr);
if (matcher.find()) {
reportDiagnosticSummary();
throw new RuntimeException("'" + pattern
+ "' found in stderr \n");
+ "' found in stderr: '" + matcher.group() + "' \n");
}
}
@ -253,6 +253,37 @@ public final class OutputAnalyzer {
}
}
/**
* Get the captured group of the first string matching the pattern.
* stderr is searched before stdout.
*
* @param pattern The multi-line pattern to match
* @param group The group to capture
* @return The matched string or null if no match was found
*/
public String firstMatch(String pattern, int group) {
Matcher stderrMatcher = Pattern.compile(pattern, Pattern.MULTILINE).matcher(stderr);
Matcher stdoutMatcher = Pattern.compile(pattern, Pattern.MULTILINE).matcher(stdout);
if (stderrMatcher.find()) {
return stderrMatcher.group(group);
}
if (stdoutMatcher.find()) {
return stdoutMatcher.group(group);
}
return null;
}
/**
* Get the first string matching the pattern.
* stderr is searched before stdout.
*
* @param pattern The multi-line pattern to match
* @return The matched string or null if no match was found
*/
public String firstMatch(String pattern) {
return firstMatch(pattern, 0);
}
/**
* Verify the exit value of the process
*