Bug 28296 - parser gives cast expression an incorrect length
Summary: parser gives cast expression an incorrect length
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.1   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 2.1 M4   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 28242
  Show dependency tree
 
Reported: 2002-12-13 14:47 EST by Rory Lucyshyn-Wright CLA
Modified: 2002-12-18 05:03 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 Rory Lucyshyn-Wright CLA 2002-12-13 14:47:24 EST
I20021210

When used in Extract Constant in the case described in bug #28242, involving 
the code below, the parser gives the CastExpression node a length of 3, which 
is incorrect.

public class Test {

	public Test() {
		int a= 2;
		int b= (int) (3.14f * a);
	}

}
Comment 1 Olivier Thomann CLA 2002-12-13 16:31:46 EST
It is a bug in the parenthesized expression check. I am investigating a fix.
Comment 2 Olivier Thomann CLA 2002-12-13 16:53:44 EST
Fixed and released in 2.1 stream.
Regression tests added in ConverterTest2.test0454
Comment 3 Olivier Thomann CLA 2002-12-13 17:03:00 EST
I cannot test if the fix allows you to extract the constant, because
self-hosting workspaces don't run in my workspace for no reason.
I will double-check on Monday.
Comment 4 David Audel CLA 2002-12-18 05:03:35 EST
Verified.