Source:
<code>public BillingEventSet getBillingEventsForAccountAndUpdateAccountBCD(final UUID accountId, final DryRunArguments dryRunArguments, final InternalCallContext context) throws CatalogApiException, AccountApiException, SubscriptionBaseApiException { final Catalog currentCatalog = catalogInternalApi.getFullCatalog(true, true, context); <START> final List<Tag> tags = tagApi.getTagsForAccountId(false, context); <END> final List<Tag> accountTags = getTagsForObjectType(ObjectType.ACCOUNT, tags); final boolean found_AUTO_INVOICING_OFF = is_AUTO_INVOICING_OFF(accountTags); final boolean found_INVOICING_DRAFT = is_AUTO_INVOICING_DRAFT(accountTags); final boolean found_INVOICING_REUSE_DRAFT = is_AUTO_INVOICING_REUSE_DRAFT(accountTags); final Set<UUID> skippedSubscriptions = new HashSet<UUID>(); final DefaultBillingEventSet result; if (found_AUTO_INVOICING_OFF) { result = new DefaultBillingEventSet(true, found_INVOICING_DRAFT, found_INVOICING_REUSE_DRAFT); } else { final List<SubscriptionBaseBundle> bundles = subscriptionApi.getBundlesForAccount(accountId, context); final ImmutableAccountData account = accountApi.getImmutableAccountDataById(accountId, context); result = new DefaultBillingEventSet(false, found_INVOICING_DRAFT, found_INVOICING_REUSE_DRAFT); addBillingEventsForBundles(bundles, account, dryRunArguments, context, result, skippedSubscriptions, currentCatalog, tags); } if (result.isEmpty()) { log.info("No billing event for accountId='{}'", accountId); return result; } final StringBuilder logStringBuilder = new StringBuilder("Computed billing events for accountId='").append(accountId).append("'"); eventsToString(logStringBuilder, result); if (blockCalculator.insertBlockingEvents(result, skippedSubscriptions, currentCatalog, context)) { logStringBuilder.append("\nBilling Events After Blocking"); eventsToString(logStringBuilder, result); } log.info(logStringBuilder.toString()); return result; }</code><technical_language>rename variable tags (in addBillingEventsForBundles) avoid confusion. tagsForAccount</technical_language>

Target:
public BillingEventSet getBillingEventsForAccountAndUpdateAccountBCD(final UUID accountId, final DryRunArguments dryRunArguments, final InternalCallContext context) throws CatalogApiException, AccountApiException, SubscriptionBaseApiException { final Catalog currentCatalog = catalogInternalApi.getFullCatalog(true, true, context); final List<Tag> tagsForAccount = tagApi.getTagsForAccount(false, context); final List<Tag> accountTags = getTagsForObjectType(ObjectType.ACCOUNT, tagsForAccount, null); final boolean found_AUTO_INVOICING_OFF = is_AUTO_INVOICING_OFF(accountTags); final boolean found_INVOICING_DRAFT = is_AUTO_INVOICING_DRAFT(accountTags); final boolean found_INVOICING_REUSE_DRAFT = is_AUTO_INVOICING_REUSE_DRAFT(accountTags); final Set<UUID> skippedSubscriptions = new HashSet<UUID>(); final DefaultBillingEventSet result; if (found_AUTO_INVOICING_OFF) { result = new DefaultBillingEventSet(true, found_INVOICING_DRAFT, found_INVOICING_REUSE_DRAFT); } else { final List<SubscriptionBaseBundle> bundles = subscriptionApi.getBundlesForAccount(accountId, context); final ImmutableAccountData account = accountApi.getImmutableAccountDataById(accountId, context); result = new DefaultBillingEventSet(false, found_INVOICING_DRAFT, found_INVOICING_REUSE_DRAFT); addBillingEventsForBundles(bundles, account, dryRunArguments, context, result, skippedSubscriptions, currentCatalog, tagsForAccount); } if (result.isEmpty()) { log.info("No billing event for accountId='{}'", accountId); return result; } final StringBuilder logStringBuilder = new StringBuilder("Computed billing events for accountId='").append(accountId).append("'"); eventsToString(logStringBuilder, result); if (blockCalculator.insertBlockingEvents(result, skippedSubscriptions, currentCatalog, context)) { logStringBuilder.append("\nBilling Events After Blocking"); eventsToString(logStringBuilder, result); } log.info(logStringBuilder.toString()); return result; }