Bug 191687 ArrayIndexOutOfBoundsException occurs when open the attache report design file
Description: ArrayIndexOutOfBoundsException occurs when open the attache report design file Build number: 2.2.0.v20070608-0630 Steps to reproduce: 1, Open the attache report design Expected result: If the report design is invalud, we just pops up a warning message to tell user Actual result: ArrayIndexOutOfBoundsException occurs Error log: java.lang.ArrayIndexOutOfBoundsException: 1 at org.eclipse.birt.report.designer.internal.ui.editors.schematic.border.TableBorderHelper.initialize(TableBorderHelper.java:165) at org.eclipse.birt.report.designer.internal.ui.editors.schematic.border.TableBorderHelper.updateCellBorderInsets(TableBorderHelper.java:287) at org.eclipse.birt.report.designer.internal.ui.layout.TableLayout.layout(TableLayout.java:146)
model/org.eclipse.birt.report.model/src/org/eclipse/birt/report/model/api/elements/table/LayoutUtil.java
* @param module
	 *            the root of the table
	 * @return <code>true</code> if the table is valid. Otherwise
	 *         <code>false</code>.
	 */
	public static boolean isValidLayout( TableItem table, Module module )
	{
		LayoutTable layout = table.getLayoutModel( module );
		assert layout != null;
		int columnCount = layout.getColumnCount( );
		if ( columnCount == 0 )
			return false;
		
		List slots = getFlattenedLayoutSlots( layout );
		for ( int i = 0; i < slots.size( ); i++ )
		{
			LayoutSlot slot = (LayoutSlot) slots.get( i );
			for ( int j = 0; j < slot.getRowCount( ); j++ )
			{
				LayoutRow row = slot.getLayoutRow( j );
				if ( row == null )
					continue;
				if ( row.getOccupiedColumnCount( ) != columnCount )
					return false;
			}
		}
		return true;
	}
}