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);
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;
return baseEnvironment.getModule(moduleName);
}
+ @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();
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) {
--- /dev/null
+import sun.security.x509.X509CertInfo;
+
+import java.security.cert.CertificateParsingException;
+
+/**
+ * https://github.com/mojohaus/aspectj-maven-plugin/issues/139
+ */
+public class Application {
+ public static void main(String[] args) {
+ try {
+ new X509CertInfo(new byte[0]);
+ }
+ catch (CertificateParsingException e) {
+ System.out.println(e);
+ }
+ }
+}
runTest("asynchronous proceed for nested around-advice (native, thread pool)");
}
+ public void testAddExports() {
+ runTest("use --add-exports");
+ }
+
public static Test suite() {
return XMLBasedAjcTestCase.loadSuite(Bugs199Tests.class);
}
</run>
</ajc-test>
+ <ajc-test dir="bugs199/add_exports" title="use --add-exports" vm="9">
+ <compile files="Application.java" options="-11 --add-exports java.base/sun.security.x509=ALL-UNNAMED" />
+ <run class="Application" vmargs="--add-exports java.base/sun.security.x509=ALL-UNNAMED">
+ <stdout>
+ <line text="java.security.cert.CertificateParsingException: java.io.IOException"/>
+ </stdout>
+ </run>
+ </ajc-test>
+
</suite>