Skip to content

Commit d200dc8

Browse files
SougandhSjukzi
authored andcommitted
Additional waiting for testHyperLink NPE error #559
This commit adds a waiting time to ensure value is received prior invoking getHyperLink method as there is a possibility for throwing NPE Fixes : #559
1 parent c73de59 commit d200dc8

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/core/LineTrackerTests.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2000, 2018 IBM Corporation and others.
2+
* Copyright (c) 2000, 2024 IBM Corporation and others.
33
*
44
* This program and the accompanying materials
55
* are made available under the terms of the Eclipse Public License 2.0
@@ -181,6 +181,14 @@ public void testHyperLink() throws Exception {
181181
try {
182182
ConsoleLineTracker.setDelegate(this);
183183
fTarget = launchAndTerminate("ThrowsNPE");
184+
long startTime = System.nanoTime();
185+
long timeOut = 6000 * 1_000_000;
186+
while (ConsoleLineTracker.getDocument() == null) {
187+
if (System.nanoTime() - startTime > timeOut) {
188+
break;
189+
}
190+
Thread.sleep(200);
191+
}
184192
getHyperlink(0, ConsoleLineTracker.getDocument());
185193
} finally {
186194
ConsoleLineTracker.setDelegate(null);

0 commit comments

Comments
 (0)