mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[java-postfix] IDEA-296188 Erroneous Arrays.stream completion in array field assignment
GitOrigin-RevId: b48d3b0ffaa8abd3e3676a6a02880ea5a691173b
This commit is contained in:
committed by
intellij-monorepo-bot
parent
d4a5a88e61
commit
ce005dce54
+2
@@ -27,6 +27,8 @@ public class StreamPostfixTemplate extends StringBasedPostfixTemplate {
|
||||
private static final Condition<PsiElement> IS_SUPPORTED_ARRAY = element -> {
|
||||
if (!(element instanceof PsiExpression)) return false;
|
||||
|
||||
if (element instanceof PsiAssignmentExpression && element.getParent() instanceof PsiExpressionStatement) return false;
|
||||
|
||||
PsiType type = ((PsiExpression)element).getType();
|
||||
if (!(type instanceof PsiArrayType)) return false;
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
package templates;
|
||||
|
||||
public class Foo {
|
||||
public static void main(String[] args) {
|
||||
Object[] a;
|
||||
Object o;
|
||||
a = o.str<caret>
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package templates;
|
||||
|
||||
public class Foo {
|
||||
public static void main(String[] args) {
|
||||
Object[] a;
|
||||
Object o;
|
||||
a = o.str <caret>
|
||||
}
|
||||
}
|
||||
+4
@@ -44,6 +44,10 @@ public class StreamPostfixTemplateTest extends PostfixTemplateTestCase {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testAssignment() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testNotAvailable() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user