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

dbalek 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 f613251  Modified to prevent IllegalStateExceptions from CasualDiff. 
(#3422)
f613251 is described below

commit f61325118521af3c1a769fcf2c4d1acd5627745f
Author: Dusan Balek <dusan.ba...@oracle.com>
AuthorDate: Fri Jan 7 09:53:45 2022 +0100

    Modified to prevent IllegalStateExceptions from CasualDiff. (#3422)
---
 .../src/org/netbeans/modules/java/source/save/PositionEstimator.java    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/java/java.source.base/src/org/netbeans/modules/java/source/save/PositionEstimator.java
 
b/java/java.source.base/src/org/netbeans/modules/java/source/save/PositionEstimator.java
index 351f163..8e69d00 100644
--- 
a/java/java.source.base/src/org/netbeans/modules/java/source/save/PositionEstimator.java
+++ 
b/java/java.source.base/src/org/netbeans/modules/java/source/save/PositionEstimator.java
@@ -968,7 +968,7 @@ public abstract class PositionEstimator {
                     if (seq.movePrevious() && seq.offset() >= sectionStart && 
nonRelevant.contains(seq.token().id())) {
                         moveToSrcRelevantBounded(seq, Direction.BACKWARD);
                         seq.moveNext();
-                        treeEnd = seq.offset();
+                        treeEnd = Math.max(seq.offset(), treeStart);
                     }
                 }
 

---------------------------------------------------------------------
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