DetectedJavaChangeInfo (String signature, @NotNull final DetectedJavaChangeInfo currentInfo, boolean delegate) { final PsiElement currentInfoMethod = currentInfo.getMethod(); final Project project = currentInfoMethod.getProject(); final PsiMethod oldMethod = currentInfo.getMethod(); String visibility = ""; PsiClass containingClass = oldMethod.getContainingClass(); if (containingClass != null && containingClass.isInterface()) { visibility = PsiModifier.PUBLIC + " "; } PsiMethod method = JavaPsiFacade.getElementFactory(project).createMethodFromText((visibility + signature).trim(), oldMethod); return currentInfo.createNextInfo(method, delegate); }