Uploaded image for project: 'Velocity'
  1. Velocity
  2. VELOCITY-712

Velocity Context clone() method doesn't do a deep cloning as mentioned in the javadoc

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.6.1
    • None
    • Engine
    • None

    Description

      Looking at the code it does:

          public Object clone()
          {
              VelocityContext clone = null;
              try
              {
                  clone = (VelocityContext) super.clone();
                  clone.context = new HashMap(context);
              }
              catch (CloneNotSupportedException ignored)
              {
              }
              return clone;
          }
      

      new HashMap() will not perform deep cloning but only shallow cloning.

      Attachments

        1. ASF.LICENSE.NOT.GRANTED--velocity-712.patch
          0.5 kB
          Jarkko Viinamäki

        Activity

          People

            Unassigned Unassigned
            vmassol Vincent Massol
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: