Skip to content

Commit

Permalink
Fix build compatibility with JDK 8
Browse files Browse the repository at this point in the history
  • Loading branch information
ilgrosso committed Dec 6, 2024
1 parent 2163398 commit ec85f70
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import com.google.common.escape.Escaper;
import com.google.common.escape.Escapers;
import java.io.IOException;
import java.util.Collections;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
Expand Down Expand Up @@ -351,13 +352,13 @@ public Set<String> handleResult(final Directory.Groups.Aliases.List request, fin
return Optional.ofNullable(value.getAliases()).map(aliases -> aliases.stream().
map(map -> ((Map<String, String>) map).get(GoogleAppsUtil.ALIAS_ATTR)).
filter(Objects::nonNull).collect(Collectors.toSet())).
orElse(Set.of());
orElse(Collections.emptySet());
}

@Override
public Set<String> handleError(final Throwable e) {
LOG.error(e, "While getting aliases for {0}", groupKey);
return Set.of();
return Collections.emptySet();
}
});
} catch (IOException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
import java.io.IOException;
import java.util.Base64;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -988,13 +989,13 @@ public Set<String> handleResult(final Directory.Users.Aliases.List request, fina
return Optional.ofNullable(value.getAliases()).map(aliases -> aliases.stream().
map(map -> ((Map<String, String>) map).get(GoogleAppsUtil.ALIAS_ATTR)).
filter(Objects::nonNull).collect(Collectors.toSet())).
orElse(Set.of());
orElse(Collections.emptySet());
}

@Override
public Set<String> handleError(final Throwable e) {
LOG.error(e, "While getting aliases for {0}", userKey);
return Set.of();
return Collections.emptySet();
}
});
} catch (IOException e) {
Expand Down

0 comments on commit ec85f70

Please sign in to comment.