mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-09 16:39:37 +07:00
Cleanup (test moved to a correct location)
This commit is contained in:
@@ -0,0 +1,66 @@
|
||||
class Test {
|
||||
final Runnable runnable;
|
||||
|
||||
{
|
||||
runnable = () -> System.out.println(<error descr="Variable 'runnable' might not have been initialized">runnable</error>);
|
||||
}
|
||||
|
||||
final Runnable runnable1;
|
||||
{
|
||||
runnable1 = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
System.out.println(runnable1);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
abstract class TestInnerAnonymous {
|
||||
|
||||
|
||||
void foo() {
|
||||
new Object() {
|
||||
final Runnable runnable;
|
||||
|
||||
{
|
||||
runnable = () -> System.out.println(<error descr="Variable 'runnable' might not have been initialized">runnable</error>);
|
||||
}
|
||||
|
||||
final Runnable runnable1;
|
||||
|
||||
{
|
||||
runnable1 = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
System.out.println(runnable1);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
private static class MyObject {
|
||||
final Runnable runnable;
|
||||
|
||||
{
|
||||
runnable = () -> System.out.println(<error descr="Variable 'runnable' might not have been initialized">runnable</error>);
|
||||
}
|
||||
|
||||
final Runnable runnable1;
|
||||
|
||||
{
|
||||
runnable1 = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
System.out.println(runnable1);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
import java.util.*;
|
||||
|
||||
class C {
|
||||
interface Simplest {
|
||||
void m();
|
||||
}
|
||||
void use(Simplest s) { }
|
||||
|
||||
interface IntParser {
|
||||
int parse(String s);
|
||||
}
|
||||
|
||||
void test() {
|
||||
Simplest simplest = () -> { };
|
||||
use(() -> { });
|
||||
|
||||
IntParser intParser = (String s) -> Integer.parseInt(s);
|
||||
}
|
||||
|
||||
Runnable foo() {
|
||||
return () -> { System.out.println("foo"); };
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
class C {
|
||||
interface Simplest {
|
||||
void m();
|
||||
}
|
||||
void simplest() { }
|
||||
void use(Simplest s) { }
|
||||
|
||||
void test() {
|
||||
Simplest simplest = this::simplest;
|
||||
use(this::simplest);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
interface A {
|
||||
<error descr="Illegal combination of modifiers: 'strictfp' and 'abstract'">strictfp</error> void m();
|
||||
strictfp default void m1(){}
|
||||
strictfp static void m2() {}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
class Test {
|
||||
void <warning descr="Use of '_' as an identifier might not be supported in releases after Java 8">_</warning>(){}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
class C {
|
||||
interface Simplest {
|
||||
void m();
|
||||
}
|
||||
private static void simplest1() { }
|
||||
private static void <warning descr="Private method 'simplest()' is never used">simplest</warning>() { }
|
||||
|
||||
public static void main(String[] args) {
|
||||
Simplest o = C::simplest1;
|
||||
System.out.println(o);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user