Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 325542 - [exceptions] NPE on null scope in LocalVariableBinding#getScopeKey()
Summary: [exceptions] NPE on null scope in LocalVariableBinding#getScopeKey()
Status: RESOLVED FIXED
Alias: None
Product: JSDT
Classification: WebTools
Component: General (show other bugs)
Version: 3.2.2   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.2.5   Edit
Assignee: Chris Jaun CLA
QA Contact: Nitin Dahyabhai CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-17 01:07 EDT by Nitin Dahyabhai CLA
Modified: 2011-07-14 02:16 EDT (History)
1 user (show)

See Also:
thatnitind: review+


Attachments
patch (4.99 KB, patch)
2011-06-30 13:40 EDT, Chris Jaun CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nitin Dahyabhai CLA 2010-09-17 01:07:42 EDT
!ENTRY org.eclipse.wst.jsdt.ui 4 0 2010-09-17 01:02:53.265
!MESSAGE Error in JSDT Core during reconcile
!STACK 0
java.lang.NullPointerException
	at org.eclipse.wst.jsdt.internal.compiler.lookup.LocalVariableBinding.getScopeKey(LocalVariableBinding.java:161)
	at org.eclipse.wst.jsdt.internal.compiler.lookup.LocalVariableBinding.computeUniqueKey(LocalVariableBinding.java:103)
	at org.eclipse.wst.jsdt.internal.compiler.lookup.Binding.computeUniqueKey(Binding.java:52)
	at org.eclipse.wst.jsdt.core.dom.VariableBinding.getKey(VariableBinding.java:103)
	at org.eclipse.wst.jsdt.core.dom.DefaultBindingResolver.resolveVariable(DefaultBindingResolver.java:1401)
	at org.eclipse.wst.jsdt.core.dom.VariableDeclaration.resolveBinding(VariableDeclaration.java:198)
	at org.eclipse.wst.jsdt.core.dom.ASTConverter.convert(ASTConverter.java:639)
	at org.eclipse.wst.jsdt.core.dom.ASTConverter.convert(ASTConverter.java:363)
	at org.eclipse.wst.jsdt.core.dom.ASTConverter.convert(ASTConverter.java:1018)
	at org.eclipse.wst.jsdt.core.dom.ASTConverter.convert(ASTConverter.java:1480)
	at org.eclipse.wst.jsdt.core.dom.ASTConverter.convert(ASTConverter.java:1050)
	at org.eclipse.wst.jsdt.core.dom.ASTConverter.convert(ASTConverter.java:1034)
	at org.eclipse.wst.jsdt.core.dom.ASTConverter.convert(ASTConverter.java:1483)
	at org.eclipse.wst.jsdt.core.dom.ASTConverter.convert(ASTConverter.java:1861)
	at org.eclipse.wst.jsdt.core.dom.ASTConverter.convert(ASTConverter.java:1471)
	at org.eclipse.wst.jsdt.core.dom.ASTConverter.convert(ASTConverter.java:2236)
	at org.eclipse.wst.jsdt.core.dom.ASTConverter.convert(ASTConverter.java:1151)
	at org.eclipse.wst.jsdt.core.dom.AST.convertCompilationUnit(AST.java:264)
	at org.eclipse.wst.jsdt.internal.core.ReconcileWorkingCopyOperation.makeConsistent(ReconcileWorkingCopyOperation.java:214)
	at org.eclipse.wst.jsdt.internal.core.ReconcileWorkingCopyOperation.executeOperation(ReconcileWorkingCopyOperation.java:96)
	at org.eclipse.wst.jsdt.internal.core.JavaModelOperation.run(JavaModelOperation.java:742)
	at org.eclipse.wst.jsdt.internal.core.JavaModelOperation.runOperation(JavaModelOperation.java:802)
	at org.eclipse.wst.jsdt.internal.core.CompilationUnit.reconcile(CompilationUnit.java:1177)
	at org.eclipse.wst.jsdt.internal.ui.text.java.JavaReconcilingStrategy$1.run(JavaReconcilingStrategy.java:95)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.wst.jsdt.internal.ui.text.java.JavaReconcilingStrategy.reconcile(JavaReconcilingStrategy.java:76)
	at org.eclipse.wst.jsdt.internal.ui.text.java.JavaReconcilingStrategy.reconcile(JavaReconcilingStrategy.java:143)
	at org.eclipse.wst.jsdt.internal.ui.text.CompositeReconcilingStrategy.reconcile(CompositeReconcilingStrategy.java:85)
	at org.eclipse.wst.jsdt.internal.ui.text.JavaCompositeReconcilingStrategy.reconcile(JavaCompositeReconcilingStrategy.java:94)
	at org.eclipse.jface.text.reconciler.MonoReconciler.process(MonoReconciler.java:77)
	at org.eclipse.wst.jsdt.internal.ui.text.JavaReconciler.process(JavaReconciler.java:371)
	at org.eclipse.jface.text.reconciler.AbstractReconciler$BackgroundThread.run(AbstractReconciler.java:206)
Comment 1 Nitin Dahyabhai CLA 2010-09-17 01:12:00 EDT
According to bug 185129, a null scope is fine.
Comment 2 Chris Jaun CLA 2011-06-30 13:40:06 EDT
Created attachment 198923 [details]
patch

Formatting makes the patch a bit hard to read....the only change is moving the call to getScopeKey inside the "if" that checks if scope is not null.
Comment 3 Nitin Dahyabhai CLA 2011-07-14 02:16:40 EDT
Committed for 3.2.5 and HEAD.