This is an automated email from the ASF dual-hosted git repository.
junichi11 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 01ae879656 PHP: Fixing cancelability bugs by reverting from a for each
loop to a normal loop
new 589218b13c Merge pull request #6853 from
troizet/php_cancelability_bug_hints
01ae879656 is described below
commit 01ae879656b3b07a33ad00e68066faaf67fdb29b
Author: Alexey Borokhvostov <[email protected]>
AuthorDate: Fri Dec 15 23:48:27 2023 +0700
PHP: Fixing cancelability bugs by reverting from a for each loop to a
normal loop
---
.../php/editor/verification/IncorrectNonAbstractMethodHintError.java | 4 ++--
.../netbeans/modules/php/editor/verification/PHP72UnhandledError.java | 4 ++--
.../netbeans/modules/php/editor/verification/PHP73UnhandledError.java | 4 ++--
.../netbeans/modules/php/editor/verification/PHP80UnhandledError.java | 4 ++--
4 files changed, 8 insertions(+), 8 deletions(-)
diff --git
a/php/php.editor/src/org/netbeans/modules/php/editor/verification/IncorrectNonAbstractMethodHintError.java
b/php/php.editor/src/org/netbeans/modules/php/editor/verification/IncorrectNonAbstractMethodHintError.java
index a0441a979a..33dd250aa6 100644
---
a/php/php.editor/src/org/netbeans/modules/php/editor/verification/IncorrectNonAbstractMethodHintError.java
+++
b/php/php.editor/src/org/netbeans/modules/php/editor/verification/IncorrectNonAbstractMethodHintError.java
@@ -85,13 +85,13 @@ public class IncorrectNonAbstractMethodHintError extends
HintErrorRule {
"IncorrectNonAbstractMethodHintErrorHintDesc=Non-abstract method
\"{0}\" must contain body"
})
private void addIcorrectNonAbstractMethodHints(Set<MethodDeclaration>
methodDeclarations, List<Hint> hints, BaseDocument doc) {
- methodDeclarations.forEach((methodDeclaration) -> {
+ for (MethodDeclaration methodDeclaration: methodDeclarations) {
if (CancelSupport.getDefault().isCancelled()) {
return;
}
List<HintFix> fixes = Collections.singletonList(new
AddBodyFix(doc, methodDeclaration));
addHint(methodDeclaration,
Bundle.IncorrectNonAbstractMethodHintErrorHintDesc(CodeUtils.extractMethodName(methodDeclaration)),
hints, fixes);
- });
+ }
}
private void addHint(ASTNode node, String description, List<Hint> hints,
List<HintFix> fixes) {
diff --git
a/php/php.editor/src/org/netbeans/modules/php/editor/verification/PHP72UnhandledError.java
b/php/php.editor/src/org/netbeans/modules/php/editor/verification/PHP72UnhandledError.java
index ef7ee8936a..4187ed0e09 100644
---
a/php/php.editor/src/org/netbeans/modules/php/editor/verification/PHP72UnhandledError.java
+++
b/php/php.editor/src/org/netbeans/modules/php/editor/verification/PHP72UnhandledError.java
@@ -115,7 +115,7 @@ public class PHP72UnhandledError extends UnhandledErrorRule
{
if (ts == null) {
return;
}
- lastUseStatementParts.forEach((lastUseStatementPart) -> {
+ for (SingleUseStatementPart lastUseStatementPart:
lastUseStatementParts) {
if (CancelSupport.getDefault().isCancelled()) {
return;
}
@@ -129,7 +129,7 @@ public class PHP72UnhandledError extends UnhandledErrorRule
{
createError(lastUseStatementPart);
}
}
- });
+ }
} finally {
document.readUnlock();
lastUseStatementParts.clear();
diff --git
a/php/php.editor/src/org/netbeans/modules/php/editor/verification/PHP73UnhandledError.java
b/php/php.editor/src/org/netbeans/modules/php/editor/verification/PHP73UnhandledError.java
index 0812932106..74a2fcb2bd 100644
---
a/php/php.editor/src/org/netbeans/modules/php/editor/verification/PHP73UnhandledError.java
+++
b/php/php.editor/src/org/netbeans/modules/php/editor/verification/PHP73UnhandledError.java
@@ -161,7 +161,7 @@ public class PHP73UnhandledError extends UnhandledErrorRule
{
}
private void checkFunctionCallTrailingCommas(TokenSequence<PHPTokenId>
ts) {
- nodes.forEach((node) -> {
+ for (ASTNode node: nodes) {
if (CancelSupport.getDefault().isCancelled()) {
return;
}
@@ -183,7 +183,7 @@ public class PHP73UnhandledError extends UnhandledErrorRule
{
if (!parameters.isEmpty()) {
createError(parameters.get(parameters.size() - 1));
}
- });
+ }
}
@CheckForNull
diff --git
a/php/php.editor/src/org/netbeans/modules/php/editor/verification/PHP80UnhandledError.java
b/php/php.editor/src/org/netbeans/modules/php/editor/verification/PHP80UnhandledError.java
index b322a87a40..8ff179a96e 100644
---
a/php/php.editor/src/org/netbeans/modules/php/editor/verification/PHP80UnhandledError.java
+++
b/php/php.editor/src/org/netbeans/modules/php/editor/verification/PHP80UnhandledError.java
@@ -280,7 +280,7 @@ public final class PHP80UnhandledError extends
UnhandledErrorRule {
private void checkTrailingCommas(TokenSequence<PHPTokenId> ts,
List<ASTNode> nodes) {
if (!nodes.isEmpty()) {
try {
- nodes.forEach((node) -> {
+ for (ASTNode node: nodes) {
if (CancelSupport.getDefault().isCancelled()) {
return;
}
@@ -292,7 +292,7 @@ public final class PHP80UnhandledError extends
UnhandledErrorRule {
&& TokenUtilities.textEquals(token.text(),
",")) { // NOI18N
createError(node);
}
- });
+ }
} finally {
nodes.clear();
}
---------------------------------------------------------------------
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