Skip to content

Commit 6f847d6

Browse files
author
Yegor Borovikov
committed
Fix FasterXML#81 (update snakeyaml version to 1.21)
1 parent 48d14af commit 6f847d6

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

yaml/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
<dependency>
3131
<groupId>org.yaml</groupId>
3232
<artifactId>snakeyaml</artifactId>
33-
<version>1.19</version>
33+
<version>1.21</version>
3434
</dependency>
3535

3636
<!-- and for testing need annotations -->

yaml/src/main/java/com/fasterxml/jackson/dataformat/yaml/YAMLGenerator.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
import org.yaml.snakeyaml.DumperOptions;
1212
import org.yaml.snakeyaml.DumperOptions.FlowStyle;
13+
import org.yaml.snakeyaml.DumperOptions.ScalarStyle;
1314
import org.yaml.snakeyaml.emitter.Emitter;
1415
import org.yaml.snakeyaml.events.*;
1516
import org.yaml.snakeyaml.nodes.Tag;
@@ -173,7 +174,7 @@ private Feature(boolean defaultState) {
173174

174175
// Which flow style to use for Base64? Maybe basic quoted?
175176
// 29-Nov-2017, tatu: Actually SnakeYAML uses block style so:
176-
private final static Character STYLE_BASE64 = STYLE_LITERAL;
177+
private final static ScalarStyle STYLE_BASE64 = ScalarStyle.createStyle(STYLE_LITERAL);
177178

178179
private final static Character STYLE_PLAIN = null;
179180

@@ -428,7 +429,7 @@ public final void writeStartArray() throws IOException
428429
{
429430
_verifyValueWrite("start an array");
430431
_outputContext = _outputContext.createChildArrayContext();
431-
Boolean style = _outputOptions.getDefaultFlowStyle().getStyleBoolean();
432+
FlowStyle style = _outputOptions.getDefaultFlowStyle();
432433
String yamlTag = _typeId;
433434
boolean implicit = (yamlTag == null);
434435
String anchor = _objectId;
@@ -456,7 +457,7 @@ public final void writeStartObject() throws IOException
456457
{
457458
_verifyValueWrite("start an object");
458459
_outputContext = _outputContext.createChildObjectContext();
459-
Boolean style = _outputOptions.getDefaultFlowStyle().getStyleBoolean();
460+
FlowStyle style = _outputOptions.getDefaultFlowStyle();
460461
String yamlTag = _typeId;
461462
boolean implicit = (yamlTag == null);
462463
String anchor = _objectId;
@@ -799,6 +800,6 @@ protected ScalarEvent _scalarEvent(String value, Character style)
799800
// 29-Nov-2017, tatu: Not 100% sure why we don't force explicit tags for
800801
// type id, but trying to do so seems to double up tag output...
801802
return new ScalarEvent(anchor, yamlTag, NO_TAGS, value,
802-
null, null, style);
803+
null, null, ScalarStyle.createStyle(style));
803804
}
804805
}

0 commit comments

Comments
 (0)