Bug 33535 Quickfix causes exceptions
- Unzip to a Java project(default package) (I'll attach the source). - Go to file w/error - Click on icon in left margin to get quickfix options - Exceptions are produce !SESSION feb 28, 2003 14:31:43.732 --------------------------------------------- java.version=1.4.1_01 java.vendor=Sun Microsystems Inc. BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=no_NO Command-line arguments: -os win32 -ws win32 -arch x86 -install file:C:/eclipse/ !ENTRY org.eclipse.ui 4 4 feb 28, 2003 14:31:43.732 !MESSAGE Unhandled exception caught in event loop. !ENTRY org.eclipse.ui 4 0 feb 28, 2003 14:31:43.752 !MESSAGE java.lang.NullPointerException !STACK 0 java.lang.NullPointerException at org.eclipse.jdt.internal.ui.text.correction.ModifierCorrectionSubProcessor.getNe ededVisibility(ModifierCorrectionSubProcessor.java:143) at org.eclipse.jdt.internal.ui.text.correction.ModifierCorrectionSubProcessor.addNo nAccessibleMemberProposal(ModifierCorrectionSubProcessor.java:86) at org.eclipse.jdt.internal.ui.text.correction.QuickFixProcessor.process (QuickFixProcessor.java:190) at org.eclipse.jdt.internal.ui.text.correction.JavaCorrectionProcessor.collectCorre ctions(JavaCorrectionProcessor.java:205) at org.eclipse.jdt.internal.ui.text.correction.JavaCorrectionProcessor.processProbl emAnnotations(JavaCorrectionProcessor.java:173) at org.eclipse.jdt.internal.ui.text.correction.JavaCorrectionProcessor.computeCompl etionProposals(JavaCorrectionProcessor.java:136) at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals (ContentAssistant.java:1281) at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals (CompletionProposalPopup.java:178) at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$7 (CompletionProposalPopup.java:177) at org.eclipse.jface.text.contentassist.CompletionProposalPopup$3.run (CompletionProposalPopup.java:139) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:65) at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals (CompletionProposalPopup.java:134) at org.eclipse.jface.text.contentassist.ContentAssistant.showPossibleCompletions (ContentAssistant.java:1201) at org.eclipse.jdt.internal.ui.text.correction.JavaCorrectionAssistant.showPossible Completions(JavaCorrectionAssistant.java:153) at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor$AdaptedSourceViewer .doOperation(CompilationUnitEditor.java:153) at org.eclipse.jdt.internal.ui.javaeditor.JavaSelectMarkerRulerAction.run (JavaSelectMarkerRulerAction.java:52) at org.eclipse.ui.texteditor.AbstractRulerActionDelegate.run (AbstractRulerActionDelegate.java:98) at org.eclipse.ui.internal.PluginAction.runWithEvent (PluginAction.java:250) at org.eclipse.ui.internal.PluginAction.run(PluginAction.java:212) at org.eclipse.ui.texteditor.AbstractTextEditor$4.triggerAction (AbstractTextEditor.java:1674) at org.eclipse.ui.texteditor.AbstractTextEditor$4.mouseUp (AbstractTextEditor.java:1681) at org.eclipse.swt.widgets.TypedListener.handleEvent (TypedListener.java:130) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:77) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:836) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:1775) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1483) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1271) at org.eclipse.ui.internal.Workbench.run(Workbench.java:1254) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:845) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:461) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.eclipse.core.launcher.Main.basicRun(Main.java:247) at org.eclipse.core.launcher.Main.run(Main.java:703) at org.eclipse.core.launcher.Main.main(Main.java:539)
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/ModifierCorrectionSubProcessor.java
rewrite.markAsInserted(newBody);
				decl.setBody(newBody);
				Expression expr= ASTResolving.getInitExpression(decl.getReturnType(), decl.getExtraDimensions());
				if (expr != null) {
					ReturnStatement returnStatement= ast.newReturnStatement();
					returnStatement.setExpression(expr);
					newBody.statements().add(returnStatement);
				}
			}
	
			String label= CorrectionMessages.getString("ModifierCorrectionSubProcessor.removeabstract.description"); 
			Image image= JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_CHANGE);
			ASTRewriteCorrectionProposal proposal= new ASTRewriteCorrectionProposal(label, cu, rewrite, 1, image);
			proposal.ensureNoModifications();
			proposals.add(proposal);
		}
		
		if (!hasNoBody && context.getProblemId() == IProblem.BodyForAbstractMethod) {
			ASTRewrite rewrite= new ASTRewrite(decl.getParent());
			rewrite.markAsRemoved(decl.getBody());
			
			String label= CorrectionMessages.getString("ModifierCorrectionSubProcessor.removebody.description"); 
			Image image= JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_CHANGE);
			ASTRewriteCorrectionProposal proposal2= new ASTRewriteCorrectionProposal(label, cu, rewrite, 0, image);
			proposal2.ensureNoModifications();
			proposals.add(proposal2);
		}
		
		if (context.getProblemId() == IProblem.AbstractMethodInAbstractClass && (parentTypeDecl != null)) {
			ASTRewriteCorrectionProposal proposal= getMakeTypeStaticProposal(cu, parentTypeDecl);