Bug 80774 NPE in Quick Fix
I20041208 + latest plug-in export java.lang.NullPointerException at org.eclipse.jdt.internal.ui.text.correction.AdvancedQuickAssistProcessor.getFullyCoveredNodes(AdvancedQuickAssistProcessor.java:735) at org.eclipse.jdt.internal.ui.text.correction.AdvancedQuickAssistProcessor.getAssists(AdvancedQuickAssistProcessor.java:79) at org.eclipse.jdt.internal.ui.text.correction.JavaCorrectionProcessor.collectAssists(JavaCorrectionProcessor.java:260) at org.eclipse.jdt.internal.ui.text.correction.JavaCorrectionProcessor.processAnnotations(JavaCorrectionProcessor.java:210) at org.eclipse.jdt.internal.ui.text.correction.JavaCorrectionProcessor.computeCompletionProposals(JavaCorrectionProcessor.java:177) at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1470) at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:250) at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeFilteredProposals(CompletionProposalPopup.java:915) at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$25(CompletionProposalPopup.java:877) at org.eclipse.jface.text.contentassist.CompletionProposalPopup$8.run(CompletionProposalPopup.java:852) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:118) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:2780) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2451) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1578) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1549) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:281) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:144) at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:102) at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:220) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:273) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:129) 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:185) at org.eclipse.core.launcher.Main.run(Main.java:684) at org.eclipse.core.launcher.Main.main(Main.java:668)
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/AdvancedQuickAssistProcessor.java
rewrite.replace(covering.getParent().getParent(), ifStatement, null);
			
		} else if (locationInParent == ReturnStatement.EXPRESSION_PROPERTY) {
			ifStatement.setThenStatement(createReturnExpression(rewrite, conditional.getThenExpression()));
			ifStatement.setElseStatement(createReturnExpression(rewrite, conditional.getElseExpression()));
			
			
			rewrite.replace(conditional.getParent(), ifStatement, null);
		} else if (locationInParent == VariableDeclarationFragment.INITIALIZER_PROPERTY) {
			VariableDeclarationFragment frag= (VariableDeclarationFragment) covering.getParent();
			Expression assignee= frag.getName();
			ifStatement.setThenStatement(createAssignmentStatement(rewrite, assignee, conditional.getThenExpression()));
			ifStatement.setElseStatement(createAssignmentStatement(rewrite, assignee, conditional.getElseExpression()));
			
			rewrite.set(frag, VariableDeclarationFragment.INITIALIZER_PROPERTY, null, null); 
			
			ASTNode statement= frag.getParent();
			rewrite.getListRewrite(statement.getParent(), Block.STATEMENTS_PROPERTY).insertAfter(ifStatement, statement, null);
		}
		
		String label= CorrectionMessages.getString("AdvancedQuickAssistProcessor.replaceConditionalWithIf"); 
		Image image= JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_LOCAL);
		ASTRewriteCorrectionProposal proposal= new ASTRewriteCorrectionProposal(label, context.getCompilationUnit(), rewrite, 1, image);
		resultingCollections.add(proposal);
		return true;
	}
}