langtools/src/share/classes/com/sun/tools/javac/comp/Attr.java
changeset 5002 12a9e8562200
parent 5001 71ed0cc22974
child 5320 e2aaa958b02d
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Attr.java	Tue Feb 23 18:43:02 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Attr.java	Thu Feb 25 09:42:35 2010 -0800
@@ -2020,6 +2020,10 @@
                               tree.pos(), site, sym.name, true);
                 }
             }
+        } else if (sym.kind != ERR && (sym.flags() & STATIC) != 0 && sym.name != names._class) {
+            // If the qualified item is not a type and the selected item is static, report
+            // a warning. Make allowance for the class of an array type e.g. Object[].class)
+            chk.warnStatic(tree, "static.not.qualified.by.type", Kinds.kindName(sym.kind), sym.owner);
         }
 
         // If we are selecting an instance member via a `super', ...