You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@netbeans.apache.org by sk...@apache.org on 2020/02/05 12:01:59 UTC
[netbeans] branch master updated: [NETBEANS-3786] : Fixed position
of hint (add import) for record (jdk14)
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 66fe1ec [NETBEANS-3786] : Fixed position of hint (add import) for record (jdk14)
new 9553184 Merge pull request #1914 from singh-akhilesh/fixed-hint-add-import-for-record
66fe1ec is described below
commit 66fe1ec053606f6e7548ae77de70bb07199e316c
Author: Akhilesh Singh <ak...@oracle.com>
AuthorDate: Mon Feb 3 22:06:35 2020 +0530
[NETBEANS-3786] : Fixed position of hint (add import) for record (jdk14)
---
.../src/org/netbeans/modules/java/source/save/PositionEstimator.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
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 b7cb243..e2f5054 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
@@ -22,6 +22,7 @@ import com.sun.source.tree.CompilationUnitTree;
import com.sun.source.tree.ExpressionTree;
import com.sun.source.tree.ImportTree;
import com.sun.source.tree.Tree;
+import org.netbeans.modules.java.source.TreeShims;
import com.sun.source.tree.VariableTree;
import com.sun.source.util.SourcePositions;
import com.sun.tools.javac.code.Flags;
@@ -59,7 +60,6 @@ public abstract class PositionEstimator {
*/
public static final int NOPOS = -2;
-
final List<? extends Tree> oldL;
final List<? extends Tree> newL;
final DiffContext diffContext;
@@ -314,7 +314,7 @@ public abstract class PositionEstimator {
do {
Tree t = cut.getTypeDecls().get(tdpos);
typeDeclStart = (int) positions.getStartPosition(cut, t);
- if (TreeUtilities.CLASS_TREE_KINDS.contains(t.getKind())) {
+ if (TreeUtilities.CLASS_TREE_KINDS.contains(t.getKind()) || t.getKind().toString().equals(TreeShims.RECORD)) {
break;
}
tdpos++;
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@netbeans.apache.org
For additional commands, e-mail: commits-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists