diff options
author | Éamonn McManus <eamonn@mcmanus.net> | 2018-04-20 17:14:33 -0700 |
---|---|---|
committer | Éamonn McManus <eamonn@mcmanus.net> | 2018-04-20 17:14:33 -0700 |
commit | 89ea4ddf7f3d0005543fb740481eeb0dc5cddac9 (patch) | |
tree | 9961d4cc4e5047bc1275746c952b9247e542384d /src/main/java/com/google/escapevelocity/EvaluationContext.java | |
parent | d68715b3e62b4f1b8ebd7fa051004934a2ba913d (diff) | |
download | escapevelocity-89ea4ddf7f3d0005543fb740481eeb0dc5cddac9.tar.gz |
Update to latest Google version of EscapeVelocity.
Diffstat (limited to 'src/main/java/com/google/escapevelocity/EvaluationContext.java')
-rw-r--r-- | src/main/java/com/google/escapevelocity/EvaluationContext.java | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/src/main/java/com/google/escapevelocity/EvaluationContext.java b/src/main/java/com/google/escapevelocity/EvaluationContext.java index 43b7868..4c4b27d 100644 --- a/src/main/java/com/google/escapevelocity/EvaluationContext.java +++ b/src/main/java/com/google/escapevelocity/EvaluationContext.java @@ -11,6 +11,25 @@ * or implied. See the License for the specific language governing permissions and limitations under * the License. */ + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ package com.google.escapevelocity; import java.util.Map; @@ -60,17 +79,9 @@ interface EvaluationContext { Runnable undo; if (vars.containsKey(var)) { final Object oldValue = vars.get(var); - undo = new Runnable() { - @Override public void run() { - vars.put(var, oldValue); - } - }; + undo = () -> vars.put(var, oldValue); } else { - undo = new Runnable() { - @Override public void run() { - vars.remove(var); - } - }; + undo = () -> vars.remove(var); } vars.put(var, value); return undo; |