This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 109179 - "Accessing static field" warning for non-static method reference
Summary: "Accessing static field" warning for non-static method reference
Status: RESOLVED WORKSFORME
Alias: None
Product: java
Classification: Unclassified
Component: Hints (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: issues@java
URL:
Keywords:
: 109328 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-07-09 21:06 UTC by _ tball
Modified: 2007-07-11 13:37 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description _ tball 2007-07-09 21:06:03 UTC
When displaying jackpot/rules/src/org/netbeans/modules/jackpot/rules/parser/GeneratedMatcher.java with the Jsr199
project open, an "accessing static field" warning is flagged on line 304: return st.isErroneous().  "st" is a
com.sun.tools.javac.code.Type instances, and isErroneous() is not static.  Type.isErroneous(List<Type>) is, however, so
maybe the tester doesn't differentiate between overloaded methods.  Found in 6.0-M10.
Comment 1 jsvec 2007-07-10 10:13:44 UTC
Here is an easier way how to reproduce this bug (the problem occurs on the last line where is st.indexOf()):

public class StaticTest {
    void indexOf() {}   
    static void indexOf(char c) {}
    public static void main(String[] args) {
        StaticTest st = new StaticTest();
        st.indexOf();
    }
}

Comment 2 Jiri Prox 2007-07-10 10:22:54 UTC
Are you able to reproduce it with the latest build? There were several fixes recently.
Comment 3 jsvec 2007-07-10 12:12:21 UTC
It seems that it is fixed.
I can not reproduce this issue in latest nightly build (Build 200707100000).
Comment 4 Jan Lahoda 2007-07-10 19:15:44 UTC
Has been already fixed as a different bug - I do not have the issue number offhand, sorry.
Comment 5 Jiri Prox 2007-07-11 13:37:47 UTC
*** Issue 109328 has been marked as a duplicate of this issue. ***