changeset 3817:804088c2e23a

Prevent follow-up errors. flys-artifacts/tags/pre2.7-2012-03-16@4162 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Mon, 19 Mar 2012 14:14:53 +0000
parents 3b6bb1cbf741
children dc18457b1cef
files flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/collections/FLYSArtifactCollection.java
diffstat 2 files changed, 12 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog	Mon Mar 19 14:13:15 2012 +0000
+++ b/flys-artifacts/ChangeLog	Mon Mar 19 14:14:53 2012 +0000
@@ -1,3 +1,11 @@
+2012-03-19	Felix Wolfsteller	<felix.wolfsteller@intevation.de>
+
+	Circumvent follow-up errors.
+
+	* src/main/java/de/intevation/flys/collections/FLYSArtifactCollection.java:
+	  Store location where to add to a list to avoid OutOfBounds if a
+	  error occurred previously.
+
 2012-03-19	Felix Wolfsteller	<felix.wolfsteller@intevation.de>
 
 	Disable legend entry aggregation in this tag.
--- a/flys-artifacts/src/main/java/de/intevation/flys/collections/FLYSArtifactCollection.java	Mon Mar 19 14:13:15 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/collections/FLYSArtifactCollection.java	Mon Mar 19 14:14:53 2012 +0000
@@ -479,7 +479,7 @@
      * ArtifactAndFacets on the fly (with the same ordering as the passed
      * ThemeList).
      * @param themeList ThemeList to create a ArtifactAndFacetList along.
-     * @param contect   The "Blackboard".
+     * @param context   The "Blackboard".
      */
     protected List<ArtifactAndFacet> doBlackboardPass(
         ThemeList themeList, CallContext context
@@ -490,6 +490,7 @@
 
         try {
             // Collect all ArtifactAndFacets for blackboard pass.
+            int pivot = 0;
             for (int i = 0; i < size; i++) {
                 ManagedFacet theme = themeList.get(i);
                 if (theme == null) {
@@ -511,7 +512,8 @@
                 artifactAndFacet.register(context);
 
                 // Add to themes.
-                dataProviders.add(i, artifactAndFacet);
+                dataProviders.add(pivot, artifactAndFacet);
+                pivot += 1;
             }
         }
         catch (ArtifactDatabaseException ade) {

http://dive4elements.wald.intevation.org