Skip to content

Commit e88a87c

Browse files
committed
Yet more fixing for #506.. :)
1 parent 712905e commit e88a87c

File tree

4 files changed

+12
-10
lines changed

4 files changed

+12
-10
lines changed

src/main/java/com/fasterxml/jackson/databind/deser/std/ObjectArrayDeserializer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ public Object[] deserialize(JsonParser jp, DeserializationContext ctxt)
157157
chunk[ix++] = value;
158158
}
159159
} catch (Exception e) {
160-
throw JsonMappingException.wrapWithPath(e, chunk, ix);
160+
throw JsonMappingException.wrapWithPath(e, chunk, buffer.bufferedSize() + ix);
161161
}
162162

163163
Object[] result;

src/main/java/com/fasterxml/jackson/databind/deser/std/PrimitiveArrayDeserializers.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ public boolean[] deserialize(JsonParser jp, DeserializationContext ctxt)
165165
chunk[ix++] = value;
166166
}
167167
} catch (Exception e) {
168-
throw JsonMappingException.wrapWithPath(e, chunk, ix);
168+
throw JsonMappingException.wrapWithPath(e, chunk, builder.bufferedSize() + ix);
169169
}
170170
return builder.completeAndClearBuffer(chunk, ix);
171171
}
@@ -245,7 +245,7 @@ public byte[] deserialize(JsonParser jp, DeserializationContext ctxt)
245245
chunk[ix++] = value;
246246
}
247247
} catch (Exception e) {
248-
throw JsonMappingException.wrapWithPath(e, chunk, ix);
248+
throw JsonMappingException.wrapWithPath(e, chunk, builder.bufferedSize() + ix);
249249
}
250250
return builder.completeAndClearBuffer(chunk, ix);
251251
}
@@ -308,7 +308,7 @@ public short[] deserialize(JsonParser jp, DeserializationContext ctxt)
308308
chunk[ix++] = value;
309309
}
310310
} catch (Exception e) {
311-
throw JsonMappingException.wrapWithPath(e, chunk, ix);
311+
throw JsonMappingException.wrapWithPath(e, chunk, builder.bufferedSize() + ix);
312312
}
313313
return builder.completeAndClearBuffer(chunk, ix);
314314
}
@@ -362,7 +362,7 @@ public int[] deserialize(JsonParser jp, DeserializationContext ctxt)
362362
chunk[ix++] = value;
363363
}
364364
} catch (Exception e) {
365-
throw JsonMappingException.wrapWithPath(e, chunk, ix);
365+
throw JsonMappingException.wrapWithPath(e, chunk, builder.bufferedSize() + ix);
366366
}
367367
return builder.completeAndClearBuffer(chunk, ix);
368368
}
@@ -415,7 +415,7 @@ public long[] deserialize(JsonParser jp, DeserializationContext ctxt)
415415
chunk[ix++] = value;
416416
}
417417
} catch (Exception e) {
418-
throw JsonMappingException.wrapWithPath(e, chunk, ix);
418+
throw JsonMappingException.wrapWithPath(e, chunk, builder.bufferedSize() + ix);
419419
}
420420
return builder.completeAndClearBuffer(chunk, ix);
421421
}
@@ -467,7 +467,7 @@ public float[] deserialize(JsonParser jp, DeserializationContext ctxt)
467467
chunk[ix++] = value;
468468
}
469469
} catch (Exception e) {
470-
throw JsonMappingException.wrapWithPath(e, chunk, ix);
470+
throw JsonMappingException.wrapWithPath(e, chunk, builder.bufferedSize() + ix);
471471
}
472472
return builder.completeAndClearBuffer(chunk, ix);
473473
}
@@ -518,7 +518,7 @@ public double[] deserialize(JsonParser jp, DeserializationContext ctxt)
518518
chunk[ix++] = value;
519519
}
520520
} catch (Exception e) {
521-
throw JsonMappingException.wrapWithPath(e, chunk, ix);
521+
throw JsonMappingException.wrapWithPath(e, chunk, builder.bufferedSize() + ix);
522522
}
523523
return builder.completeAndClearBuffer(chunk, ix);
524524
}

src/main/java/com/fasterxml/jackson/databind/deser/std/StringArrayDeserializer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public final class StringArrayDeserializer
1919
extends StdDeserializer<String[]>
2020
implements ContextualDeserializer
2121
{
22-
private static final long serialVersionUID = -7589512013334920693L;
22+
private static final long serialVersionUID = 1L;
2323

2424
public final static StringArrayDeserializer instance = new StringArrayDeserializer();
2525

@@ -74,7 +74,7 @@ public String[] deserialize(JsonParser jp, DeserializationContext ctxt) throws I
7474
chunk[ix++] = value;
7575
}
7676
} catch (Exception e) {
77-
throw JsonMappingException.wrapWithPath(e, chunk, ix);
77+
throw JsonMappingException.wrapWithPath(e, chunk, buffer.bufferedSize() + ix);
7878
}
7979
String[] result = buffer.completeAndClearBuffer(chunk, ix, String.class);
8080
ctxt.returnObjectBuffer(buffer);

src/main/java/com/fasterxml/jackson/databind/util/PrimitiveArrayBuilder.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ protected PrimitiveArrayBuilder() { }
5050
/**********************************************************
5151
*/
5252

53+
public int bufferedSize() { return _bufferedEntryCount; }
54+
5355
public T resetAndStart()
5456
{
5557
_reset();

0 commit comments

Comments
 (0)