Buggy code:
@ Service public class SslTerminationServiceImpl extends BaseService implements SslTerminationService { protected final Log LOG = LogFactory . getLog ( SslTerminationServiceImpl . class ) ; @ Override @ Transactional public ZeusSslTermination updateSslTermination ( int lbId , int accountId , SslTermination sslTermination ) throws BadRequestException , EntityNotFoundException , ImmutableEntityException , UnprocessableEntityException { ZeusSslTermination zeusSslTermination = new ZeusSslTermination ( ) ; ZeusCertFile zeusCertFile = null ; LoadBalancer dbLoadBalancer = loadBalancerRepository . getByIdAndAccountId ( lbId , accountId ) ; SslTerminationHelper . isProtocolSecure ( dbLoadBalancer ) ; Map < Integer , List < LoadBalancer > > vipPorts = new TreeMap < Integer , List < LoadBalancer > > ( ) ; Map < Integer , List < LoadBalancer > > vip6Ports = new TreeMap < Integer , List < LoadBalancer > > ( ) ; if ( ! ( dbLoadBalancer . getLoadBalancerJoinVipSet ( ) . isEmpty ( ) ) ) { vipPorts = virtualIpRepository . getPorts ( dbLoadBalancer . getLoadBalancerJoinVipSet ( ) . iterator ( ) . next ( ) . getVirtualIp ( ) . getId ( ) ) ; } if ( ! ( dbLoadBalancer . getLoadBalancerJoinVip6Set ( ) . isEmpty ( ) ) ) { vip6Ports = virtualIpv6Repository . getPorts ( dbLoadBalancer . getLoadBalancerJoinVip6Set ( ) . iterator ( ) . next ( ) . getVirtualIp ( ) . getId ( ) ) ; } if ( ! ( SslTerminationHelper . verifyPortSecurePort ( dbLoadBalancer , sslTermination , vipPorts , vip6Ports ) ) ) { <START_BUG> throw new BadRequestException ( String . format ( ( "Secure<seq2seq4repair_space>port:<seq2seq4repair_space>'%s'<seq2seq4repair_space>must<seq2seq4repair_space>be<seq2seq4repair_space>unique<seq2seq4repair_space>across<seq2seq4repair_space>loadbalancers<seq2seq4repair_space>" + "<seq2seq4repair_space>Ports<seq2seq4repair_space>taken:<seq2seq4repair_space>'%s'" ) , sslTermination . getSecurePort ( ) , buildPortString ( vipPorts , vip6Ports ) ) ) ; <END_BUG> } org . openstack . atlas . service . domain . entities . SslTermination dbTermination = null ; try { dbTermination = getSslTermination ( dbLoadBalancer . getId ( ) , dbLoadBalancer . getAccountId ( ) ) ; } catch ( EntityNotFoundException e ) { LOG . warn ( "LoadBalancer<seq2seq4repair_space>ssl<seq2seq4repair_space>termination<seq2seq4repair_space>could<seq2seq4repair_space>not<seq2seq4repair_space>be<seq2seq4repair_space>found,<seq2seq4repair_space>" ) ; } org . openstack . atlas . service . domain . entities . SslTermination updatedSslTermination = SslTerminationHelper . verifyAttributes ( sslTermination , dbTermination ) ; if ( ! ( SslTerminationHelper . modificationStatus ( sslTermination , dbLoadBalancer ) ) ) { updatedSslTermination = SslTerminationHelper . cleanSSLCertKeyEntries ( updatedSslTermination ) ; zeusCertFile = ZeusUtil . getCertFile ( updatedSslTermination . getPrivatekey ( ) , updatedSslTermination . getCertificate ( ) , updatedSslTermination . getIntermediateCertificate ( ) ) ; SslTerminationHelper . verifyCertificationCredentials ( zeusCertFile ) ; } LOG . debug ( "Updating<seq2seq4repair_space>the<seq2seq4repair_space>lb<seq2seq4repair_space>status<seq2seq4repair_space>to<seq2seq4repair_space>pending_update" ) ; if ( ! ( loadBalancerRepository . testAndSetStatus ( dbLoadBalancer . getAccountId ( ) , dbLoadBalancer . getId ( ) , PENDING_UPDATE , false ) ) ) { String message = StringHelper . immutableLoadBalancer ( dbLoadBalancer ) ; LOG . warn ( message ) ; throw new ImmutableEntityException ( message ) ; } LOG . info ( String . format ( "Saving<seq2seq4repair_space>ssl<seq2seq4repair_space>termination<seq2seq4repair_space>to<seq2seq4repair_space>the<seq2seq4repair_space>data<seq2seq4repair_space>base<seq2seq4repair_space>for<seq2seq4repair_space>loadbalancer:<seq2seq4repair_space>'%s'" , lbId ) ) ; sslTerminationRepository . setSslTermination ( lbId , updatedSslTermination ) ; LOG . info ( String . format ( "Succesfully<seq2seq4repair_space>saved<seq2seq4repair_space>ssl<seq2seq4repair_space>termination<seq2seq4repair_space>to<seq2seq4repair_space>the<seq2seq4repair_space>data<seq2seq4repair_space>base<seq2seq4repair_space>for<seq2seq4repair_space>loadbalancer:<seq2seq4repair_space>'%s'" , lbId ) ) ; zeusSslTermination . setSslTermination ( updatedSslTermination ) ; if ( zeusCertFile != null ) { zeusSslTermination . setCertIntermediateCert ( zeusCertFile . getPublic_cert ( ) ) ; } return zeusSslTermination ; } @ Override @ Transactional public boolean deleteSslTermination ( Integer loadBalancerId , Integer accountId ) throws BadRequestException , EntityNotFoundException , ImmutableEntityException , UnprocessableEntityException { } @ Override @ Transactional public void pseudoDeleteSslTermination ( Integer loadBalancerId , Integer accountId ) throws BadRequestException , EntityNotFoundException , ImmutableEntityException , UnprocessableEntityException { } @ Override public SslTermination getSslTermination ( Integer lid , Integer accountId ) throws EntityNotFoundException { } private String buildPortString ( Map < Integer , List < LoadBalancer > > vipPorts , Map < Integer , List < LoadBalancer > > vip6Ports ) { } }

Fix:
throw new BadRequestException ( String . format ( ( "Secure<seq2seq4repair_space>port:<seq2seq4repair_space>'%s'<seq2seq4repair_space>must<seq2seq4repair_space>be<seq2seq4repair_space>unique<seq2seq4repair_space>" + "<seq2seq4repair_space>Ports<seq2seq4repair_space>taken:<seq2seq4repair_space>'%s'" ) , sslTermination . getSecurePort ( ) , buildPortString ( vipPorts , vip6Ports ) ) ) ;