Summary: | Override methods... inserts methods incorrectly if class body is as {} | ||
---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Darshan Shaligram <darshans> |
Component: | Core | Assignee: | Olivier Thomann <Olivier_Thomann> |
Status: | VERIFIED FIXED | QA Contact: | |
Severity: | normal | ||
Priority: | P3 | ||
Version: | 2.0.2 | ||
Target Milestone: | 2.1 RC2 | ||
Hardware: | PC | ||
OS: | Windows XP | ||
Whiteboard: |
Description
Darshan Shaligram
2003-02-26 06:17:01 EST
JDT Core IType.createMethod is used This is still a problem in 2.1 RC1. I might have a fix for this one. Ok if not too much risky. The problem comes from the normalize method in DOMType. The test is: if (fInsertionPosition < openBodyEnd) { fInsertionPosition = getCloseBodyPosition(); } instead of: if (fInsertionPosition <= openBodyEnd) { fInsertionPosition = getCloseBodyPosition(); } The reason is that the fInsertion position is inclusive. If it is equal to openBodyEnd, it means that this is not a good position for insertion. This would result with the new method outside of the class braces. Changing < for <= means that in this case the new method is inserted before the closing brace. Fixed and released in 2.1 stream. Regression tests added. Verified. |