Community
Participate
Working Groups
When using code assist to apply a cast to the following statement: DefaultMutableTreeNode root = getParentContainer().treeMapperTree.getModel ().getRoot(); You get: DefaultMutableTreeNode root = getParentContainer().(DefaultMutableTreeNode) treeMapperTree.getModel().getRoot(); When you should get: DefaultMutableTreeNode root = (DefaultMutableTreeNode) getParentContainer ().treeMapperTree.getModel().getRoot(); Seems to be getting confused about where the cast statement should go because the treeMapperTree isn't using getters (i.e. getTreeMapperTree()). When using getters then the cast works fine... Should also work without getters, hence bug.
Affected version: M4 and previous of 2.1
This is not a code assist bug but a quick fix bug Move to JDTUI
The bug comes from wrong offsets in the AST. Created test case ASTRewritingExpressionsTest.testCastExpression_bug28824. Moving to Olivier.
I am investigating.
Reproduced. I am working on a fix.
Fixed and released in 2.1 stream. Regression test added.
Fixed.
Verified.