You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Sam Solon <ss...@usa.net> on 2004/04/28 03:51:04 UTC

[PATCH] IntakeTool remove method

I found a problem with the "remove" method in IntakeTool that is
triggered by a "removeAll".

When there is more than one instance of a group and a "removeAll" is
done the "remove" method is called for each of the instances of the
group. If a mutiply instantiated group is the last one to be removed,
it's parameter entries will already have been removed and "getStrings"
returns null, which is not being handled in the code.

I made the following patch against anoncvs TURBINE_2_3_BRANCH

Index: IntakeTool.java
===================================================================
RCS file:
/home/cvspublic/jakarta-turbine-2/src/java/org/apache/turbine/services/intake/IntakeTool.java,v
retrieving revision 1.17.2.2
diff -u -r1.17.2.2 IntakeTool.java
--- IntakeTool.java     27 Feb 2004 05:48:51 -0000      1.17.2.2
+++ IntakeTool.java     27 Apr 2004 23:21:21 -0000
@@ -406,14 +406,17 @@
  
             pp.remove(INTAKE_GRP);
  
-            for (int i = 0; i < groupKeys.length; i++)
-            {
-                if (!groupKeys[i].equals(group.getGID()))
-                {
-                    pp.add(INTAKE_GRP, groupKeys[i]);
+           if (groupKeys != null)
+           {
+               for (int i = 0; i < groupKeys.length; i++)
+               {
+                           if (!groupKeys[i].equals(group.getGID()))
+                           {
+                       pp.add(INTAKE_GRP, groupKeys[i]);
+                    }
                 }
-            }
-
+            }
+
             try
             {
                 TurbineIntake.releaseGroup(group);




---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org