Bug 106725 - [content assist] wrong method created when overriding static method
Summary: [content assist] wrong method created when overriding static method
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: 3.2 M2   Edit
Assignee: David Audel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 97208 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-08-11 04:57 EDT by Volodymyr Bychkoviak CLA
Modified: 2006-03-30 05:56 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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. ***