mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-09 20:42:52 +07:00
make method static: warn about broken method references if filed or class need to be passed; NPE (EA-66661 - NPE: MakeMethodStaticProcessor.changeExternalUsage)
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
class Test4 {
|
||||
void test() {
|
||||
Runnable f = Test4::yyy;
|
||||
}
|
||||
|
||||
String myField = "";
|
||||
static void yyy() {
|
||||
System.out.println(myField);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
class Test4 {
|
||||
void test() {
|
||||
Runnable f = this::yyy;
|
||||
}
|
||||
|
||||
String myField = "";
|
||||
void yy<caret>y() {
|
||||
System.out.println(myField);
|
||||
}
|
||||
}
|
||||
@@ -203,6 +203,10 @@ public class MakeMethodStaticTest extends LightRefactoringTestCase {
|
||||
doTest(true);
|
||||
}
|
||||
|
||||
public void testThisMethodReference() throws Exception {
|
||||
doTest(false);
|
||||
}
|
||||
|
||||
public void testPreserveParametersAlignment() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user