Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 320511 - [infer type arguments] NPE in InferTypeArgumentsConstraintsSolver#getNonTaggingInterfaces()
Summary: [infer type arguments] NPE in InferTypeArgumentsConstraintsSolver#getNonTaggi...
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.7   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.7 M1   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-21 09:59 EDT by Markus Keller CLA
Modified: 2010-07-21 11:04 EDT (History)
0 users

See Also:


Attachments
Fix (3.57 KB, patch)
2010-07-21 09:59 EDT, Markus Keller CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Keller CLA 2010-07-21 09:59:12 EDT
Created attachment 174852 [details]
Fix

I20100720-0800

NPE in InferTypeArgumentsConstraintsSolver#getNonTaggingInterfaces() when trying to infer type arguments of org.eclipse.jdt.ui:

Root exception:
java.lang.NullPointerException
	at org.eclipse.jdt.internal.corext.refactoring.generics.InferTypeArgumentsConstraintsSolver.getNonTaggingInterfaces(InferTypeArgumentsConstraintsSolver.java:358)
	at org.eclipse.jdt.internal.corext.refactoring.generics.InferTypeArgumentsConstraintsSolver.chooseSingleType(InferTypeArgumentsConstraintsSolver.java:321)
	at org.eclipse.jdt.internal.corext.refactoring.generics.InferTypeArgumentsConstraintsSolver.chooseTypes(InferTypeArgumentsConstraintsSolver.java:280)
	at org.eclipse.jdt.internal.corext.refactoring.generics.InferTypeArgumentsConstraintsSolver.solveConstraints(InferTypeArgumentsConstraintsSolver.java:129)
	at org.eclipse.jdt.internal.corext.refactoring.generics.InferTypeArgumentsRefactoring.checkFinalConditions(InferTypeArgumentsRefactoring.java:235)
	at org.eclipse.ltk.core.refactoring.CheckConditionsOperation.run(CheckConditionsOperation.java:85)
	at org.eclipse.ltk.core.refactoring.CreateChangeOperation.run(CreateChangeOperation.java:121)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1975)
	at org.eclipse.ltk.internal.ui.refactoring.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:87)
	at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)


Problem is that InferTypeArgumentsConstraintsSolver#getNonTaggingInterfaces() assumes that all types are from the same project. The code was stupid anyway (expensive AST parsing is not required at all), so the fix will also improve performance.
Comment 1 Markus Keller CLA 2010-07-21 11:04:54 EDT
Fixed in HEAD.