Bug 11025 - extract method: incorrectly disallowed on some boolean expressions
Summary: extract method: incorrectly disallowed on some boolean expressions
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 2.0 M4   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-03-08 09:57 EST by Adam Kiezun CLA
Modified: 2002-03-08 14:11 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Adam Kiezun CLA 2002-03-08 09:57:57 EST
public class A{
	boolean m(){
		return /*[*/a().length != 3/*]*/;
	}
	int[] a(){
		return null;
	}
}
Comment 1 Dirk Baeumer CLA 2002-03-08 13:34:26 EST
The problem is that the reported positions for the expression a().length != 3 
is incorrect. The expression doesn't include the message send. It starts with l 
from length.

Moving to JDT Core
Comment 2 Olivier Thomann CLA 2002-03-08 13:44:39 EST
Reproduced. I am working on it.
Comment 3 Olivier Thomann CLA 2002-03-08 14:11:53 EST
The bug comes from the wrong position returned by the parser. I used them to 
set the source range of the InfixExpression I created for the expression:
a().length != 3. Sometimes the positions provided by the Parser are confusing 
<g>.
Now I set the start position of the infix expression to the starting positions 
of its left expression.
Fixed and released in HEAD.