diff src/org/tmatesoft/hg/internal/Patch.java @ 530:0f6fa88e2162

Towards commit command: refactor clone, extract pieces to reuse. Describe a defect discovered when bundle has few patches with 0,0 parents
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Wed, 23 Jan 2013 17:46:12 +0100
parents 6c22bdc0bdfd
children 688c1ab113bb
line wrap: on
line diff
--- a/src/org/tmatesoft/hg/internal/Patch.java	Mon Jan 21 19:41:51 2013 +0100
+++ b/src/org/tmatesoft/hg/internal/Patch.java	Wed Jan 23 17:46:12 2013 +0100
@@ -114,7 +114,11 @@
 			destIndex += start - prevEnd;
 			// insert new data from the patch, if any
 			byte[] d = data.get(i);
-			System.arraycopy(d, 0, rv, destIndex, d.length);
+			try {
+				System.arraycopy(d, 0, rv, destIndex, d.length);
+			} catch (ArrayIndexOutOfBoundsException ex) {
+				ex.printStackTrace();
+			}
 			destIndex += d.length;
 			prevEnd = ends.get(i);
 		}