Bug 23348 Quickfix ignores read-only state [quick fix]
Build: 20020903 1. Create a new Java project. 2. Create a new Java file, A.java public class A { public void foo() { ba(); } public void bar() { } } 3. Save the file. 4. Mark it read-only. 5. Right click the error in the task list and select "Quick- fix..." 6. Select either of the options, the edits are made (in a read-only file!).
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/CorrectionMarkerResolutionGenerator.java
public IMarkerResolution[] getResolutions(IMarker marker) {
		int id= marker.getAttribute(IJavaModelMarker.ID, -1);
		if (!JavaCorrectionProcessor.hasCorrections(id)) {
			return new IMarkerResolution[0]; 
		}
		
		try {
			ICompilationUnit cu= getCompilationUnit(marker);
			if (cu != null) {
				IEditorInput input= EditorUtility.getEditorInput(cu);
				if (input != null) { 
					ProblemPosition pos= findProblemPosition(input, marker);
					if (pos != null) {
						ArrayList proposals= new ArrayList();
						JavaCorrectionProcessor.collectCorrections(pos, proposals);
						int nProposals= proposals.size();
						IMarkerResolution[] resolutions= new IMarkerResolution[nProposals];
						for (int i= 0; i < nProposals; i++) {
							resolutions[i]= new CorrectionMarkerResolution(input, (ChangeCorrectionProposal) proposals.get(i));
						}
						return resolutions;
					}
				}
			}
		} catch (JavaModelException e) {
			JavaPlugin.log(e);
		}
		return new IMarkerResolution[0]; 
	}
	private ICompilationUnit getCompilationUnit(IMarker marker) {