Abacn commented on code in PR #40090:
URL: https://github.com/apache/beam/pull/40090#discussion_r3990588754
##########
runners/spark/4/src/test/java/org/apache/beam/runners/spark/structuredstreaming/translation/streaming/StreamingTestUtils.java:
##########
@@ -77,13 +79,13 @@ private static void append(String collectorId, Object
value) {
/** Returns a snapshot of everything collected so far under {@code
collectorId}. */
@SuppressWarnings("unchecked")
- public static <T> List<T> getCollected(String collectorId) {
+ public static <T> Set<T> collected(String collectorId) {
List<Object> values = COLLECTORS.get(collectorId);
if (values == null) {
- return Collections.emptyList();
+ return Collections.emptySet();
}
synchronized (values) {
- return (List<T>) new ArrayList<>(values);
+ return (Set<T>) (Set<?>) new HashSet<>(values);
Review Comment:
redundant cast here.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]