Buggy code:
private static boolean isTierPaid ( String tierName , String tenantDomainName ) throws APIManagementException { } private static boolean isUnlimitedTierPaid ( String tenantDomain ) throws APIManagementException { } public static Tier getTierFromCache ( String tierName , String tenantDomain ) throws APIManagementException { } public static void clearTiersCache ( String tenantDomain ) { } private static Cache getTiersCache ( ) { } public static GenericArtifact getAPIArtifact ( APIIdentifier apiIdentifier , Registry registry ) throws APIManagementException { } public static HttpClient getHttpClient ( int port , String protocol ) { } public static String getRegistryResourcePathForUI ( APIConstants . RegistryResourceTypesForUI resourceType , String tenantDomain , String resourcePath ) { } public static Class getClassForName ( String className ) throws ClassNotFoundException , IllegalAccessException , InstantiationException { } public static boolean isValidURL ( String url ) { } public static JSONObject getTenantRESTAPIScopesConfig ( String tenantDomain ) throws APIManagementException { } public static Map < String , String > getRESTAPIScopesFromConfig ( JSONObject config ) { } public static boolean isWhiteListedScope ( String scope ) { } public static String getServerURL ( ) throws APIManagementException { } public static String getAPIProviderFromRESTAPI ( String apiVersion , String tenantDomain ) { } public static CORSConfiguration getCorsConfigurationDtoFromJson ( String jsonString ) { } public static String getCorsConfigurationJsonFromDto ( CORSConfiguration corsConfiguration ) { } public static String getAllowedHeaders ( ) { } public static String getAllowedMethods ( ) { } public static boolean isAllowCredentials ( ) { } public static boolean isCORSEnabled ( ) { } public static String getAllowedOrigins ( ) { } public static CORSConfiguration getCorsConfigurationFromArtifact ( GovernanceArtifact artifact ) throws GovernanceException { } public static CORSConfiguration getDefaultCorsConfiguration ( ) { } public static String getAPINamefromRESTAPI ( String api_version ) { } public static HashMap < Integer , String > getAllAlertTypeByStakeHolder ( String stakeHolder ) throws APIManagementException { } public static List < Integer > getSavedAlertTypesIdsByUserNameAndStakeHolder ( String userName , String stakeHolder ) throws APIManagementException { } public static List < String > retrieveSavedEmailList ( String userName , String stakeHolder ) throws APIManagementException { } public static boolean isContentAwarePolicy ( Policy policy ) { } private static boolean isDefaultQuotaPolicyContentAware ( Policy policy ) { } public static void addDefaultAdvancedThrottlePoliciesToDB ( int tenantId ) throws APIManagementException { int [ ] requestCount = new int [ ] { 20 , 5 , 1 , - 1 } ; String [ ] appPolicies = new String [ ] { APIConstants . DEFAULT_APP_POLICY_LARGE , APIConstants . DEFAULT_APP_POLICY_MEDIUM , APIConstants . DEFAULT_APP_POLICY_SMALL , APIConstants . DEFAULT_APP_POLICY_UNLIMITED } ; String [ ] appPolicyDecs = new String [ ] { APIConstants . DEFAULT_APP_POLICY_LARGE_DESC , APIConstants . DEFAULT_APP_POLICY_MEDIUM_DESC , APIConstants . DEFAULT_APP_POLICY_SMALL_DESC , APIConstants . DEFAULT_APP_POLICY_UNLIMITED_DESC } ; ApiMgtDAO apiMgtDAO = ApiMgtDAO . getInstance ( ) ; String policyName ; for ( int i = 0 ; i < ( appPolicies . length ) ; i ++ ) { policyName = appPolicies [ i ] ; if ( ! ( apiMgtDAO . isPolicyExist ( POLICY_LEVEL_APP , tenantId , policyName ) ) ) { ApplicationPolicy applicationPolicy = new ApplicationPolicy ( policyName ) ; applicationPolicy . setDescription ( appPolicyDecs [ i ] ) ; applicationPolicy . setTenantId ( tenantId ) ; QuotaPolicy defaultQuotaPolicy = new QuotaPolicy ( ) ; RequestCountLimit requestCountLimit = new RequestCountLimit ( ) ; requestCountLimit . setRequestCount ( requestCount [ i ] ) ; requestCountLimit . setUnitTime ( 60 ) ; requestCountLimit . setTimeUnit ( TIME_UNIT_SECOND ) ; defaultQuotaPolicy . setType ( REQUEST_COUNT_TYPE ) ; defaultQuotaPolicy . setLimit ( requestCountLimit ) ; applicationPolicy . setDefaultQuotaPolicy ( defaultQuotaPolicy ) ; apiMgtDAO . addApplicationPolicy ( applicationPolicy ) ; } } String [ ] subPolicies = new String [ ] { APIConstants . DEFAULT_SUB_POLICY_GOLD , APIConstants . DEFAULT_SUB_POLICY_SILVER , APIConstants . DEFAULT_SUB_POLICY_BRONZE , APIConstants . DEFAULT_SUB_POLICY_UNLIMITED } ; String [ ] subPolicyDecs = new String [ ] { APIConstants . DEFAULT_SUB_POLICY_GOLD_DESC , APIConstants . DEFAULT_SUB_POLICY_SILVER_DESC , APIConstants . DEFAULT_SUB_POLICY_BRONZE_DESC , APIConstants . DEFAULT_SUB_POLICY_UNLIMITED_DESC } ; for ( int i = 0 ; i < ( subPolicies . length ) ; i ++ ) { policyName = subPolicies [ i ] ; if ( ! ( apiMgtDAO . isPolicyExist ( POLICY_LEVEL_SUB , tenantId , policyName ) ) ) { SubscriptionPolicy subscriptionPolicy = new SubscriptionPolicy ( policyName ) ; <START_BUG> subscriptionPolicy . setDescription ( appPolicyDecs [ i ] ) ; <END_BUG> subscriptionPolicy . setTenantId ( tenantId ) ; QuotaPolicy defaultQuotaPolicy = new QuotaPolicy ( ) ; RequestCountLimit requestCountLimit = new RequestCountLimit ( ) ; requestCountLimit . setRequestCount ( requestCount [ i ] ) ; requestCountLimit . setUnitTime ( 60 ) ; requestCountLimit . setTimeUnit ( TIME_UNIT_SECOND ) ; defaultQuotaPolicy . setType ( REQUEST_COUNT_TYPE ) ; defaultQuotaPolicy . setLimit ( requestCountLimit ) ; subscriptionPolicy . setDefaultQuotaPolicy ( defaultQuotaPolicy ) ; subscriptionPolicy . setStopOnQuotaReach ( true ) ; subscriptionPolicy . setBillingPlan ( BILLING_PLAN_FREE ) ; apiMgtDAO . addSubscriptionPolicy ( subscriptionPolicy ) ; } } String [ ] apiPolicies = new String [ ] { APIConstants . DEFAULT_API_POLICY_ULTIMATE , APIConstants . DEFAULT_API_POLICY_PLUS , APIConstants . DEFAULT_API_POLICY_BASIC , APIConstants . DEFAULT_API_POLICY_UNLIMITED } ; String [ ] apiPolicyDecs = new String [ ] { APIConstants . DEFAULT_API_POLICY_ULTIMATE_DESC , APIConstants . DEFAULT_API_POLICY_PLUS_DESC , APIConstants . DEFAULT_API_POLICY_BASIC_DESC , APIConstants . DEFAULT_API_POLICY_UNLIMITED_DESC } ; for ( int i = 0 ; i < ( apiPolicies . length ) ; i ++ ) { policyName = apiPolicies [ i ] ; if ( ! ( apiMgtDAO . isPolicyExist ( POLICY_LEVEL_API , tenantId , policyName ) ) ) { APIPolicy apiPolicy = new APIPolicy ( policyName ) ; apiPolicy . setDescription ( apiPolicyDecs [ i ] ) ; apiPolicy . setTenantId ( tenantId ) ; apiPolicy . setUserLevel ( API_POLICY_API_LEVEL ) ; QuotaPolicy defaultQuotaPolicy = new QuotaPolicy ( ) ; RequestCountLimit requestCountLimit = new RequestCountLimit ( ) ; requestCountLimit . setRequestCount ( requestCount [ i ] ) ; requestCountLimit . setUnitTime ( 60 ) ; requestCountLimit . setTimeUnit ( TIME_UNIT_SECOND ) ; defaultQuotaPolicy . setType ( REQUEST_COUNT_TYPE ) ; defaultQuotaPolicy . setLimit ( requestCountLimit ) ;

Fix:
subscriptionPolicy . setDescription ( subPolicyDecs [ i ] ) ;