diff --git a/src/main/java/com/fasterxml/jackson/databind/deser/std/ObjectArrayDeserializer.java b/src/main/java/com/fasterxml/jackson/databind/deser/std/ObjectArrayDeserializer.java index 45174c6718..49d447efd4 100644 --- a/src/main/java/com/fasterxml/jackson/databind/deser/std/ObjectArrayDeserializer.java +++ b/src/main/java/com/fasterxml/jackson/databind/deser/std/ObjectArrayDeserializer.java @@ -157,7 +157,7 @@ public Object[] deserialize(JsonParser jp, DeserializationContext ctxt) chunk[ix++] = value; } } catch (Exception e) { - throw JsonMappingException.wrapWithPath(e, chunk, ix); + throw JsonMappingException.wrapWithPath(e, chunk, buffer.bufferedSize() + ix); } Object[] result; diff --git a/src/main/java/com/fasterxml/jackson/databind/deser/std/PrimitiveArrayDeserializers.java b/src/main/java/com/fasterxml/jackson/databind/deser/std/PrimitiveArrayDeserializers.java index ea5ac60fcf..7ecdd90ec0 100644 --- a/src/main/java/com/fasterxml/jackson/databind/deser/std/PrimitiveArrayDeserializers.java +++ b/src/main/java/com/fasterxml/jackson/databind/deser/std/PrimitiveArrayDeserializers.java @@ -165,7 +165,7 @@ public boolean[] deserialize(JsonParser jp, DeserializationContext ctxt) chunk[ix++] = value; } } catch (Exception e) { - throw JsonMappingException.wrapWithPath(e, chunk, ix); + throw JsonMappingException.wrapWithPath(e, chunk, builder.bufferedSize() + ix); } return builder.completeAndClearBuffer(chunk, ix); } @@ -245,7 +245,7 @@ public byte[] deserialize(JsonParser jp, DeserializationContext ctxt) chunk[ix++] = value; } } catch (Exception e) { - throw JsonMappingException.wrapWithPath(e, chunk, ix); + throw JsonMappingException.wrapWithPath(e, chunk, builder.bufferedSize() + ix); } return builder.completeAndClearBuffer(chunk, ix); } @@ -308,7 +308,7 @@ public short[] deserialize(JsonParser jp, DeserializationContext ctxt) chunk[ix++] = value; } } catch (Exception e) { - throw JsonMappingException.wrapWithPath(e, chunk, ix); + throw JsonMappingException.wrapWithPath(e, chunk, builder.bufferedSize() + ix); } return builder.completeAndClearBuffer(chunk, ix); } @@ -362,7 +362,7 @@ public int[] deserialize(JsonParser jp, DeserializationContext ctxt) chunk[ix++] = value; } } catch (Exception e) { - throw JsonMappingException.wrapWithPath(e, chunk, ix); + throw JsonMappingException.wrapWithPath(e, chunk, builder.bufferedSize() + ix); } return builder.completeAndClearBuffer(chunk, ix); } @@ -415,7 +415,7 @@ public long[] deserialize(JsonParser jp, DeserializationContext ctxt) chunk[ix++] = value; } } catch (Exception e) { - throw JsonMappingException.wrapWithPath(e, chunk, ix); + throw JsonMappingException.wrapWithPath(e, chunk, builder.bufferedSize() + ix); } return builder.completeAndClearBuffer(chunk, ix); } @@ -467,7 +467,7 @@ public float[] deserialize(JsonParser jp, DeserializationContext ctxt) chunk[ix++] = value; } } catch (Exception e) { - throw JsonMappingException.wrapWithPath(e, chunk, ix); + throw JsonMappingException.wrapWithPath(e, chunk, builder.bufferedSize() + ix); } return builder.completeAndClearBuffer(chunk, ix); } @@ -518,7 +518,7 @@ public double[] deserialize(JsonParser jp, DeserializationContext ctxt) chunk[ix++] = value; } } catch (Exception e) { - throw JsonMappingException.wrapWithPath(e, chunk, ix); + throw JsonMappingException.wrapWithPath(e, chunk, builder.bufferedSize() + ix); } return builder.completeAndClearBuffer(chunk, ix); } diff --git a/src/main/java/com/fasterxml/jackson/databind/deser/std/StringArrayDeserializer.java b/src/main/java/com/fasterxml/jackson/databind/deser/std/StringArrayDeserializer.java index a4e08e4636..142eda3559 100644 --- a/src/main/java/com/fasterxml/jackson/databind/deser/std/StringArrayDeserializer.java +++ b/src/main/java/com/fasterxml/jackson/databind/deser/std/StringArrayDeserializer.java @@ -19,7 +19,7 @@ public final class StringArrayDeserializer extends StdDeserializer implements ContextualDeserializer { - private static final long serialVersionUID = -7589512013334920693L; + private static final long serialVersionUID = 1L; public final static StringArrayDeserializer instance = new StringArrayDeserializer(); @@ -74,7 +74,7 @@ public String[] deserialize(JsonParser jp, DeserializationContext ctxt) throws I chunk[ix++] = value; } } catch (Exception e) { - throw JsonMappingException.wrapWithPath(e, chunk, ix); + throw JsonMappingException.wrapWithPath(e, chunk, buffer.bufferedSize() + ix); } String[] result = buffer.completeAndClearBuffer(chunk, ix, String.class); ctxt.returnObjectBuffer(buffer); diff --git a/src/main/java/com/fasterxml/jackson/databind/util/PrimitiveArrayBuilder.java b/src/main/java/com/fasterxml/jackson/databind/util/PrimitiveArrayBuilder.java index 468f392370..69c902f9f9 100644 --- a/src/main/java/com/fasterxml/jackson/databind/util/PrimitiveArrayBuilder.java +++ b/src/main/java/com/fasterxml/jackson/databind/util/PrimitiveArrayBuilder.java @@ -50,6 +50,8 @@ protected PrimitiveArrayBuilder() { } /********************************************************** */ + public int bufferedSize() { return _bufferedEntryCount; } + public T resetAndStart() { _reset();