]> source.dussan.org Git - jgit.git/commit
Fixed MyersDiff to be able to handle more than 100k 37/37/4
authorChristian Halstrick <christian.halstrick@sap.com>
Tue, 6 Oct 2009 14:21:39 +0000 (16:21 +0200)
committerChristian Halstrick <christian.halstrick@sap.com>
Thu, 8 Oct 2009 22:35:44 +0000 (00:35 +0200)
commitb3e4ac2622891ec50d1b56d61585263fadcf9160
treee1d13dd9dc8824407a4b02a9e6e8a75d36dc46b9
parenta3aa43ecb164d13679b9ee33fb8626c82dea7f8c
Fixed MyersDiff to be able to handle more than 100k

MyersDiff was crashing with ArrayIndexOutOfBoundsException when
diffing huge files. This was because the snake data (begin and
end position while processing chunks of the text) was sequeezed
into a single int. But with longer texts to diff these values
exceeded the range of java int values. It is fixed by squeezing
the two ints into a long and by adding the LongList helper
class.

Change-Id: Iacb9082e1b076e994d1486aa8e512342ad7432b3
Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
org.eclipse.jgit/src/org/eclipse/jgit/diff/MyersDiff.java
org.eclipse.jgit/src/org/eclipse/jgit/util/LongList.java [new file with mode: 0644]