Bug 131459 - Java model returns stale resolved source type for binary type
Summary: Java model returns stale resolved source type for binary type
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2   Edit
Hardware: PC All
: P3 major (vote)
Target Milestone: 3.2 M6   Edit
Assignee: Jerome Lanneluc CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-03-12 09:57 EST by Tobias Widmer CLA
Modified: 2006-03-28 07:47 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tobias Widmer CLA 2006-03-12 09:57:52 EST
JDT Core HEAD

Steps to reproduce:
- Create new project "source"
- Create following cu in "source"
package q;

public class Probe {

	public void foo() {
		class Test {
			int f= 0;
		}
	}
}

- Export "source" as jar file
- Export "source" as zip archive (source code only)
- Create new project "client"
- Add exported jar file to buildpath of "client"
- Add exported zip archive as source attachment to jar file
- Open "Probe.class"
- Hover over type "Type"

-> NPE occurs

JavadocContentAccess.getContentReader(IMember, boolean) line: 58
JavadocContentAccess.getHTMLContentReader(IMember, boolean, boolean) line: 117
JavadocHover.getHoverInfo(IJavaElement[]) line: 161
JavadocHover(AbstractJavaEditorTextHover).getHoverInfo(ITextViewer, IRegion) line: 107
BestMatchHover.getHoverInfo(ITextViewer, IRegion) line: 102
JavaEditorTextHoverProxy.getHoverInfo(ITextViewer, IRegion) line: 69
TextViewerHoverManager$4.run() line: 160

The IMember wrongly is a ResolvedSourceType which has an IClassfile as parent
Comment 1 Jerome Lanneluc CLA 2006-03-17 06:12:07 EST
Changed SelectionRequestor#acceptLocalType(...) and acceptLocalMethod(...) to use JavaElement#resolve(Binding) instead of creating a ResolvedSourceType.

Added regression test ResolveTests#testLocalClass9()
Comment 2 Maxime Daniel CLA 2006-03-28 07:47:13 EST
Verified for 3.2M6 using build I20060327-0010.
Interestingly enough, the hover text is quite different in Probe.class (p.Test) than it is in Probe.java (p.Probe.foo().Test). Anyway, the hover works and this bug is verified.