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
String[] tables = relationString.split( CONST_TABLE_DELIMITER );
		for ( int i = 0; i < tables.length; i++ )
		{
			String[] temp = tables[i].trim( )
					.split( CONST_TABLE_COLUMN_DELIMITER );
			assert ( temp.length == 3 );
			
			TableInfo tableInfo = new TableInfo( temp[0].trim( ),
					temp[1].substring( 1, temp[1].length( ) - 1 ).trim( ) );
			
			String[] columns = temp[2].trim( ).split( CONST_COLUMN_DELIMITER );
			
			for ( int j = 0; j < columns.length; j++ )
			{
				String trimedColumn = columns[j].trim( );
				
			
				String[] columnInfos = trimedColumn.substring( 1,
						trimedColumn.length( ) - 1 )
						.split( CONST_COLUMN_METAINFO_DELIMITER );
				
				
				
				
				String columnXpath = null;
				if( columnInfos.length == 3 )
				{
					columnXpath = columnInfos[2];
				}else