mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
AIOOBE (IDEA-173816)
This commit is contained in:
+1
-1
@@ -130,7 +130,7 @@ public class ExtractToMethodReferenceIntention extends BaseElementAtCaretIntenti
|
||||
targetMethodName + parameters, targetClass);
|
||||
PsiCodeBlock targetMethodBody = emptyMethod.getBody();
|
||||
LOG.assertTrue(targetMethodBody != null);
|
||||
targetMethodBody.addRange(elements[0], elements[elements.length - 1]);
|
||||
if (elements.length > 0) targetMethodBody.addRange(elements[0], elements[elements.length - 1]);
|
||||
|
||||
PsiMethod method = (PsiMethod)CodeStyleManager.getInstance(project).reformat(JavaCodeStyleManager.getInstance(project).shortenClassReferences(targetClass.add(emptyMethod)));
|
||||
PsiMethodReferenceExpression methodReference =
|
||||
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
class B {
|
||||
{
|
||||
Runnable r = () <caret>-> {} ;
|
||||
}
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
class B {
|
||||
{
|
||||
Runnable r = B::run;
|
||||
}
|
||||
|
||||
private static void run() {
|
||||
}
|
||||
}
|
||||
+4
@@ -54,6 +54,10 @@ public class ExtractToMethodReferenceTest extends IPPTestCase {
|
||||
assertIntentionNotAvailable();
|
||||
}
|
||||
|
||||
public void testEmptyCodeBlock() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testUsedLocalVariables() throws Exception {
|
||||
assertIntentionNotAvailable();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user