MCPcopy Index your code
hub / github.com/apache/groovy / copy

Method copy

src/main/java/org/codehaus/groovy/ast/VariableScope.java:303–317  ·  view source on GitHub ↗

Creates a shallow copy of this variable scope with the same parent, class scope, static context, and copies of all variable maps. The returned scope is independent from the original and may be safely modified without affecting the source scope. @return a new VariableScope with copied config

()

Source from the content-addressed store, hash-verified

301 * @return a new {@link VariableScope} with copied configuration
302 */
303 public VariableScope copy() {
304 VariableScope that = new VariableScope(parent);
305 that.classScope = this.classScope;
306 that.inStaticContext = this.inStaticContext;
307 if (!this.declaredVariables.isEmpty()) {
308 that.declaredVariables = new LinkedHashMap<>(this.declaredVariables);
309 }
310 if (!this.referencedLocalVariables.isEmpty()) {
311 that.referencedLocalVariables = new LinkedHashMap<>(this.referencedLocalVariables);
312 }
313 if (!this.referencedClassVariables.isEmpty()) {
314 that.referencedClassVariables = new LinkedHashMap<>(this.referencedClassVariables);
315 }
316 return that;
317 }
318}

Callers 2

createClosureClassMethod · 0.95
createClosureClassMethod · 0.95

Calls 1

isEmptyMethod · 0.45

Tested by

no test coverage detected