arrayoutofbounds fixes,
diff --git a/core/plugins/org.eclipse.dltk.ui/src/org/eclipse/dltk/internal/ui/text/LineComparator.java b/core/plugins/org.eclipse.dltk.ui/src/org/eclipse/dltk/internal/ui/text/LineComparator.java
index 57926c7..28325fd 100644
--- a/core/plugins/org.eclipse.dltk.ui/src/org/eclipse/dltk/internal/ui/text/LineComparator.java
+++ b/core/plugins/org.eclipse.dltk.ui/src/org/eclipse/dltk/internal/ui/text/LineComparator.java
@@ -81,12 +81,17 @@
* if the line number is invalid
*/
private Integer getHash(int line) throws BadLocationException {
- Integer hash = (Integer) fHashes.get(line);
+ Integer hash = null;
+ if (fHashes.size() > line) {
+ hash = (Integer) fHashes.get(line);
+ }
if (hash == null) {
IRegion lineRegion = fDocument.getLineInformation(line);
String lineContents = fDocument.get(lineRegion.getOffset(),
lineRegion.getLength());
hash = new Integer(computeDJBHash(lineContents));
+ while (fHashes.size() <= line)
+ fHashes.add(null);
fHashes.set(line, hash);
}