Skip to content

Commit

Permalink
Merge pull request apache#1914 from singh-akhilesh/fixed-hint-add-imp…
Browse files Browse the repository at this point in the history
…ort-for-record

[NETBEANS-3786] : Fixed position of hint (add import) for record (jdk14).
  • Loading branch information
ebarboni committed Feb 5, 2020
2 parents 57f811b + 66fe1ec commit 9553184
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -22,6 +22,7 @@
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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -314,7 +314,7 @@ public int prepare(final int startPos, StringBuilder aHead, StringBuilder aTail)
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++;
Expand Down

0 comments on commit 9553184

Please sign in to comment.