This is an automated email from the ASF dual-hosted git repository.

emaynard pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/polaris.git


The following commit(s) were added to refs/heads/main by this push:
     new f9f197ff9 Fix compile warning: [unchecked] unchecked cast (#1544)
f9f197ff9 is described below

commit f9f197ff9388756a95a02d26268b12627f192977
Author: Dmitri Bourlatchkov <[email protected]>
AuthorDate: Wed May 7 20:47:19 2025 -0400

    Fix compile warning: [unchecked] unchecked cast (#1544)
    
    Use `Class.cast()` instead of implicit cast.
---
 .../org/apache/polaris/service/events/TestPolarisEventListener.java    | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git 
a/service/common/src/main/java/org/apache/polaris/service/events/TestPolarisEventListener.java
 
b/service/common/src/main/java/org/apache/polaris/service/events/TestPolarisEventListener.java
index 668edc7fa..2e2538e89 100644
--- 
a/service/common/src/main/java/org/apache/polaris/service/events/TestPolarisEventListener.java
+++ 
b/service/common/src/main/java/org/apache/polaris/service/events/TestPolarisEventListener.java
@@ -31,7 +31,8 @@ public class TestPolarisEventListener extends 
PolarisEventListener {
   private final List<PolarisEvent> history = new ArrayList<>();
 
   public <T> T getLatest(Class<T> type) {
-    return (T) 
Streams.findLast(history.stream().filter(type::isInstance)).orElseThrow();
+    return (T)
+        
Streams.findLast(history.stream().filter(type::isInstance)).map(type::cast).orElseThrow();
   }
 
   @Override

Reply via email to