try { state.pushActiveContextObject(new TypedValue(entry)); state.enterScope(); result.add(this.children[0].getValueInternal(state).getValue()); try { state.pushActiveContextObject(new TypedValue(element)); state.enterScope("index", idx); Object value = this.children[0].getValueInternal(state).getValue(); if (value != null && operandIsArray) {
TypedValue kvPair = new TypedValue(entry); state.pushActiveContextObject(kvPair); state.enterScope(); Object val = selectionCriteria.getValueInternal(state).getValue(); if (val instanceof Boolean) { try { state.pushActiveContextObject(new TypedValue(element)); state.enterScope("index", index); Object val = selectionCriteria.getValueInternal(state).getValue(); if (val instanceof Boolean) {
try { state.pushActiveContextObject(new TypedValue(entry)); state.enterScope(); result.add(this.children[0].getValueInternal(state).getValue()); try { state.pushActiveContextObject(new TypedValue(element)); state.enterScope("index", idx); Object value = this.children[0].getValueInternal(state).getValue(); if (value != null && operandIsArray) {
@Test public void testPopulatedNestedScopes() { ExpressionState state = getState(); assertNull(state.lookupLocalVariable("foo")); state.enterScope("foo",34); assertEquals(34, state.lookupLocalVariable("foo")); state.enterScope(null); state.setLocalVariable("foo", 12); assertEquals(12, state.lookupLocalVariable("foo")); state.exitScope(); assertEquals(34, state.lookupLocalVariable("foo")); state.exitScope(); assertNull(state.lookupLocalVariable("goo")); }
@Test public void testPopulatedNestedScopesMap() { ExpressionState state = getState(); assertNull(state.lookupLocalVariable("foo")); assertNull(state.lookupLocalVariable("goo")); Map<String,Object> m = new HashMap<>(); m.put("foo", 34); m.put("goo", "abc"); state.enterScope(m); assertEquals(34, state.lookupLocalVariable("foo")); assertEquals("abc", state.lookupLocalVariable("goo")); state.enterScope(null); state.setLocalVariable("foo",12); assertEquals(12, state.lookupLocalVariable("foo")); assertEquals("abc", state.lookupLocalVariable("goo")); state.exitScope(); state.exitScope(); assertNull(state.lookupLocalVariable("foo")); assertNull(state.lookupLocalVariable("goo")); }
TypedValue kvPair = new TypedValue(entry); state.pushActiveContextObject(kvPair); state.enterScope(); Object val = selectionCriteria.getValueInternal(state).getValue(); if (val instanceof Boolean) { try { state.pushActiveContextObject(new TypedValue(element)); state.enterScope("index", index); Object val = selectionCriteria.getValueInternal(state).getValue(); if (val instanceof Boolean) {
@Test public void testLocalVariableNestedScopes() { ExpressionState state = getState(); assertEquals(null, state.lookupLocalVariable("foo")); state.setLocalVariable("foo",12); assertEquals(12, state.lookupLocalVariable("foo")); state.enterScope(null); assertEquals(12, state.lookupLocalVariable("foo")); // found in upper scope state.setLocalVariable("foo","abc"); assertEquals("abc", state.lookupLocalVariable("foo")); // found in nested scope state.exitScope(); assertEquals(12, state.lookupLocalVariable("foo")); // found in nested scope }
try { state.pushActiveContextObject(new TypedValue(entry)); state.enterScope(); result.add(this.children[0].getValueInternal(state).getValue()); try { state.pushActiveContextObject(new TypedValue(element)); state.enterScope("index", idx); Object value = this.children[0].getValueInternal(state).getValue(); if (value != null && operandIsArray) {