shunping commented on code in PR #30317:
URL: https://github.com/apache/beam/pull/30317#discussion_r1492733026
##########
sdks/java/harness/src/main/java/org/apache/beam/fn/harness/state/FnApiStateAccessor.java:
##########
@@ -169,6 +172,7 @@ public ResultT get() {
}
@Override
+ @SuppressWarnings("unchecked")
Review Comment:
I got warning message on each of these binding functions. For example in the
code I wrote
https://github.com/apache/beam/blob/5d7cd5e2e2e6b966ddb47cd78135b58013622d23/sdks/java/harness/src/main/java/org/apache/beam/fn/harness/state/FnApiStateAccessor.java#L612
the warning message is as follows:
```
Unchecked cast: 'java.lang.Object' to
'org.apache.beam.sdk.state.OrderedListState<T>'
Inspection info: Reports code on which an unchecked warning will be issued
by the javac compiler. Every unchecked warning may potentially trigger
ClassCastException at runtime
```
Basically, the compiler complains that we convert an object (from the state
key cache) into the state class we bind.
--
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]