junichi11 commented on a change in pull request #3257:
URL: https://github.com/apache/netbeans/pull/3257#discussion_r732675934
##########
File path:
php/php.refactoring/test/unit/src/org/netbeans/modules/refactoring/php/findusages/FindUsagesTestBase.java
##########
@@ -60,7 +67,8 @@ private String getTestResult(final String exactFileName,
final String caretLine)
caretOffset = -1;
}
final String[] result = new String[1];
- ParserManager.parse(Collections.singleton(testSource), new UserTask() {
+ // wait for the scan to finish
+ Future<Void> future =
ParserManager.parseWhenScanFinished(Collections.singleton(testSource), new
UserTask() {
Review comment:
The following error may occur. So, wait for the scan to finish.
<details>
<summary>log</summary>
```
Testcase:
testInterfaces_01(org.netbeans.modules.refactoring.php.findusages.WhereUsedSupportTest):
Caused an ERROR
null
org.netbeans.modules.parsing.spi.ParseException
at
org.netbeans.modules.parsing.impl.TaskProcessor.runUserTask(TaskProcessor.java:186)
at
org.netbeans.modules.parsing.api.ParserManager.parse(ParserManager.java:81)
at
org.netbeans.modules.refactoring.php.findusages.FindUsagesTestBase.getTestResult(FindUsagesTestBase.java:69)
at
org.netbeans.modules.refactoring.php.findusages.FindUsagesTestBase.findUsages(FindUsagesTestBase.java:48)
at
org.netbeans.modules.refactoring.php.findusages.WhereUsedSupportTest.testInterfaces_01(WhereUsedSupportTest.java:200)
at org.netbeans.junit.NbTestCase.access$200(NbTestCase.java:77)
at org.netbeans.junit.NbTestCase$2.doSomething(NbTestCase.java:476)
at org.netbeans.junit.NbTestCase$1Guard.run(NbTestCase.java:402)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NullPointerException
at
org.netbeans.modules.refactoring.php.findusages.FindUsagesTestBase$1.run(FindUsagesTestBase.java:78)
at
org.netbeans.modules.parsing.impl.TaskProcessor.callUserTask(TaskProcessor.java:586)
at
org.netbeans.modules.parsing.api.ParserManager$UserTaskAction.run(ParserManager.java:130)
at
org.netbeans.modules.parsing.api.ParserManager$UserTaskAction.run(ParserManager.java:114)
at
org.netbeans.modules.parsing.impl.TaskProcessor$2.call(TaskProcessor.java:181)
at
org.netbeans.modules.parsing.impl.TaskProcessor$2.call(TaskProcessor.java:178)
at
org.netbeans.modules.masterfs.filebasedfs.utils.FileChangedManager.priorityIO(FileChangedManager.java:153)
at
org.netbeans.modules.masterfs.providers.ProvidedExtensions.priorityIO(ProvidedExtensions.java:335)
at
org.netbeans.modules.parsing.nb.DataObjectEnvFactory.runPriorityIO(DataObjectEnvFactory.java:118)
at
org.netbeans.modules.parsing.impl.Utilities.runPriorityIO(Utilities.java:67)
at
org.netbeans.modules.parsing.impl.TaskProcessor.runUserTask(TaskProcessor.java:178)
```
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists