package com.intellij.refactoring.rename;

import com.intellij.openapi.util.Condition;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiJavaFile;
import com.intellij.psi.util.PsiUtil;

public class JavaVetoRenameCondition implements Condition<PsiElement> {
  public boolean value(final PsiElement element) {
    return element instanceof PsiJavaFile && !PsiUtil.isInJspFile(element);
  }
}

@@ -388,16 +388,67 @@
 element)
+ && ((PsiJavaFile) element).getClasses().length %3E 0
 ;%0A  %7D%0A%7D%0A

allow renaming Java file with no contained classes (IDEADEV-27682)