EA-34288 (IOE: PsiJavaParserFacadeImpl.createExpressionFromText)

This commit is contained in:
Bas Leijdekkers
2012-03-26 15:01:19 +02:00
parent 2b8b4985ba
commit 245fcceb1c
4 changed files with 35 additions and 2 deletions
@@ -1,5 +1,5 @@
/*
* Copyright 2006-2011 Bas Leijdekkers
* Copyright 2006-201@ Bas Leijdekkers
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -73,6 +73,10 @@ public class UnqualifiedFieldAccessInspection extends BaseInspection {
if (field.hasModifierProperty(PsiModifier.STATIC)) {
return;
}
final PsiClass containingClass = field.getContainingClass();
if (containingClass instanceof PsiAnonymousClass) {
return;
}
registerError(expression);
}
}
@@ -1,5 +1,5 @@
/*
* Copyright 2006-2011 Bas Leijdekkers
* Copyright 2006-2012 Bas Leijdekkers
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -68,6 +68,10 @@ public class UnqualifiedMethodAccessInspection extends BaseInspection {
if (method.isConstructor() || method.hasModifierProperty(PsiModifier.STATIC)) {
return;
}
final PsiClass containingClass = method.getContainingClass();
if (containingClass instanceof PsiAnonymousClass) {
return;
}
registerError(expression);
}
}
@@ -9,4 +9,17 @@ public class UnqualifiedFieldAccess {
final String s = String.valueOf(field.hashCode());
System.out.println(s);
}
void foo() {
new Object() {
int i;
void foo() {
new Object() {
void foo() {
i = 0;
}
};
}
};
}
}
@@ -15,4 +15,16 @@ public class UnqualifiedMethodAccess extends JPanel {
void foo(String s) {
this.foo();
}
void anonymous() {
new Object() {
void bar() {
new Object() {
void foo() {
bar();
}
};
}
};
}
}