summaryrefslogtreecommitdiff
path: root/java/java-tests/testData/codeInsight
diff options
context:
space:
mode:
Diffstat (limited to 'java/java-tests/testData/codeInsight')
-rw-r--r--java/java-tests/testData/codeInsight/completion/keywords/finalInCatch.java7
-rw-r--r--java/java-tests/testData/codeInsight/completion/keywords/finalInIncompleteCatch.java7
-rw-r--r--java/java-tests/testData/codeInsight/completion/smartType/SuggestTypeParametersInTypeArgumentList.java8
-rw-r--r--java/java-tests/testData/codeInsight/daemonCodeAnalyzer/genericsHighlighting/ParameterBoundsWithCapturedWildcard.java5
-rw-r--r--java/java-tests/testData/codeInsight/daemonCodeAnalyzer/genericsHighlighting/SuperCaptureSubstitutionWhenTypeParameterHasUpperBounds.java30
-rw-r--r--java/java-tests/testData/codeInsight/daemonCodeAnalyzer/genericsHighlighting8/IDEA110947.java2
-rw-r--r--java/java-tests/testData/codeInsight/daemonCodeAnalyzer/genericsHighlighting8/IDEA128333.java24
-rw-r--r--java/java-tests/testData/codeInsight/daemonCodeAnalyzer/genericsHighlighting8/SuperWildcardWithBoundPromotion.java4
-rw-r--r--java/java-tests/testData/codeInsight/daemonCodeAnalyzer/genericsHighlighting8/WildcardsBoundsIntersection.java2
-rw-r--r--java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/graphInference/CyclicParamsDependency.java18
-rw-r--r--java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/graphInference/IDEA126163.java29
-rw-r--r--java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/graphInference/IDEA128101.java4
-rw-r--r--java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/graphInference/IDEA128766.java21
-rw-r--r--java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/graphInference/InfiniteTypes.java9
-rw-r--r--java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/graphInference/SOEDuringInferenceFromParamBounds.java2
-rw-r--r--java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/graphInference/SameMethodNestedChainedCallsNearFunctionInterfaces.java87
-rw-r--r--java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/newMethodRef/AdditionalConstraints3Level.java15
-rw-r--r--java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/newMethodRef/WildcardParametrization.java19
-rw-r--r--java/java-tests/testData/codeInsight/typing/fixIfByBraceCompositeCondition_after.java5
-rw-r--r--java/java-tests/testData/codeInsight/typing/fixIfByBraceCompositeCondition_before.java5
-rw-r--r--java/java-tests/testData/codeInsight/typing/fixIfByBraceNewObject_after.java5
-rw-r--r--java/java-tests/testData/codeInsight/typing/fixIfByBraceNewObject_before.java5
-rw-r--r--java/java-tests/testData/codeInsight/typing/fixIfByBrace_after.java7
-rw-r--r--java/java-tests/testData/codeInsight/typing/fixIfByBrace_before.java5
-rw-r--r--java/java-tests/testData/codeInsight/typing/fixWhileByBrace_after.java7
-rw-r--r--java/java-tests/testData/codeInsight/typing/fixWhileByBrace_before.java5
26 files changed, 330 insertions, 7 deletions
diff --git a/java/java-tests/testData/codeInsight/completion/keywords/finalInCatch.java b/java/java-tests/testData/codeInsight/completion/keywords/finalInCatch.java
new file mode 100644
index 000000000000..6346b73dd045
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/completion/keywords/finalInCatch.java
@@ -0,0 +1,7 @@
+public class StructuredConfigKey {
+ {
+ try {
+
+ } catch (<caret>)
+ }
+}
diff --git a/java/java-tests/testData/codeInsight/completion/keywords/finalInIncompleteCatch.java b/java/java-tests/testData/codeInsight/completion/keywords/finalInIncompleteCatch.java
new file mode 100644
index 000000000000..0cdeb4962618
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/completion/keywords/finalInIncompleteCatch.java
@@ -0,0 +1,7 @@
+public class StructuredConfigKey {
+ {
+ try {
+
+ } catch (<caret>
+ }
+}
diff --git a/java/java-tests/testData/codeInsight/completion/smartType/SuggestTypeParametersInTypeArgumentList.java b/java/java-tests/testData/codeInsight/completion/smartType/SuggestTypeParametersInTypeArgumentList.java
new file mode 100644
index 000000000000..0bc90adbf7a3
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/completion/smartType/SuggestTypeParametersInTypeArgumentList.java
@@ -0,0 +1,8 @@
+class StringEx<T extends String> {
+}
+class Outer<T extends String> {
+ static class CompletionTest<T extends String> {
+ private StringEx<<caret>> myString;
+ }
+}
+
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/genericsHighlighting/ParameterBoundsWithCapturedWildcard.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/genericsHighlighting/ParameterBoundsWithCapturedWildcard.java
new file mode 100644
index 000000000000..c7cb266321c5
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/genericsHighlighting/ParameterBoundsWithCapturedWildcard.java
@@ -0,0 +1,5 @@
+class Test<T > {
+ public static interface EventListener<V extends String> {}
+ public void addListener (EventListener<<error descr="Type parameter '? extends T' is not within its bound; should extend 'java.lang.String'">? extends T</error>> listener) {}
+ public void addListener1(EventListener<? super T> listener) {}
+}
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/genericsHighlighting/SuperCaptureSubstitutionWhenTypeParameterHasUpperBounds.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/genericsHighlighting/SuperCaptureSubstitutionWhenTypeParameterHasUpperBounds.java
new file mode 100644
index 000000000000..4eaf810dad4f
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/genericsHighlighting/SuperCaptureSubstitutionWhenTypeParameterHasUpperBounds.java
@@ -0,0 +1,30 @@
+class Test<T > {
+ interface Event{}
+
+ interface EventListener<V extends Event> {
+ void handleEvent(V event);
+ }
+
+ public void addListener(EventListener<? super T> listener) {
+ EventListener<? extends Event> localListener = listener;
+ <error descr="Incompatible types. Found: 'Test.EventListener<capture<? super T>>', required: 'Test.EventListener<? super Test.Event>'">EventListener<? super Event> localListener1 = listener;</error>
+ }
+}
+
+class Test1 {
+
+ public static class Entity<E extends Entity<E>> {
+
+ public final <T, V extends EntityVisitor<? super E, T>> T handle(final V visitor) {
+ return visitor.handle(this);
+ }
+
+ }
+
+ public interface EntityVisitor<E extends Entity<E>, T> {
+
+ T handle(Entity<? extends E> e);
+
+ }
+
+} \ No newline at end of file
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/genericsHighlighting8/IDEA110947.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/genericsHighlighting8/IDEA110947.java
index 5f7ac80942a2..e895159a5762 100644
--- a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/genericsHighlighting8/IDEA110947.java
+++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/genericsHighlighting8/IDEA110947.java
@@ -9,7 +9,7 @@ abstract class ProcedureService {
abstract <C extends Command<Result>> Class<? extends Procedure<Command<Result>>> getProcedure(Class<C> cmd);
public <C extends Command<Result>> void execute(Class<? extends Command> aClass) {
- Class<Procedure<Command<Result>>> procedureClass = getProcedure(aClass);
+ <error descr="Incompatible types. Found: 'java.lang.Class<capture<? extends Procedure<Command<Result>>>>', required: 'java.lang.Class<Procedure<Command<Result>>>'">Class<Procedure<Command<Result>>> procedureClass = getProcedure(aClass);</error>
<error descr="Incompatible types. Found: 'java.lang.Class<capture<? extends Command>>', required: 'java.lang.Class<Command>'">Class<Command> c = aClass;</error>
<error descr="Incompatible types. Found: 'java.lang.Class<capture<? extends Command>>', required: 'java.lang.Class<C>'">Class<C> c1 = aClass;</error>
}
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/genericsHighlighting8/IDEA128333.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/genericsHighlighting8/IDEA128333.java
new file mode 100644
index 000000000000..24bc5b3ab1fe
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/genericsHighlighting8/IDEA128333.java
@@ -0,0 +1,24 @@
+import java.util.*;
+import java.lang.annotation.Annotation;
+import java.util.function.Function;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+abstract class WithAnn {
+
+ {
+ map((Class<? extends Annotation> ann) -> getAnnotation(ann));
+ map(this::getAnnotation);
+ }
+
+ abstract <A> A getAnnotation(Class<A> annotationClass);
+ abstract <R> void map(Function<Class<? extends Annotation>, ? extends R> mapper);
+}
+
+class Test {
+ private void it(final Set<Class<? extends String>> set) {
+ set.forEach((clazz) -> bind(clazz));
+ }
+
+ protected <T> void bind(Class<T> clazz) {}
+} \ No newline at end of file
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/genericsHighlighting8/SuperWildcardWithBoundPromotion.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/genericsHighlighting8/SuperWildcardWithBoundPromotion.java
index f1a533020e34..33dd56b27183 100644
--- a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/genericsHighlighting8/SuperWildcardWithBoundPromotion.java
+++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/genericsHighlighting8/SuperWildcardWithBoundPromotion.java
@@ -20,7 +20,7 @@ class Bug2<T extends Integer>{
}
void bug1(Parametrized<? super T> param) {
- <error descr="Inferred type 'capture<? super T>' for type parameter 'I' is not within its bound; should extend 'java.lang.Number'">foo(param)</error>;
+ foo(param);
}
@@ -35,7 +35,7 @@ class Test {
}
void bug1(Parametrized<? super T> param) {
- <error descr="Inferred type 'java.io.Serializable' for type parameter 'I' is not within its bound; should extend 'java.lang.Number'">foo(param)</error>;
+ <error descr="Inferred type 'capture<? super T>' for type parameter 'I' is not within its bound; should extend 'java.lang.Number'">foo(param)</error>;
}
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/genericsHighlighting8/WildcardsBoundsIntersection.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/genericsHighlighting8/WildcardsBoundsIntersection.java
index 6385fe5d125e..cf8ad1c9fb9f 100644
--- a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/genericsHighlighting8/WildcardsBoundsIntersection.java
+++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/genericsHighlighting8/WildcardsBoundsIntersection.java
@@ -10,6 +10,6 @@ class Node<NodeTypeT extends NodeType> {
class Main {
public static void main(NodeProperty<NumberExpression, Integer> nval, Node<? extends NodeType> expr) {
- int val = expr.get<error descr="'get(NodeProperty<? super capture<? extends NodeType>,java.lang.Integer>)' in 'Node' cannot be applied to '(NodeProperty<NumberExpression,java.lang.Integer>)'">(nval)</error>;
+ int val = expr.get<error descr="'get(NodeProperty<? super capture<? extends NodeType>,java.lang.Object>)' in 'Node' cannot be applied to '(NodeProperty<NumberExpression,java.lang.Integer>)'">(nval)</error>;
}
}
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/graphInference/CyclicParamsDependency.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/graphInference/CyclicParamsDependency.java
new file mode 100644
index 000000000000..927165e23e9c
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/graphInference/CyclicParamsDependency.java
@@ -0,0 +1,18 @@
+import java.util.List;
+
+class Sample {
+ <T extends List<K>, K extends List<T>> T foo(){
+ <error descr="Incompatible types. Found: 'K', required: 'T'">T t = foo().get(0);</error>
+ <error descr="Incompatible types. Found: 'K', required: 'K'">K k = foo().get(0);</error>
+
+ <error descr="Incompatible types. Found: 'T', required: 'T'">T t1 = foo().get(0).get(0);</error>
+
+ String s = foo();
+ <error descr="Incompatible types. Found: 'K', required: 'java.lang.String'">String s1 = foo().get(0);</error>
+ return null;
+ }
+
+ {
+ foo();
+ }
+} \ No newline at end of file
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/graphInference/IDEA126163.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/graphInference/IDEA126163.java
new file mode 100644
index 000000000000..7869663fb863
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/graphInference/IDEA126163.java
@@ -0,0 +1,29 @@
+class Test {
+
+ public static void main( String[] args ) throws Exception {
+ Checker.assertThat("", Utils.is(Utils.notNullValue()));
+ }
+}
+
+interface Util<T> {
+}
+
+class Utils {
+ static <T> Util<T> is( Util<T> util ) {
+ return null;
+ }
+
+ static <T> Util<T> is( T t ) {
+ return null;
+ }
+
+ static <T> Util<T> notNullValue() {
+ return null;
+ }
+}
+
+class Checker {
+ static <T> void assertThat(T actual, Util<T> util) {
+ }
+}
+
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/graphInference/IDEA128101.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/graphInference/IDEA128101.java
index 42be49b62f04..ac00e0bae517 100644
--- a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/graphInference/IDEA128101.java
+++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/graphInference/IDEA128101.java
@@ -22,8 +22,8 @@ class TestIDEA128101 {
construct(String.class, createPath(integerAttribute), createPath(stringAttribute));
construct1<error descr="Cannot resolve method 'construct1(java.lang.Class<java.lang.String>, TestIDEA128101.Path<java.lang.Integer>, TestIDEA128101.Path<java.lang.String>)'">(String.class, createPath(integerAttribute), createPath(stringAttribute))</error>;
construct2(String.class, createPath(integerAttribute), createPath(stringAttribute));
- <error descr="Type parameter K has incompatible upper bounds: Integer and String">construct3(String.class, createPath(integerAttribute), createPath(stringAttribute));</error>
- <error descr="Type parameter K has incompatible upper bounds: Integer and String">construct4(String.class, createPath(integerAttribute), createPath(stringAttribute));</error>
+ construct3<error descr="Cannot resolve method 'construct3(java.lang.Class<java.lang.String>, TestIDEA128101.Path<java.lang.Integer>, TestIDEA128101.Path<java.lang.String>)'">(String.class, createPath(integerAttribute), createPath(stringAttribute))</error>;
+ construct4(String.class, createPath(integerAttribute), createPath<error descr="'createPath(TestIDEA128101.Attribute<Y>)' in 'TestIDEA128101' cannot be applied to '(TestIDEA128101.Attribute<java.lang.String>)'">(stringAttribute)</error>);
}
}
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/graphInference/IDEA128766.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/graphInference/IDEA128766.java
new file mode 100644
index 000000000000..715b158d2cdd
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/graphInference/IDEA128766.java
@@ -0,0 +1,21 @@
+class Test {
+
+ static class TKey<T> {}
+
+ public interface Getter {
+ <T> T getValue(TKey<T> key);
+ }
+
+ public static <TK extends TKey<?>> TK getAKey(TK tKeySuffix) {
+ return tKeySuffix;
+ }
+
+ static final TKey<Double> KEY_D = new TKey<>();
+ public static void f(Getter getter) {
+ double d1 = getter.getValue(KEY_D);
+ double d2 = getter.getValue(getAKey(KEY_D));
+ TKey<Double> aKey = getAKey(KEY_D);
+ double d3 = getter.getValue(aKey);
+ }
+}
+
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/graphInference/InfiniteTypes.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/graphInference/InfiniteTypes.java
new file mode 100644
index 000000000000..2f6d975261e4
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/graphInference/InfiniteTypes.java
@@ -0,0 +1,9 @@
+class Test {
+
+ public static void main(String[] args) {
+ multiBound("test");
+ multiBound(null);
+ }
+
+ static <E extends Comparable<E> & CharSequence> void multiBound(E e) {}
+} \ No newline at end of file
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/graphInference/SOEDuringInferenceFromParamBounds.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/graphInference/SOEDuringInferenceFromParamBounds.java
index 3f26bbc1ef56..90e8efb23b5d 100644
--- a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/graphInference/SOEDuringInferenceFromParamBounds.java
+++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/graphInference/SOEDuringInferenceFromParamBounds.java
@@ -3,5 +3,5 @@ import java.util.Map;
public class SOE {
public static <K extends M, M extends Map<K,M>> M foo() {return null;}
- public static <K1 extends M1, M1 extends Map<K1,M1>> Map<K1, M1> foo1() {return <error descr="Inferred type 'java.util.Map<K1,M1>' for type parameter 'M' is not within its bound; should implement 'java.util.Map<java.util.Map<K1,M1>,java.util.Map<K1,M1>>'">foo()</error>;}
+ public static <K1 extends M1, M1 extends Map<K1,M1>> Map<K1, M1> foo1() {<error descr="Incompatible types. Found: 'M', required: 'java.util.Map<K1,M1>'">return foo();</error>}
}
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/graphInference/SameMethodNestedChainedCallsNearFunctionInterfaces.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/graphInference/SameMethodNestedChainedCallsNearFunctionInterfaces.java
new file mode 100644
index 000000000000..d8e931915013
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/graphInference/SameMethodNestedChainedCallsNearFunctionInterfaces.java
@@ -0,0 +1,87 @@
+import java.util.*;
+import java.util.function.BiFunction;
+import java.util.function.Supplier;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+class Test
+{
+ public static class K<T>
+ {
+ private final T head;
+ private final K<T> tail;
+
+ public K(T head, K<T> tail)
+ {
+ this.head = head;
+ this.tail = tail;
+ }
+ }
+
+ public static class P<U>
+ {
+ public <B, C> P<C> biMap(P<B> that, BiFunction<U, B, C> f)
+ {
+ return null;
+ }
+ }
+
+ public static <A> P<K<A>> f(K<P<A>> x)
+ {
+ return x.head.biMap(f(x.tail), K::new);
+ }
+}
+
+class A<T>
+{
+ public A(Supplier<T> arg0, Supplier<A<T>> arg1){}
+
+ static <S> A<S> make(S[] s)
+ {
+ return helpMake(0, s);
+ }
+
+ static <S> A<S> helpMake(int offset, S[] s)
+ {
+ return new A<>(() -> s[offset], () -> helpMake(offset + 1, s));
+ }
+}
+
+interface MultivaluedMap<K, V> extends Map<K, List<V>> {
+
+ void putSingle(K var1, V var2);
+
+ void add(K var1, V var2);
+
+ V getFirst(K var1);
+}
+
+
+class Headers {
+ private final Map<String, List<String>> headers;
+
+ public Headers(Map<String, List<String>> headers) {
+ this.headers = headers;
+ }
+
+ public Headers(MultivaluedMap<String, Object> multimap) {
+ this.headers = multimap.entrySet()
+ .stream()
+ .collect(
+ Collectors.toMap(
+ Map.Entry::getKey,
+ x -> x.getValue()
+ .stream()
+ .map(Object::toString)
+ .collect(Collectors.toList())
+ )
+ );
+ }
+}
+
+class IDEA128245 {
+ public void testCollectors(final Stream<Map.Entry<String, Set<String>>> stream,
+ Stream<Integer> integerStream) {
+ stream.collect(Collectors.toMap(Map.Entry::getKey, entry -> integerStream.collect(Collectors.toSet())));
+ }
+}
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/newMethodRef/AdditionalConstraints3Level.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/newMethodRef/AdditionalConstraints3Level.java
new file mode 100644
index 000000000000..3e4ef6f955e5
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/newMethodRef/AdditionalConstraints3Level.java
@@ -0,0 +1,15 @@
+import java.util.List;
+import java.util.function.Function;
+
+abstract class Sample {
+ abstract <T> T id (T t);
+ abstract <R> void foo(List<R> c);
+ abstract <U> List<U> bar(Function<String, U> m);
+
+ {
+ foo(bar(this::id));
+ foo(bar(id(i -> i)));
+
+ Function<String, String> s = id(this::id);
+ }
+} \ No newline at end of file
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/newMethodRef/WildcardParametrization.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/newMethodRef/WildcardParametrization.java
new file mode 100644
index 000000000000..d1adfe4a9ee1
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/newMethodRef/WildcardParametrization.java
@@ -0,0 +1,19 @@
+
+import java.util.function.Function;
+
+class IdeaTest {
+ class Test<K>{}
+
+ public void checkAnnotationsPresent() {
+ Function<Test<? extends Annotation>, Annotation> mapper = this::getAnnotation;
+ Function<Test<? extends Annotation>, ? extends Annotation> mapper1 = this::getAnnotation;
+ }
+
+ public <A extends Annotation> A getAnnotation(Test<A> annotationClass) {
+ return null;
+ }
+
+ static class Annotation{}
+
+
+}
diff --git a/java/java-tests/testData/codeInsight/typing/fixIfByBraceCompositeCondition_after.java b/java/java-tests/testData/codeInsight/typing/fixIfByBraceCompositeCondition_after.java
new file mode 100644
index 000000000000..d57959a1485a
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/typing/fixIfByBraceCompositeCondition_after.java
@@ -0,0 +1,5 @@
+class C {
+ boolean f() {
+ if (f() && new Object(){<caret>)
+ }
+} \ No newline at end of file
diff --git a/java/java-tests/testData/codeInsight/typing/fixIfByBraceCompositeCondition_before.java b/java/java-tests/testData/codeInsight/typing/fixIfByBraceCompositeCondition_before.java
new file mode 100644
index 000000000000..9718c041c2e0
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/typing/fixIfByBraceCompositeCondition_before.java
@@ -0,0 +1,5 @@
+class C {
+ boolean f() {
+ if (f() && new Object()<caret>)
+ }
+} \ No newline at end of file
diff --git a/java/java-tests/testData/codeInsight/typing/fixIfByBraceNewObject_after.java b/java/java-tests/testData/codeInsight/typing/fixIfByBraceNewObject_after.java
new file mode 100644
index 000000000000..f85e4d676ead
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/typing/fixIfByBraceNewObject_after.java
@@ -0,0 +1,5 @@
+class C {
+ boolean f() {
+ if (new Object(){<caret>)
+ }
+} \ No newline at end of file
diff --git a/java/java-tests/testData/codeInsight/typing/fixIfByBraceNewObject_before.java b/java/java-tests/testData/codeInsight/typing/fixIfByBraceNewObject_before.java
new file mode 100644
index 000000000000..f536c7eba9a3
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/typing/fixIfByBraceNewObject_before.java
@@ -0,0 +1,5 @@
+class C {
+ boolean f() {
+ if (new Object()<caret>)
+ }
+} \ No newline at end of file
diff --git a/java/java-tests/testData/codeInsight/typing/fixIfByBrace_after.java b/java/java-tests/testData/codeInsight/typing/fixIfByBrace_after.java
new file mode 100644
index 000000000000..f17312c07aa6
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/typing/fixIfByBrace_after.java
@@ -0,0 +1,7 @@
+class C {
+ boolean f() {
+ if (f()) {
+ <caret>
+ }
+ }
+} \ No newline at end of file
diff --git a/java/java-tests/testData/codeInsight/typing/fixIfByBrace_before.java b/java/java-tests/testData/codeInsight/typing/fixIfByBrace_before.java
new file mode 100644
index 000000000000..017a62e874f3
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/typing/fixIfByBrace_before.java
@@ -0,0 +1,5 @@
+class C {
+ boolean f() {
+ if (f()<caret>)
+ }
+} \ No newline at end of file
diff --git a/java/java-tests/testData/codeInsight/typing/fixWhileByBrace_after.java b/java/java-tests/testData/codeInsight/typing/fixWhileByBrace_after.java
new file mode 100644
index 000000000000..92e28bfe1542
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/typing/fixWhileByBrace_after.java
@@ -0,0 +1,7 @@
+class C {
+ boolean f() {
+ while (f()) {
+ <caret>
+ }
+ }
+} \ No newline at end of file
diff --git a/java/java-tests/testData/codeInsight/typing/fixWhileByBrace_before.java b/java/java-tests/testData/codeInsight/typing/fixWhileByBrace_before.java
new file mode 100644
index 000000000000..a254dee776db
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/typing/fixWhileByBrace_before.java
@@ -0,0 +1,5 @@
+class C {
+ boolean f() {
+ while (f()<caret>)
+ }
+} \ No newline at end of file