From 1da67c35d8b6a7ab7df85e846a8852141f434180 Mon Sep 17 00:00:00 2001 From: aclement Date: Mon, 6 Apr 2009 19:23:16 +0000 Subject: [PATCH] 271201: inpath handles --- .../aspectj/ajde/core/IOutputLocationManager.java | 6 ++++++ .../ajde/core/internal/OutputLocationAdapter.java | 10 ++++++++++ .../ajde/core/TestOutputLocationManager.java | 13 +++++++++++++ .../tests/model/SavedModelConsistencyTests.java | 5 +++-- 4 files changed, 32 insertions(+), 2 deletions(-) diff --git a/ajde.core/src/org/aspectj/ajde/core/IOutputLocationManager.java b/ajde.core/src/org/aspectj/ajde/core/IOutputLocationManager.java index d9f9a6d34..605629ad4 100644 --- a/ajde.core/src/org/aspectj/ajde/core/IOutputLocationManager.java +++ b/ajde.core/src/org/aspectj/ajde/core/IOutputLocationManager.java @@ -13,6 +13,7 @@ package org.aspectj.ajde.core; import java.io.File; import java.util.List; +import java.util.Map; /** * Interface that handles where the compilation output is sent. Allows for the output folder to be different for different source @@ -68,6 +69,11 @@ public interface IOutputLocationManager { */ void reportFileWrite(String outputfile, int fileType); + /** + * @return a Map from inpath absolute paths to handle components + */ + Map getInpathMap(); + /** * Callback from the compiler to indicate that a file has been removed from disk, the type of the file (if known) is also * supplied. diff --git a/ajde.core/src/org/aspectj/ajde/core/internal/OutputLocationAdapter.java b/ajde.core/src/org/aspectj/ajde/core/internal/OutputLocationAdapter.java index 380ab1c59..a944de996 100644 --- a/ajde.core/src/org/aspectj/ajde/core/internal/OutputLocationAdapter.java +++ b/ajde.core/src/org/aspectj/ajde/core/internal/OutputLocationAdapter.java @@ -14,6 +14,7 @@ package org.aspectj.ajde.core.internal; import java.io.File; import java.util.List; +import java.util.Map; import org.aspectj.ajde.core.IOutputLocationManager; import org.aspectj.ajdt.internal.compiler.CompilationResultDestinationManager; @@ -61,4 +62,13 @@ public class OutputLocationAdapter implements CompilationResultDestinationManage return this.locationManager.discoverChangesSince(dir,buildtime); } + /** + * Return a map from fully qualified jar/dir entries to handle components. + * + * @return a map from inpath entries (jars/dirs) to handle components. + */ + public Map getInpathMap() { + return this.locationManager.getInpathMap(); + } + } diff --git a/ajde.core/testsrc/org/aspectj/ajde/core/TestOutputLocationManager.java b/ajde.core/testsrc/org/aspectj/ajde/core/TestOutputLocationManager.java index 495dd182f..8ce149c37 100644 --- a/ajde.core/testsrc/org/aspectj/ajde/core/TestOutputLocationManager.java +++ b/ajde.core/testsrc/org/aspectj/ajde/core/TestOutputLocationManager.java @@ -12,7 +12,9 @@ package org.aspectj.ajde.core; import java.io.File; import java.util.ArrayList; +import java.util.Collections; import java.util.List; +import java.util.Map; /** * Test implementation of IOutputLocationManager. By default returns the same location for both resources and classes, however, @@ -25,11 +27,17 @@ public class TestOutputLocationManager implements IOutputLocationManager { private File classOutputLoc; private File resourceOutputLoc; private List allOutputLocations; + private Map inpathMap = Collections.EMPTY_MAP; public TestOutputLocationManager(String testProjectPath) { this.testProjectOutputPath = testProjectPath + File.separator + "bin"; } + public TestOutputLocationManager(String string, Map inpathMap) { + this(string); + this.inpathMap = inpathMap; + } + public File getOutputLocationForClass(File compilationUnit) { initLocations(); return classOutputLoc; @@ -39,6 +47,11 @@ public class TestOutputLocationManager implements IOutputLocationManager { initLocations(); return resourceOutputLoc; } + + public Map getInpathMap() { + return inpathMap; + } + // -------------- setter methods useful for testing ------------- public void setOutputLocForClass(File f) { diff --git a/ajde.core/testsrc/org/aspectj/ajde/core/tests/model/SavedModelConsistencyTests.java b/ajde.core/testsrc/org/aspectj/ajde/core/tests/model/SavedModelConsistencyTests.java index 5c97bcbe7..1b475ae89 100644 --- a/ajde.core/testsrc/org/aspectj/ajde/core/tests/model/SavedModelConsistencyTests.java +++ b/ajde.core/testsrc/org/aspectj/ajde/core/tests/model/SavedModelConsistencyTests.java @@ -14,6 +14,7 @@ package org.aspectj.ajde.core.tests.model; import java.io.File; import java.util.ArrayList; +import java.util.Collections; import java.util.List; import org.aspectj.ajde.core.AjdeCoreTestCase; @@ -54,7 +55,7 @@ public class SavedModelConsistencyTests extends AjdeCoreTestCase { } public void testInterfaceIsSameInBoth() { - AsmManager asm = AsmManager.createNewStructureModel(); + AsmManager asm = AsmManager.createNewStructureModel(Collections.EMPTY_MAP); asm.readStructureModel(getAbsoluteProjectDir()); IHierarchy model = asm.getHierarchy(); @@ -77,7 +78,7 @@ public class SavedModelConsistencyTests extends AjdeCoreTestCase { } public void testModelIsSamePreAndPostBuild() { - AsmManager asm = AsmManager.createNewStructureModel(); + AsmManager asm = AsmManager.createNewStructureModel(Collections.EMPTY_MAP); asm.readStructureModel(getAbsoluteProjectDir()); // AsmManager.getDefault().readStructureModel(getAbsoluteProjectDir()); IHierarchy model = asm.getHierarchy(); -- 2.39.5