Project: Birt
Bug 229220 NPE occurs after changing the parameter name in QueryText
Reported: 2008-04-29 01:51:04 | Status: closed fixed

Description: NPE occurs after changing the parameter name in QueryText. Build number: 2.3.0.v20080428-0630 Steps to reproduce: 1, New a datasource FROM "BIRT Classic Models Sample Database" Connection profile 2, New a dataset based on the datasource 3, Specify the QueryText to "SELECT * FROM CLASSICMODELS.CUSTOMERS WHERE CUSTOMERNUMBER = :number OR CUSTOMERNAME = :name" 4, Finish 5, Reopen the dataset and modify the QueryText to "SELECT * FROM CLASSICMODELS.CUSTOMERS WHERE CUSTOMERNUMBER = :number1 OR CUSTOMERNAME = :name" 6, Go to Computed Column Page or Parameters page Expected result: After step6, no NPE occurs Actual result: After step6, NPE occues Error log: java.lang.NullPointerException at org.eclipse.birt.report.model.command.PropertyCommand.setMember(PropertyCommand.java:882) at org.eclipse.birt.report.model.api.MemberHandle.setValue(MemberHandle.java:120) at org.eclipse.birt.report.model.api.StructureHandle.setProperty(StructureHandle.java:163) at org.eclipse.birt.report.model.adapter.oda.impl.DataSetParameterAdapter.updateROMDataSetParamWithNewParam(DataSetParameterAdapter.java:1489) at org.eclipse.birt.report.model.adapter.oda.impl.DataSetParameterAdapter.updateRomDataSetParamsWithNewParams(DataSetParameterAdapter.java:1438) at org.eclipse.birt.report.model.adapter.oda.impl.ModelOdaAdapter.updateROMDataSetParams(ModelOdaAdapter.java:1115) at org.eclipse.birt.report.model.adapter.oda.impl.ModelOdaAdapter.updateDataSetHandle(ModelOdaAdapter.java:1312) at org.eclipse.birt.report.model.adapter.oda.impl.ModelOdaAdapter.updateDataSetHandle(ModelOdaAdapter.java:820) at org.eclipse.birt.report.model.adapter.oda.ModelOdaAdapter.updateDataSetHandle(ModelOdaAdapter.java:191) at org.eclipse.birt.report.designer.data.ui.util.DTPUtil.updateDataSetHandle(DTPUtil.java:141) at org.eclipse.birt.report.designer.data.ui.dataset.PropertyPageWrapper.canLeave(PropertyPageWrapper.java:113) at org.eclipse.birt.report.designer.data.ui.property.AbstractPropertyDialog.showPage(AbstractPropertyDialog.java:546) at org.eclipse.birt.report.designer.data.ui.property.AbstractPropertyDialog.showSelectionPage(AbstractPropertyDialog.java:459) at org.eclipse.birt.report.designer.data.ui.dataset.DataSetEditor.showSelectionPage(DataSetEditor.java:824) at org.eclipse.birt.report.designer.data.ui.property.AbstractPropertyDialog$2$1.run(AbstractPropertyDialog.java:417)

Files changed in fix:
model/org.eclipse.birt.report.model.adapter.oda/src/org/eclipse/birt/report/model/adapter/oda/impl/DataSetParameterAdapter.java