From 33bd2b4a2e30de544ec2bb8a90997e8b6595b13c Mon Sep 17 00:00:00 2001 From: Alexander Kriegisch Date: Sun, 27 Mar 2022 14:12:04 +0700 Subject: Use upstream method to generate '--add-reads', '--add-exports' info and copy it into our FileSystem instance. In order to be able to access JDT Core's FileSystem.moduleUpdates field, we had to make it public there first. Signed-off-by: Alexander Kriegisch --- .../aspectj/ajdt/internal/core/builder/AjBuildManager.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'org.aspectj.ajdt.core') 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 c1bc570cc..75f8c36cd 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,9 +1044,14 @@ public class AjBuildManager implements IOutputClassFileNameProvider, IBinarySour for (int i = 0; i < cps.size(); i++) { classpaths[i] = cps.get(i); } - //FileSystem fileSystem = getLibraryAccess(classpaths, filenames); - // TODO: This will probably fail other tests, it is just an experiment - FileSystem fileSystem = buildConfig.getBuildArgParser().getLibraryAccess(); + FileSystem fileSystem = getLibraryAccess(classpaths, filenames); + + // Use upstream method to generate '--add-reads', '--add-exports' info and copy it into our FileSystem instance. + // See https://github.com/eclipse/org.aspectj/issues/145. + FileSystem fileSystemTemp = buildConfig.getBuildArgParser().getLibraryAccess(); + fileSystem.moduleUpdates = fileSystemTemp.moduleUpdates; + fileSystemTemp.cleanup(); + environment = new StatefulNameEnvironment(fileSystem, state.getClassNameToFileMap(), state); state.setFileSystem(fileSystem); state.setNameEnvironment(environment); -- cgit v1.2.3