Bug 28296

Summary: parser gives cast expression an incorrect length
Product: [Eclipse Project] JDT Reporter: Rory Lucyshyn-Wright <Rory_Lucyshyn-Wright>
Component: CoreAssignee: Olivier Thomann <Olivier_Thomann>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 2.1   
Target Milestone: 2.1 M4   
Hardware: PC   
OS: Windows 2000   
Whiteboard:
Bug Depends on:    
Bug Blocks: 28242    

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.