Skip to content

Commit 473241e

Browse files
authored
Merge pull request #8443 from apache/delivery
Sync delivery to release260 for 26-rc2
2 parents 27b43e7 + acc6180 commit 473241e

File tree

16 files changed

+105
-46
lines changed

16 files changed

+105
-46
lines changed

ide/xml.retriever/test/unit/src/org/netbeans/modules/xml/retriever/impl/SecureURLResourceRetrieverTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ public void shouldAskForSelfSignedCertificate() throws Exception {
7979
@Test
8080
public void shouldUseKeyStoreFromSystemProperties() throws Exception {
8181
System.setProperty("javax.net.debug", "ssl,keystore");
82+
// get from https://badssl.com/download/ (expires 04.2027)
8283
System.setProperty("javax.net.ssl.keyStore", SecureURLResourceRetrieverTest.class.getResource("badssl.com-client.p12").getPath());
8384
System.setProperty("javax.net.ssl.keyStorePassword", "badssl.com");
8485
System.setProperty("javax.net.ssl.keyStoreType", "pkcs12");
Binary file not shown.

java/maven.junit/src/org/netbeans/modules/maven/junit/JUnitOutputListenerProvider.java

Lines changed: 49 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,13 @@ static boolean isFullJavaId(String possibleNewRunningTestClass) {
316316
}
317317
if (null != outputDir) {
318318
createSession(outputDir);
319-
project2outputDirs.put(visitor.getContext().getCurrentProject(), outputDir);
319+
OutputVisitor.Context context = visitor.getContext();
320+
if (context != null) {
321+
Project currentProject = context.getCurrentProject();
322+
if (currentProject != null) {
323+
project2outputDirs.put(currentProject, outputDir);
324+
}
325+
}
320326
}
321327
}
322328
}
@@ -325,10 +331,13 @@ private String getReportsDirectory(String groupId, String artifactId, String goa
325331
MavenProject currentProject = null;
326332
// get maven module from context if available
327333
OutputVisitor.Context context = visitor.getContext();
328-
if (context != null && context.getCurrentProject() != null) {
329-
NbMavenProject subProject = context.getCurrentProject().getLookup().lookup(NbMavenProject.class);
330-
if (subProject != null) {
331-
currentProject = subProject.getMavenProject();
334+
if (context != null) {
335+
Project cp = context.getCurrentProject();
336+
if (cp != null) {
337+
NbMavenProject subProject = cp.getLookup().lookup(NbMavenProject.class);
338+
if (subProject != null) {
339+
currentProject = subProject.getMavenProject();
340+
}
332341
}
333342
}
334343
if (currentProject == null) {
@@ -590,12 +599,20 @@ private boolean usingJUnit4(MavenProject prj) { // SUREFIRE-724
590599
if (runningTestClass != null) {
591600
generateTest();
592601
}
593-
File outputDir = project2outputDirs.remove(visitor.getContext().getCurrentProject());
594-
TestSession session = outputDir != null ? outputDir2sessions.remove(outputDir) : null;
595-
if (session != null) {
596-
CoreManager junitManager = getManagerProvider();
597-
if (junitManager != null) {
598-
junitManager.sessionFinished(session);
602+
OutputVisitor.Context context = visitor.getContext();
603+
if (context != null) {
604+
Project currentProject = context.getCurrentProject();
605+
if (currentProject != null) {
606+
File outputDir = project2outputDirs.remove(currentProject);
607+
if (outputDir != null) {
608+
TestSession session = outputDir2sessions.remove(outputDir);
609+
if (session != null) {
610+
CoreManager junitManager = getManagerProvider();
611+
if (junitManager != null) {
612+
junitManager.sessionFinished(session);
613+
}
614+
}
615+
}
599616
}
600617
}
601618
runningTestClass = null;
@@ -633,28 +650,31 @@ static Trouble constructTrouble(@NonNull String type, @NullAllowed String messag
633650
}
634651

635652
public @Override void sequenceFail(String sequenceId, OutputVisitor visitor) {
636-
LOG.log(Level.FINE, "Got sequenceFail: {0}, line {1}", new Object[] { visitor.getContext().getCurrentProject(), visitor.getLine() });
637-
// try to get the failed test class. How can this be solved if it is not the first one in the list?
638-
if(surefireRunningInParallel) {
639-
String saveRunningTestClass = runningTestClass;
640-
641-
Project currentProject = visitor.getContext().getCurrentProject();
642-
for (String s : runningTestClassesInParallel) {
643-
File outputDir = locateOutputDirAndWait(s, false);
644-
// match the output dir to the project
645-
if (outputDir != null) {
646-
Project outputOwner = FileOwnerQuery.getOwner(FileUtil.toFileObject(outputDir));
647-
if (outputOwner == currentProject) {
648-
LOG.log(Level.FINE, "Found unfinished test {0} in {1}, trying to finish", new Object[] { s, currentProject });
649-
runningTestClass = s;
650-
if (Objects.equals(saveRunningTestClass, s)) {
651-
saveRunningTestClass = null;
653+
OutputVisitor.Context context = visitor.getContext();
654+
if (context != null) {
655+
Project currentProject = context.getCurrentProject();
656+
LOG.log(Level.FINE, "Got sequenceFail: {0}, line {1}", new Object[] {currentProject, visitor.getLine()});
657+
// try to get the failed test class. How can this be solved if it is not the first one in the list?
658+
if (currentProject != null && surefireRunningInParallel) {
659+
String saveRunningTestClass = runningTestClass;
660+
661+
for (String s : runningTestClassesInParallel) {
662+
File outputDir = locateOutputDirAndWait(s, false);
663+
// match the output dir to the project
664+
if (outputDir != null) {
665+
Project outputOwner = FileOwnerQuery.getOwner(FileUtil.toFileObject(outputDir));
666+
if (outputOwner == currentProject) {
667+
LOG.log(Level.FINE, "Found unfinished test {0} in {1}, trying to finish", new Object[] {s, currentProject});
668+
runningTestClass = s;
669+
if (Objects.equals(saveRunningTestClass, s)) {
670+
saveRunningTestClass = null;
671+
}
672+
generateTest();
652673
}
653-
generateTest();
654674
}
655675
}
676+
runningTestClass = saveRunningTestClass;
656677
}
657-
runningTestClass = saveRunningTestClass;
658678
}
659679
sequenceEnd(sequenceId, visitor);
660680
}

webcommon/javascript2.editor/src/org/netbeans/modules/javascript2/editor/JsSemanticAnalyzer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -402,11 +402,11 @@ public boolean enterObjectNode(ObjectNode objectNode) {
402402

403403
@Override
404404
public boolean enterVarNode(VarNode varNode) {
405-
if (varNode.isLet()) {
405+
if (varNode.isLet() || varNode.isConst()) {
406406
TokenSequence<? extends JsTokenId> ts = LexUtilities.getJsPositionedSequence(result.getSnapshot(), varNode.getStart() - 1);
407407
if (ts != null) {
408408
Token<? extends JsTokenId> token = LexUtilities.findPreviousNonWsNonComment(ts);
409-
if (token != null && token.id() == JsTokenId.RESERVED_LET) {
409+
if (token != null && (token.id() == JsTokenId.RESERVED_LET || token.id() == JsTokenId.KEYWORD_CONST)) {
410410
highlights.put(LexUtilities.getLexerOffsets(result,
411411
new OffsetRange(ts.offset(), ts.offset() + token.length())), SEMANTIC_KEYWORD);
412412
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
for |>CUSTOM2:await<| (const i of num()) {}
1+
for |>CUSTOM2:await<| (|>CUSTOM2:const<| i of num()) {}

webcommon/javascript2.editor/test/unit/data/testfiles/coloring/semanticalKeywords.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,4 @@ class Test {
4747
}
4848
}
4949

50+
const test2 = 7;

webcommon/javascript2.editor/test/unit/data/testfiles/coloring/semanticalKeywords.js.semantic

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,4 @@ class |>CLASS,GLOBAL:Test<| {
4747
}
4848
}
4949

50+
|>CUSTOM2:const<| test2 = 7;

webcommon/javascript2.editor/test/unit/data/testfiles/markoccurences/blockscope/arrayLiteral01.js.semantic

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
function |>METHOD:_getFileList<|(buildType, fileList, theme) {
44
|>CUSTOM2:let<| |>LOCAL_VARIABLE_DECLARATION:result<| = [];
5-
for (const file of fileList) {
5+
for (|>CUSTOM2:const<| file of fileList) {
66
if (file.buildType === buildType || !file.buildType) {
77
|>CUSTOM2:let<| |>LOCAL_VARIABLE_DECLARATION:matches<| = [];
88
|>CUSTOM2:let<| |>LOCAL_VARIABLE_DECLARATION:dest<|;
99
|>CUSTOM2:let<| |>LOCAL_VARIABLE_DECLARATION:cwd<|;
1010
for (|>CUSTOM2:let<| |>CLASS:src<| of file.src) {
11-
const exclusion = src.indexOf('!') === 0;
11+
|>CUSTOM2:const<| exclusion = src.indexOf('!') === 0;
1212
|>LOCAL_VARIABLE:cwd<| = file.cwd;
1313
|>LOCAL_VARIABLE:dest<| = file.dest;
1414
|>LOCAL_VARIABLE:cwd<| = (_isFunction(file.cwd) ? |>LOCAL_VARIABLE:cwd<|(theme) : |>LOCAL_VARIABLE:cwd<|) || '';
@@ -23,7 +23,7 @@ function |>METHOD:_getFileList<|(buildType, fileList, theme) {
2323
|>LOCAL_VARIABLE:matches<| = _union(|>LOCAL_VARIABLE:matches<|, |>LOCAL_VARIABLE:match<|);
2424
}
2525
}
26-
const prefixedPaths = _addFileListPathPrefix(|>LOCAL_VARIABLE:matches<|, |>LOCAL_VARIABLE:dest<|, |>GLOBAL:util<|.destPath(|>LOCAL_VARIABLE:cwd<|));
26+
|>CUSTOM2:const<| prefixedPaths = _addFileListPathPrefix(|>LOCAL_VARIABLE:matches<|, |>LOCAL_VARIABLE:dest<|, |>GLOBAL:util<|.destPath(|>LOCAL_VARIABLE:cwd<|));
2727
|>LOCAL_VARIABLE:result<| = |>LOCAL_VARIABLE:result<|.concat(prefixedPaths);
2828
}
2929
}

webcommon/javascript2.editor/test/unit/data/testfiles/markoccurences/classes/class04.js.semantic

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ class |>CLASS,GLOBAL:Point<| {
1212
* @param {Point} b
1313
*/
1414
|>CUSTOM2:static<| |>METHOD:distance<|(a, b) {
15-
const dx = a.|>FIELD:x<| - b.|>FIELD:x<|;
16-
const dy = a.|>FIELD:y<| - b.|>FIELD:y<|;
15+
|>CUSTOM2:const<| dx = a.|>FIELD:x<| - b.|>FIELD:x<|;
16+
|>CUSTOM2:const<| dy = a.|>FIELD:y<| - b.|>FIELD:y<|;
1717

1818
return |>GLOBAL:Math<|.sqrt(dx*dx + dy*dy);
1919
}
2020
}
2121

22-
const p1 = new |>GLOBAL:Point<|(5, 5);
23-
const p2 = new |>GLOBAL:Point<|(10, 10);
22+
|>CUSTOM2:const<| p1 = new |>GLOBAL:Point<|(5, 5);
23+
|>CUSTOM2:const<| p2 = new |>GLOBAL:Point<|(10, 10);
2424

2525
|>GLOBAL:console<|.log(|>GLOBAL:Point<|.distance(p1, p2));

webcommon/javascript2.editor/test/unit/data/testfiles/parser/asyncFunctions/asyncFunctions1.js.semantic

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ export default {
33
|>FIELD:path<|: '/',
44

55
|>CUSTOM2:async<| |>METHOD:action<|() {
6-
const component = |>CUSTOM2:await<| next();
6+
|>CUSTOM2:const<| component = |>CUSTOM2:await<| next();
77

88
},
99

0 commit comments

Comments
 (0)