Bug 321582 - [quick fix] wrong quick fix for inaccessible type's methods/fields/ctors when an object of that type is returned via a method.
Summary: [quick fix] wrong quick fix for inaccessible type's methods/fields/ctors when...
Status: CLOSED WONTFIX
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.7   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-03 08:08 EDT by Ayushman Jain CLA
Modified: 2020-04-03 06:13 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ayushman Jain CLA 2010-08-03 08:08:16 EDT
Build id: I20100802-1800.

For the following case, the quickfix offered is "change visibility of m() to public", which is wrong:

package p0;

class A {
    public class M {
        public M() {
            System.out.println("Invoked M()");
        }
    }
}

-------------------------------------------

package p0;

public class B {
    public static A m() {
        return new A();
    }
}

-------------------------------------------

package p1;
import p0.B;

class C {
    public static void main(String[] args) {
        B.m().new M();         // error at B.m() -> The type A is not visible
    }
}

The correct quickfix should be "change visibility of A to public".
This also happens if we're accessing a method from A, or a field, instead of the constructor for M as shown above.
Comment 1 Dani Megert CLA 2010-08-04 03:28:55 EDT
See also fixed bug 262511.
Comment 2 Eclipse Genie CLA 2020-04-03 06:13:07 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.