Skip to content
This repository was archived by the owner on Feb 12, 2022. It is now read-only.

Commit 5910aec

Browse files
author
pacafuentes
committed
Fix non printable test to be compatible in java11 and java8.
1 parent 873685e commit 5910aec

File tree

2 files changed

+4
-4
lines changed
  • raml-parser-2/src/test/resources/org/raml/v2/parser/unprintable-character
  • yagi/src/main/java/org/raml/yagi/framework/nodes/snakeyaml

2 files changed

+4
-4
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
ErrorNode: "Underlying error while parsing YAML syntax: 'special characters are not allowed around 'ow an error like:
2-
# {â[BAD: LATIN 1 SUPPLEMENT 80]'" (Start: -1 , End: -1)
1+
ErrorNode: "Underlying error while parsing YAML syntax: 'special characters are not allowed around: JS parser should show an error like:
2+
# {â[BAD: €]'" (Start: -1 , End: -1)

yagi/src/main/java/org/raml/yagi/framework/nodes/snakeyaml/NodeParser.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ public String getLastValidString()
148148
{
149149

150150

151-
for (char c : ("[BAD: " + Character.getName(this.lastBufferRead[i]) + "]").toCharArray())
151+
for (char c : ("[BAD: " + this.lastBufferRead[i] + "]").toCharArray())
152152
{
153153

154154
seen.add(c);
@@ -214,7 +214,7 @@ private static Node buildYamlErrorNode(MarkedYAMLException e, String resourcePat
214214
private static Node buildYamlErrorNode(ReaderException e, SmartReader reader)
215215
{
216216

217-
final ErrorNode errorNode = new ErrorNode("Underlying error while parsing YAML syntax: '" + e.getMessage() + " around '" + reader.getLastValidString() + "'");
217+
final ErrorNode errorNode = new ErrorNode("Underlying error while parsing YAML syntax: '" + e.getMessage() + " around: " + reader.getLastValidString() + "'");
218218
// errorNode.setStartPosition(new DefaultPosition(e.getPosition(), 0, 0, resourcePath, new DefaultResourceLoader()));
219219
// errorNode.setEndPosition(new DefaultPosition(e.getPosition() + 1, 0,0, resourcePath, new DefaultResourceLoader()));
220220
return errorNode;

0 commit comments

Comments
 (0)