Cleanup (test moved to a correct location)

This commit is contained in:
Roman Shevchenko
2015-07-18 22:59:11 +03:00
parent f2c9ca8d97
commit de416d4f7f
9 changed files with 11 additions and 23 deletions

View File

@@ -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);
}
};
}
}
}

View File

@@ -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"); };
}
}

View File

@@ -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);
}
}

View File

@@ -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() {}
}

View File

@@ -0,0 +1,3 @@
class Test {
void <warning descr="Use of '_' as an identifier might not be supported in releases after Java 8">_</warning>(){}
}

View File

@@ -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);
}
}