Skip to content

Commit

Permalink
WW-5047 Marks previous constructors as deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaszlenart committed Feb 23, 2020
1 parent 6da1693 commit 35aae07
Showing 1 changed file with 26 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,44 @@

import com.opensymphony.xwork2.util.ValueStack;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class StrutsVelocityContext extends VelocityContext {

private ValueStack stack;
private List<VelocityContext> chainedContexts;

public StrutsVelocityContext(ValueStack stack) {
this(null, stack);
}

/**
* Creates a content with link to the ValueStack and any other Velocity contexts
*
* @param chainedContexts Existing Velocity contexts to chain to
* @param stack Struts ValueStack
* @since 2.6
*/
public StrutsVelocityContext(List<VelocityContext> chainedContexts, ValueStack stack) {
this.chainedContexts = chainedContexts;
this.stack = stack;
}

/**
* @deprecated please use newly added {@link StrutsVelocityContext(List<VelocityContext)} constructor instead
* and pass {null} or empty list if no chained contexts were defined
*/
@Deprecated
public StrutsVelocityContext(ValueStack stack) {
this((List<VelocityContext>) null, stack);
}

/**
* @deprecated please use newly added {@link StrutsVelocityContext(List<VelocityContext)} constructor instead
*/
@Deprecated()
public StrutsVelocityContext(VelocityContext[] chainedContexts, ValueStack stack) {
this(new ArrayList<>(Arrays.asList(chainedContexts)), stack);
}

public boolean internalContainsKey(String key) {
boolean contains = super.internalContainsKey(key);

Expand Down

0 comments on commit 35aae07

Please sign in to comment.