Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 321885 - Invalid logic in at MethodBinding.canBeSeenBy(MethodBinding.java:256) resulting in NPE
Summary: Invalid logic in at MethodBinding.canBeSeenBy(MethodBinding.java:256) resulti...
Status: RESOLVED FIXED
Alias: None
Product: JSDT
Classification: WebTools
Component: General (show other bugs)
Version: 3.2.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.2.2   Edit
Assignee: Chris Jaun CLA
QA Contact: Nitin Dahyabhai CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-05 10:44 EDT by Chris Jaun CLA
Modified: 2010-08-05 14:46 EDT (History)
0 users

See Also:
thatnitind: review+


Attachments
patch (1.42 KB, patch)
2010-08-05 10:45 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 Chris Jaun CLA 2010-08-05 10:44:26 EDT
For the following code:

function someFunction() {

var subFunction = function() {
}
*
}

If you attempt content assist at the * you get a NPE.

Add a null check.
Comment 1 Chris Jaun CLA 2010-08-05 10:45:22 EDT
Created attachment 175947 [details]
patch
Comment 2 Chris Jaun CLA 2010-08-05 10:45:38 EDT
Add a null check.
Comment 3 Chris Jaun CLA 2010-08-05 13:31:33 EDT
java.lang.NullPointerException
    at org.eclipse.wst.jsdt.internal.compiler.lookup.MethodBinding.canBeSeenBy(Unknown Source)
    at org.eclipse.wst.jsdt.internal.codeassist.CompletionEngine.findLocalMethods(Unknown Source)
    at org.eclipse.wst.jsdt.internal.codeassist.CompletionEngine.findVariablesAndMethods(Unknown Source)
    at org.eclipse.wst.jsdt.internal.codeassist.CompletionEngine.complete(Unknown Source)
    at org.eclipse.wst.jsdt.internal.codeassist.CompletionEngine.complete(Unknown Source)
    at org.eclipse.wst.jsdt.internal.core.Openable.codeComplete(Unknown Source)
    at org.eclipse.wst.jsdt.internal.core.CompilationUnit.codeComplete(Unknown Source)
    at org.eclipse.wst.jsdt.internal.core.CompilationUnit.codeComplete(Unknown Source)
    at org.eclipse.wst.jsdt.internal.ui.text.java.JavaCompletionProposalComputer.internalComputeCompletionProposals(Unknown Source)
    at org.eclipse.wst.jsdt.internal.ui.text.java.JavaCompletionProposalComputer.computeCompletionProposals(Unknown Source)
    at org.eclipse.wst.jsdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(Unknown Source)
    at org.eclipse.wst.jsdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(Unknown Source)
    at org.eclipse.wst.jsdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(Unknown Source)
    at org.eclipse.wst.jsdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(Unknown Source)
    at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(Unknown Source)
    at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(Unknown Source)
    at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(Unknown Source)
    at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(Unknown Source)
Comment 4 Chris Jaun CLA 2010-08-05 14:46:46 EDT
Checked into 3.2.2. and HEAD.