Bug 19234 NPE in NewMethodCompletionProposal.apply
Build 20020602 (F2) Sorry, no steps. I was writing code for a couple of hours, and I noticed this stack in my log afterwards. I was using the java browsing perspective to write code. Hopefully the stack trace contains enough information to be useful... Attaching complete log file, but here's the top of the stack: java.lang.NullPointerException at org.eclipse.jdt.internal.ui.text.correction.NewMethodCompletionProposal.apply(Ne wMethodCompletionProposal.java:253)
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/NewMethodCompletionProposal.java
CodeGenerationSettings settings= JavaPreferencesSettings.getCodeGenerationSettings();
		ImportEdit importEdit= new ImportEdit(changedCU, settings);
		IMethod currMethod= null;
		IJavaElement elem= fCurrCU.getElementAt(fNode.getStartPosition());
		if (elem != null && elem.getElementType() == IJavaElement.METHOD) {
			currMethod= (IMethod) elem;
		}
		String content= generateStub(importEdit, settings);
		
		int insertPos= MemberEdit.ADD_AT_END;
		IJavaElement anchor= fDestType;
		if (isLocalChange() && currMethod != null) {
			anchor= elem;
			insertPos= MemberEdit.INSERT_AFTER;			
		}
		
		fMemberEdit= new MemberEdit(anchor, insertPos, new String[] { content }, settings.tabWidth);
		fMemberEdit.setUseFormatter(true);
		
		if (!importEdit.isEmpty()) {
			changeElement.addTextEdit("Add imports", importEdit); 
		}
		changeElement.addTextEdit("Add method", fMemberEdit); 
	}
	
	
	private String generateStub(ImportEdit importEdit, CodeGenerationSettings settings) throws CoreException {
		
		String methodName= fNode.getName().getIdentifier();