From fc08f25462d679a1faae68c5f3c16914c38e2ce5 Mon Sep 17 00:00:00 2001 From: adam Date: Mon, 11 Apr 2005 07:05:52 +0000 Subject: [PATCH] another bugfix darcs-hash:20050411070552-5007d-859792b673275c8203d6eb0b85a38ccbb185eb0c.gz --- src/org/ibex/util/Basket.java | 6 ++++-- src/org/ibex/util/GetDep.java | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/org/ibex/util/Basket.java b/src/org/ibex/util/Basket.java index bd981b6..baee97c 100644 --- a/src/org/ibex/util/Basket.java +++ b/src/org/ibex/util/Basket.java @@ -76,9 +76,11 @@ public interface Basket extends Serializable { o[i] = obj; size++; } public Object set(int i, Object obj) { - if (i >= size) throw new IndexOutOfBoundsException( + if (i >= o.length) throw new IndexOutOfBoundsException( "index "+i+" is beyond list boundary "+size); - Object old = o[i]; o[i] = obj; return old; + Object old = o[i]; o[i] = obj; + size = Math.max(i+1, size); + return old; } public Object get(int i) { if (i >= size) throw new IndexOutOfBoundsException( diff --git a/src/org/ibex/util/GetDep.java b/src/org/ibex/util/GetDep.java index 9e0e67a..135dd8b 100644 --- a/src/org/ibex/util/GetDep.java +++ b/src/org/ibex/util/GetDep.java @@ -44,7 +44,7 @@ public final class GetDep { if (ze == null) break; if (ze.getName().equals(path)) return zis; } - return null; + throw new RuntimeException("could not find file within archive"); } else { Tar.TarInputStream tis = new Tar.TarInputStream(new GZIPInputStream(rest)); while(true) { @@ -52,7 +52,7 @@ public final class GetDep { if (te == null) break; if (te.getName().equals(path)) return tis; } - return null; + throw new RuntimeException("could not find file within archive"); } } else { URL u = new URL(url); -- 1.7.10.4