mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-08 15:09:39 +07:00
[tests] prepares Java tests for the language level raise
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
class Test {
|
||||
interface F<T extends Throwable> {
|
||||
void _(T t) throws T;
|
||||
void m(T t) throws T;
|
||||
}
|
||||
<K extends Throwable> void foo(F<K> f) throws K { }
|
||||
|
||||
|
||||
@@ -2,14 +2,14 @@ import java.io.IOException;
|
||||
|
||||
class Test {
|
||||
interface F<T extends Throwable> {
|
||||
void _() throws T;
|
||||
void m() throws T;
|
||||
}
|
||||
|
||||
|
||||
void m1() { }
|
||||
void m2() throws NullPointerException{ }
|
||||
void m3() throws IOException { }
|
||||
<K extends Throwable> void foo(F<K> f) throws K { }
|
||||
|
||||
|
||||
{
|
||||
foo(()->{});
|
||||
foo(()->{throw new NullPointerException();});
|
||||
@@ -18,5 +18,5 @@ class Test {
|
||||
foo(this::m2);
|
||||
<error descr="Unhandled exception: java.io.IOException">foo(this::m3);</error>
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
class Test {
|
||||
interface F<T extends ClassNotFoundException> {
|
||||
void _() throws T;
|
||||
void m() throws T;
|
||||
}
|
||||
<K extends ClassNotFoundException> void foo(F<K> f) throws K { }
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
class Test {
|
||||
|
||||
interface F<T extends Throwable> {
|
||||
void _() throws T;
|
||||
void m() throws T;
|
||||
}
|
||||
|
||||
void m1() { }
|
||||
void m2() throws ClassNotFoundException { }
|
||||
void m3() throws Exception { }
|
||||
|
||||
|
||||
<K extends Throwable> void foo1(F<K> f) throws K { }
|
||||
<K extends ClassNotFoundException> void foo2(F<K> f) throws K { }
|
||||
|
||||
|
||||
@@ -21,6 +21,6 @@ class Main {
|
||||
|
||||
|
||||
public interface Fun<T, R> {
|
||||
public R _(T t);
|
||||
public R f(T t);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,6 @@ class Main {
|
||||
}
|
||||
|
||||
interface Fun<T, R> {
|
||||
R _(T t);
|
||||
R f(T t);
|
||||
}
|
||||
}
|
||||
@@ -20,7 +20,7 @@ class Main {
|
||||
}
|
||||
|
||||
interface Fun<T, R> {
|
||||
R _(T t);
|
||||
R f(T t);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -9,12 +9,12 @@ class Main2 {
|
||||
}
|
||||
|
||||
interface Fun<T, R> {
|
||||
R _(T t);
|
||||
R f(T t);
|
||||
}
|
||||
|
||||
|
||||
class Foo<K> implements Fun<K, Integer> {
|
||||
@Override
|
||||
public Integer _(K k) {
|
||||
public Integer f(K k) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,6 +19,6 @@ class Main {
|
||||
}
|
||||
|
||||
interface Fun<T, R> {
|
||||
R _(T t);
|
||||
R f(T t);
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,11 @@
|
||||
class Test {
|
||||
|
||||
interface II {
|
||||
int _();
|
||||
int m();
|
||||
}
|
||||
|
||||
interface IL {
|
||||
long _();
|
||||
long m();
|
||||
}
|
||||
|
||||
void m0(II im) { }
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
public class Test<A, B extends Number> {
|
||||
interface IO<T> {
|
||||
T _(Object o);
|
||||
T m(Object o);
|
||||
}
|
||||
|
||||
interface IN<T extends Number> {
|
||||
T _(Object o);
|
||||
T m(Object o);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ class Test {
|
||||
int foo() { return 0; }
|
||||
Integer fooBoxed() { return 0; }
|
||||
}
|
||||
|
||||
|
||||
void test(Stream<Inner> sp) {
|
||||
IntStream mi = sp.map(Inner::foo);
|
||||
Stream<Integer> mI = sp.map(Inner::fooBoxed);
|
||||
@@ -18,11 +18,11 @@ class Test {
|
||||
}
|
||||
|
||||
interface Function<T, R> {
|
||||
public R _(T t);
|
||||
public R f(T t);
|
||||
}
|
||||
|
||||
interface IntFunction<T> {
|
||||
public int _(T t);
|
||||
public int f(T t);
|
||||
}
|
||||
|
||||
interface IntStream {}
|
||||
|
||||
@@ -1,18 +1,3 @@
|
||||
/*
|
||||
* Copyright 2000-2012 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
class Test {
|
||||
public interface I {
|
||||
int m();
|
||||
@@ -39,7 +24,7 @@ class Test {
|
||||
|
||||
class Test1 {
|
||||
interface I<T, V> {
|
||||
V _(T t);
|
||||
V m(T t);
|
||||
}
|
||||
|
||||
static <V> void bar(I<String, V> ii, I<V, String> ik){}
|
||||
@@ -47,5 +32,4 @@ class Test1 {
|
||||
{
|
||||
bar(s -> s.equals("") ? 0 : 1, i -> "");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
class Test {
|
||||
interface I<T extends Number> {
|
||||
void _(T t);
|
||||
void m(T t);
|
||||
}
|
||||
|
||||
|
||||
void foo(Object o) { }
|
||||
|
||||
void test() {
|
||||
|
||||
@@ -18,14 +18,14 @@ class Test {
|
||||
}
|
||||
|
||||
interface II {
|
||||
boolean _(String s);
|
||||
boolean m(String s);
|
||||
}
|
||||
class Test1 {
|
||||
void bar(boolean b){
|
||||
II ik = b ? (s)-> true : (s)->false;
|
||||
II ik1 = (II)((b ? <error descr="Lambda expression not expected here">(s)-> true</error> : <error descr="Lambda expression not expected here">(s)->false</error>));
|
||||
II ik2 = (II)(ik1 = (b ? (s)-> true : (s)->false));
|
||||
(b ? <error descr="Lambda expression not expected here">(s) -> true</error> : ik)._("");
|
||||
(b ? <error descr="Lambda expression not expected here">(s) -> true</error> : ik).m("");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
class TestData<K> {}
|
||||
interface TerminalOp<L, M> extends IntermediateOp<L, M> {}
|
||||
interface IntermediateOp<L1, M1> { boolean _(L1 l, M1 m);}
|
||||
interface IntermediateOp<L1, M1> { boolean m(L1 l, M1 m);}
|
||||
|
||||
class Test<T, U> {
|
||||
protected U exerciseOps(TestData<T> data, TerminalOp<T, U> terminal, IntermediateOp<T, U>... ops) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import java.util.*;
|
||||
class TestData<K> {}
|
||||
interface TerminalOp<L, M> extends IntermediateOp<L, M> {}
|
||||
interface IntermediateOp<L1, M1> { boolean _(L1 l, M1 m);}
|
||||
interface IntermediateOp<L1, M1> { boolean m(L1 l, M1 m);}
|
||||
|
||||
|
||||
class Test1 {
|
||||
@@ -52,7 +52,7 @@ class Test4 {
|
||||
|
||||
}
|
||||
public interface BiPredicate1<T, U> extends IntermediateOp1<T, U>{
|
||||
boolean _(T t, U u);
|
||||
boolean m(T t, U u);
|
||||
}
|
||||
|
||||
public interface TerminalOp1<T, U> extends IntermediateOp1<T, U> {}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
interface I {
|
||||
Integer _();
|
||||
Integer m();
|
||||
}
|
||||
|
||||
interface I1 {
|
||||
String _();
|
||||
String m();
|
||||
}
|
||||
|
||||
class Test {
|
||||
|
||||
@@ -57,7 +57,7 @@ lower bounds: String">x-> ""</error>);
|
||||
|
||||
static <K> K fooo(){return null;}
|
||||
static int foooI(){return 0;}
|
||||
|
||||
|
||||
interface I<X> {
|
||||
X foo(X x);
|
||||
}
|
||||
@@ -72,12 +72,11 @@ lower bounds: String">x-> ""</error>);
|
||||
}
|
||||
|
||||
class TypeArgsConsistency3 {
|
||||
public static void main(String[] args) {
|
||||
public static void main(String[] args) {
|
||||
doIt1(1, x -> doIt1(x, y -> x * y));
|
||||
doIt1(1, x -> x);
|
||||
doIt1(1, x -> x * x);
|
||||
}
|
||||
interface F1<ResultType, P1> { ResultType _(P1 p); }
|
||||
static <T> T doIt1(T i, F1<T,T> f) { return f._(i);}
|
||||
}
|
||||
|
||||
interface F1<ResultType, P1> { ResultType f(P1 p); }
|
||||
static <T> T doIt1(T i, F1<T,T> f) { return f.f(i);}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
class Test {
|
||||
interface I {
|
||||
int _();
|
||||
int m();
|
||||
}
|
||||
|
||||
static abstract class Parent {
|
||||
|
||||
@@ -1,27 +1,25 @@
|
||||
class MyTest {
|
||||
|
||||
private static class Foo {
|
||||
static int foo(int i) { return i; }
|
||||
}
|
||||
|
||||
|
||||
static Foo foo = new Foo();
|
||||
|
||||
static void foo(String s) {}
|
||||
|
||||
|
||||
static void bar(Integer i, Number n) {}
|
||||
static void bar(Number n, Integer i) {}
|
||||
|
||||
|
||||
void baz(int i) {}
|
||||
}
|
||||
|
||||
class AlienTest {
|
||||
|
||||
interface IInt {
|
||||
int _(int i);
|
||||
int m(int i);
|
||||
}
|
||||
|
||||
|
||||
interface IIntInt {
|
||||
int _(Integer i1, Integer i2);
|
||||
int m(Integer i1, Integer i2);
|
||||
}
|
||||
|
||||
static {
|
||||
@@ -35,34 +33,31 @@ class AlienTest {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class MyTest1 {
|
||||
|
||||
interface I1 {
|
||||
int[] _();
|
||||
int[] m();
|
||||
}
|
||||
|
||||
interface I2 {
|
||||
Object _();
|
||||
}
|
||||
|
||||
interface I3 {
|
||||
char[] _();
|
||||
}
|
||||
|
||||
interface I4 {
|
||||
|
||||
boolean _();
|
||||
interface I2 {
|
||||
Object m();
|
||||
}
|
||||
|
||||
interface I3 {
|
||||
char[] m();
|
||||
}
|
||||
|
||||
interface I4 {
|
||||
boolean m();
|
||||
}
|
||||
|
||||
interface I5 {
|
||||
Class<? extends MyTest1> _();
|
||||
Class<? extends MyTest1> m();
|
||||
}
|
||||
|
||||
interface I6 {
|
||||
Class<MyTest1> _();
|
||||
Class<MyTest1> m();
|
||||
}
|
||||
|
||||
|
||||
void foo(Object[] arr) {
|
||||
I1 c1 = <error descr="Bad return type in method reference: cannot convert java.lang.Object[] to int[]">arr :: clone</error>;
|
||||
I2 c2 = arr :: clone;
|
||||
|
||||
@@ -1,19 +1,12 @@
|
||||
package todelete;
|
||||
|
||||
/**
|
||||
* Created with IntelliJ IDEA.
|
||||
* User: Anna.Kozlova
|
||||
* Date: 9/26/12
|
||||
* Time: 1:18 PM
|
||||
* To change this template use File | Settings | File Templates.
|
||||
*/
|
||||
class MyTest {
|
||||
interface Bar1 {
|
||||
int _(String s);
|
||||
int m(String s);
|
||||
}
|
||||
|
||||
interface Bar2 {
|
||||
int _(int s);
|
||||
int m(int s);
|
||||
}
|
||||
|
||||
void bar(Bar1 b1){}
|
||||
@@ -35,11 +28,11 @@ class MyTest {
|
||||
|
||||
class MyTest1 {
|
||||
interface Bar1 {
|
||||
int _(String s);
|
||||
int m(String s);
|
||||
}
|
||||
|
||||
interface Bar2 {
|
||||
int _(int s);
|
||||
int m(int s);
|
||||
}
|
||||
|
||||
//void bar(Bar1 b1){}
|
||||
@@ -61,11 +54,11 @@ class MyTest1 {
|
||||
|
||||
class MyTest2 {
|
||||
interface Bar1 {
|
||||
int _(String s);
|
||||
int m(String s);
|
||||
}
|
||||
|
||||
interface Bar2 {
|
||||
int _(int s);
|
||||
int m(int s);
|
||||
}
|
||||
|
||||
void bar(Bar1 b1){}
|
||||
@@ -87,11 +80,11 @@ class MyTest2 {
|
||||
|
||||
class MyTest3 {
|
||||
interface Bar1 {
|
||||
int _(String s);
|
||||
int m(String s);
|
||||
}
|
||||
|
||||
interface Bar2 {
|
||||
int _(int s);
|
||||
int m(int s);
|
||||
}
|
||||
|
||||
//void bar(Bar1 b1){}
|
||||
@@ -114,7 +107,7 @@ class MyTest3 {
|
||||
|
||||
class MyTest4 {
|
||||
interface Bar1<T> {
|
||||
int _(T s);
|
||||
int m(T s);
|
||||
}
|
||||
|
||||
|
||||
@@ -135,7 +128,7 @@ class MyTest4 {
|
||||
|
||||
class MyTest5 {
|
||||
interface Bar1<T> {
|
||||
int _(T s);
|
||||
int m(T s);
|
||||
}
|
||||
|
||||
|
||||
@@ -156,7 +149,7 @@ class MyTest5 {
|
||||
|
||||
class MyTest6 {
|
||||
interface I {
|
||||
void _(Integer i);
|
||||
void m(Integer i);
|
||||
}
|
||||
|
||||
static void foo(Number i) {}
|
||||
@@ -165,13 +158,13 @@ class MyTest6 {
|
||||
|
||||
public static void main(String[] args) {
|
||||
I s = MyTest6::foo;
|
||||
s._(1);
|
||||
s.m(1);
|
||||
}
|
||||
}
|
||||
|
||||
class MyTest7 {
|
||||
interface I {
|
||||
void _(Number i);
|
||||
void m(Number i);
|
||||
}
|
||||
|
||||
static void foo(Number i) {}
|
||||
@@ -180,6 +173,6 @@ class MyTest7 {
|
||||
|
||||
public static void main(String[] args) {
|
||||
I s = MyTest7::foo;
|
||||
s._(1);
|
||||
s.m(1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ class Test {
|
||||
}
|
||||
|
||||
interface Bar {
|
||||
Integer _(String s);
|
||||
Integer m(String s);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ class Test1 {
|
||||
Comparable<String> c = Test1 :: length;
|
||||
Comparable<Integer> c1 = Test1 :: length;
|
||||
}
|
||||
|
||||
|
||||
public static Integer length(String s) {
|
||||
return s.length();
|
||||
}
|
||||
@@ -28,9 +28,9 @@ class Test1 {
|
||||
public static Integer length(Integer s) {
|
||||
return s;
|
||||
}
|
||||
|
||||
|
||||
interface Bar {
|
||||
Integer _(String s);
|
||||
Integer m(String s);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -60,11 +60,11 @@ class StaticInner1 {
|
||||
}
|
||||
|
||||
interface I1 {
|
||||
Inner _(StaticInner1 rec);
|
||||
Inner m(StaticInner1 rec);
|
||||
}
|
||||
|
||||
interface I2 {
|
||||
Inner _();
|
||||
Inner m();
|
||||
}
|
||||
|
||||
static void call3(I1 s) {}
|
||||
@@ -130,7 +130,7 @@ class NonStaticInner3 {
|
||||
interface I2<X> {
|
||||
X m();
|
||||
}
|
||||
|
||||
|
||||
interface I3<X> {
|
||||
X m(NonStaticInner3 rec, int i);
|
||||
}
|
||||
|
||||
@@ -3,19 +3,19 @@ class MyTest<E> {
|
||||
}
|
||||
|
||||
interface I<T> {
|
||||
MyTest<T> _(T t);
|
||||
MyTest<T> m(T t);
|
||||
}
|
||||
|
||||
static <Y> void bar(Y arg, I<Y> i) {
|
||||
i._(arg);
|
||||
i.m(arg);
|
||||
}
|
||||
|
||||
static <Y> void bar(I<Y> i, Y arg) {
|
||||
i._(arg);
|
||||
i.m(arg);
|
||||
}
|
||||
|
||||
static <Y> void bar(I<Y> i) {
|
||||
i._(null);
|
||||
i.m(null);
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
import java.util.List;
|
||||
|
||||
class GetClassTest {
|
||||
interface GetCl {
|
||||
Class<? extends List> _();
|
||||
Class<? extends List> m();
|
||||
}
|
||||
|
||||
interface GetClReturnTypeProblems {
|
||||
Class<List<String>> _();
|
||||
Class<List<String>> m();
|
||||
}
|
||||
|
||||
void test(int[] iarr, List<String> ls) {
|
||||
|
||||
@@ -3,19 +3,19 @@ class MyTestDefaultConstructor {
|
||||
|
||||
static class Foo<X extends Number> extends SuperFoo<X> {
|
||||
}
|
||||
|
||||
|
||||
interface I1 {
|
||||
SuperFoo<String> _();
|
||||
SuperFoo<String> m();
|
||||
}
|
||||
|
||||
interface I2 {
|
||||
SuperFoo<Integer> _();
|
||||
SuperFoo<Integer> m();
|
||||
}
|
||||
|
||||
|
||||
interface I3 {
|
||||
SuperFoo<Object> _();
|
||||
SuperFoo<Object> m();
|
||||
}
|
||||
|
||||
|
||||
private static void <warning descr="Private method 'foo(MyTestDefaultConstructor.I1)' is never used">foo</warning>(I1 i) {System.out.println(i);}
|
||||
private static void <warning descr="Private method 'foo(MyTestDefaultConstructor.I2)' is never used">foo</warning>(I2 i) {System.out.println(i);}
|
||||
private static void <warning descr="Private method 'foo(MyTestDefaultConstructor.I3)' is never used">foo</warning>(I3 i) {System.out.println(i);}
|
||||
@@ -31,19 +31,19 @@ class MyTestConstructor {
|
||||
static class Foo<X extends Number> extends SuperFoo<X> {
|
||||
Foo(){}
|
||||
}
|
||||
|
||||
|
||||
interface I1 {
|
||||
SuperFoo<String> _();
|
||||
SuperFoo<String> m();
|
||||
}
|
||||
|
||||
interface I2 {
|
||||
SuperFoo<Integer> _();
|
||||
SuperFoo<Integer> m();
|
||||
}
|
||||
|
||||
|
||||
interface I3 {
|
||||
SuperFoo<Object> _();
|
||||
SuperFoo<Object> m();
|
||||
}
|
||||
|
||||
|
||||
private static void <warning descr="Private method 'foo(MyTestConstructor.I1)' is never used">foo</warning>(I1 i) {System.out.println(i);}
|
||||
private static void <warning descr="Private method 'foo(MyTestConstructor.I2)' is never used">foo</warning>(I2 i) {System.out.println(i);}
|
||||
private static void <warning descr="Private method 'foo(MyTestConstructor.I3)' is never used">foo</warning>(I3 i) {System.out.println(i);}
|
||||
@@ -58,21 +58,21 @@ class MyTestMethod {
|
||||
|
||||
static class Foo<X extends Number> extends SuperFoo<X> {
|
||||
}
|
||||
|
||||
|
||||
interface I1 {
|
||||
SuperFoo<String> _();
|
||||
SuperFoo<String> m();
|
||||
}
|
||||
|
||||
interface I2 {
|
||||
SuperFoo<Integer> _();
|
||||
SuperFoo<Integer> m();
|
||||
}
|
||||
|
||||
|
||||
interface I3 {
|
||||
SuperFoo<Object> _();
|
||||
SuperFoo<Object> m();
|
||||
}
|
||||
|
||||
|
||||
static <X extends Number> Foo<X> m() { return null; }
|
||||
|
||||
|
||||
private static void <warning descr="Private method 'foo(MyTestMethod.I1)' is never used">foo</warning>(I1 i) {System.out.println(i);}
|
||||
private static void <warning descr="Private method 'foo(MyTestMethod.I2)' is never used">foo</warning>(I2 i) {System.out.println(i);}
|
||||
private static void <warning descr="Private method 'foo(MyTestMethod.I3)' is never used">foo</warning>(I3 i) {System.out.println(i);}
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
class MyTest {
|
||||
|
||||
interface I {
|
||||
void _(MyTest receiver, Integer i);
|
||||
void m(MyTest receiver, Integer i);
|
||||
}
|
||||
|
||||
void m(Integer i) {}
|
||||
|
||||
public static void main(String[] args) {
|
||||
I i = MyTest :: m;
|
||||
i._(new MyTest(), 1);
|
||||
i.m(new MyTest(), 1);
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,4 @@
|
||||
class OnArrayTest {
|
||||
|
||||
interface Cln {
|
||||
Object m(int[] i);
|
||||
}
|
||||
@@ -16,9 +15,8 @@ class OnArrayTest {
|
||||
int len(T[] ta);
|
||||
}
|
||||
|
||||
|
||||
interface ToStr<T> {
|
||||
String _(T[] ta);
|
||||
String m(T[] ta);
|
||||
}
|
||||
|
||||
interface ArrayReturnType<T> {
|
||||
@@ -40,18 +38,17 @@ class OnArrayTest {
|
||||
ArrayReturnType<String[]> a1 = String[]::new;
|
||||
ArrayReturnType<String[][]> a2 = String[][]::new;
|
||||
ArrayReturnType<String[]> a3 = <error descr="Bad return type in method reference: cannot convert int[] to java.lang.String[]">int[]::new</error>;
|
||||
|
||||
|
||||
ObjectArrayReturnType a4 = Foo<?>[]::new;
|
||||
ObjectArrayReturnType a5 = <error descr="Generic array creation">Foo<? extends String>[]</error>::new;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class IDEA106973 {
|
||||
interface Function<T, R> {
|
||||
R apply(T t);
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
Function<Integer, String[]> a = String[] :: new;
|
||||
<error descr="Incompatible types. Found: '<method reference>', required: 'IDEA106973.Function<java.lang.String,java.lang.String[]>'">Function<String, String[]> a1 = String[] :: new;</error>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
class MyTest {
|
||||
interface I<X> {
|
||||
X _();
|
||||
X m();
|
||||
}
|
||||
static <T> T bar() {return null;}
|
||||
static {
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
class Test<X> {
|
||||
|
||||
interface I {
|
||||
void _();
|
||||
void m();
|
||||
}
|
||||
|
||||
|
||||
|
||||
void test() {
|
||||
I i1 = <error descr="Parameterized qualifier on static method reference">Test<String>::foo</error>;
|
||||
I i2 = Test::foo;
|
||||
|
||||
@@ -12,11 +12,11 @@ class Test {
|
||||
public static Integer length(String s) {
|
||||
return s.length();
|
||||
}
|
||||
|
||||
|
||||
public static void bar(Bar bar) {}
|
||||
|
||||
|
||||
interface Bar {
|
||||
Integer _(String s);
|
||||
Integer m(String s);
|
||||
}
|
||||
|
||||
void f() throws IOException {
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
class Test {
|
||||
interface IInt {
|
||||
int _();
|
||||
int m();
|
||||
}
|
||||
|
||||
interface ILong {
|
||||
long _();
|
||||
long m();
|
||||
}
|
||||
|
||||
void m(IInt i, Long l) {}
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
import java.util.List;
|
||||
|
||||
class Test {
|
||||
|
||||
interface Function<K, V> {
|
||||
V _(K k);
|
||||
V f(K k);
|
||||
}
|
||||
|
||||
static {
|
||||
@@ -18,9 +17,8 @@ class Test {
|
||||
}
|
||||
|
||||
class Test1 {
|
||||
|
||||
interface Function<K> {
|
||||
K _();
|
||||
K f();
|
||||
}
|
||||
|
||||
static {
|
||||
@@ -32,4 +30,4 @@ class Test1 {
|
||||
}
|
||||
|
||||
public static <C> void foo(Function<C> fn) { }
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
class Test {
|
||||
interface I {
|
||||
Object _();
|
||||
Object m();
|
||||
}
|
||||
static class Foo<X> {}
|
||||
static class Foo1 {}
|
||||
@@ -9,5 +9,4 @@ class Test {
|
||||
I o1 = Foo1::<String>new;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
class Test {
|
||||
{
|
||||
((Bar) Test::length)._("");
|
||||
((Bar) Test::length).m("");
|
||||
}
|
||||
|
||||
public static Integer length(String s) {
|
||||
@@ -8,6 +8,6 @@ class Test {
|
||||
}
|
||||
|
||||
interface Bar {
|
||||
Integer _(String s);
|
||||
Integer m(String s);
|
||||
}
|
||||
}
|
||||
@@ -49,7 +49,7 @@ public class KeywordCompletionTest extends LightCompletionTestCase {
|
||||
public void testClassScope2() { doTest(4, CLASS_SCOPE_KEYWORDS); }
|
||||
public void testClassScope3() { doTest(0, CLASS_SCOPE_KEYWORDS); }
|
||||
public void testClassScope4() { doTest(10, CLASS_SCOPE_KEYWORDS_2); }
|
||||
public void testInterfaceScope() { doTest(8, INTERFACE_SCOPE_KEYWORDS); }
|
||||
public void testInterfaceScope() { setLanguageLevel(LanguageLevel.JDK_1_8); doTest(8, INTERFACE_SCOPE_KEYWORDS); }
|
||||
public void testAfterAnnotations() { doTest(6, "public", "final", "class", "interface", "abstract", "enum", null); }
|
||||
public void testExtends1() { doTest(2, "extends", "implements", null); }
|
||||
public void testExtends2() { doTest(1, "extends", "implements", "AAA", "BBB", "instanceof"); }
|
||||
|
||||
@@ -17,6 +17,7 @@ package com.intellij.codeInsight.daemon.lambda;
|
||||
|
||||
import com.intellij.codeInsight.daemon.LightDaemonAnalyzerTestCase;
|
||||
import com.intellij.codeInspection.deadCode.UnusedDeclarationInspection;
|
||||
import com.intellij.pom.java.LanguageLevel;
|
||||
|
||||
public class LambdaHighlightingTest extends LightDaemonAnalyzerTestCase {
|
||||
private static final String BASE_PATH = "/codeInsight/daemonCodeAnalyzer/lambda/highlighting/";
|
||||
@@ -88,7 +89,7 @@ public class LambdaHighlightingTest extends LightDaemonAnalyzerTestCase {
|
||||
public void testIDEA108195() { doTest(); }
|
||||
public void testDiamondInference() { doTest(); }
|
||||
public void testFunctionalInterfaceCheck() { doTest(); }
|
||||
public void testUnderscores() { doTest(true); }
|
||||
public void testUnderscores() { setLanguageLevel(LanguageLevel.JDK_1_8); doTest(true); }
|
||||
public void testReturnTypeAmbiguity() { doTest(); }
|
||||
public void testWildcardsAndFormalLambdaParams() { doTest(); }
|
||||
public void testFinalInitializer() { doTest(); }
|
||||
|
||||
Reference in New Issue
Block a user