Bug 147809 Null pointer exception if the table name contains spaces
The null pointer exception will be thrown if the table name contains spaces when calling the method: public String[] getTableComplexNestedXMLColumnNames( String tableName ) { return ( (TableInfo) this.tableInfos.get( tableName ) ).getComplexNestXMLColumnNames(); } In the org.eclipse.birt.report.data.oda.xml.util. RelationInformation.java The table name was stripped before adding it to the tableInfos, however if the tableName of this method is not a stripped string, then it will cause the null pointer exception. This the stack: RelationInformation.getTableColumnNames(String) line: 189 ResultSetMetaData.<init>(RelationInformation, String) line: 39 Query.getMetaData() line: 126 OdaQuery.doGetMetaData() line: 388 OdaQuery.getMetaData() line: 356 PreparedStatement.getRuntimeMetaData() line: 296 PreparedStatement.getProjectedColumns() line: 283 PreparedStatement.addColumnHints(Collection) line: 715 DataSourceQuery.addColumnHints(PreparedStatement) line: 292 DataSourceQuery.prepare() line: 207 DataExecutionManager.executeQuery(int, String, String, ArrayOfParameterValue, int, int, ArrayOfColumnProperty) line: 236 AWPSoapBindingImpl.iStatementExecute(IStatementExecute) line: 174 NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method] NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39 DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25 Method.invoke(Object, Object...) line: 585 RPCProvider.invokeMethod(MessageContext, Method, Object, Object[]) line: 388 RPCProvider.processMessage(MessageContext, SOAPEnvelope, SOAPEnvelope, Object) line: 283 RPCProvider(JavaProvider).invoke(MessageContext) line: 323 InvocationStrategy.visit(Handler, MessageContext) line: 32 SOAPService(SimpleChain).doVisiting(MessageContext, HandlerIterationStrategy) line: 118 SOAPService(SimpleChain).invoke(MessageContext) line: 83 SOAPService.invoke(MessageContext) line: 453 AxisServer.invoke(MessageContext) line: 281 OdaServerAxisServlet(AxisServlet).doPost(HttpServletRequest, HttpServletResponse) line: 699 SOAPRunnable(AxisSOAPRunnable).run() line: 54 ThreadPool$WorkerThread.run() line: 216 Thread.run() line: 595
data/org.eclipse.birt.report.data.oda.xml/src/org/eclipse/birt/report/data/oda/xml/util/RelationInformation.java
/*******************************************************************************
 * Copyright (c) 2004, 2005 Actuate Corporation.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http:www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *  Actuate Corporation  - initial API and implementation
 *******************************************************************************/
package org.eclipse.birt.report.data.oda.xml.util;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import org.eclipse.birt.report.data.oda.xml.impl.DataTypes;
import org.eclipse.birt.report.data.oda.xml.i18n.Messages;
import org.eclipse.datatools.connectivity.oda.OdaException;
/**
 * This class is used to dealing with the strings which are parsed as arguments to 
 * create an XML data source connection.The structure of string must follow the given rule:
 * TableName1#:#[TableRootPath]#:#{columnName1;Type;RelativeXPath},{columnName2;Type;RelativeXPath}...
 * #-#TableName2#:#[TableRootPath]#:#{columnName1;Type;RelativeXpath}.....
 * 
 */
public class RelationInformation