mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 15:27:45 +07:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
+12
@@ -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>
|
||||
}
|
||||
+1
-1
@@ -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>;
|
||||
}
|
||||
|
||||
+25
@@ -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);
|
||||
});
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -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 {
|
||||
|
||||
+1
-1
@@ -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 {
|
||||
|
||||
+9
@@ -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));
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -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 {
|
||||
|
||||
+9
@@ -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());
|
||||
}
|
||||
}
|
||||
+10
@@ -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>
|
||||
}
|
||||
}
|
||||
+6
@@ -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> {
|
||||
}
|
||||
Reference in New Issue
Block a user