Buggy code:
public class GCEOperations { private static final Log log = LogFactory . getLog ( GCELoadBalancer . class ) ; private static final String PROJECT_NAME = GCEContext . getInstance ( ) . getProjectName ( ) ; private static final String PROJECT_ID = GCEContext . getInstance ( ) . getProjectID ( ) ; private static final String ZONE_NAME = GCEContext . getInstance ( ) . getZoneName ( ) ; private static final String REGION_NAME = GCEContext . getInstance ( ) . getRegionName ( ) ; private static final String KEY_FILE_PATH = GCEContext . getInstance ( ) . getKeyFilePath ( ) ; private static final String ACCOUNT_ID = GCEContext . getInstance ( ) . getGceAccountID ( ) ; private static final String HEALTH_CHECK_REQUEST_PATH = GCEContext . getInstance ( ) . getHealthCheckRequestPath ( ) ; private static final String HEALTH_CHECK_PORT = GCEContext . getInstance ( ) . getHealthCheckPort ( ) ; private static final String HEALTH_CHECK_TIME_OUT_SEC = GCEContext . getInstance ( ) . getHealthCheckTimeOutSec ( ) ; private static final String HEALTH_CHECK_UNHEALTHY_THRESHOLD = GCEContext . getInstance ( ) . getHealthCheckUnhealthyThreshold ( ) ; private static final String DATA_STORE_DIR = ".store//gce-extension" ; private static final String RUNNING_FILTER = "status<seq2seq4repair_space>eq<seq2seq4repair_space>RUNNING" ; private static final int OPERATION_TIMEOUT_MSILEC = 10000 ; static Compute compute ; public GCEOperations ( ) throws IOException , GeneralSecurityException , LoadBalancerExtensionException { } private void buildComputeEngineObject ( ) throws IOException , GeneralSecurityException { } public void createTargetPool ( String targetPoolName , String healthCheckName ) { } public void deleteTargetPool ( String targetPoolName ) { } public void createForwardingRule ( String forwardingRuleName , String targetPoolName , String protocol , String portRange ) { } public void deleteForwardingRule ( String forwardingRuleName ) { } public boolean isTargetPoolExists ( String targetPoolName ) { } public boolean isForwardingRuleExists ( String forwardingRuleName ) { } public TargetPool getTargetPool ( String targetPoolName ) { } private void addInstancesToTargetPool ( String targetPoolName , List < InstanceReference > instanceReferenceList ) { } public void removeInstancesFromTargetPool ( String targetPoolName , List < InstanceReference > instanceReferenceList ) { } public static InstanceList getInstanceList ( ) throws IOException { } public static String getInstanceURLFromName ( String instanceName ) { } public void setPortRangeToForwardingRule ( ) { } public void addInstancesToTargetPool ( List < String > instancesNamesList , String targetPoolName ) { } public void createHealthCheck ( String healthCheckName ) { if ( ! ( isHealthCheckExists ( healthCheckName ) ) ) { HttpHealthCheck httpHealthCheck = new HttpHealthCheck ( ) ; httpHealthCheck . setName ( healthCheckName ) ; httpHealthCheck . setRequestPath ( GCEOperations . HEALTH_CHECK_REQUEST_PATH ) ; httpHealthCheck . setPort ( Integer . parseInt ( GCEOperations . HEALTH_CHECK_PORT ) ) ; httpHealthCheck . setTimeoutSec ( Integer . parseInt ( GCEOperations . HEALTH_CHECK_TIME_OUT_SEC ) ) ; httpHealthCheck . setUnhealthyThreshold ( Integer . parseInt ( GCEOperations . HEALTH_CHECK_UNHEALTHY_THRESHOLD ) ) ; try { Operation operation = GCEOperations . compute . httpHealthChecks ( ) . insert ( GCEOperations . PROJECT_ID , httpHealthCheck ) . execute ( ) ; <START_BUG> waitForRegionOperationCompletion ( operation . getName ( ) ) ; <END_BUG> } catch ( IOException e ) { e . printStackTrace ( ) ; } } else { if ( GCEOperations . log . isDebugEnabled ( ) ) { GCEOperations . log . debug ( ( "Health<seq2seq4repair_space>check<seq2seq4repair_space>is<seq2seq4repair_space>already<seq2seq4repair_space>exist:<seq2seq4repair_space>" + healthCheckName ) ) ; } } } public boolean isHealthCheckExists ( String healthCheckName ) { } public HttpHealthCheck getHealthCheckFromName ( String healthCheckName ) { } public static String getHealthCheckURLFromName ( String healthCheckName ) { } public static HttpHealthCheckList getHealthCheckList ( ) { } private void waitForGlobalOperationCompletion ( String operationName ) { } private void waitForRegionOperationCompletion ( String operationName ) { } private void waitForZoneOperationCompletion ( String operationName ) { } public void sampleMethodForAddingInstancesToTargetPool ( ) { } public void sampleMethodForRemovingInstancesToTargetPool ( ) { } No newline ; at end ; of file ; }

Fix:
waitForGlobalOperationCompletion ( operation . getName ( ) ) ;