Skip to content

Commit

Permalink
Fix remaining location case
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Feb 15, 2024
1 parent 0e1e55a commit 411b566
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
13 changes: 7 additions & 6 deletions src/main/java/com/fasterxml/jackson/core/base/ParserBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -1373,16 +1373,17 @@ protected char _handleUnrecognizedCharacterEscape(char ch) throws JsonProcessing
if (ch == '\'' && isEnabled(Feature.ALLOW_SINGLE_QUOTES)) {
return ch;
}
_reportError("Unrecognized character escape "+_getCharDesc(ch));
return ch;
throw _constructReadException("Unrecognized character escape "+_getCharDesc(ch),
_currentLocationMinusOne());
}

protected void _reportMismatchedEndMarker(int actCh, char expCh) throws JsonParseException {
JsonReadContext ctxt = getParsingContext();
_reportError(String.format(
final JsonReadContext ctxt = getParsingContext();
final String msg = String.format(
"Unexpected close marker '%s': expected '%c' (for %s starting at %s)",
(char) actCh, expCh, ctxt.typeDesc(),
ctxt.startLocation(_contentReference())));
ctxt.startLocation(_contentReference()));
throw _constructReadException(msg, _currentLocationMinusOne());
}

/**
Expand All @@ -1402,7 +1403,7 @@ protected void _throwUnquotedSpace(int i, String ctxtDesc) throws JsonParseExcep
if (!isEnabled(Feature.ALLOW_UNQUOTED_CONTROL_CHARS) || i > INT_SPACE) {
char c = (char) i;
String msg = "Illegal unquoted character ("+_getCharDesc(c)+"): has to be escaped using backslash to be included in "+ctxtDesc;
_reportError(msg);
throw _constructReadException(msg, _currentLocationMinusOne());
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.fasterxml.jackson.failing;
package com.fasterxml.jackson.core.read.loc;

import java.io.*;
import java.nio.charset.StandardCharsets;
Expand Down

0 comments on commit 411b566

Please sign in to comment.