mirror of https://github.com/apache/cassandra
switch to SafeConstructor
Patch by brandonwilliams; reviewed by bereng for CASSANDRA-18150
This commit is contained in:
parent
357c0d5a89
commit
e7f55ab8c3
|
|
@ -1,4 +1,5 @@
|
|||
3.0.29
|
||||
* Switch to snakeyaml's SafeConstructor (CASSANDRA-18150)
|
||||
* Expand build.dir property in rat targets (CASSANDRA-18183)
|
||||
* Suppress CVE-2022-41881 (CASSANDRA-18148)
|
||||
* Default role is created with zero timestamp (CASSANDRA-12525)
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ import org.apache.cassandra.exceptions.ConfigurationException;
|
|||
import org.yaml.snakeyaml.TypeDescription;
|
||||
import org.yaml.snakeyaml.Yaml;
|
||||
import org.yaml.snakeyaml.composer.Composer;
|
||||
import org.yaml.snakeyaml.constructor.Constructor;
|
||||
import org.yaml.snakeyaml.constructor.SafeConstructor;
|
||||
import org.yaml.snakeyaml.constructor.CustomClassLoaderConstructor;
|
||||
import org.yaml.snakeyaml.error.YAMLException;
|
||||
import org.yaml.snakeyaml.introspector.MissingProperty;
|
||||
|
|
@ -114,7 +114,7 @@ public class YamlConfigurationLoader implements ConfigurationLoader
|
|||
throw new AssertionError(e);
|
||||
}
|
||||
|
||||
Constructor constructor = new CustomConstructor(Config.class);
|
||||
SafeConstructor constructor = new CustomConstructor(Config.class);
|
||||
MissingPropertiesChecker propertiesChecker = new MissingPropertiesChecker();
|
||||
constructor.setPropertyUtils(propertiesChecker);
|
||||
Yaml yaml = new Yaml(constructor);
|
||||
|
|
@ -136,7 +136,7 @@ public class YamlConfigurationLoader implements ConfigurationLoader
|
|||
@SuppressWarnings("unchecked") //getSingleData returns Object, not T
|
||||
public static <T> T fromMap(Map<String,Object> map, boolean shouldCheck, Class<T> klass)
|
||||
{
|
||||
Constructor constructor = new YamlConfigurationLoader.CustomConstructor(klass, klass.getClassLoader());
|
||||
SafeConstructor constructor = new YamlConfigurationLoader.CustomConstructor(klass, klass.getClassLoader());
|
||||
YamlConfigurationLoader.MissingPropertiesChecker propertiesChecker = new YamlConfigurationLoader.MissingPropertiesChecker();
|
||||
constructor.setPropertyUtils(propertiesChecker);
|
||||
Yaml yaml = new Yaml(constructor);
|
||||
|
|
|
|||
Loading…
Reference in New Issue