[ 
https://issues.apache.org/jira/browse/VELOCITY-712?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Vincent Massol updated VELOCITY-712:
------------------------------------

    Description: 
Looking at the code it does:

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

newHashMap() will not perform deep cloning but only shallow cloning.


  was:
Looking at the code it does:

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

newHashMap() will not perform deep cloning but only shallow cloning.



> Velocity Context clone() method doesn't do a deep cloning as mentioned
> ----------------------------------------------------------------------
>
>                 Key: VELOCITY-712
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-712
>             Project: Velocity
>          Issue Type: Bug
>          Components: Engine
>    Affects Versions: 1.6.1
>            Reporter: Vincent Massol
>
> Looking at the code it does:
> {noformat}
>     public Object clone()
>     {
>         VelocityContext clone = null;
>         try
>         {
>             clone = (VelocityContext) super.clone();
>             clone.context = new HashMap(context);
>         }
>         catch (CloneNotSupportedException ignored)
>         {
>         }
>         return clone;
>     }
> {noformat}
> newHashMap() will not perform deep cloning but only shallow cloning.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to