diff options
author | Alexander Kriegisch <Alexander@Kriegisch.name> | 2021-03-14 00:09:02 +0700 |
---|---|---|
committer | Alexander Kriegisch <Alexander@Kriegisch.name> | 2021-03-14 00:11:47 +0700 |
commit | 2fd6804db8aebfe6634e4df7d5e5c71fe856d4f6 (patch) | |
tree | 542e1f1feb804342b7a17ec7851dfec2f5575790 /weaver | |
parent | cd83adc724c3779cc688405cc475ca5bd1e13bfe (diff) | |
download | aspectj-2fd6804db8aebfe6634e4df7d5e5c71fe856d4f6.tar.gz aspectj-2fd6804db8aebfe6634e4df7d5e5c71fe856d4f6.zip |
Fix 'ajdoc' tests for Java 15 build
Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
Diffstat (limited to 'weaver')
4 files changed, 31 insertions, 31 deletions
diff --git a/weaver/src/main/java/org/aspectj/weaver/bcel/ClassPathManager.java b/weaver/src/main/java/org/aspectj/weaver/bcel/ClassPathManager.java index 76acc6e7f..2b8cc5ceb 100644 --- a/weaver/src/main/java/org/aspectj/weaver/bcel/ClassPathManager.java +++ b/weaver/src/main/java/org/aspectj/weaver/bcel/ClassPathManager.java @@ -351,7 +351,7 @@ public class ClassPathManager { String jdkHome = new File(jrtFsPath).getParentFile().getParent(); FileSystem fs = null; try { - if (LangUtil.is19VMOrGreater()) { + if (LangUtil.is9VMOrGreater()) { Map<String, String> env = new HashMap<>(); env.put("java.home", jdkHome); fs = FileSystems.newFileSystem(JRT_URI, env); diff --git a/weaver/src/main/java/org/aspectj/weaver/tools/WeavingAdaptor.java b/weaver/src/main/java/org/aspectj/weaver/tools/WeavingAdaptor.java index f191da13b..a27824635 100644 --- a/weaver/src/main/java/org/aspectj/weaver/tools/WeavingAdaptor.java +++ b/weaver/src/main/java/org/aspectj/weaver/tools/WeavingAdaptor.java @@ -149,7 +149,7 @@ public class WeavingAdaptor implements IMessageContext { } // On Java9 it is possible to fail to find a URLClassLoader from which to derive a suitable classpath // For now we can determine it from the java.class.path: - if (LangUtil.is19VMOrGreater()) { + if (LangUtil.is9VMOrGreater()) { list.add(0, LangUtil.getJrtFsFilePath()); List<String> javaClassPathEntries = makeClasspath(System.getProperty("java.class.path")); for (int i=javaClassPathEntries.size()-1;i>=0;i--) { @@ -945,4 +945,4 @@ public class WeavingAdaptor implements IMessageContext { public void setActiveProtectionDomain(ProtectionDomain protectionDomain) { activeProtectionDomain = protectionDomain; } -}
\ No newline at end of file +} diff --git a/weaver/src/test/java/org/aspectj/weaver/WeaverModuleTests.java b/weaver/src/test/java/org/aspectj/weaver/WeaverModuleTests.java index 78566e523..4ef5bf3e0 100644 --- a/weaver/src/test/java/org/aspectj/weaver/WeaverModuleTests.java +++ b/weaver/src/test/java/org/aspectj/weaver/WeaverModuleTests.java @@ -1,13 +1,13 @@ /* ******************************************************************* * Copyright (c) 2002 Palo Alto Research Center, Incorporated (PARC). - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * PARC initial implementation + * All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * PARC initial implementation * ******************************************************************/ package org.aspectj.weaver; @@ -110,7 +110,7 @@ public class WeaverModuleTests extends TestCase { suite.addTestSuite(FieldSetTestCase.class); suite.addTestSuite(HierarchyDependsTestCase.class); suite.addTestSuite(IdWeaveTestCase.class); - if (LangUtil.is19VMOrGreater()) { + if (LangUtil.is9VMOrGreater()) { suite.addTestSuite(JImageTestCase.class); } suite.addTestSuite(MegaZipTestCase.class); @@ -125,7 +125,7 @@ public class WeaverModuleTests extends TestCase { suite.addTestSuite(WorldTestCase.class); suite.addTestSuite(ZipTestCase.class); suite.addTestSuite(TypeXTestCase.class); - + suite.addTestSuite(AnnotationPatternMatchingTestCase.class); suite.addTestSuite(AnnotationPatternTestCase.class); suite.addTestSuite(ConcretizationTestCase.class); diff --git a/weaver/src/test/java/org/aspectj/weaver/bcel/JImageTestCase.java b/weaver/src/test/java/org/aspectj/weaver/bcel/JImageTestCase.java index abb8c08b2..faa645f84 100644 --- a/weaver/src/test/java/org/aspectj/weaver/bcel/JImageTestCase.java +++ b/weaver/src/test/java/org/aspectj/weaver/bcel/JImageTestCase.java @@ -1,10 +1,10 @@ /* ******************************************************************* * Copyright (c) 2017 Contributors - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html + * All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution and is available at + * http://www.eclipse.org/legal/epl-v10.html * ******************************************************************/ package org.aspectj.weaver.bcel; @@ -35,7 +35,7 @@ import junit.framework.TestCase; /** * Exercise the JImage handling in @link {@link org.aspectj.weaver.bcel.ClassPathManager}. - * + * * @author Andy Clement */ public class JImageTestCase extends TestCase { @@ -47,15 +47,15 @@ public class JImageTestCase extends TestCase { paths.add(LangUtil.getJrtFsFilePath()); cpm = new ClassPathManager(paths,new TestMessageHandler()); } - + public void testOnJava9() { - if (!LangUtil.is19VMOrGreater()) { + if (!LangUtil.is9VMOrGreater()) { System.out.println("SKIPPING JIMAGE TESTS AS NOT ON 1.9 OR LATER"); } } - - public void testBasicStructureAndCapabilities() { - if (!LangUtil.is19VMOrGreater()) return; + + public void testBasicStructureAndCapabilities() { + if (!LangUtil.is9VMOrGreater()) return; // Should be one entry for finding JRT contents List<Entry> entries = cpm.getEntries(); assertEquals(1,entries.size()); @@ -65,11 +65,11 @@ public class JImageTestCase extends TestCase { assertNotNull(stringClassFile); assertEquals("java/lang/String.class",stringClassFile.getPath()); } - + public void testBehaviour() throws Exception { - if (!LangUtil.is19VMOrGreater()) return; + if (!LangUtil.is9VMOrGreater()) return; JImageEntry jie = getJImageEntry(); - + Map<String, Path> packageCache = jie.getPackageCache(); assertTrue(packageCache.size()>0); // Note: seems to be about 1625 entries in it for Java9 @@ -77,12 +77,12 @@ public class JImageTestCase extends TestCase { assertEquals("modules/java.base/java/lang", path.toString()); path = packageCache.get("java/io"); assertEquals("modules/java.base/java/io", path.toString()); - + assertNotNull(jie.find("java/lang/String")); assertNotNull(jie.find("java/io/File")); // TODO test the filecache, hard because difficult to simulate collection of SoftReferences } - + static class TestMessageHandler implements IMessageHandler { @@ -103,11 +103,11 @@ public class JImageTestCase extends TestCase { @Override public void ignore(Kind kind) { } - + } // --- - + private JImageEntry getJImageEntry() { return (JImageEntry) cpm.getEntries().get(0); } |