Bug 123722 Java based scripting -> getExpressionValue(int i) of IRowData returns unreasonable value
public void onPrepare( IRow row, IReportContext reportContext ) { try { row.setBookmark( "\"row-bookmark\"" ); System.out.println( row.getBookmark( ) ); } catch ( Exception e ) { e.printStackTrace( ); } } public void onCreate(IRowInstance rowInstance, IReportContext reportContext) { try { IRowData rowData = rowInstance.getRowData( ); Object int2 = rowData.getExpressionValue( 1 ); System.out.println( int2 ); } catch ( Exception e ) { e.printStackTrace( ); } } Consider the script above, according to Javadoc, rowData.getExpressionValue( 1 ) will return the first data expr. of the row, i.e. the value of the first column. However, it was noticed that "row-bookmark" was returned instead. And if i used rowData.getExpressionValue( 2 ), then i got the right value. So if it was the correct implementation, it should be clearly stated in Javadoc.
engine/org.eclipse.birt.report.engine/src/org/eclipse/birt/report/engine/script/internal/ElementUtil.java
if ( element == null )
			return null;
		if ( element instanceof ReportDesignHandle )
			return new ReportDesign( ( ReportDesignHandle ) element );
		if ( !( element instanceof ReportElementHandle ) )
			return null;
		if ( element instanceof CellHandle )
			return new Cell( ( CellHandle ) element );
		if ( element instanceof DataItemHandle )
			return new DataItem( ( DataItemHandle ) element );
		if ( element instanceof GridHandle )
			return new Grid( ( GridHandle ) element );
		if ( element instanceof ImageHandle )
			return new Image( ( ImageHandle ) element );
		if ( element instanceof LabelHandle )
			return new Label( ( LabelHandle ) element );
		if ( element instanceof ListHandle )
			return new List( ( ListHandle ) element );
		if ( element instanceof RowHandle )
			return new Row( ( RowHandle ) element );
		if ( element instanceof TableHandle )
			return new Table( ( TableHandle ) element );
		if ( element instanceof TextDataHandle )
			return new DynamicText( ( TextDataHandle ) element );
		if ( element instanceof TextItemHandle )
			return new TextItem( ( TextItemHandle ) element );
		return new ReportElement( ( ReportElementHandle ) element );
	}
}