Bug 106725

Summary: [content assist] wrong method created when overriding static method
Product: [Eclipse Project] JDT Reporter: Volodymyr Bychkoviak <vbychkoviak>
Component: CoreAssignee: David Audel <david_audel>
Status: VERIFIED FIXED QA Contact:
Severity: major    
Priority: P3 CC: daniel_megert, martinae
Version: 3.1   
Target Milestone: 3.2 M2   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Volodymyr Bychkoviak CLA 2005-08-11 04:57:42 EDT
Eclipse build id:I20050627-1435

steps to reproduce:
create some class with method main. 
create another class that extends first class.
type "main" in class body, press ctrl-space for content assistant choose there
"main - main method".
method toString is created.
Comment 1 Dani Megert CLA 2005-08-11 05:25:51 EDT
Your scenario works for me but when I select:
main(Stting[] args) void - Override method in 'A'
it inserts a wrong proposal
Comment 2 Volodymyr Bychkoviak CLA 2005-08-11 05:45:09 EDT
it's exactly what I mean. 
Comment 3 Dani Megert CLA 2005-08-11 06:46:30 EDT
codeComplete should not propose the proposal since static methods can't be
overridden in a OO-sense.
Comment 4 Volodymyr Bychkoviak CLA 2005-08-11 06:51:32 EDT
Yes, but I still can create method main, so it should be possible to create
method main with codeComlete.
Comment 5 Dani Megert CLA 2005-08-11 07:02:34 EDT
sure. that's why there's the main template.
Comment 6 Volodymyr Bychkoviak CLA 2005-08-11 07:23:47 EDT
yes, I see.
Comment 7 David Audel CLA 2005-08-25 06:18:18 EDT
Fixed and tests updated.
  CompletionTests#testCompletionStaticMethodDeclaration1()
  CompletionTests#testCompletionStaticMethodDeclaration2()
  CompletionTests#testCompletionStaticMethodDeclaration3()
  CompletionTests#testCompletionStaticMethodDeclaration4()
  CompletionTests#testCompletionStaticMethodDeclaration5()
  CompletionTests#testCompletionStaticMethodDeclaration6()

Static method aren't proposed any more.
Comment 8 Olivier Thomann CLA 2005-09-20 11:32:30 EDT
Verified in I20050920-0010 for 3.2M2
Comment 9 David Audel CLA 2006-03-30 05:56:16 EST
*** Bug 97208 has been marked as a duplicate of this bug. ***