You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@phoenix.apache.org by st...@apache.org on 2024/10/01 10:33:11 UTC
(phoenix-omid) branch master updated: OMID-263 Remove usage of TrustedPrefixesTagInspector as this will be dropped in Snakeyaml 2.2 (#162)
This is an automated email from the ASF dual-hosted git repository.
stoty pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/phoenix-omid.git
The following commit(s) were added to refs/heads/master by this push:
new 79d03b0f OMID-263 Remove usage of TrustedPrefixesTagInspector as this will be dropped in Snakeyaml 2.2 (#162)
79d03b0f is described below
commit 79d03b0f73f30277d7d61a1bf542f03cc330f39b
Author: Nikita Pande <37...@users.noreply.github.com>
AuthorDate: Tue Oct 1 16:03:06 2024 +0530
OMID-263 Remove usage of TrustedPrefixesTagInspector as this will be dropped in Snakeyaml 2.2 (#162)
---
common/src/main/java/org/apache/omid/YAMLUtils.java | 3 +--
pom.xml | 2 +-
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/common/src/main/java/org/apache/omid/YAMLUtils.java b/common/src/main/java/org/apache/omid/YAMLUtils.java
index 08e84107..c4031ab6 100644
--- a/common/src/main/java/org/apache/omid/YAMLUtils.java
+++ b/common/src/main/java/org/apache/omid/YAMLUtils.java
@@ -24,7 +24,6 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.yaml.snakeyaml.LoaderOptions;
import org.yaml.snakeyaml.Yaml;
-import org.yaml.snakeyaml.inspector.TrustedPrefixesTagInspector;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
@@ -79,7 +78,7 @@ public class YAMLUtils {
public Map loadStringAsMap(String content) {
try {
LoaderOptions options = new LoaderOptions();
- options.setTagInspector(new TrustedPrefixesTagInspector(Collections.singletonList("org.apache.omid")));
+ options.setTagInspector(tagInspector -> tagInspector.getClassName().startsWith("org.apache.omid"));
Yaml yaml = new Yaml(options);
Map settings = yaml.loadAs(content, Map.class);
return (settings != null) ? settings : new HashMap(0);
diff --git a/pom.xml b/pom.xml
index a2cd36b9..cb7565c8 100644
--- a/pom.xml
+++ b/pom.xml
@@ -174,7 +174,7 @@
<guava.version>32.1.3-jre</guava.version>
<!-- 2.12+ shades guava -->
<curator.version>5.6.0</curator.version>
- <snakeyaml.version>2.0</snakeyaml.version>
+ <snakeyaml.version>2.2</snakeyaml.version>
<beanutils.version>1.9.4</beanutils.version>
<commons-io.version>2.11.0</commons-io.version>
<commons-pool2.version>2.4.2</commons-pool2.version>