Source:
<code>private void addCategories(final Contentlet contentlet, final Map<String, Object> map, final Set<TransformOptions> options, final User user) { final boolean allCategoriesInfo = options.contains(CATEGORIES_INFO); final boolean includeCategoryName = options.contains(CATEGORIES_NAME); if (includeCategoryName || allCategoriesInfo) { try { <START> final List<Category> cats = toolBox.categoryAPI.getParents(contentlet, user, true); <END> final List<CategoryField> categoryFields = contentlet.getContentType() .fields(CategoryField.class).stream().filter(Objects::nonNull) .map(CategoryField.class::cast).collect(Collectors.toList()); for (final CategoryField categoryField : categoryFields) { final Category parentCategory = toolBox.categoryAPI .find(categoryField.values(), user, true); final List<Category> childCategories = new ArrayList<>(); if (parentCategory != null) { for (final Category category : cats) { if (toolBox.categoryAPI .isParent(category, parentCategory, user, true)) { childCategories.add(category); } } } if (!childCategories.isEmpty()) { final List categoriesValue; if (allCategoriesInfo) { categoriesValue = childCategories.stream() .map(Category::getMap) .collect(Collectors.toList()); } else { categoriesValue = childCategories.stream().map(category -> ImmutableMap .of(category.getKey(), category.getCategoryName())) .collect(Collectors.toList()); } map.put(categoryField.variable(), categoriesValue); } } } catch (DotDataException | DotSecurityException e) { Logger.warn(DefaultTransformStrategy.class, "Unable to get categories from content with id "); } } }</code><technical_language>rename categories</technical_language>

Target:
private void addCategories(final Contentlet contentlet, final Map<String, Object> map, final Set<TransformOptions> options, final User user) { final boolean allCategoriesInfo = options.contains(CATEGORIES_INFO); final boolean includeCategoryName = options.contains(CATEGORIES_NAME); if (includeCategoryName || allCategoriesInfo) { try { final List<Category> categories = toolBox.categoryAPI.getParents(contentlet, user, true); final List<CategoryField> categoryFields = contentlet.getContentType() .fields(CategoryField.class).stream().filter(Objects::nonNull) .map(CategoryField.class::cast).collect(Collectors.toList()); for (final CategoryField categoryField : categoryFields) { final Category parentCategory = toolBox.categoryAPI .find(categoryField.values(), user, true); final List<Category> childCategories = new ArrayList<>(); if (parentCategory != null) { for (final Category category : categories) { if (toolBox.categoryAPI .isParent(category, parentCategory, user, true)) { childCategories.add(category); } } } if (!childCategories.isEmpty()) { final List categoriesValue; if (allCategoriesInfo) { categoriesValue = childCategories.stream() .map(Category::getMap) .collect(Collectors.toList()); } else { categoriesValue = childCategories.stream().map(category -> ImmutableMap .of(category.getKey(), category.getCategoryName())) .collect(Collectors.toList()); } map.put(categoryField.variable(), categoriesValue); } } } catch (DotDataException | DotSecurityException e) { Logger.warn(DefaultTransformStrategy.class, "Unable to get categories from content with id "); } } }