Buggy code:
@ Override public boolean disassociateIpAddrFromGloboNetwork ( final long ipId ) { } @ Override public boolean applyLbRuleInGloboNetwork ( final Network network , final LoadBalancingRule rule ) throws ResourceUnavailableException { } private String getLbRecord ( String fullLbName , String lbDomain ) { } @ Override public boolean validateLBRule ( Network network , LoadBalancingRule rule ) { if ( ( network == null ) || ( rule == null ) ) { return false ; } GloboNetworkNetworkVO globoNetworkNetworkVO = _globoNetworkNetworkDao . findByNetworkId ( network . getId ( ) ) ; if ( globoNetworkNetworkVO == null ) { throw new InvalidParameterValueException ( ( "GloboNetwork<seq2seq4repair_space>Load<seq2seq4repair_space>Balancer<seq2seq4repair_space>work<seq2seq4repair_space>only<seq2seq4repair_space>with<seq2seq4repair_space>networks<seq2seq4repair_space>managed<seq2seq4repair_space>by<seq2seq4repair_space>GloboNetwork.<seq2seq4repair_space>NetworkId=" + ( network . getId ( ) ) ) ) ; } if ( ( rule . getAdditionalNetworks ( ) ) != null ) { for ( Long networkId : rule . getAdditionalNetworks ( ) ) { GloboNetworkNetworkVO additionalGNNetworkVO = _globoNetworkNetworkDao . findByNetworkId ( networkId ) ; if ( additionalGNNetworkVO == null ) { throw new InvalidParameterValueException ( ( "GloboNetwork<seq2seq4repair_space>Load<seq2seq4repair_space>Balancer<seq2seq4repair_space>work<seq2seq4repair_space>only<seq2seq4repair_space>with<seq2seq4repair_space>networks<seq2seq4repair_space>managed<seq2seq4repair_space>by<seq2seq4repair_space>GloboNetwork.<seq2seq4repair_space>NetworkId=" + ( network . getId ( ) ) ) ) ; } } } IPAddressVO ipVO = _ipAddrDao . findByIpAndNetworkId ( rule . getNetworkId ( ) , rule . getSourceIp ( ) . addr ( ) ) ; if ( ipVO == null ) { throw new InvalidParameterValueException ( ( ( ( "Ip<seq2seq4repair_space>" + ( rule . getSourceIp ( ) . addr ( ) ) ) + "<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>associate<seq2seq4repair_space>with<seq2seq4repair_space>network<seq2seq4repair_space>" ) + ( rule . getNetworkId ( ) ) ) ) ; } GloboNetworkIpDetailVO gnIpDetail = _globoNetworkIpDetailDao . findByIp ( ipVO . getId ( ) ) ; if ( gnIpDetail == null ) { throw new InvalidParameterValueException ( ( ( ( ( "Ip<seq2seq4repair_space>" + ( rule . getSourceIp ( ) . addr ( ) ) ) + "<seq2seq4repair_space>(id<seq2seq4repair_space>" ) + ( ipVO . getId ( ) ) ) + ")<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>associate<seq2seq4repair_space>with<seq2seq4repair_space>globo<seq2seq4repair_space>network" ) ) ; } else if ( ( gnIpDetail . getGloboNetworkEnvironmentRefId ( ) ) == null ) { throw new InvalidParameterValueException ( ( ( ( ( "Ip<seq2seq4repair_space>" + ( rule . getSourceIp ( ) . addr ( ) ) ) + "<seq2seq4repair_space>(id<seq2seq4repair_space>" ) + ( ipVO . getId ( ) ) ) + ")<seq2seq4repair_space>can't<seq2seq4repair_space>be<seq2seq4repair_space>used<seq2seq4repair_space>to<seq2seq4repair_space>load<seq2seq4repair_space>balancing" ) ) ; } if ( ( ( rule . getStickinessPolicies ( ) ) != null ) && ( ( rule . getStickinessPolicies ( ) . size ( ) ) > 1 ) ) { throw new InvalidParameterValueException ( "Invalid<seq2seq4repair_space>stickness<seq2seq4repair_space>policy,<seq2seq4repair_space>list<seq2seq4repair_space>should<seq2seq4repair_space>contain<seq2seq4repair_space>only<seq2seq4repair_space>one" ) ; } if ( ( ( rule . getHealthCheckPolicies ( ) ) != null ) && ( ( rule . getHealthCheckPolicies ( ) . size ( ) ) > 1 ) ) { throw new InvalidParameterValueException ( "Invalid<seq2seq4repair_space>healthcheck<seq2seq4repair_space>policy,<seq2seq4repair_space>list<seq2seq4repair_space>should<seq2seq4repair_space>contain<seq2seq4repair_space>only<seq2seq4repair_space>one" ) ; } if ( ( gnIpDetail . getGloboNetworkVipId ( ) ) != null ) { boolean isv6 = this . isNetworkv6 ( network ) ; GetVipInfoFromGloboNetworkCommand cmd = new GetVipInfoFromGloboNetworkCommand ( gnIpDetail . getGloboNetworkVipId ( ) , isv6 ) ; Answer answer = this . callCommand ( cmd , network . getDataCenterId ( ) , false ) ; if ( ( answer != null ) && ( answer . getResult ( ) ) ) { GloboNetworkVipResponse globoNetworkVip = ( ( GloboNetworkVipResponse ) ( answer ) ) ; String port = String . format ( "%d:%d" , rule . getSourcePortStart ( ) , rule . getDefaultPortStart ( ) ) ; if ( ! ( port . equals ( globoNetworkVip . getPorts ( ) . get ( 0 ) ) ) ) { throw new InvalidParameterValueException ( "You<seq2seq4repair_space>can<seq2seq4repair_space>create<seq2seq4repair_space>only<seq2seq4repair_space>1<seq2seq4repair_space>lb<seq2seq4repair_space>rule<seq2seq4repair_space>per<seq2seq4repair_space>IP." ) ; } String method = globoNetworkVip . getMethod ( ) ; if ( "least-conn" . equals ( method ) ) { method = "leastconn" ; } else if ( "round-robin" . equals ( method ) ) { method = "roundrobin" ; } if ( ( globoNetworkVip . getCreated ( ) ) && ( ! ( rule . getAlgorithm ( ) . equals ( method ) ) ) ) { throw new InvalidParameterValueException ( "It<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>allowed<seq2seq4repair_space>to<seq2seq4repair_space>change<seq2seq4repair_space>balancing<seq2seq4repair_space>method<seq2seq4repair_space>in<seq2seq4repair_space>GloboNetwork." ) ; } if ( ! ( globoNetworkVip . getName ( ) . equals ( rule . getName ( ) ) ) ) { throw new InvalidParameterValueException ( "It<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>allowed<seq2seq4repair_space>to<seq2seq4repair_space>change<seq2seq4repair_space>load<seq2seq4repair_space>balancer<seq2seq4repair_space>name<seq2seq4repair_space>in<seq2seq4repair_space>GloboNetwork" ) ; } } } if ( ( _networkManager . isProviderForNetwork ( GloboDns , network . getId ( ) ) ) && ( _networkManager . isProviderEnabledInPhysicalNetwork ( network . getPhysicalNetworkId ( ) , GloboDns . getName ( ) ) ) ) { String allowedDomainsOpt = GloboNetworkManager . GloboNetworkLBAllowedSuffixes . value ( ) ; List < String > allowedDomains = new ArrayList < String > ( ) ; if ( ( allowedDomainsOpt != null ) && ( ! ( allowedDomainsOpt . equals ( "" ) ) ) ) { allowedDomains = Arrays . asList ( allowedDomainsOpt . split ( "," ) ) ; } String lbDomain = null ; for ( String allowedDomain : allowedDomains ) { allowedDomain = allowedDomain . trim ( ) ; allowedDomain = ( allowedDomain . startsWith ( "." ) ) ? allowedDomain : "." + allowedDomain ; if ( rule . getName ( ) . endsWith ( allowedDomain ) ) { lbDomain = allowedDomain . substring ( 1 ) ; break ; } } if ( lbDomain == null ) { throw new InvalidParameterValueException ( ( ( "Load<seq2seq4repair_space>balancer<seq2seq4repair_space>name<seq2seq4repair_space>" + ( rule . getName ( ) ) ) + "<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>in<seq2seq4repair_space>the<seq2seq4repair_space>allowed<seq2seq4repair_space>list<seq2seq4repair_space>for<seq2seq4repair_space>domains." ) ) ; } String lbRecord = getLbRecord ( rule . getName ( ) , lbDomain ) ; <START_BUG> return _globoDnsService . validateDnsRecordForLoadBalancer ( lbDomain , lbRecord , network . getDataCenterId ( ) ) ; <END_BUG> } else { GloboNetworkManager . s_logger . warn ( "Allowing<seq2seq4repair_space>creation<seq2seq4repair_space>of<seq2seq4repair_space>Load<seq2seq4repair_space>Balancer<seq2seq4repair_space>without<seq2seq4repair_space>registering<seq2seq4repair_space>DNS<seq2seq4repair_space>because<seq2seq4repair_space>network<seq2seq4repair_space>offering<seq2seq4repair_space>does<seq2seq4repair_space>not<seq2seq4repair_space>have<seq2seq4repair_space>GloboDNS<seq2seq4repair_space>as<seq2seq4repair_space>provider" ) ; } return true ; } @ Override public LoadBalancer importGloboNetworkLoadBalancer ( Long lbId , final Long networkId , Long projectId ) { } @ Override public String getDomainSuffix ( ) { } @ Override public boolean isSupportedCustomNetworkDomain ( ) { } @ Override public List < DataCenter > getAllZonesThatProviderAreEnabled ( ) { } private boolean isNetworkv6 ( Network network ) { } @ Override public List < String > listAllowedLbSuffixes ( ) { } }

Fix:
return _globoDnsService . validateDnsRecordForLoadBalancer ( lbDomain , lbRecord , rule . getSourceIp ( ) . addr ( ) , network . getDataCenterId ( ) ) ;