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 220444 - Quick fix for attempted reference to an inaccessible private member
Summary: Quick fix for attempted reference to an inaccessible private member
Status: NEW
Alias: None
Product: java
Classification: Unclassified
Component: Editor (show other bugs)
Version: 7.2
Hardware: PC Windows Vista
: P3 normal (vote)
Assignee: Dusan Balek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-19 18:00 UTC by exolon
Modified: 2012-10-19 18:00 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description exolon 2012-10-19 18:00:52 UTC
class A {
    private static String a() { return ""; }
}

class B {
    void b() { A.a(); }
}


In this example, the attempted call to A.a() produces an error because B doesn't have access to A's private members.

However, when the programmer discovers that they want to make such a call, it would be helpful to have a quick fix/refactoring option which changes A.a's access specifier to public (or perhaps protected, if A and B are in the same package).