diff --git a/src/org/rascalmpl/interpreter/TestEvaluator.java b/src/org/rascalmpl/interpreter/TestEvaluator.java index e9bf487a55..72752fa9ad 100644 --- a/src/org/rascalmpl/interpreter/TestEvaluator.java +++ b/src/org/rascalmpl/interpreter/TestEvaluator.java @@ -134,7 +134,7 @@ private void runTests(ModuleEnvironment env, List tests) { // TODO: add bound type parameters return new UnExpectedExceptionThrownResult(test.getEnv().getName() + "::" + test.getName(), actuals, Map.of(), args, e); } - }, env.getRoot().getStore(), tries, maxDepth, maxWidth, typesConfig); + }, env.getStore(), tries, maxDepth, maxWidth, typesConfig); eval.getOutPrinter().flush(); eval.getErrorPrinter().flush(); diff --git a/src/org/rascalmpl/interpreter/env/Environment.java b/src/org/rascalmpl/interpreter/env/Environment.java index 40bc3a03f4..509a822356 100644 --- a/src/org/rascalmpl/interpreter/env/Environment.java +++ b/src/org/rascalmpl/interpreter/env/Environment.java @@ -195,20 +195,6 @@ public Environment(Environment parent, Environment callerScope, ISourceLocation } } - protected Environment(Environment old) { - this.parent = old.parent; - this.loc = old.loc; - this.name = old.name; - this.callerScope = old.callerScope; - this.callerLocation = old.callerLocation; - this.variableEnvironment = old.variableEnvironment; - this.functionEnvironment = old.functionEnvironment; - this.staticTypeParameters = old.staticTypeParameters; - this.dynamicTypeParameters = old.dynamicTypeParameters; - this.variableFlags = old.variableFlags; - this.functionFlags = old.functionFlags; - } - /** * @return the name of this environment/stack frame for use in tracing */ @@ -1011,7 +997,7 @@ public Environment getCallerScope() { public ISourceLocation getCallerLocation() { if (callerLocation != null) { - return callerLocation; + return callerLocation; } else if (parent != null) { return parent.getCallerLocation(); } diff --git a/src/org/rascalmpl/interpreter/env/ModuleEnvironment.java b/src/org/rascalmpl/interpreter/env/ModuleEnvironment.java index a0b2991d4f..4395826c47 100644 --- a/src/org/rascalmpl/interpreter/env/ModuleEnvironment.java +++ b/src/org/rascalmpl/interpreter/env/ModuleEnvironment.java @@ -70,23 +70,23 @@ * */ public class ModuleEnvironment extends Environment { - protected final GlobalEnvironment heap; + private final GlobalEnvironment heap; /** Map of imported modules to resolved ModuleEnvironments, will only be empty in case of a module was in a cycle or got reloaded and failed during the reload. use {@link #importedModulesResolved} to lazily resolve the modules. */ - protected Map> importedModules; - protected Set extended; - protected TypeStore typeStore; - protected Set productions; - protected Map> generalKeywordParameters; - protected Map concreteSyntaxTypes; + private Map> importedModules; + private Set extended; + private TypeStore typeStore; + private Set productions; + private Map> generalKeywordParameters; + private Map concreteSyntaxTypes; private boolean initialized; private boolean syntaxDefined; private boolean bootstrap; private String deprecated; - protected Map resourceImporters; - protected Map> cachedGeneralKeywordParameters; - protected Map> cachedPublicFunctions; + private Map resourceImporters; + private Map> cachedGeneralKeywordParameters; + private Map> cachedPublicFunctions; - protected static final TypeFactory TF = TypeFactory.getInstance(); + private static final TypeFactory TF = TypeFactory.getInstance(); public final static String SHELL_MODULE = "$"; @@ -105,27 +105,6 @@ public ModuleEnvironment(String name, GlobalEnvironment heap) { this.cachedGeneralKeywordParameters = null; this.cachedPublicFunctions = null; } - - /** - * This constructor creates a shallow copy of the given environment - * - * @param env - */ - protected ModuleEnvironment(ModuleEnvironment env) { - super(env); - this.heap = env.heap; - this.importedModules = env.importedModules; - this.concreteSyntaxTypes = env.concreteSyntaxTypes; - this.productions = env.productions; - this.typeStore = env.typeStore; - this.initialized = env.initialized; - this.syntaxDefined = env.syntaxDefined; - this.bootstrap = env.bootstrap; - this.resourceImporters = env.resourceImporters; - this.cachedGeneralKeywordParameters = null; - this.cachedPublicFunctions = null; - this.deprecated = env.deprecated; - } @Override public void reset() {