Bug 227761 - NPE from CompletionContext.getVisibleElements
Summary: NPE from CompletionContext.getVisibleElements
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: 3.4 M7   Edit
Assignee: David Audel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-04-18 09:08 EDT by Martin Aeschlimann CLA
Modified: 2008-04-29 07:21 EDT (History)
4 users (show)

See Also:


Attachments
Proposed fix (3.95 KB, patch)
2008-04-21 06:24 EDT, David Audel CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Aeschlimann CLA 2008-04-18 09:08:43 EDT
20080418 HEAD (1028 CET) (jdt.ui and jdt.core)


- create a plug-in that requires org.eclipse.ui
- create class
package p;

import org.eclipse.ui.dialogs.ElementTreeSelectionDialog;;
import org.eclipse.swt.widgets.Shell;

public class A extends ElementTreeSelectionDialog {
	
  public JARFileSelectionDialog(Shell p, boolean m, boolean acceptFolders) {
   this(p, m, A)
  }
}

- code assist after 'ac' in the constructor

java.lang.NullPointerException
	at org.eclipse.jdt.internal.codeassist.InternalExtendedCompletionContext.getTypeFromSignature(InternalExtendedCompletionContext.java:277)
	at org.eclipse.jdt.internal.codeassist.InternalExtendedCompletionContext.getVisibleElements(InternalExtendedCompletionContext.java:325)
	at org.eclipse.jdt.core.CompletionContext.getVisibleElements(CompletionContext.java:329)
	at org.eclipse.jdt.internal.ui.text.java.ParameterGuessingProposal.createProposal(ParameterGuessingProposal.java:77)
	at org.eclipse.jdt.internal.ui.text.java.FillArgumentNamesCompletionProposalCollector.createMethodReferenceProposal(FillArgumentNamesCompletionProposalCollector.java:76)
	at org.eclipse.jdt.internal.ui.text.java.FillArgumentNamesCompletionProposalCollector.createJavaCompletionProposal(FillArgumentNamesCompletionProposalCollector.java:59)
	at org.eclipse.jdt.ui.text.java.CompletionProposalCollector.accept(CompletionProposalCollector.java:246)
	at org.eclipse.jdt.internal.codeassist.CompletionEngine.findLocalMethods(CompletionEngine.java:6184)
	at org.eclipse.jdt.internal.codeassist.CompletionEngine.findMethods(CompletionEngine.java:7401)
	at org.eclipse.jdt.internal.codeassist.CompletionEngine.findVariablesAndMethods(CompletionEngine.java:8432)
	at org.eclipse.jdt.internal.codeassist.CompletionEngine.complete(CompletionEngine.java:1134)
	at org.eclipse.jdt.internal.codeassist.CompletionEngine.complete(CompletionEngine.java:2518)
	at org.eclipse.jdt.internal.core.Openable.codeComplete(Openable.java:129)
	at org.eclipse.jdt.internal.core.CompilationUnit.codeComplete(CompilationUnit.java:344)
	at org.eclipse.jdt.internal.core.CompilationUnit.codeComplete(CompilationUnit.java:337)
	at org.eclipse.jdt.internal.ui.text.java.JavaCompletionProposalComputer.internalComputeCompletionProposals(JavaCompletionProposalComputer.java:190)
	at org.eclipse.jdt.internal.ui.text.java.JavaCompletionProposalComputer.computeCompletionProposals(JavaCompletionProposalComputer.java:156)
Comment 1 David Audel CLA 2008-04-21 06:24:33 EDT
Created attachment 96818 [details]
Proposed fix
Comment 2 David Audel CLA 2008-04-21 06:27:08 EDT
Released for 3.4M7.

Test added
  CompletionContextTests_1_5#test0040()
Comment 3 Eric Jodet CLA 2008-04-29 07:21:44 EDT
Verified in the code for 3.4M7 using I20080427-2000.