diff --git a/plugins/velocity/src/main/java/org/apache/struts2/views/velocity/StrutsVelocityContext.java b/plugins/velocity/src/main/java/org/apache/struts2/views/velocity/StrutsVelocityContext.java index 587acb0138..7ab4f24e78 100644 --- a/plugins/velocity/src/main/java/org/apache/struts2/views/velocity/StrutsVelocityContext.java +++ b/plugins/velocity/src/main/java/org/apache/struts2/views/velocity/StrutsVelocityContext.java @@ -77,10 +77,10 @@ public Object internalGet(String key) { } protected List> contextGetterList() { - return Arrays.asList(this::superGet, this::chainedContextGet, this::stackGet); + return Arrays.asList(this::superInternalGet, this::chainedContextGet, this::stackGet); } - protected Object superGet(String key) { + protected Object superInternalGet(String key) { return super.internalGet(key); } @@ -96,7 +96,7 @@ protected Object chainedContextGet(String key) { return null; } for (VelocityContext chainedContext : chainedContexts) { - Object val = chainedContext.internalGet(key); + Object val = chainedContext.get(key); if (val != null) { return val; } diff --git a/plugins/velocity/src/test/java/org/apache/struts2/views/velocity/StrutsVelocityContextTest.java b/plugins/velocity/src/test/java/org/apache/struts2/views/velocity/StrutsVelocityContextTest.java index 6cd38c8aa6..60490c6aff 100644 --- a/plugins/velocity/src/test/java/org/apache/struts2/views/velocity/StrutsVelocityContextTest.java +++ b/plugins/velocity/src/test/java/org/apache/struts2/views/velocity/StrutsVelocityContextTest.java @@ -54,7 +54,7 @@ public void setUp() throws Exception { @Test public void getChainedValue() { - when(chainedContext.internalGet("foo")).thenReturn("bar"); + when(chainedContext.get("foo")).thenReturn("bar"); assertEquals("bar", strutsVelocityContext.internalGet("foo")); } @@ -75,7 +75,7 @@ public void getValuePrecedence() { when(stack.findValue("foo")).thenReturn("qux"); assertEquals("qux", strutsVelocityContext.internalGet("foo")); - when(chainedContext.internalGet("foo")).thenReturn("baz"); + when(chainedContext.get("foo")).thenReturn("baz"); assertEquals("baz", strutsVelocityContext.internalGet("foo")); strutsVelocityContext.put("foo", "bar");