void () { EqualsHashCodeTemplatesManager manager = EqualsHashCodeTemplatesManager.getInstance(); String baseName = manager.getDefaultTemplateBaseName(); try { TemplateResource defaultTemplate = manager.getDefaultTemplate(); String className = defaultTemplate.getClassName(); if (className != null) { PsiClass usedClass = JavaPsiFacade.getInstance(myClass.getProject()).findClass(className, myClass.getResolveScope()); if (usedClass == null || PsiUtil.getLanguageLevel(myClass).isLessThan(PsiUtil.getLanguageLevel(usedClass))) { manager.setDefaultTemplate(EqualsHashCodeTemplatesManager.INTELLI_J_DEFAULT); } } run(); } finally { manager.setDefaultTemplate(baseName); } }