Buggy code:
public final class AdapterBuilder { private final String id ; private final BuiltAdapters builtAdapters ; private final ScriptExecutionBlackboard env ; private final StandardisedStringSet callerAdapters ; private final StandardisedStringTreeMap < Integer > datasourceMap = new StandardisedStringTreeMap ( ) ; private final ArrayList < ODLDatastore < ? extends ODLTable > > datasources = new ArrayList < > ( ) ; private final AdapterConfig inputConfig ; private final ProcessingApi continueCb ; private ODLDatastore < ? extends ODLTableDefinition > destination ; private AdapterMapping mapping ; private AdapterConfig processedConfig ; private AdapterBuilder ( AdapterConfig adapterConfig , String id , StandardisedStringSet callerAdapters , ScriptExecutionBlackboard env , ProcessingApi continueCb , BuiltAdapters result ) { } public AdapterBuilder ( String id , StandardisedStringSet callerAdapters , ScriptExecutionBlackboard env , ProcessingApi continueCb , BuiltAdapters result ) { } public AdapterBuilder ( AdapterConfig adapterConfig , StandardisedStringSet callerAdapters , ScriptExecutionBlackboard env , ProcessingApi continueCb , BuiltAdapters result ) { } private void setFailed ( ) { } public ODLDatastore < ? extends ODLTable > build ( ) { } private void limitResults ( int tableIndx , int limit ) { } static class UnionTableException extends RuntimeException { UnionTableException ( ) { } UnionTableException ( String s ) { } UnionTableException ( Throwable cause ) { } } private AdapterConfig createUnionedSourcelessAdapter ( List < AdaptedTableConfig > constituents ) { } private void buildUnionTable ( List < AdaptedTableConfig > constituents , int destinationTableId ) { } private int [ ] getOrderedSortColumns ( AdaptedTableConfig table ) { } private class TableSorter { final AdapterBuilder . InternalTableRef sourceTableRef ; final TLongArrayList idsToSort ; final AdaptedTableConfig adaptedTableConfig ; final int [ ] sortColumns ; TableSorter ( AdapterBuilder . InternalTableRef sourceTableRef , TLongArrayList idsToSort , AdaptedTableConfig adaptedTableConfig , int [ ] sortColumns ) { } TLongArrayList sort ( ) { } Function buildFunction ( ODLTableReadOnly sourceTable , AdapterColumnConfig col ) { } } private void buildNonUnionNonGroupedTable ( int destTableIndx ) { AdaptedTableConfig tableConfig = processedConfig . getTables ( ) . get ( destTableIndx ) ; AdapterBuilder . InternalTableRef tableRef = new AdapterBuilder . InternalTableRef ( ) ; int originalFromDsIndex = recurseBuild ( tableConfig . getFromDatastore ( ) ) ; tableRef . dsIndex = originalFromDsIndex ; if ( ( tableRef . dsIndex ) == ( - 1 ) ) { setFailed ( ) ; return ; } tableRef . tableIndex = TableUtils . findTableIndex ( datasources . get ( tableRef . dsIndex ) , tableConfig . getFromTable ( ) , true ) ; if ( ( tableRef . tableIndex ) == ( - 1 ) ) { env . setFailed ( ( ( "Could<seq2seq4repair_space>not<seq2seq4repair_space>find<seq2seq4repair_space>table<seq2seq4repair_space>\"" + ( tableConfig . getFromTable ( ) ) ) + "\"." ) ) ; setFailed ( ) ; return ; } boolean processSortNow = ( AdapterBuilderUtils . hasGroupByColumn ( tableConfig ) ) == false ; int [ ] sortCols = getOrderedSortColumns ( tableConfig ) ; String filterFormula = tableConfig . getFilterFormula ( ) ; if ( ( processSortNow && ( ( sortCols . length ) > 0 ) ) && ( ( filterFormula == null ) || ( ( filterFormula . trim ( ) . length ( ) ) == 0 ) ) ) { filterFormula = "true" ; } if ( ( filterFormula != null ) && ( ( filterFormula . trim ( ) . length ( ) ) > 0 ) ) { ODLTableReadOnly srcTable = table ( tableRef ) ; Function formula = buildFormulaWithTableVariables ( srcTable , filterFormula , tableRef . dsIndex ) ; if ( env . isFailed ( ) ) { return ; } if ( ! ( env . isCompileOnly ( ) ) ) { int nbRows = srcTable . getRowCount ( ) ; TLongArrayList rowIds = new TLongArrayList ( nbRows ) ; boolean didIndexedSearch = false ; <START_BUG> if ( ( FmEquals . class . isInstance ( formula ) ) && ( ( formula . nbChildren ( ) ) == 2 ) ) { <END_BUG> FmConst constFnc = null ; FmLocalElement localVar = null ; for ( int i = 0 ; i < 2 ; i ++ ) { Function child = formula . child ( i ) ; if ( FmConst . class . isInstance ( child ) ) { constFnc = ( ( FmConst ) ( child ) ) ; } else if ( FmLocalElement . class . isInstance ( child ) ) { localVar = ( ( FmLocalElement ) ( child ) ) ; } } if ( ( constFnc != null ) && ( localVar != null ) ) { long [ ] vals = srcTable . find ( localVar . getColumnIndex ( ) , constFnc . value ( ) ) ; if ( vals != null ) { rowIds . addAll ( vals ) ; } didIndexedSearch = true ; } } else if ( FmLocalElement . class . isInstance ( formula ) ) { long [ ] vals = srcTable . find ( ( ( FmLocalElement ) ( formula ) ) . getColumnIndex ( ) , 1 ) ; if ( vals != null ) { rowIds . addAll ( vals ) ; } didIndexedSearch = true ; } if ( ! didIndexedSearch ) { for ( int row = 0 ; row < nbRows ; row ++ ) { FunctionParameters parameters = new com . opendoorlogistics . core . scripts . formulae . TableParameters ( datasources , tableRef . dsIndex , srcTable . getImmutableId ( ) , srcTable . getRowId ( row ) , row ) ; Object exec = formula . execute ( parameters ) ; if ( exec == ( Functions . EXECUTION_ERROR ) ) { env . setFailed ( ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>execute<seq2seq4repair_space>filter<seq2seq4repair_space>formula:<seq2seq4repair_space>" + filterFormula ) ) ; return ; } if ( exec != null ) { Long val = Numbers . toLong ( exec ) ; if ( ( val != null ) && ( ( val . intValue ( ) ) == 1 ) ) { rowIds . add ( srcTable . getRowId ( row ) ) ; } } } }

Fix:
if ( ( ( FmEquals . class . isInstance ( formula ) ) && ( ( formula . nbChildren ( ) ) == 2 ) ) && ( ( ( ( FmEquals ) ( formula ) ) . isNot ( ) ) == false ) ) {