Source:
<code>private static Map<String, List<String>> checkTable(String schema, String table, String index, int level) throws Exception { LanguageConnectionContext lcc = ConnectionUtil.getCurrentLCC(); TransactionController tc = lcc.getTransactionExecute(); TxnView txn = ((SpliceTransactionManager) tc).getActiveStateTxn(); Activation activation = lcc.getLastActivation(); DataDictionary dd = lcc.getDataDictionary(); SchemaDescriptor sd = dd.getSchemaDescriptor(schema, tc, true); if (sd == null) { throw StandardException.newException(SQLState.LANG_SCHEMA_DOES_NOT_EXIST, schema); } TableDescriptor td = dd.getTableDescriptor(table, sd, tc); if (td == null) { throw StandardException.newException(SQLState.TABLE_NOT_FOUND, table); } if (index != null) { ConglomerateDescriptor indexCD = SpliceRegionAdmin.getIndex(td, index); if (indexCD == null) { throw StandardException.newException(SQLState.LANG_INDEX_NOT_FOUND, index); } } ConglomerateDescriptorList list = td.getConglomerateDescriptorList(); List<TentativeIndex> tentativeIndexList = new ArrayList(); for (ConglomerateDescriptor searchCD : list) { if (searchCD.isIndex() && !searchCD.isPrimaryKey()) { <START> DDLChange ddlChange = ProtoUtil.createTentativeIndexChange(txn.getTxnId(), <END> activation.getLanguageConnectionContext(), td.getHeapConglomerateId(), searchCD.getConglomerateNumber(), td, searchCD.getIndexDescriptor(), td.getDefaultValue(searchCD.getIndexDescriptor().baseColumnPositions()[0])); if (index == null || searchCD.getObjectName().compareToIgnoreCase(index) == 0) { tentativeIndexList.add(ddlChange.getTentativeIndex()); } } } Map<String, List<String>> errors = null; if (tentativeIndexList.size() > 0) { ConglomerateDescriptorList cdList = td.getConglomerateDescriptorList(); errors = checkIndexes(schema, table, cdList, tentativeIndexList, level); } return errors; }</code><technical_language>Please move setting of ddlChange subsequent if statement</technical_language>

Target:
private static Map<String, List<String>> checkTable(String schema, String table, String index, int level) throws Exception { LanguageConnectionContext lcc = ConnectionUtil.getCurrentLCC(); TransactionController tc = lcc.getTransactionExecute(); TxnView txn = ((SpliceTransactionManager) tc).getActiveStateTxn(); Activation activation = lcc.getLastActivation(); DataDictionary dd = lcc.getDataDictionary(); SchemaDescriptor sd = dd.getSchemaDescriptor(schema, tc, true); if (sd == null) { throw StandardException.newException(SQLState.LANG_SCHEMA_DOES_NOT_EXIST, schema); } TableDescriptor td = dd.getTableDescriptor(table, sd, tc); if (td == null) { throw StandardException.newException(SQLState.TABLE_NOT_FOUND, table); } if (index != null) { ConglomerateDescriptor indexCD = SpliceRegionAdmin.getIndex(td, index); if (indexCD == null) { throw StandardException.newException(SQLState.LANG_INDEX_NOT_FOUND, index); } } ConglomerateDescriptorList cdList = td.getConglomerateDescriptorList(); List<TentativeIndex> tentativeIndexList = new ArrayList(); for (ConglomerateDescriptor searchCD : cdList) { if (searchCD.isIndex() && !searchCD.isPrimaryKey()) { if (index == null || searchCD.getObjectName().compareToIgnoreCase(index) == 0) { DDLChange ddlChange = ProtoUtil.createTentativeIndexChange(txn.getTxnId(), activation.getLanguageConnectionContext(), td.getHeapConglomerateId(), searchCD.getConglomerateNumber(), td, searchCD.getIndexDescriptor(), td.getDefaultValue(searchCD.getIndexDescriptor().baseColumnPositions()[0])); tentativeIndexList.add(ddlChange.getTentativeIndex()); } } } Map<String, List<String>> errors = null; if (tentativeIndexList.size() > 0) { errors = checkIndexes(schema, table, cdList, tentativeIndexList, level); } return errors; }