Bug 87173

Summary: Surface compiler information about boxing/unboxing in the DOM AST (implicit conversion)
Product: [Eclipse Project] JDT Reporter: Dirk Baeumer <dirk_baeumer>
Component: CoreAssignee: Olivier Thomann <Olivier_Thomann>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: eclipse
Version: 3.1   
Target Milestone: 3.1 M6   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on:    
Bug Blocks: 68209    

Description Dirk Baeumer CLA 2005-03-04 14:22:29 EST
Philppe, as discussed at EclipseCon

Tom, this will ease the semantic coloring of autoboxing.
Comment 1 Tom Hofmann CLA 2005-03-23 10:26:09 EST
any news here? I don't want to nag, but this might be API relevant...
Comment 2 Philipe Mulet CLA 2005-03-23 13:06:56 EST
olivier - how doable is this ? Expression#isBoxed()/isUnboxed() ?
Comment 3 Olivier Thomann CLA 2005-03-23 14:22:34 EST
I think this is doable if we consider that this is available only when bindings
are requested.
I could do it lazily by using the binding resolver.
If the binding resolution is disabled, then both methods would always return false.
Is this ok?
Comment 4 Olivier Thomann CLA 2005-03-23 14:50:34 EST
I will do it the same way I handled the constant value.
Jim, could you please put the corresponding method API and javadoc? Then
reassign it to me and I will take care of the implementation.
Comment 5 Jim des Rivieres CLA 2005-03-23 15:24:49 EST
Added specs for 2 new API methods on o.e.jdt.core.dom.Expression:

/**
 * Returns whether this expression node is the site of a boxing
 * conversion (JLS3 5.1.7). This information is available only
 * when bindings are requested when the AST is being built.
 * 
 * @return <code>true</code> if this expression is the site of a
 * boxing conversion, or <code>false</code> if either no boxing conversion
 * is involved or if bindings were not requested when the AST was created
 * @since 3.1
 */
public final boolean resolveBoxing();
	
/**
 * Returns whether this expression node is the site of an unboxing
 * conversion (JLS3 5.1.8). This information is available only
 * when bindings are requested when the AST is being built.
 * 
 * @return <code>true</code> if this expression is the site of an
 * unboxing conversion, or <code>false</code> if either no unboxing
 * conversion is involved or if bindings were not requested when the
 * AST was created
 * @since 3.1
 */
public final boolean resolveUnboxing();

Olivier, over to you
Comment 6 Olivier Thomann CLA 2005-03-23 16:45:58 EST
Fixed and released in HEAD.
Regression tests added in ASTConverter15Test.test0153/0154.
Comment 7 Olivier Thomann CLA 2005-03-30 23:20:24 EST
Verified in 20050330-0500