This is an automated email from the ASF dual-hosted git repository.

skygo 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 05e9abe  If cancel happens while Analyzer is running, AssertionError 
is thrown. Rather ignore all exception happening while the parser is cancelled.
     new f445170  Merge pull request #2095 from 
jlahoda/ignore-cancel-in-analyzer
05e9abe is described below

commit 05e9abe79fdc032d7d678c578fdd3a2447126209
Author: Jan Lahoda <jlah...@netbeans.org>
AuthorDate: Tue Apr 21 07:38:24 2020 +0200

    If cancel happens while Analyzer is running, AssertionError is thrown. 
Rather ignore all exception happening while the parser is cancelled.
---
 .../org/netbeans/modules/java/source/parsing/JavacParser.java | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git 
a/java/java.source.base/src/org/netbeans/modules/java/source/parsing/JavacParser.java
 
b/java/java.source.base/src/org/netbeans/modules/java/source/parsing/JavacParser.java
index 7231327..ca0f9bd 100644
--- 
a/java/java.source.base/src/org/netbeans/modules/java/source/parsing/JavacParser.java
+++ 
b/java/java.source.base/src/org/netbeans/modules/java/source/parsing/JavacParser.java
@@ -709,9 +709,14 @@ public class JavacParser extends Parser {
         } catch (Abort abort) {
             parserError = currentPhase;
         } catch (RuntimeException | Error ex) {
-            parserError = currentPhase;
-            dumpSource(currentInfo, ex);
-            throw ex;
+            if (cancellable && parserCanceled.get()) {
+                currentPhase = Phase.MODIFIED;
+                invalidate(false);
+            } else {
+                parserError = currentPhase;
+                dumpSource(currentInfo, ex);
+                throw ex;
+            }
         } finally {
             currentInfo.setPhase(currentPhase);
             currentInfo.parserCrashed = parserError;


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to