Skip to content

Commit

Permalink
Merge pull request #464 from rdulmina/master
Browse files Browse the repository at this point in the history
Fix the build after snakeyaml upgrade to 2.0
  • Loading branch information
keizer619 authored Jul 27, 2023
2 parents 64564ee + 08213f3 commit 35dcde4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.yaml.snakeyaml.LoaderOptions;
import org.yaml.snakeyaml.Yaml;
import org.yaml.snakeyaml.constructor.CustomClassLoaderConstructor;
import org.yaml.snakeyaml.introspector.BeanAccess;
Expand Down Expand Up @@ -80,7 +81,8 @@ public TransportsConfiguration getConfiguration(String configFileLocation) {
if (file.exists()) {
try (Reader in = new InputStreamReader(new FileInputStream(file), StandardCharsets.ISO_8859_1)) {
Yaml yaml = new Yaml(new CustomClassLoaderConstructor
(TransportsConfiguration.class, TransportsConfiguration.class.getClassLoader()));
(TransportsConfiguration.class, TransportsConfiguration.class.getClassLoader(),
new LoaderOptions()));
yaml.setBeanAccess(BeanAccess.FIELD);
transportsConfiguration = yaml.loadAs(in, TransportsConfiguration.class);
} catch (IOException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
import org.wso2.transport.http.netty.util.server.HttpServer;
import org.wso2.transport.http.netty.util.server.HttpsServer;
import org.wso2.transport.http.netty.util.server.ServerThread;
import org.yaml.snakeyaml.LoaderOptions;
import org.yaml.snakeyaml.Yaml;
import org.yaml.snakeyaml.constructor.CustomClassLoaderConstructor;
import org.yaml.snakeyaml.introspector.BeanAccess;
Expand Down Expand Up @@ -221,7 +222,7 @@ public static TransportsConfiguration getConfiguration(String configFileLocation
try (Reader in = new InputStreamReader(new FileInputStream(file), StandardCharsets.ISO_8859_1)) {
Yaml yaml = new Yaml(new CustomClassLoaderConstructor
(TransportsConfiguration.class,
TransportsConfiguration.class.getClassLoader()));
TransportsConfiguration.class.getClassLoader(), new LoaderOptions()));
yaml.setBeanAccess(BeanAccess.FIELD);
transportsConfiguration = yaml.loadAs(in, TransportsConfiguration.class);
} catch (IOException e) {
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<groupId>org.wso2</groupId>
<artifactId>wso2</artifactId>
<version>5</version>
<version>5.1</version>
</parent>
<packaging>pom</packaging>
<groupId>org.wso2.transport.http</groupId>
Expand Down

0 comments on commit 35dcde4

Please sign in to comment.