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

Bug 321621

Summary: NPE in LazyJavaTypeCompletionProposal when files outside workspace
Product: [WebTools] JSDT Reporter: Chris Jaun <cmjaun>
Component: GeneralAssignee: Chris Jaun <cmjaun>
Status: RESOLVED FIXED QA Contact: Nitin Dahyabhai <thatnitind>
Severity: normal    
Priority: P3 Flags: thatnitind: review+
Version: 3.0.5   
Target Milestone: 3.0.5 P   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on: 306986    
Bug Blocks:    
Attachments:
Description Flags
patch none

Description Chris Jaun CLA 2010-08-03 11:45:06 EDT
+++ This bug was initially created as a clone of Bug #306986 +++

Getting an NPE at getFilePackage.

if (fImportRewrite != null) {
			String packageName=null;
			try {
				IJavaScriptElement javaElement = this.getProposalInfo().getJavaElement();
				 packageName=JavaModelUtil.getFilePackage(javaElement);
			} catch (JavaScriptModelException e) {
				JavaScriptPlugin.log(e);
			}
			return fImportRewrite.addImport(qualifiedTypeName,packageName, fImportContext);
		}
Comment 1 Chris Jaun CLA 2010-08-03 11:45:35 EDT
Same problem exists in 3.0.5. Need to backport fix.
Comment 2 Chris Jaun CLA 2010-08-03 11:53:21 EDT
Created attachment 175794 [details]
patch
Comment 3 Chris Jaun CLA 2010-08-24 14:37:16 EDT
In patch build.