This is an automated email from the ASF dual-hosted git repository.
albumenj pushed a commit to branch 3.3
in repository https://gitbox.apache.org/repos/asf/dubbo.git
The following commit(s) were added to refs/heads/3.3 by this push:
new 0fa88a1180 Fix compilation error of YamlCodec in jdk1.8 (#13791)
0fa88a1180 is described below
commit 0fa88a118076f51d9b693cd5ad740898a8081bea
Author: Sean Yang <[email protected]>
AuthorDate: Mon Feb 26 16:39:14 2024 +0800
Fix compilation error of YamlCodec in jdk1.8 (#13791)
---
.../org/apache/dubbo/remoting/http12/message/codec/YamlCodec.java | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git
a/dubbo-remoting/dubbo-remoting-http12/src/main/java/org/apache/dubbo/remoting/http12/message/codec/YamlCodec.java
b/dubbo-remoting/dubbo-remoting-http12/src/main/java/org/apache/dubbo/remoting/http12/message/codec/YamlCodec.java
index 2b3aacfb5c..30380eb159 100644
---
a/dubbo-remoting/dubbo-remoting-http12/src/main/java/org/apache/dubbo/remoting/http12/message/codec/YamlCodec.java
+++
b/dubbo-remoting/dubbo-remoting-http12/src/main/java/org/apache/dubbo/remoting/http12/message/codec/YamlCodec.java
@@ -36,12 +36,13 @@ import org.yaml.snakeyaml.Yaml;
import org.yaml.snakeyaml.constructor.Constructor;
import org.yaml.snakeyaml.representer.Representer;
+@SuppressWarnings({"unchecked", "rawtypes"})
public class YamlCodec implements HttpMessageCodec {
@Override
public Object decode(InputStream is, Class<?> targetType, Charset charset)
throws DecodeException {
try (InputStreamReader reader = new InputStreamReader(is, charset)) {
- return createYaml().loadAs(reader, targetType);
+ return createYaml().loadAs(reader, (Class) targetType);
} catch (Throwable t) {
throw new DecodeException("Error decoding yaml", t);
}
@@ -57,7 +58,7 @@ public class YamlCodec implements HttpMessageCodec {
for (int i = 0; i < len; i++) {
if (iterator.hasNext()) {
Object result = iterator.next();
- Class<?> targetType = targetTypes[i];
+ Class targetType = targetTypes[i];
if (targetType.isInstance(result)) {
results[i] = result;
} else {