Skip to content

Commit

Permalink
refact: replace org.snakeyaml 2.2 with org.snakeyaml.engine 2.7
Browse files Browse the repository at this point in the history
  • Loading branch information
sebthom committed Nov 14, 2023
1 parent 4a835bb commit 10d7fef
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion org.eclipse.tm4e.core/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Require-Bundle: com.google.gson;bundle-version="[2.10.1,3.0.0)",
org.apache.batik.util;bundle-version="[1.16.0,2.0.0)";resolution:=optional,
org.jcodings;bundle-version="[1.0.58,2.0.0)",
org.joni;bundle-version="[2.2.1,3.0.0)",
org.yaml.snakeyaml;bundle-version="[2.2.0,3.0.0)"
org.snakeyaml.engine;bundle-version="[2.7.0,3.0.0)"
Import-Package: org.w3c.css.sac;resolution:=optional,
org.w3c.css.sac.helpers;resolution:=optional,
org.w3c.dom.css
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
import java.util.Map;
import java.util.Map.Entry;

import org.snakeyaml.engine.v2.api.Load;
import org.snakeyaml.engine.v2.api.LoadSettings;
import org.xml.sax.SAXException;
import org.yaml.snakeyaml.Yaml;
import org.yaml.snakeyaml.error.YAMLException;

/**
* Parses TextMate Grammar file in YAML format.
Expand Down Expand Up @@ -77,11 +77,13 @@ private void addStringToPList(final PListContentHandler<T> pList, final String v
pList.endElement(null, "string", null);
}

@SuppressWarnings("unchecked")
@Override
public T parse(final Reader contents) throws SAXException, YAMLException {
public T parse(final Reader contents) throws SAXException {
final var yamlLoader = new Load(LoadSettings.builder().build());
final var pList = new PListContentHandler<T>(objectFactory);
pList.startElement(null, "plist", null, null);
addMapToPList(pList, new Yaml().loadAs(contents, Map.class));
addMapToPList(pList, (Map<String, Object>) yamlLoader.loadFromReader(contents));
pList.endElement(null, "plist", null);
return pList.getResult();
}
Expand Down
2 changes: 1 addition & 1 deletion org.eclipse.tm4e.repository/category.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<bundle id="org.joni" version="0.0.0">
<category name="Dependencies"/>
</bundle>
<bundle id="org.yaml.snakeyaml" version="0.0.0">
<bundle id="org.snakeyaml.engine" version="0.0.0">
<category name="Dependencies"/>
</bundle>
<category-def name="TextMate" label="TextMate"/>
Expand Down
6 changes: 3 additions & 3 deletions target-platform/tm4e-target.target
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
<location includeDependencyDepth="direct" includeDependencyScopes="compile" includeSource="true" missingManifest="generate" type="Maven">
<dependencies>
<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
<version>2.2</version>
<groupId>org.snakeyaml</groupId>
<artifactId>snakeyaml-engine</artifactId>
<version>2.7</version>
<type>jar</type>
</dependency>
</dependencies>
Expand Down

0 comments on commit 10d7fef

Please sign in to comment.