diff options
author | Alexander Kriegisch <Alexander@Kriegisch.name> | 2022-03-27 12:57:19 +0700 |
---|---|---|
committer | Alexander Kriegisch <Alexander@Kriegisch.name> | 2022-03-27 12:57:19 +0700 |
commit | 8a933427ec77859a40c5cd9c55226bbe6f9d736a (patch) | |
tree | 414f4971c8c26e5f8ddd5627ef2b81760feaa2fb /org.aspectj.ajdt.core | |
parent | dddefd99b1d5e7078e0212343fdce3230f2aec18 (diff) | |
download | aspectj-8a933427ec77859a40c5cd9c55226bbe6f9d736a.tar.gz aspectj-8a933427ec77859a40c5cd9c55226bbe6f9d736a.zip |
Add test case + experimental fix for AJC option '--add-exports'
I am expecting the test case to pass, but other tests to fail. This
temporary commit is meant to create feedback from GitHub CI test runs.
Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
Diffstat (limited to 'org.aspectj.ajdt.core')
3 files changed, 23 insertions, 2 deletions
diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java index 08bf00d54..c1bc570cc 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java @@ -1044,7 +1044,9 @@ public class AjBuildManager implements IOutputClassFileNameProvider, IBinarySour for (int i = 0; i < cps.size(); i++) { classpaths[i] = cps.get(i); } - FileSystem fileSystem = getLibraryAccess(classpaths, filenames); + //FileSystem fileSystem = getLibraryAccess(classpaths, filenames); + // TODO: This will probably fail other tests, it is just an experiment + FileSystem fileSystem = buildConfig.getBuildArgParser().getLibraryAccess(); environment = new StatefulNameEnvironment(fileSystem, state.getClassNameToFileMap(), state); state.setFileSystem(fileSystem); state.setNameEnvironment(environment); diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/StatefulNameEnvironment.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/StatefulNameEnvironment.java index 0af411be3..dad61e7b2 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/StatefulNameEnvironment.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/StatefulNameEnvironment.java @@ -27,6 +27,7 @@ import org.aspectj.org.eclipse.jdt.internal.compiler.classfmt.ClassFormatExcepti import org.aspectj.org.eclipse.jdt.internal.compiler.env.IBinaryType; import org.aspectj.org.eclipse.jdt.internal.compiler.env.IModule; import org.aspectj.org.eclipse.jdt.internal.compiler.env.IModuleAwareNameEnvironment; +import org.aspectj.org.eclipse.jdt.internal.compiler.env.IUpdatableModule; import org.aspectj.org.eclipse.jdt.internal.compiler.env.NameEnvironmentAnswer; import org.aspectj.util.FileUtil; @@ -152,6 +153,16 @@ public class StatefulNameEnvironment implements IModuleAwareNameEnvironment { } @Override + public void applyModuleUpdates(IUpdatableModule module, IUpdatableModule.UpdateKind kind) { + baseEnvironment.applyModuleUpdates(module, kind); + } + + @Override + public char[][] getUniqueModulesDeclaringPackage(char[][] packageName, char[] moduleName) { + return baseEnvironment.getUniqueModulesDeclaringPackage(packageName, moduleName); + } + + @Override public char[][] getAllAutomaticModules() { return baseEnvironment.getAllAutomaticModules(); } diff --git a/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/AjcTestCase.java b/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/AjcTestCase.java index 7a1ad855b..0aa9a81db 100644 --- a/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/AjcTestCase.java +++ b/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/AjcTestCase.java @@ -699,7 +699,15 @@ public abstract class AjcTestCase extends TestCase { e.printStackTrace(); } return lastRunResult; - } else if (vmargs!=null && (vmargs.contains("--enable-preview") || vmargs.contains("--add-modules") || vmargs.contains("--limit-modules") || vmargs.contains("--add-reads"))) { + } else if ( + vmargs != null && ( + vmargs.contains("--enable-preview") || + vmargs.contains("--add-modules") || + vmargs.contains("--limit-modules") || + vmargs.contains("--add-reads") || + vmargs.contains("--add-exports") + ) + ) { // If --add-modules supplied, need to fork the test try { // if (mp.indexOf("$runtime") != -1) { |