void (final Project project, final MethodParameterInjection template, PsiFile psiFile, final PsiMethod contextMethod) { final Configuration configuration = InjectorUtils.getEditableInstance(project); final BaseInjection baseTemplate = new BaseInjection(template.getSupportId()).copyFrom(template); final MethodParameterInjection allMethodParameterInjection = createFrom(project, baseTemplate, contextMethod, true); // find existing injection for this class. final BaseInjection originalInjection = configuration.findExistingInjection(allMethodParameterInjection); final MethodParameterInjection methodParameterInjection; if (originalInjection == null) { methodParameterInjection = template; } else { final BaseInjection originalCopy = originalInjection.copy(); final InjectionPlace currentPlace = template.getInjectionPlaces()[0]; originalCopy.mergeOriginalPlacesFrom(template, true); originalCopy.setPlaceEnabled(currentPlace.getText(), true); methodParameterInjection = createFrom(project, originalCopy, contextMethod, false); } mergePlacesAndAddToConfiguration(project, psiFile, configuration, methodParameterInjection, originalInjection); }