Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 363591

Summary: [quick fix] Change visibility to default makes the suggested file not respond to saving
Product: [Eclipse Project] JDT Reporter: nickh186
Component: UIAssignee: JDT-UI-Inbox <jdt-ui-inbox>
Status: CLOSED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: deepakazad
Version: 3.8   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description nickh186 CLA 2011-11-11 10:26:41 EST
Build Identifier: 20110916-0149

I had a few private fields/methods in a separate class that I was trying to access in another class and when the suggestion popped up to "Change visibility of 'x' to default", I clicked on it.  The view switched to the other class at the point where I declared the changed item and when I tried to save, it wouldn't save.  

The star denoting that it has unsaved changes is present next to the name in the class tab, but the GUI save icon is disabled and CTRL-s doesn't work either.  The only way to save the file is to close it and choose to save it at the prompt.

Both of the classes in question are in the same package.  Also, it continues to work after I do the work around, but naturally Eclipse shows errors until the file with the changed visibility is saved.

Reproducible: Always

Steps to Reproduce:
1. Create two classes in the same package.
2. Add a method or field in one class with a private modifier.
3. Go to the other class and try to use the field/method as though it were not private.
4. When the auto-correct marks the item and suggests changing the visibility, allow it to and then try to save the file.

Expected: File is saved
Actual: File is unable to be saved until the class is closed and the user is prompted by the save prompt.
Comment 1 Deepak Azad CLA 2011-11-11 10:38:55 EST

*** This bug has been marked as a duplicate of bug 361136 ***