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

Summary: [68cat] Incorrect usage analysis for private classes
Product: java Reporter: matthies <matthies>
Component: EditorAssignee: Dusan Balek <dbalek>
Status: REOPENED ---    
Severity: blocker    
Priority: P3    
Version: 6.x   
Hardware: PC   
OS: Windows XP   
Issue Type: DEFECT Exception Reporter:

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.