mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
resolve conflicting names (IDEA-119412)
This commit is contained in:
@@ -720,7 +720,7 @@ public class PsiClassImpl extends JavaStubPsiElement<PsiClassStub<?>> implements
|
||||
PsiMethod method = myValueOfMethod;
|
||||
if (method == null && isEnum() && getName() != null) {
|
||||
PsiElementFactory elementFactory = JavaPsiFacade.getInstance(getProject()).getElementFactory();
|
||||
final PsiMethod valuesMethod = elementFactory.createMethodFromText("public static " + getName() + " valueOf(String name) throws IllegalArgumentException {}", this);
|
||||
final PsiMethod valuesMethod = elementFactory.createMethodFromText("public static " + getName() + " valueOf(String name) throws java.lang.IllegalArgumentException {}", this);
|
||||
myValueOfMethod = method = new LightMethod(getManager(), valuesMethod, this);
|
||||
}
|
||||
return method;
|
||||
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
enum SomeEnumeration {
|
||||
A;
|
||||
|
||||
public static SomeEnumeration fromValue(String v) {
|
||||
return valueOf(v);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class IllegalArgumentException extends Exception {}
|
||||
+1
@@ -59,4 +59,5 @@ public class LightAdvHighlightingJdk6Test extends LightDaemonAnalyzerTestCase {
|
||||
public void testRedundantCastInConditionalExpression() throws Exception { setLanguageLevel(LanguageLevel.JDK_1_6); doTest(true, false); }
|
||||
public void testJava5CastConventions() { setLanguageLevel(LanguageLevel.JDK_1_5); doTest(true, false); }
|
||||
public void testUnhandledExceptions() { doTest(true, false); }
|
||||
public void testUnhandledExceptionsValueOf() { doTest(true, false); }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user