aboutsummaryrefslogtreecommitdiffstats
path: root/src/org/apache/fop/area/AreaTree.java
diff options
context:
space:
mode:
authorKeiron Liddle <keiron@apache.org>2002-09-16 07:35:46 +0000
committerKeiron Liddle <keiron@apache.org>2002-09-16 07:35:46 +0000
commit18558ad78b40fecd78d444ad3196ec8c7879a536 (patch)
tree6c41e04cd4182ee64ec9f4b59116b1d4d61b11ca /src/org/apache/fop/area/AreaTree.java
parent9957e496742ea27c7c0fdcec0a053b511d4871be (diff)
downloadxmlgraphics-fop-18558ad78b40fecd78d444ad3196ec8c7879a536.tar.gz
xmlgraphics-fop-18558ad78b40fecd78d444ad3196ec8c7879a536.zip
fixed npe when a page has several forward links
Submitted by: Rainer Garus <rainer.garus@arcor.de> git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@195202 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/org/apache/fop/area/AreaTree.java')
-rw-r--r--src/org/apache/fop/area/AreaTree.java21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/org/apache/fop/area/AreaTree.java b/src/org/apache/fop/area/AreaTree.java
index 4046c6afd..de097f7fe 100644
--- a/src/org/apache/fop/area/AreaTree.java
+++ b/src/org/apache/fop/area/AreaTree.java
@@ -12,6 +12,7 @@ import org.apache.fop.render.Renderer;
import java.util.ArrayList;
import java.util.List;
import java.util.HashMap;
+import java.util.HashSet;
import java.util.Iterator;
/**
@@ -99,10 +100,10 @@ public class AreaTree {
}
list.add(pv);
- List todo = (List)resolve.get(id);
+ HashSet todo = (HashSet)resolve.get(id);
if (todo != null) {
- for (int count = 0; count < todo.size(); count++) {
- Resolveable res = (Resolveable)todo.get(count);
+ for (Iterator iter = todo.iterator(); iter.hasNext();) {
+ Resolveable res = (Resolveable)iter.next();
res.resolve(id, list);
}
resolve.remove(id);
@@ -124,9 +125,9 @@ public class AreaTree {
* @param res the Resolveable object to resolve
*/
public void addUnresolvedID(String id, Resolveable res) {
- ArrayList todo = (ArrayList)resolve.get(id);
+ HashSet todo = (HashSet)resolve.get(id);
if (todo == null) {
- todo = new ArrayList();
+ todo = new HashSet();
resolve.put(id, todo);
}
todo.add(res);
@@ -147,9 +148,9 @@ public class AreaTree {
if (idLocations.containsKey(ids[count])) {
res.resolve(ids[count], (ArrayList)idLocations.get(ids[count]));
} else {
- ArrayList todo = (ArrayList)resolve.get(ids[count]);
+ HashSet todo = (HashSet)resolve.get(ids[count]);
if (todo == null) {
- todo = new ArrayList();
+ todo = new HashSet();
resolve.put(ids[count], todo);
}
todo.add(ext);
@@ -179,9 +180,9 @@ public class AreaTree {
public void endDocument() {
for (Iterator iter = resolve.keySet().iterator(); iter.hasNext();) {
String id = (String)iter.next();
- ArrayList list = (ArrayList)resolve.get(id);
- for (int count = 0; count < list.size(); count++) {
- Resolveable res = (Resolveable)list.get(count);
+ HashSet list = (HashSet)resolve.get(id);
+ for (Iterator resIter = list.iterator(); resIter.hasNext();) {
+ Resolveable res = (Resolveable)resIter.next();
if (!res.isResolved()) {
res.resolve(id, null);
}