mirror of
https://github.com/revanced/Apktool.git
synced 2024-12-11 13:27:47 +01:00
Deprecated SnakeYAML methods (#3079)
I replaced the deprecated methods in SnakeYAML 1.33 with the respective non-deprecated constructor calls. These are equivalent: The deprecated non-arg constructor of Constructor https://bitbucket.org/snakeyaml/snakeyaml/src/snakeyaml-1.33/src/main/java/org/yaml/snakeyaml/constructor/Constructor.java calls7f5106920d/src/main/java/org/yaml/snakeyaml/constructor/SafeConstructor.java (lines-52)
, which uses a new empty LoaderOptions() Similarly, SafeRepresenter7f5106920d/src/main/java/org/yaml/snakeyaml/representer/SafeRepresenter.java (lines-54)
uses a new empty DumperOptions.
This commit is contained in:
parent
e53869ceba
commit
636b1a128e
@ -19,6 +19,7 @@ package brut.androlib.meta;
|
||||
import org.yaml.snakeyaml.constructor.AbstractConstruct;
|
||||
import org.yaml.snakeyaml.constructor.Constructor;
|
||||
import org.yaml.snakeyaml.error.YAMLException;
|
||||
import org.yaml.snakeyaml.LoaderOptions;
|
||||
import org.yaml.snakeyaml.nodes.Node;
|
||||
import org.yaml.snakeyaml.nodes.ScalarNode;
|
||||
import org.yaml.snakeyaml.nodes.Tag;
|
||||
@ -29,6 +30,7 @@ public class ClassSafeConstructor extends Constructor {
|
||||
protected final List<Class<?>> allowableClasses = new ArrayList<>();
|
||||
|
||||
public ClassSafeConstructor() {
|
||||
super(new LoaderOptions());
|
||||
this.yamlConstructors.put(Tag.STR, new ConstructStringEx());
|
||||
|
||||
this.allowableClasses.add(MetaInfo.class);
|
||||
|
@ -16,11 +16,13 @@
|
||||
*/
|
||||
package brut.androlib.meta;
|
||||
|
||||
import org.yaml.snakeyaml.DumperOptions;
|
||||
import org.yaml.snakeyaml.nodes.Node;
|
||||
import org.yaml.snakeyaml.representer.Representer;
|
||||
|
||||
public class EscapedStringRepresenter extends Representer {
|
||||
public EscapedStringRepresenter() {
|
||||
super(new DumperOptions());
|
||||
RepresentStringEx representStringEx = new RepresentStringEx();
|
||||
multiRepresenters.put(String.class, representStringEx);
|
||||
representers.put(String.class, representStringEx);
|
||||
|
Loading…
Reference in New Issue
Block a user