Buggy code:
public class CloudAppDeployer { private static final Logger journal = Logger . getLogger ( CloudAppDeployer . class . getName ( ) ) ; private static boolean DEBUG = false ; ComponentInstanceGroup < ComponentInstance < ? extends Component > > alreadyDeployed = new ComponentInstanceGroup < ComponentInstance < ? extends Component > > ( ) ; ComponentInstanceGroup < ComponentInstance < ? extends Component > > alreadyStarted = new ComponentInstanceGroup < ComponentInstance < ? extends Component > > ( ) ; private Deployment currentModel ; private Deployment targetModel ; private Coordinator coordinator ; private boolean statusMonitorActive ; private StatusMonitor statusMonitor ; public CloudAppDeployer ( ) { } public Deployment getCurrentModel ( ) { } public StatusMonitor getStatusMonitor ( ) { } public Coordinator getCoordinator ( ) { } public void setCoordinator ( Coordinator coordinator ) { } public void deploy ( Deployment targetModel ) { } private Boolean startSLA ( String url , String agreementId ) { } public void reset ( ) { } public void deploy ( Deployment targetModel , CloudMLModelComparator diff ) { } private void unlessNotNull ( String message , Object ... obj ) { } public void updateCurrentModel ( CloudMLModelComparator diff ) { } private void prepareComponents ( ComponentInstanceGroup < ComponentInstance < ? extends Component > > components , RelationshipInstanceGroup relationships ) { } private void prepareAnInternalComponent ( InternalComponentInstance instance , ComponentInstanceGroup < ComponentInstance < ? extends Component > > components , RelationshipInstanceGroup relationships ) { } private void executeCommand ( VMInstance owner , Connector jc , String command ) { } private void executeInstallCommand ( InternalComponentInstance x , VMInstance owner , Connector jc ) { } private void executeUploadCommands ( InternalComponentInstance x , VMInstance owner , Connector jc ) { } private void executeRetrieveCommand ( InternalComponentInstance x , VMInstance owner , Connector jc ) { } public ExternalComponentInstance getDestination ( ComponentInstance component ) { } private void generatePuppetManifestAndConfigure ( ) { } private void managePuppet ( PuppetResource pr , VMInstance n , String hostname , String path ) { } private void configureWithPuppet ( ComponentInstanceGroup < InternalComponentInstance > components ) { } private void startExecutes ( InternalComponentInstance x ) { } private void buildExecutes ( InternalComponentInstance x ) { } private void buildPaas ( InternalComponentInstance x , List < RelationshipInstance > relationships ) { } private void configureSaas ( ComponentInstanceGroup < InternalComponentInstance > components ) { } protected void configure ( Connector jc , VM n , VMInstance ni , String configurationCommand , Boolean keyRequired ) { } protected void start ( Connector jc , VM n , VMInstance ni , String startCommand ) { } private void setExternalServices ( ExternalComponentInstanceGroup ems ) { } private void provisionAVM ( VMInstance n ) { } private void provisionAPlatform ( ExternalComponentInstance n ) { } private Map < String , String > loadbalancerTargets = new HashMap < String , String > ( ) ; protected void configureWithRelationships ( RelationshipInstanceGroup relationships ) { } private Boolean isPaaS2PaaS ( RelationshipInstance bi ) { } private RelationshipInstance bi = null ; public void retrieveIPandConfigure ( Resource serverResource , Resource clientResource , PortInstance < ? extends Port > server , PortInstance < ? extends Port > client ) { } private void configureWithIP ( Resource server , Resource client , PortInstance < ? extends Port > pserver , PortInstance < ? extends Port > pclient , String destinationIpAddress , String ipAddress , int destinationPortNumber ) { } private void configureWithIP ( Resource r , PortInstance < ? extends Port > i , String destinationIpAddress , String ipAddress , int destinationPortNumber ) { } private void terminateExternalServices ( Map < ExternalComponentInstance < ? extends ExternalComponent > , List < InternalComponentInstance > > vms ) { } private void terminateVM ( VMInstance n ) { } private void stopInternalComponents ( List < InternalComponentInstance > components ) { } private void stopInternalComponent ( InternalComponentInstance a ) { } private void unconfigureRelationships ( List < RelationshipInstance > relationships ) { } private void unconfigureRelationship ( RelationshipInstance b ) { } private void unconfigureWithIP ( Resource r , PortInstance < ? extends Port > i ) { } public void setCurrentModel ( Deployment current ) { } private ExternalComponentInstance findDestinationWhenNoRequiredExecutionPlatformSpecified ( InternalComponentInstance a ) { } private void prepareSetEnv ( Deployment d , InternalComponentInstance c , Property p ) { } public void setAllEnvVarComponent ( Deployment d ) { } private void setEnvVar ( VMInstance vmi , String varName , String value ) { } public Boolean scaleOut ( VMInstance vmi ) { Scaler scaler = new Scaler ( currentModel , coordinator , this ) ; if ( ( vmi . getType ( ) . getProvider ( ) . getProperties ( ) . get ( "MaxVM" ) ) != null ) { int max = Integer . parseInt ( vmi . getType ( ) . getProvider ( ) . getProperties ( ) . valueOf ( "MaxVM" ) ) ; <START_BUG> if ( ( currentModel . getComponentInstances ( ) . onlyVMs ( ) . size ( ) ) < max ) { <END_BUG> scaler . scaleOut ( vmi ) ; } else return false ; } else { scaler . scaleOut ( vmi ) ; } return true ; } public Boolean scaleOut ( VMInstance vmi , int nb ) { } public void scaleOut ( VMInstance vmi , Provider provider ) { } public Deployment scaleOut ( ExternalComponentInstance eci , Provider provider ) { } public void activeDebug ( ) { } public void stopDebug ( ) { } }

Fix:
if ( ( ( currentModel . getComponentInstances ( ) . onlyVMs ( ) . size ( ) ) + 1 ) < max ) {