diff --git a/release-notes/VERSION b/release-notes/VERSION index a2fbd43..a2632e2 100644 --- a/release-notes/VERSION +++ b/release-notes/VERSION @@ -14,6 +14,8 @@ Not yet released (contributed by @winfriedgerlach) #29: Cleanup: reorder modifiers to comply with JLS; remove redundant casts (contributed by @winfriedgerlach) +#33: `ArrayDecoders` can run into `ArrayIndexOutOfBoundsException` when start != 0 + (contributed by @winfriedgerlach) - Use Maven wrapper for builds - Update parent (oss-parent) 55->68 diff --git a/src/main/java/org/codehaus/stax2/ri/typed/ValueDecoderFactory.java b/src/main/java/org/codehaus/stax2/ri/typed/ValueDecoderFactory.java index 3f483ce..7054ae7 100644 --- a/src/main/java/org/codehaus/stax2/ri/typed/ValueDecoderFactory.java +++ b/src/main/java/org/codehaus/stax2/ri/typed/ValueDecoderFactory.java @@ -428,7 +428,7 @@ protected static final int parseInt(int num, String digitChars, int start, int e num = (num * 10) + (digitChars.charAt(start) - '0'); } } - } + } } } } @@ -1255,7 +1255,7 @@ public void expand() int oldLen = old.length; int newSize = calcNewSize(oldLen); mResult = new int[newSize]; - System.arraycopy(old, mStart, mResult, 0, oldLen); + System.arraycopy(old, mStart, mResult, 0, mCount); mStart = 0; mEnd = newSize; } @@ -1315,7 +1315,7 @@ public void expand() int oldLen = old.length; int newSize = calcNewSize(oldLen); mResult = new long[newSize]; - System.arraycopy(old, mStart, mResult, 0, oldLen); + System.arraycopy(old, mStart, mResult, 0, mCount); mStart = 0; mEnd = newSize; } @@ -1373,7 +1373,7 @@ public void expand() int oldLen = old.length; int newSize = calcNewSize(oldLen); mResult = new float[newSize]; - System.arraycopy(old, mStart, mResult, 0, oldLen); + System.arraycopy(old, mStart, mResult, 0, mCount); mStart = 0; mEnd = newSize; } @@ -1431,7 +1431,7 @@ public void expand() int oldLen = old.length; int newSize = calcNewSize(oldLen); mResult = new double[newSize]; - System.arraycopy(old, mStart, mResult, 0, oldLen); + System.arraycopy(old, mStart, mResult, 0, mCount); mStart = 0; mEnd = newSize; }