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

Bug 325297

Summary: [search] NPE when searching for callout in a role nested in a role file
Product: [Tools] Objectteams Reporter: Stephan Herrmann <stephan.herrmann>
Component: OTDTAssignee: Project Teams <objectteams.otdt-inbox>
Status: RESOLVED WORKSFORME QA Contact:
Severity: normal    
Priority: P3    
Version: 0.7   
Target Milestone: 2.3 RC1   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Stephan Herrmann CLA 2010-09-14 17:14:14 EDT
Currently class MyJavaLinkedModeProposal 
(in CompletionAdaptor.CreateMethodMappingCompletionProposal)
contains an unused callout binding computeEdits -> computeEdits.

When searching for references to this (selecting the role method spec)
the following NPE occurrs:

java.lang.NullPointerException
	at org.eclipse.jdt.internal.core.Member.getFlags(Member.java:165)
	at org.eclipse.jdt.internal.core.search.matching.MethodPattern.<init>(MethodPattern.java:172)
	at org.eclipse.jdt.core.search.SearchPattern.createPattern(SearchPattern.java:2078)
	at org.eclipse.jdt.internal.ui.search.JavaSearchQuery.run(JavaSearchQuery.java:124)
	at org.eclipse.search2.internal.ui.InternalSearchUI$InternalSearchJob.run(InternalSearchUI.java:91)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Comment 1 Stephan Herrmann CLA 2010-09-16 17:49:50 EDT
Code inspection yields that the NPE cannot occur with a regular
JavaElement (getElementInfo() can only return non-null or throw).

Some overrides exist in package codeassist.impl that could potentially
return null, but at this point it is totally unclear, how the search
and the AssistXY could be related.

I've added OTJavaMethodSearchTests.test325297() to witness the general
working in the specified scenario (not able to reproduce the NPE).
Comment 2 Stephan Herrmann CLA 2013-03-14 09:54:48 EDT
candidate for WORKSFORME
Comment 3 Stephan Herrmann CLA 2014-05-15 16:59:49 EDT
closing as per previous comment, since it was never again observed.