You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by em...@apache.org on 2022/03/05 03:27:19 UTC
[groovy] 01/03: no throw
This is an automated email from the ASF dual-hosted git repository.
emilles pushed a commit to branch GROOVY_4_0_X
in repository https://gitbox.apache.org/repos/asf/groovy.git
commit 727242349471d4869df201059a92421bf6cb5492
Author: Eric Milles <er...@thomsonreuters.com>
AuthorDate: Fri Mar 4 17:55:09 2022 -0600
no throw
---
.../java/org/codehaus/groovy/control/ErrorCollector.java | 13 +++++--------
src/main/java/org/codehaus/groovy/control/SourceUnit.java | 2 +-
2 files changed, 6 insertions(+), 9 deletions(-)
diff --git a/src/main/java/org/codehaus/groovy/control/ErrorCollector.java b/src/main/java/org/codehaus/groovy/control/ErrorCollector.java
index 86c25f6..94668b2 100644
--- a/src/main/java/org/codehaus/groovy/control/ErrorCollector.java
+++ b/src/main/java/org/codehaus/groovy/control/ErrorCollector.java
@@ -80,7 +80,11 @@ public class ErrorCollector implements Serializable {
}
}
- public void addErrorAndContinue(final SyntaxException error, final SourceUnit source) throws CompilationFailedException {
+ public void addErrorAndContinue(final String error, final ASTNode node, final SourceUnit source) {
+ addErrorAndContinue(Message.create(new SyntaxException(error, node), source));
+ }
+
+ public void addErrorAndContinue(final SyntaxException error, final SourceUnit source) {
addErrorAndContinue(Message.create(error, source));
}
@@ -95,13 +99,6 @@ public class ErrorCollector implements Serializable {
errors.add(message);
}
- public void addErrorAndContinue(final String error, final ASTNode node, final SourceUnit source) {
- addErrorAndContinue(new SyntaxErrorMessage(
- new SyntaxException(error, node.getLineNumber(), node.getColumnNumber(), node.getLastLineNumber(), node.getLastColumnNumber()),
- source)
- );
- }
-
/**
* Adds a non-fatal error to the message set, which may cause a failure if the error threshold is exceeded.
* The message is not required to have a source line and column specified, but it is best practice to try
diff --git a/src/main/java/org/codehaus/groovy/control/SourceUnit.java b/src/main/java/org/codehaus/groovy/control/SourceUnit.java
index 72c8db0..255f87c 100644
--- a/src/main/java/org/codehaus/groovy/control/SourceUnit.java
+++ b/src/main/java/org/codehaus/groovy/control/SourceUnit.java
@@ -339,7 +339,7 @@ public class SourceUnit extends ProcessingUnit {
);
}
- public void addErrorAndContinue(SyntaxException se) throws CompilationFailedException {
+ public void addErrorAndContinue(SyntaxException se) {
getErrorCollector().addErrorAndContinue(se, this);
}