Skip to content

Commit c6ea5e1

Browse files
committed
filter blank category before sort in order to enhance comparator method.
1 parent 4d8fb06 commit c6ea5e1

File tree

1 file changed

+2
-2
lines changed
  • PluginsAndFeatures/azure-toolkit-for-intellij/azure-sdk-reference-book/src/main/java/com/microsoft/azure/toolkit/intellij/azuresdk/referencebook

1 file changed

+2
-2
lines changed

PluginsAndFeatures/azure-toolkit-for-intellij/azure-sdk-reference-book/src/main/java/com/microsoft/azure/toolkit/intellij/azuresdk/referencebook/AzureSdkTreePanel.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,8 @@ private void loadData(final Map<String, List<AzureSdkCategoryEntity>> categoryTo
131131
final DefaultMutableTreeNode root = (DefaultMutableTreeNode) this.model.getRoot();
132132
root.removeAllChildren();
133133
final Map<String, AzureSdkServiceEntity> serviceMap = services.stream().collect(Collectors.toMap(e -> getServiceKeyByName(e.getName()), e -> e));
134-
final List<String> categories = categoryToServiceMap.keySet().stream().sorted((s1, s2) -> StringUtils.isAnyBlank(s1, s2) ||
135-
StringUtils.contains(s1, "Others") ? 1 : StringUtils.contains(s2, "Others") ? -1 : s1.compareTo(s2)).collect(Collectors.toList());
134+
final List<String> categories = categoryToServiceMap.keySet().stream().filter(StringUtils::isNotBlank).sorted(
135+
(s1, s2) -> StringUtils.contains(s1, "Others") ? 1 : StringUtils.contains(s2, "Others") ? -1 : s1.compareTo(s2)).collect(Collectors.toList());
136136
for (final String category : categories) {
137137
// no feature found for current category
138138
if (CollectionUtils.isEmpty(categoryToServiceMap.get(category)) ||

0 commit comments

Comments
 (0)