Bug 43139 - Delete member in Outliner not working
Summary: Delete member in Outliner not working
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: 3.0 M5   Edit
Assignee: Jerome Lanneluc CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-09-16 06:51 EDT by Kai-Uwe Maetzel CLA
Modified: 2003-11-21 11:36 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 Kai-Uwe Maetzel CLA 2003-09-16 06:51:50 EDT
Smoke for 20030916

1) Open TestCase.java
2) add method "void static m() {}"
3) select m in outliner
4) DEL
-> you are asked to save which should not happen
5) Confirm deletion of m
-> m still there, nothing deleted

Note, if m has no error deleting after confirmation works.
Comment 1 Dirk Baeumer CLA 2003-10-03 13:27:02 EDT
The problem is that the name range of the source method is bogus. For the 
given method I get the following results:

iMember.getNameRange() == [offset=4767, length=-4767]

iMember.getSourceRange()== [offset=4760, length=13]

Moving to JDT/Core for comments.
Comment 2 Jerome Lanneluc CLA 2003-11-03 09:17:02 EST
The method declaration is syntactically incorrect. While in recovery mode, a 
SourceConstructorDeclaration is created, then it is converted in a 
MethodDeclaration since its selector doesn't match the type name. This means 
that the selectorSourceEnd is lost.

Changed TypeDeclaration.checkConstructor(Parser) to redirect to the parser 
(using convertToMethodDeclaration(...)). The SourceElementParser nows overides 
this method to convert the SourceConstructorDeclaration into a 
SourceMethodDeclaration.

Added regression test GetSourceTests.testNameRangeMethodWithSyntaxError.
Comment 3 David Audel CLA 2003-11-21 11:36:07 EST
Verified.