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 227770 - Method with same name as field dissappears in Codecompletion
Summary: Method with same name as field dissappears in Codecompletion
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Editor (show other bugs)
Version: 7.3
Hardware: PC Linux
: P2 normal (vote)
Assignee: Dusan Balek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-21 13:05 UTC by tomzi
Modified: 2013-03-26 14:51 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 tomzi 2013-03-21 13:05:27 UTC
I created an inner class
public class MyClass
    private enum Scenario {

        MOBILE("MOBILE_SERVICE", true);
        private boolean hasBroadband;
        private Object offer;

        Scenario(Object offer, boolean hasBroadband) {
            this.offer = offer;
            this.hasBroadband = hasBroadband;
        }

        public boolean hasBroadband() {
            return hasBroadband;
        }

        public Object getOffer() {
            return offer;
        }
    }

public void  method() {
    new Scenario().
}
}

When CTRL SPACE (CodeCompletion) on 'new Scenario().' it interestingly only shows the field 'hasBroadband' although it is private.
If I rename the field 'hasBroadband' I get both the method and the field in the codecompletion list
the field
Comment 1 Jiri Prox 2013-03-25 09:02:10 UTC
reproducible

Here is example w/o initializing enum 

public class MyClass {

    class Inner {
        private int x;
        
        private int x() {
            return x;
        }
    }
    
    public void method() {
        new Inner().x();
    }
}
Comment 2 Dusan Balek 2013-03-26 14:51:53 UTC
Fixed in jet-main.

http://hg.netbeans.org/jet-main/rev/c376a4dd0cbb