Bug 210324 Fail to switch 123.45 to boolean value in dataset.[07]
Description: Fail to switch 123.45 to boolean value in dataset. Build number:2.3.0.v20071120 Steps to reproduce: 1. Open attached report. 2. Edit the script dataset, click Preview Result. Expected result: Display data rows. Actual result: Error dialog to indicate that fail to convert value to boolean. In Boolean java doc, I saw "representing the value true if the string argument is not null and is equal, ignoring case, to the string "true"". So I think it should accept any kind of string values. Error log: org.eclipse.birt.data.engine.core.DataException: A BIRT exception occurred: Can not convert the value of 12345.6789 to Boolean type.. See next exception for more information. Can not convert the value of 12345.6789 to Boolean type. at org.eclipse.birt.data.engine.core.DataException.wrap(DataException.java:118) at org.eclipse.birt.data.engine.expression.ExprEvaluateUtil.evaluateExpression(ExprEvaluateUtil.java:78) at org.eclipse.birt.data.engine.impl.BindingColumnsEvalUtil.evaluateValue(BindingColumnsEvalUtil.java:217) at org.eclipse.birt.data.engine.impl.BindingColumnsEvalUtil.getColumnsValue(BindingColumnsEvalUtil.java:180) at org.eclipse.birt.data.engine.impl.ResultIterator.prepareCurrentRow(ResultIterator.java:614) at org.eclipse.birt.data.engine.impl.ResultIterator.next(ResultIterator.java:375) at org.eclipse.birt.report.designer.data.ui.dataset.ResultSetPreviewPage.populateRecords(ResultSetPreviewPage.java:489) at org.eclipse.birt.report.designer.data.ui.dataset.ResultSetPreviewPage.access$2(ResultSetPreviewPage.java:479) at org.eclipse.birt.report.designer.data.ui.dataset.ResultSetPreviewPage$5.run(ResultSetPreviewPage.java:435) at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:113) Caused by: org.eclipse.birt.core.exception.CoreException: Can not convert the value of 12345.6789 to Boolean type. at org.eclipse.birt.core.data.DataTypeUtil.toBoolean(DataTypeUtil.java:378) at org.eclipse.birt.core.data.DataTypeUtil.convert(DataTypeUtil.java:96) at org.eclipse.birt.data.engine.expression.ExprEvaluateUtil.evaluateExpression(ExprEvaluateUtil.java:74) ... 8 more
core/org.eclipse.birt.core/src/org/eclipse/birt/core/data/DataTypeUtil.java
break;
            case Types.BOOLEAN :
                fieldClass = Boolean.class;
                break;
			case Types.NULL :
				fieldClass = null;
				break;
		}
		return fieldClass;
	}
	/**
	 * Converts an ODI type class to its corresponding 
	 * ODA data type code. <br>
	 * <b>ODI Type Class -> ODA Data Type</b><br>
	 * <i>java.lang.Integer -> Integer<br>
	 * java.lang.Double -> Double<br>
	 * java.lang.String -> Character<br>
	 * java.math.BigDecimal -> Decimal<br>
	 * java.util.Date -> Timestamp<br>
     * java.sql.Date -> Date<br>
	 * java.sql.Time -> Time<br>
	 * java.sql.Timestamp -> Timestamp<br>
	 * java.sql.Blob -> Blob<br>
	 * java.sql.Clob -> Clob<br>
     * java.lang.Boolean -> Boolean<br></i><br>
	 * All other type classes are mapped to the ODA String data type.
	 * @param odiTypeClass  a type class used by the Data Engine ODI component
	 * @return  the ODA data type that maps to the ODI type class.
	 */
	public static int toOdaDataType( Class odiTypeClass )