This is an automated email from the ASF dual-hosted git repository.
mbien pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git
The following commit(s) were added to refs/heads/master by this push:
new 49cda01b0c Fix php tag fold test (attempt 2)
new 54b5d2a112 Merge pull request #6665 from
mbien/stabilize-php-tag-folding-test
49cda01b0c is described below
commit 49cda01b0caaed36a8a87874750efd20f5995052
Author: Michael Bien <[email protected]>
AuthorDate: Tue Nov 7 05:48:25 2023 +0100
Fix php tag fold test (attempt 2)
---
.../unit/src/org/netbeans/modules/csl/api/test/CslTestBase.java | 7 -------
.../src/org/netbeans/modules/php/editor/csl/FoldingScanner.java | 2 +-
2 files changed, 1 insertion(+), 8 deletions(-)
diff --git
a/ide/csl.api/test/unit/src/org/netbeans/modules/csl/api/test/CslTestBase.java
b/ide/csl.api/test/unit/src/org/netbeans/modules/csl/api/test/CslTestBase.java
index 6f5ab184b6..2e523dbfae 100644
---
a/ide/csl.api/test/unit/src/org/netbeans/modules/csl/api/test/CslTestBase.java
+++
b/ide/csl.api/test/unit/src/org/netbeans/modules/csl/api/test/CslTestBase.java
@@ -2146,13 +2146,6 @@ public abstract class CslTestBase extends NbTestCase {
ParserManager.parse(Collections.singleton(testSource), new UserTask() {
public @Override void run(ResultIterator resultIterator) throws
Exception {
- // FoldingScanner#folds calls source.getDocument(false) and
receive non null values on JDK 8.
- // On JDK 11+ however the document is null which leads to test
failures in FoldingTest#testPHPTags.
- // This is likely a race condition which is more likely to
occur on JDK 11+ since the test can be
- // brute forced to passing on linux if restarted often enough.
- // This fixes it by making sure the document is open before
folds are computed
-
assertNotNull(resultIterator.getSnapshot().getSource().getDocument(true));
-
StructureScanner analyzer = getStructureScanner();
assertNotNull("getStructureScanner must be implemented",
analyzer);
diff --git
a/php/php.editor/src/org/netbeans/modules/php/editor/csl/FoldingScanner.java
b/php/php.editor/src/org/netbeans/modules/php/editor/csl/FoldingScanner.java
index f82fa74f4a..fb565eb64a 100644
--- a/php/php.editor/src/org/netbeans/modules/php/editor/csl/FoldingScanner.java
+++ b/php/php.editor/src/org/netbeans/modules/php/editor/csl/FoldingScanner.java
@@ -179,7 +179,7 @@ public final class FoldingScanner {
program.accept(new FoldingVisitor(folds));
Source source = phpParseResult.getSnapshot().getSource();
assert source != null : "source was null";
- Document doc = source.getDocument(false);
+ Document doc = source.getDocument(true);
if (FOLD_PHPTAG) {
processPHPTags(folds, doc);
}
---------------------------------------------------------------------
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