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 152746 - [68cat] "Implement all abstract methods" generates methods in reverse hierarchical order
Summary: [68cat] "Implement all abstract methods" generates methods in reverse hierarc...
Status: REOPENED
Alias: None
Product: java
Classification: Unclassified
Component: Hints (show other bugs)
Version: 6.x
Hardware: PC Windows XP
: P4 blocker (vote)
Assignee: Jan Becicka
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-11-07 23:16 UTC by matthies
Modified: 2016-07-18 20:16 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 matthies 2008-11-07 23:16:51 UTC
Example: Given

    interface X
    {
        void a();
        void b();
    }
    
    interface Y extends X
    {
        void c();
        void d();
    }

for "new Y() { }" the method implementations are generated in the order c, d, a, b.
The expected, more intuitive and useful order would be a, b, c, d.
Basically post-order rather than pre-order when traversing the super-type tree.
Comment 1 matthies 2008-11-07 23:29:27 UTC
PS: This should also remain true with return type specialization. I have use cases like

    interface X
    {
        Number f(Number a, Number b);
        Number f(Number a, Integer b);
        Number f(Integer a, Number b);
        Number f(Integer a, Integer b);
    }
    
    interface Y extends X
    {
        Integer f(Integer a, Integer b);  // specialize return type
    }

where for implementations of Y the method implementations are then generated in the order

        Integer f(Integer a, Integer b);
        Number f(Number a, Number b);
        Number f(Number a, Integer b);
        Number f(Integer a, Number b);

which is annoying not only because the parameter combinations are not properly "sorted" any more, but also because it's 
inconsistent with the order generated for implementations of X, which leads to confusing the methods when switching 
between the source code of the different implementations.
Comment 2 David Strupl 2009-04-28 15:08:08 UTC
I think this is either P3 enhancement request or P5 bug depending on how you look at the behaviour.
Comment 3 Jan Becicka 2010-10-18 14:39:29 UTC
implemented as hint
Comment 4 Martin Balin 2016-07-07 07:18:08 UTC
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue.

Thanks for your cooperation,
NetBeans IDE 8.2 Release Boss
Comment 5 matthies 2016-07-18 20:16:55 UTC
Still reproducable in current dev build.