Skip to content

Commit 28ee396

Browse files
committed
maven version
1 parent 38f29d0 commit 28ee396

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

java/maven.junit.ui/src/org/netbeans/modules/maven/junit/ui/MavenJUnitNodeOpener.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -188,14 +188,18 @@ public void openCallstackFrame(Node node, @NonNull String frameInfo) {
188188
if (testfo != null && file == null && methodNode.getTestcase().getTrouble() != null && lineNumStorage[0] == -1) {
189189
//213935 we could not recognize the stack trace line and map it to known file
190190
//if it's a failure text, grab the testcase's own line from the stack.
191+
String fqMethodName= methodNode.getTestcase().getClassName()+ '.'+ methodNode.getTestcase().getName();
191192
String[] st = methodNode.getTestcase().getTrouble().getStackTrace();
192193
if ((st != null) && (st.length > 0)) {
193-
int index = st.length - 1;
194+
int index = 0;//st.length - 1;
194195
//213935 we need to find the testcase linenumber to jump to.
195196
// and ignore the infrastructure stack lines in the process
196-
while (!testfo.equals(file) && index != -1) {
197-
file = UIJavaUtils.getFile(st[index], lineNumStorage, locator);
198-
index = index - 1;
197+
while (!testfo.equals(file) && index < st.length) {
198+
if (st[index].contains(fqMethodName)) {
199+
file = UIJavaUtils.getFile(st[index], lineNumStorage, locator);
200+
break;
201+
}
202+
index++;
199203
}
200204
}
201205
}

0 commit comments

Comments
 (0)