Skip to content

Commit

Permalink
[GR-15891] Fixed JNIExceptionWrapperTest on JDK 11.
Browse files Browse the repository at this point in the history
  • Loading branch information
tzezula committed May 15, 2019
1 parent 536d63b commit 63c899a
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ public void testMergedStackTrace() throws Exception {
} catch (Throwable t) {
String message = t.getMessage();
int runtimeIndex = findFrame(message, GraalTruffleRuntime.class.getName(), "doCompile");
assertNotEquals(-1, runtimeIndex);
assertNotEquals(message, -1, runtimeIndex);
int listenerIndex = findFrame(message, TestListener.class.getName(), "onCompilationTruffleTierFinished");
assertNotEquals(-1, listenerIndex);
assertNotEquals(message, -1, listenerIndex);
int compilerIndex = findFrame(message, TruffleCompilerImpl.class.getName(), "compileAST");
assertNotEquals(-1, compilerIndex);
assertNotEquals(message, -1, compilerIndex);
assertTrue(listenerIndex < compilerIndex);
assertTrue(compilerIndex < runtimeIndex);
} finally {
Expand All @@ -72,7 +72,7 @@ public void testMergedStackTrace() throws Exception {

private static int findFrame(String message, String className, String methodName) {
String[] lines = message.split("\n");
Pattern pattern = Pattern.compile("\\s*at\\s+" + Pattern.quote(className + '.' + methodName), 0);
Pattern pattern = Pattern.compile("\\s*at\\s+(.*/)?" + Pattern.quote(className + '.' + methodName), 0);
for (int i = 0; i < lines.length; i++) {
if (pattern.matcher(lines[i]).find()) {
return i;
Expand Down

0 comments on commit 63c899a

Please sign in to comment.