void (MultiMap<PsiElement, @DialogMessage String> conflicts, UsageInfo[] infos, PsiMethod method, JavaIntroduceParameterObjectClassDescriptor classDescriptor) { final MoveDestination moveDestination = classDescriptor.getMoveDestination(); if (moveDestination != null) { if (!moveDestination.isTargetAccessible(method.getProject(), method.getContainingFile().getVirtualFile())) { conflicts.putValue(method, JavaRefactoringBundle.message("introduce.parameter.object.error.created.class.wont.be.accessible")); } if (!classDescriptor.isCreateInnerClass() && !classDescriptor.isUseExistingClass()) { final PsiFile containingFile = method.getContainingFile(); final PsiDirectory containingDirectory = containingFile.getContainingDirectory(); PsiDirectory directory = moveDestination.getTargetDirectory(containingDirectory); if (directory != null) { PsiFile file = directory.findFile(classDescriptor.getClassName() + ".java"); if (file != null) { VirtualFile virtualFile = PsiUtilCore.getVirtualFile(file); if (virtualFile != null) { conflicts.putValue(method, JavaRefactoringBundle.message("introduce.parameter.object.error.file.already.exits", virtualFile.getPresentableUrl())); } } } } } if (moveDestination != null) { boolean constructorMiss = false; for (UsageInfo info : infos) { if (info instanceof IntroduceParameterObjectProcessor.ChangeSignatureUsageWrapper) { final UsageInfo usageInfo = ((IntroduceParameterObjectProcessor.ChangeSignatureUsageWrapper)info).getInfo(); if (usageInfo instanceof OverriderMethodUsageInfo) { final PsiElement overridingMethod = ((OverriderMethodUsageInfo<?>)usageInfo).getOverridingMethod(); if (!moveDestination.isTargetAccessible(overridingMethod.getProject(), overridingMethod.getContainingFile().getVirtualFile())) { conflicts.putValue(overridingMethod, JavaRefactoringBundle.message("introduce.parameter.object.error.created.class.wont.be.accessible")); } } if (!constructorMiss && classDescriptor.isUseExistingClass() && usageInfo instanceof MethodCallUsageInfo && classDescriptor.getExistingClassCompatibleConstructor() == null) { conflicts.putValue(classDescriptor.getExistingClass(), JavaRefactoringBundle .message("introduce.parameter.object.error.existing.class.misses.compatible.constructor")); constructorMiss = true; } } } } if (classDescriptor.isUseExistingClass()) { for (ParameterInfoImpl info : classDescriptor.getParamsToMerge()) { Object existingClassBean = classDescriptor.getBean(info); if (existingClassBean == null) { conflicts.putValue(classDescriptor.getExistingClass(), JavaRefactoringBundle.message("introduce.parameter.object.error.no.field.associated.found", info.getName())); } } } }