mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-19 13:02:30 +07:00
accept static methods with body in interfaces (IDEA-124745)
This commit is contained in:
@@ -135,7 +135,7 @@ public class CreateFromUsageUtils {
|
||||
|
||||
JVMElementFactory factory = JVMElementFactories.getFactory(aClass.getLanguage(), aClass.getProject());
|
||||
|
||||
LOG.assertTrue(!aClass.isInterface() || method.hasModifierProperty(PsiModifier.DEFAULT), "Interface bodies should be already set up");
|
||||
LOG.assertTrue(!aClass.isInterface() || method.hasModifierProperty(PsiModifier.DEFAULT) || method.hasModifierProperty(PsiModifier.STATIC), "Interface bodies should be already set up");
|
||||
|
||||
FileType fileType = FileTypeManager.getInstance().getFileTypeByExtension(template.getExtension());
|
||||
Properties properties = new Properties();
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
// "Create Method 'fooBar'" "true"
|
||||
interface I {
|
||||
static void fooBar() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
class Test {
|
||||
void test() {
|
||||
Runnable runnable = I::fooBar;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
// "Create Method 'fooBar'" "true"
|
||||
interface I {
|
||||
}
|
||||
|
||||
class Test {
|
||||
void test() {
|
||||
Runnable runnable = I::foo<caret>Bar;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user