commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 13472] New: - Attempt to modify FastHashMap while in fast mode through iterator.
Date Wed, 09 Oct 2002 21:56:19 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=13472>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=13472

Attempt to modify FastHashMap while in fast mode through iterator.

           Summary: Attempt to modify FastHashMap while in fast mode through
                    iterator.
           Product: Commons
           Version: Nightly Builds
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Blocker
          Priority: Other
         Component: Validator
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: rleland@apache.org


DESCRIPTION 
    Validator attempts to modify FastHashMap while it
    is in fast mode & while using an iterator().
    Because of changes made to FastHashMap()
    back in Mid August this now throws a
    ConcurrentModificationException which is the correct behaviour.

The offending code is:

Class Field
    public void processMessageComponents(String key, String replaceValue) {
       String varKey = TOKEN_START + TOKEN_VAR;
       // Process Messages
       if (key != null && !key.startsWith(varKey)) {
          for (Iterator i = hMsgs.keySet().iterator(); i.hasNext(); ) {
             String msgKey = (String)i.next();
             String value = (String)hMsgs.get(msgKey);
            
         hMsgs.put(msgKey, ValidatorUtil.replace(value, key, replaceValue));
          }
       }

SOLUTION
  Turn off fast mode for hMsgs.

  This is the patch solution that worked for me,
   there may be a larger design issue that I don't
   understand.

  --- Field.java    Wed Oct  9 17:36:00 2002
+++ .#Field.java.1.5    Wed Oct  9 17:35:36 2002
@@ -439,7 +439,7 @@
      * to create the dependency <code>Map</code>.
     */
     public void process(Map globalConstants, Map constants) {
-       hMsgs.setFast(true);
+       hMsgs.setFast(false);
        hArg0.setFast(true);
        hArg1.setFast(true);
        hArg2.setFast(true);
@@ -498,6 +498,7 @@
              
           hDependencies.setFast(true);
        }
+       hMsgs.setFast(true);
     }
 
     /**

HOW TO RECREATE
  Grab an nightly struts build and drop the
   struts-validator.war into tomcat.
   The error occurs when reading in the
    2nd validator.xml definition.
   This causes an update to happen.

--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message