Skip to content

Commit

Permalink
style: edit code style
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelahojna committed Oct 6, 2022
1 parent 4b374e7 commit 3c6788b
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
Expand Down Expand Up @@ -404,11 +405,13 @@ private void addColumnNamesAndTags(@Nonnull final FluxTable table, @Nonnull fina
fluxColumn.setLabel(columnName);
}

HashSet<Object> seen = new HashSet<>();
columnNames.removeIf(seen::add);
Set<String> items = new HashSet<>();
Set<String> duplicates = columnNames.stream()
.filter(n -> !items.add(n))
.collect(Collectors.toSet());

if (!columnNames.isEmpty()) {
System.out.printf("The response contains columns with duplicated names: %s)%n", columnNames);
if (!duplicates.isEmpty()) {
System.out.printf("The response contains columns with duplicated names: %s)%n", duplicates);
System.out.println("You should use the \"FluxRecord.getRow()\" to access your data instead of "
+ "\"FluxRecord.getValues()\".");
}
Expand Down

0 comments on commit 3c6788b

Please sign in to comment.