mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
extract parameter object: warn if existing class doesn't contain compatible constructor though method calls to modify are found
This commit is contained in:
+5
@@ -279,6 +279,7 @@ public class JavaIntroduceParameterObjectDelegate
|
||||
}
|
||||
|
||||
if (moveDestination != null) {
|
||||
boolean constructorMiss = false;
|
||||
for (UsageInfo info : infos) {
|
||||
if (info instanceof IntroduceParameterObjectProcessor.ChangeSignatureUsageWrapper) {
|
||||
final UsageInfo usageInfo = ((IntroduceParameterObjectProcessor.ChangeSignatureUsageWrapper)info).getInfo();
|
||||
@@ -289,6 +290,10 @@ public class JavaIntroduceParameterObjectDelegate
|
||||
conflicts.putValue(overridingMethod, "Created class won't be accessible");
|
||||
}
|
||||
}
|
||||
if (!constructorMiss && classDescriptor.isUseExistingClass() && usageInfo instanceof MethodCallUsageInfo && classDescriptor.getExistingClassCompatibleConstructor() == null) {
|
||||
conflicts.putValue(classDescriptor.getExistingClass(), "Existing class misses compatible constructor");
|
||||
constructorMiss = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user