Bug 97487 - [call hierarchy] Call Hierarchy Fails in mounted classes with attached src files
Summary: [call hierarchy] Call Hierarchy Fails in mounted classes with attached src files
Status: CLOSED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1 RC2   Edit
Assignee: Jerome Lanneluc CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-05-31 10:32 EDT by chillum CLA
Modified: 2005-06-10 11:02 EDT (History)
1 user (show)

See Also:


Attachments
Possible fix (1.55 KB, patch)
2005-06-09 09:29 EDT, Jerome Lanneluc CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description chillum CLA 2005-05-31 10:32:42 EDT
I am using 3.1 RC1. Java 1.4.08
When I do a CTRL-ALt-H, I can see the code all the way to the a private method
in the attached clas files source code. The calls to this private method do not
 get genrated in the view.
Also if I have src files opened for the attached source code, I cannot do a
ctrl-alt-h, it pops up a dialog saying "The resource is not on the build path of
the java project".
Comment 1 Dirk Baeumer CLA 2005-05-31 13:43:14 EDT
Markus, can you please comment.
Comment 2 Markus Keller CLA 2005-06-06 06:23:17 EDT
Moving to JDT/Core. The problem is that ITypeBinding#getJavaElement() returns
null if the type comes from a class folder.

Steps in N20050606-0010:
- new workspace, import plug-in org.junit as source
- create new project "Bug97487" and add "/org.junit/bin" as class folder with
source attachment "/org.junit/src-junit"
- open call hierarchy in "Callee" mode on TestSuite#run(TestResult) from project
"Bug97487"
- NPE below is logged, call hiearchy shows no callees.

java.lang.NullPointerException
	at org.eclipse.jdt.internal.corext.dom.Bindings.findMethod(Bindings.java:1021)
	at
org.eclipse.jdt.internal.corext.callhierarchy.CalleeAnalyzerVisitor.findIncludingSupertypes(CalleeAnalyzerVisitor.java:247)
	at
org.eclipse.jdt.internal.corext.callhierarchy.CalleeAnalyzerVisitor.addMethodCall(CalleeAnalyzerVisitor.java:219)
	at
org.eclipse.jdt.internal.corext.callhierarchy.CalleeAnalyzerVisitor.visit(CalleeAnalyzerVisitor.java:134)
	at org.eclipse.jdt.core.dom.MethodInvocation.accept0(MethodInvocation.java:236)
	at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2450)
	at org.eclipse.jdt.core.dom.ASTNode.acceptChild(ASTNode.java:2497)
	at
org.eclipse.jdt.core.dom.VariableDeclarationFragment.accept0(VariableDeclarationFragment.java:224)
	at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2450)
	at org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2520)
	at
org.eclipse.jdt.core.dom.VariableDeclarationExpression.accept0(VariableDeclarationExpression.java:269)
	at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2450)
	at org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2520)
	at org.eclipse.jdt.core.dom.ForStatement.accept0(ForStatement.java:225)
	at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2450)
	at org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2520)
	at org.eclipse.jdt.core.dom.Block.accept0(Block.java:135)
	at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2450)
	at org.eclipse.jdt.core.dom.ASTNode.acceptChild(ASTNode.java:2497)
	at org.eclipse.jdt.core.dom.MethodDeclaration.accept0(MethodDeclaration.java:501)
	at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2450)
	at org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2520)
	at org.eclipse.jdt.core.dom.TypeDeclaration.accept0(TypeDeclaration.java:483)
	at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2450)
	at org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2520)
	at org.eclipse.jdt.core.dom.CompilationUnit.accept0(CompilationUnit.java:299)
	at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2450)
	at
org.eclipse.jdt.internal.corext.callhierarchy.CalleeMethodWrapper.findChildren(CalleeMethodWrapper.java:97)
	at
org.eclipse.jdt.internal.corext.callhierarchy.MethodWrapper.performSearch(MethodWrapper.java:253)
	at
org.eclipse.jdt.internal.corext.callhierarchy.MethodWrapper.doFindChildren(MethodWrapper.java:194)
	at
org.eclipse.jdt.internal.corext.callhierarchy.MethodWrapper.getCalls(MethodWrapper.java:76)
	at
org.eclipse.jdt.internal.corext.callhierarchy.CalleeMethodWrapper.getCalls(CalleeMethodWrapper.java:62)
	at
org.eclipse.jdt.internal.ui.callhierarchy.DeferredMethodWrapper.getCalls(DeferredMethodWrapper.java:62)
	at
org.eclipse.jdt.internal.ui.callhierarchy.DeferredMethodWrapper.fetchDeferredChildren(DeferredMethodWrapper.java:80)
	at
org.eclipse.ui.progress.DeferredTreeContentManager$1.run(DeferredTreeContentManager.java:192)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:73)
Comment 3 Jerome Lanneluc CLA 2005-06-09 09:29:13 EDT
Created attachment 22684 [details]
Possible fix
Comment 4 Philipe Mulet CLA 2005-06-09 12:56:27 EDT
+1 for RC2
Comment 5 Jerome Lanneluc CLA 2005-06-09 13:36:07 EDT
Applied patch and added regression test
JavaModelTests#testCreatePkgHandleInDifferentProject()
Comment 6 chillum CLA 2005-06-09 14:08:23 EDT
Will this be available in an integration build?

-chhil
Comment 7 Jerome Lanneluc CLA 2005-06-09 14:18:53 EDT
It should be in I20050609-1600
Comment 8 Olivier Thomann CLA 2005-06-09 18:34:23 EDT
Verified in I20050609-1605.
Comment 9 Frederic Fusier CLA 2005-06-10 11:02:11 EDT
Verified for 3.1 RC2 using build I20050610-0010