mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[java-actions] IDEA-343025 "Move initializer to constructor" shouldn't be available for implicitly declared class
- disable for ImplicitClass GitOrigin-RevId: 1cd67fd89726eb19ccedb5227715a7d95c2c7c50
This commit is contained in:
committed by
intellij-monorepo-bot
parent
caeb4b6152
commit
8b76574052
+1
@@ -24,6 +24,7 @@ public final class MoveInitializerToConstructorAction extends BaseMoveInitialize
|
||||
protected boolean isAvailable(@NotNull PsiField field) {
|
||||
if (!super.isAvailable(field)) return false;
|
||||
PsiClass containingClass = field.getContainingClass();
|
||||
if (containingClass instanceof PsiImplicitClass) return false;
|
||||
assert containingClass != null;
|
||||
PsiMethod[] constructors = containingClass.getConstructors();
|
||||
if (constructors.length > 0 && ContainerUtil.all(constructors, c -> c instanceof SyntheticElement)) return false;
|
||||
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
// "Move initializer to constructor" "false"
|
||||
private final Integer i<caret> = 2;
|
||||
|
||||
void main() {
|
||||
foo(i);
|
||||
}
|
||||
|
||||
void foo(Integer i) {
|
||||
System.out.println(i);
|
||||
}
|
||||
Reference in New Issue
Block a user