Community
Participate
Working Groups
Steps to reproduce: - open the following java file: package test; public class Test { private void test() { boolean equals = A|rrays.equals(new Object[0], new Object[0]); // CA works new Runnable() { @Override public void run() { boolean equals = A|rrays.equals(new Object[0], new Object[0]); // CA doesn't work } }; } } - try CA at line 8. It doesn't work. The "Import Arrays (java.util)" quick fix is not shown. Related issue - https://github.com/redhat-developer/vscode-java/issues/2034 The issue can't be reproduced in Eclipse 2020-09
Please check if that is still broken in latest 4.21 nightly build.
(In reply to Andrey Loskutov from comment #1) > Please check if that is still broken in latest 4.21 nightly build. I can reproduce the issue in Eclipse I20210721-1800
(In reply to Snjezana Peco from comment #2) > (In reply to Andrey Loskutov from comment #1) > > Please check if that is still broken in latest 4.21 nightly build. > > I can reproduce the issue in Eclipse I20210721-1800 Thanks. Sounds similar to bug 574978.
(In reply to Andrey Loskutov from comment #3) > (In reply to Snjezana Peco from comment #2) > > (In reply to Andrey Loskutov from comment #1) > > > Please check if that is still broken in latest 4.21 nightly build. > > > > I can reproduce the issue in Eclipse I20210721-1800 > > Thanks. Sounds similar to bug 574978. I can't reproduce the issue described in bug 574978 in Eclipse I20210721-1800.
The following patch fixes the issue: diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionParser.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionParser.java index 6cb3d79bfc..740e864fa3 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionParser.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionParser.java @@ -5405,7 +5405,7 @@ protected NameReference getUnspecifiedReference(boolean rejectTypeAnnotations) { char[] token = this.identifierStack[this.identifierPtr]; long position = this.identifierPositionStack[this.identifierPtr--]; int start = (int) (position >>> 32), end = (int) position; - if (this.assistNode == null && start < this.cursorLocation && end >= this.cursorLocation) { + if (this.assistNode == null && start <= this.cursorLocation && end >= this.cursorLocation) { ref = new CompletionOnSingleNameReference(token, position, isInsideAttributeValue()); this.assistNode = ref; } else {
This is a regression in 4.20. In 4.19 I see that the quick fix to import java.util.Arrays is proposed on second Arrays. (In reply to Snjezana Peco from comment #5) > The following patch fixes the issue: Can you please submit gerrit patch?
New Gerrit change created: https://git.eclipse.org/r/c/jdt/eclipse.jdt.core/+/183339
(In reply to Andrey Loskutov from comment #6) > This is a regression in 4.20. In 4.19 I see that the quick fix to import > java.util.Arrays is proposed on second Arrays. > > (In reply to Snjezana Peco from comment #5) > > The following patch fixes the issue: > > Can you please submit gerrit patch? I have created https://git.eclipse.org/r/c/jdt/eclipse.jdt.core/+/183339
Gerrit change https://git.eclipse.org/r/c/jdt/eclipse.jdt.core/+/183339 was merged to [master]. Commit: http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/?id=8772e9b6f3b839164a752cc69ccd5e37939aa8f3
(In reply to Eclipse Genie from comment #9) > Gerrit change https://git.eclipse.org/r/c/jdt/eclipse.jdt.core/+/183339 was > merged to [master]. > Commit: > http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/ > ?id=8772e9b6f3b839164a752cc69ccd5e37939aa8f3 Released for 4.21 M2. Thanks, Snjezana.
Verified using I20210818-1800.