@@ -133,9 +133,9 @@ public JsonNode fromReader(final Reader r)
133
133
private static JsonNode readNode (final MappingIterator <JsonNode > iterator )
134
134
throws IOException
135
135
{
136
- final Object source = iterator .getParser (). getInputSource ();
136
+ final JsonParser parser = iterator .getParser ();
137
137
final JsonParseExceptionBuilder builder
138
- = new JsonParseExceptionBuilder (source );
138
+ = new JsonParseExceptionBuilder (parser );
139
139
140
140
builder .setMessage (BUNDLE .getMessage ("read.noContent" ));
141
141
@@ -160,13 +160,15 @@ private static JsonNode readNode(final MappingIterator<JsonNode> iterator)
160
160
private static final class JsonParseExceptionBuilder
161
161
implements Builder <JsonParseException >
162
162
{
163
+ private JsonParser parser ;
163
164
private String message = "" ;
164
165
private JsonLocation location ;
165
166
166
- private JsonParseExceptionBuilder (@ Nonnull final Object source )
167
+ private JsonParseExceptionBuilder (@ Nonnull final JsonParser parser )
167
168
{
168
- BUNDLE .checkNotNull (source , "read.nullArgument" );
169
- location = new JsonLocation (source , 0L , 1 , 1 );
169
+ BUNDLE .checkNotNull (parser , "read.nullArgument" );
170
+ this .parser = parser ;
171
+ location = parser .getCurrentLocation ();
170
172
}
171
173
172
174
private JsonParseExceptionBuilder setMessage (
@@ -186,7 +188,7 @@ private JsonParseExceptionBuilder setLocation(
186
188
@ Override
187
189
public JsonParseException build ()
188
190
{
189
- return new JsonParseException (message , location );
191
+ return new JsonParseException (parser , message , location );
190
192
}
191
193
}
192
194
}
0 commit comments