Skip to content

Commit

Permalink
bugfix nullpointerexception minimizestatement
Browse files Browse the repository at this point in the history
  • Loading branch information
llsand committed Oct 10, 2017
1 parent c21d71e commit b80e364
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -394,9 +394,12 @@ private <T extends AbstractDiff> RecreateNeededBuilder<T> setRecreateNeededFor(
return recreateNeededRegistry.createRecreateNeededBuilder( pDiff );
}

private Optional<TableDiff> findTableDiff( ModelDiff pModelDiff, String pTableName )
private Optional<TableDiff> findTableDiffByOldName( ModelDiff pModelDiff, String pTableName )
{
return pModelDiff.model_elementsTableDiff.stream().filter( p -> p.nameOld.equals( pTableName ) ).findAny();
return pModelDiff.model_elementsTableDiff.stream()//
.filter( p -> p.isOld )//
.filter( p -> p.nameOld.equals( pTableName ) )//
.findAny();
}

private List<DiffActionReason> getRefConstraintRecreate( ModelDiff pModelDiff, String pDestTableName, List<ColumnRefDiff> pDestColumnsDiff )
Expand Down Expand Up @@ -548,7 +551,7 @@ private void updateImplicitDropList( ModelDiff pModelDiff )
return false;
}

Optional<TableDiff> lDestTableDiff = findTableDiff( pModelDiff, pDiff.destTableOld );
Optional<TableDiff> lDestTableDiff = findTableDiffByOldName( pModelDiff, pDiff.destTableOld );
if( lDestTableDiff.isPresent() )
{
return ddlBuilder.isAllColumnsNew( pDiff.destColumnsDiff, lDestTableDiff.get() );
Expand Down

0 comments on commit b80e364

Please sign in to comment.