mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 22:51:17 +07:00
inline class to anonymous: replace varargs with array creation
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
class A {
|
||||
private Object b = new MyException("w");
|
||||
|
||||
private class <caret>MyException implements Runnable {
|
||||
public MyException(String...msg){
|
||||
this(new Throwable(), msg[0]);
|
||||
}
|
||||
|
||||
public MyException(Throwable t, String msg)
|
||||
{
|
||||
System.out.println(msg);
|
||||
}
|
||||
|
||||
public void run(){}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
class A {
|
||||
private Object b = new Runnable() {
|
||||
{
|
||||
System.out.println(new String[]{"w"}[0]);
|
||||
}
|
||||
|
||||
public void run(){}
|
||||
};
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user