Merge remote-tracking branch 'origin/master'

This commit is contained in:
Roman Shevchenko
2016-09-16 10:40:07 +03:00
110 changed files with 1747 additions and 536 deletions
@@ -0,0 +1,12 @@
class Dummy {
public @interface Debug {
String value() default "[no comment]";
}
private static final class Constants {
private static final String INPUT = "Input";
}
<error descr="Annotations are not allowed here">@Dummy.Debug(Constants.INPUT)</error><EOLError descr="Identifier or type expected"></EOLError>
}
@@ -52,7 +52,7 @@ class Test {
static {
Test s1 = staticCall(Test::n0);
Test s2 = staticCall(Test::n1);
Test s3 = <error descr="Cannot resolve method 'staticCall(<method reference>)'">staticCall</error>(Test::n2);
Test s3 = staticCall<error descr="Cannot resolve method 'staticCall(<method reference>)'">(Test::n2)</error>;
Test s4 = staticCall<error descr="Ambiguous method call: both 'Test.staticCall(I1<Test>)' and 'Test.staticCall(I2<Test, String>)' match">(Test::n01)</error>;
Test s5 = staticCall<error descr="Ambiguous method call: both 'Test.staticCall(I1<Test>)' and 'Test.staticCall(I2<Test, String>)' match">(Test::n012)</error>;
}
@@ -0,0 +1,25 @@
import java.util.function.*;
class Test {
void foo(Function<String, String> f) {}
void foo(String f) {}
{
foo(a -> {
String s = a.substring(0);
<error descr="Missing return statement">}</error>);
}
interface A {
void m(String s);
}
void bar(Function<String, String> f) {}
void bar(A f) {}
{
bar(a -> {
String s = a.substring(0);
});
}
}
@@ -4,7 +4,7 @@ import java.util.*;
public class Main {
void sort(List<Person> persons) {
persons.sort(Comparator.comparingDouble(p -> p.getName().length()));
persons.sort(Comparator.comparingDouble(person -> person.getName().length()));
}
interface Person {
@@ -5,7 +5,7 @@ import java.util.*;
public class Main {
void sort(List<Person> persons) {
String p;
persons.sort(Comparator.comparing(p1 -> p1.name));
persons.sort(Comparator.comparing(p2 -> p2.name));
}
class Person {
@@ -0,0 +1,9 @@
// "Replace with Comparator.comparingInt" "true"
import java.util.*;
public class Main {
void sort(List<String> data) {
data.sort(Comparator.comparingInt(String::length));
}
}
@@ -4,7 +4,7 @@ import java.util.*;
public class Main {
void sort(List<Person> persons) {
persons.sort((p1, p2) -> Double.com<caret>pare(p1.getName().length(), p2.getName().length()));
persons.sort((first, second) -> Double.com<caret>pare(first.getName().length(), second.getName().length()));
}
interface Person {
@@ -0,0 +1,9 @@
// "Replace with Comparator.comparingInt" "true"
import java.util.*;
public class Main {
void sort(List<String> data) {
data.sort((d1, d2) -> d1.length() - d2.le<caret>ngth());
}
}
@@ -0,0 +1,10 @@
// "Implement methods" "true"
interface I<T> {
void m(I<? extends T> i, T v);
}
class Impl implements I<? super Number> {
@Override
public void m(I<?> i, Object v) {
<caret>
}
}
@@ -0,0 +1,6 @@
// "Implement methods" "true"
interface I<T> {
void m(I<? extends T> i, T v);
}
class I<caret>mpl implements I<? super Number> {
}