Buggy code:
public class AppMDAO { private APIProvider apiProviderImpl ; private static final Log log = LogFactory . getLog ( AppMDAO . class ) ; public static JWTGenerator jwtGenerator ; public static Boolean removeUserNameInJWTForAppToken ; private static final String ENABLE_JWT_GENERATION = "APIConsumerAuthentication.EnableTokenGeneration" ; private static final String ENABLE_JWT_CACHE = "APIKeyManager.EnableJWTCache" ; private static final String GATEWAY_URL = "APIGateway.Environments.Environment.GatewayEndpoint" ; private static final String USERID_LOGIN = "UserIdLogin" ; private static final String EMAIL_LOGIN = "EmailLogin" ; private static final String PRIMARY_LOGIN = "primary" ; private static final String CLAIM_URI = "ClaimUri" ; public AppMDAO ( ) { } public APIInfoDTO [ ] getSubscribedAPIsOfUser ( String userId ) throws AppManagementException , IdentityException { } public APIKeyInfoDTO [ ] getSubscribedUsersForAPI ( APIInfoDTO apiInfoDTO ) throws AppManagementException { } public void changeAccessTokenStatus ( String userId , APIInfoDTO apiInfoDTO , String statusEnum ) throws AppManagementException , IdentityException { } public APIKeyValidationInfoDTO validateKey ( String context , String version , String accessToken , String requiredAuthenticationLevel ) throws AppManagementException { } public ArrayList < String > getInUrlMappingById ( int appId ) throws AppManagementException { } public String getInUrlMappingRoles ( int appId , String urlMapping , String httpVerb ) throws AppManagementException { } public static WebAppInfoDTO getSAML2SSOConfigInfo ( String context , String version ) throws AppManagementException { Connection conn = null ; PreparedStatement ps = null ; ResultSet rs = null ; WebAppInfoDTO webAppInfoDTO = new WebAppInfoDTO ( ) ; String saml2SsoIssuer ; String ssoInfoSqlQuery = "SELECT<seq2seq4repair_space>app.APP_NAME,<seq2seq4repair_space>app.LOG_OUT_URL,<seq2seq4repair_space>app.APP_ID,<seq2seq4repair_space>" + ( ( "COALESCE(app.APP_ALLOW_ANONYMOUS,<seq2seq4repair_space>'FALSE')<seq2seq4repair_space>APP_ALLOW_ANONYMOUS<seq2seq4repair_space>" + "<seq2seq4repair_space>FROM<seq2seq4repair_space>APM_APP<seq2seq4repair_space>app<seq2seq4repair_space>" ) + "<seq2seq4repair_space>WHERE<seq2seq4repair_space>app.CONTEXT<seq2seq4repair_space>=<seq2seq4repair_space>?<seq2seq4repair_space>AND<seq2seq4repair_space>app.APP_VERSION<seq2seq4repair_space>=<seq2seq4repair_space>?<seq2seq4repair_space>" ) ; try { conn = APIMgtDBUtil . getConnection ( ) ; ps = conn . prepareStatement ( ssoInfoSqlQuery ) ; ps . setString ( 1 , context ) ; ps . setString ( 2 , version ) ; rs = ps . executeQuery ( ) ; if ( rs . next ( ) ) { saml2SsoIssuer = rs . getString ( "APP_NAME" ) ; webAppInfoDTO . setSaml2SsoIssuer ( saml2SsoIssuer ) ; webAppInfoDTO . setLogoutUrl ( rs . getString ( "LOG_OUT_URL" ) ) ; webAppInfoDTO . setContext ( context ) ; webAppInfoDTO . setVersion ( version ) ; webAppInfoDTO . setAppID ( rs . getInt ( "APP_ID" ) ) ; <START_BUG> webAppInfoDTO . setAllowAnonymous ( Boolean . parseBoolean ( rs . getString ( "APP_ALLOW_ANONYMOUS" ) ) ) ; <END_BUG> } } catch ( SQLException e ) { AppMDAO . handleException ( ( ( ( ( ( ( "Error<seq2seq4repair_space>when<seq2seq4repair_space>executing<seq2seq4repair_space>the<seq2seq4repair_space>SQL:<seq2seq4repair_space>" + ssoInfoSqlQuery ) + "<seq2seq4repair_space>(Context:" ) + context ) + "<seq2seq4repair_space>,Version:" ) + version ) + ")" ) , e ) ; } finally { APIMgtDBUtil . closeAllConnections ( ps , conn , rs ) ; } return webAppInfoDTO ; } public static VerbInfoDTO getVerbConfigInfo ( String context , String version ) throws AppManagementException { } private String generateJWTToken ( String userType , APIKeyValidationInfoDTO keyValidationInfoDTO , String context , String version ) throws AppManagementException { } public long getApplicationAccessTokenRemainingValidityPeriod ( String accessToken ) throws AppManagementException { } private void updateTokenState ( String accessToken , Connection conn , PreparedStatement ps ) throws SQLException , AppManagementException , CryptoException { } public void addSubscriber ( Subscriber subscriber ) throws AppManagementException { } public void updateSubscriber ( Subscriber subscriber ) throws AppManagementException { } public Subscriber getSubscriber ( int subscriberId ) throws AppManagementException { } public int getDefaultApplicationForSubscriber ( String subscriber ) throws AppManagementException { } public Subscription getSubscription ( APIIdentifier identifier , int applicationId , String subscriptionTyp ) throws AppManagementException { } public boolean updateSubscription ( int subscriptionId , String subscriptionType , String trustedIdps , String subStatus ) throws AppManagementException { } public int addSubscription ( APIIdentifier identifier , String subscriptionType , String context , int applicationId , String status , String trustedIdps ) throws AppManagementException { } public void removeSubscription ( APIIdentifier identifier , int applicationId ) throws AppManagementException { } public void removeAPISubscription ( APIIdentifier identifier ) throws AppManagementException { } public void removeAPISubscription ( APIIdentifier identifier , String userID , String applicationName ) throws AppManagementException { } public void removeSubscriptionById ( int subscription_id ) throws AppManagementException { } public String getSubscriptionStatusById ( int subscriptionId ) throws AppManagementException { } public Subscriber getSubscriber ( String subscriberName ) throws AppManagementException { } public Set < SubscribedAPI > getSubscribedAPIs ( Subscriber subscriber , String applicationName ) throws AppManagementException { } public String getAPISubscibedStatus ( ) throws AppManagementException , IdentityException { } public Set < SubscribedAPI > getSubscribedAPIs ( Subscriber subscriber ) throws AppManagementException { } public String getTokenScope ( String consumerKey ) throws AppManagementException { } private String getTokenScope ( String consumerKey , String getScopeSql ) throws AppManagementException { } private String getScopeSql ( String accessTokenStoreTable ) { } public Boolean isAccessTokenExists ( String accessToken ) throws AppManagementException { } public Boolean isAccessTokenRevoked ( String accessToken ) throws AppManagementException { } public APIKey getAccessTokenData ( String accessToken ) throws AppManagementException { } public Map < Integer , APIKey > getAccessTokens ( String query ) throws AppManagementException { } private Map < Integer , APIKey > getAccessTokens ( String query , String getTokenSql ) throws AppManagementException { } private String getTokenSql ( String accessTokenStoreTable ) { } public Map < Integer , APIKey > getAccessTokensByUser ( String user , String loggedInUser ) throws AppManagementException { } public Map < Integer , APIKey > getAccessTokensByDate ( String date , boolean latest , String loggedInUser ) throws AppManagementException { } public Map < Integer , APIKey > getAccessTokensByDate ( String date , boolean latest , String [ ] querySql , String loggedInUser ) throws AppManagementException { } public String [ ] getTokenByDateSqls ( String accessTokenStoreTable ) { } public void updateTierPermissions ( String tierName , String permissionType , String roles , int tenantId ) throws AppManagementException { } public Set < TierPermissionDTO > getTierPermissions ( int tenantId ) throws AppManagementException { } public TierPermissionDTO getTierPermission ( String tierName , int tenantId ) throws AppManagementException { } public Set < Subscriber > getSubscribersOfProvider ( String providerName ) throws AppManagementException { } public Set < Subscriber > getSubscribersOfAPI ( APIIdentifier identifier ) throws AppManagementException { }

Fix:
webAppInfoDTO . setAllowAnonymous ( rs . getBoolean ( "APP_ALLOW_ANONYMOUS" ) ) ;