diff --git a/src/helma/framework/core/Application.java b/src/helma/framework/core/Application.java index b8aeb882..077e73ba 100644 --- a/src/helma/framework/core/Application.java +++ b/src/helma/framework/core/Application.java @@ -1735,28 +1735,6 @@ public final class Application implements Runnable { return Collections.unmodifiableList(repositories); } - /** - * Set the code resource currently being evaluated/compiled. This is used - * to set the proper parent repository when a new repository is added - * via app.addRepository(). - * - * @param resource the resource being currently evaluated/compiled - */ - public void setCurrentCodeResource(Resource resource) { - currentCodeResource = resource; - } - - /** - * Set the code resource currently being evaluated/compiled. This is used - * to set the proper parent repository when a new repository is added - * via app.addRepository(). - - * @return the resource being currently evaluated/compiled - */ - public Resource getCurrentCodeResource() { - return currentCodeResource; - } - /** * Return the directory of the Helma server */ diff --git a/src/helma/framework/core/ApplicationBean.java b/src/helma/framework/core/ApplicationBean.java index 6f536230..d23c2c4c 100644 --- a/src/helma/framework/core/ApplicationBean.java +++ b/src/helma/framework/core/ApplicationBean.java @@ -138,9 +138,6 @@ public class ApplicationBean implements Serializable { * @param obj the repository, relative or absolute path to the library. */ public synchronized void addRepository(Object obj) { - Resource current = app.getCurrentCodeResource(); - Repository parent = current == null ? - null : current.getRepository().getRootRepository(); Repository rep; if (obj instanceof String) { String path = (String) obj; @@ -152,12 +149,12 @@ public class ApplicationBean implements Serializable { throw new RuntimeException("Repository path does not exist: " + file); } if (file.isDirectory()) { - rep = new FileRepository(file, parent); + rep = new FileRepository(file); } else if (file.isFile()) { if (file.getName().endsWith(".zip")) { - rep = new ZipRepository(file, parent); + rep = new ZipRepository(file); } else { - rep = new SingleFileRepository(file, parent); + rep = new SingleFileRepository(file); } } else { throw new RuntimeException("Unsupported file type in addRepository: " + file); diff --git a/src/helma/scripting/rhino/RhinoCore.java b/src/helma/scripting/rhino/RhinoCore.java index 073140aa..ce358177 100644 --- a/src/helma/scripting/rhino/RhinoCore.java +++ b/src/helma/scripting/rhino/RhinoCore.java @@ -799,9 +799,6 @@ public final class RhinoCore implements ScopeProvider { String sourceName = code.getName(); Reader reader = null; - Resource previousCurrentResource = app.getCurrentCodeResource(); - app.setCurrentCodeResource(code); - String encoding = app.getProperty("sourceCharset"); try { @@ -837,7 +834,6 @@ public final class RhinoCore implements ScopeProvider { wrappercache.clear(); } } finally { - app.setCurrentCodeResource(previousCurrentResource); if (reader != null) { try { reader.close();