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 169372 - [68cat] Incorrect usage analysis for private classes
Summary: [68cat] Incorrect usage analysis for private classes
Status: REOPENED
Alias: None
Product: java
Classification: Unclassified
Component: Editor (show other bugs)
Version: 6.x
Hardware: PC Windows XP
: P3 blocker with 1 vote (vote)
Assignee: Dusan Balek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-07-28 19:08 UTC by matthies
Modified: 2016-07-18 20:22 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 2009-07-28 19:08:01 UTC
Example:

    class Outer
    {
        private static final class Nested
        {
            private Nested(int n) { }

            public static Nested getInstance(int n)
            {
                return new Nested(n);
            }
        }
    }

The Nested class should be highlighted as unused, because there is no call to the static method getInstance() within 
the Outer class. When removing the getInstance() method definition, the Nested class is correctly highlighted as 
unused. Note that while the getInstance() method is public in Nested, it is still private in Outer because Nested is 
private in Outer. As the method is static, it's also not possible for it to be invoked through a super type.

(NB 6.7.1)
Comment 1 matthies 2009-10-27 23:43:32 UTC
Still reproducable in 6.8 Beta.
Comment 2 Martin Balin 2016-07-07 07:16:38 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 3 matthies 2016-07-18 20:22:57 UTC
Still reproducable in current dev build.