diff options
author | Andy Clement <aclement@pivotal.io> | 2016-01-18 16:08:03 -0800 |
---|---|---|
committer | Andy Clement <aclement@pivotal.io> | 2016-01-18 16:08:03 -0800 |
commit | 448dc83571dc16c8b087e2d5e2242474c02ff819 (patch) | |
tree | 869a14d0d539c3f4c1f6881440b8b34e89e2ef4b /tests | |
parent | e3d5df726f39207ae93de93e4389dd004c93984c (diff) | |
download | aspectj-448dc83571dc16c8b087e2d5e2242474c02ff819.tar.gz aspectj-448dc83571dc16c8b087e2d5e2242474c02ff819.zip |
Fix 486203: NPE in IntelliJ since 1.8.7
Diffstat (limited to 'tests')
-rw-r--r-- | tests/bugs189/486203/While.java | 14 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/AllTests18.java | 10 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc189/Ajc189Tests.java | 39 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc189/AllTestsAspectJ189.java | 26 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc189/ajc189.xml | 9 |
5 files changed, 94 insertions, 4 deletions
diff --git a/tests/bugs189/486203/While.java b/tests/bugs189/486203/While.java new file mode 100644 index 000000000..f41e74aa8 --- /dev/null +++ b/tests/bugs189/486203/While.java @@ -0,0 +1,14 @@ +import java.util.function.Consumer; + +class While { + void m() { + t(Long.class, value -> { + int x = 1; + while (--x >= 0) + ; + }); + } + + <T> void t(Class<T> clazz, Consumer<T> object) { + } +} diff --git a/tests/src/org/aspectj/systemtest/AllTests18.java b/tests/src/org/aspectj/systemtest/AllTests18.java index 030bcfd45..a5382792b 100644 --- a/tests/src/org/aspectj/systemtest/AllTests18.java +++ b/tests/src/org/aspectj/systemtest/AllTests18.java @@ -10,24 +10,26 @@ *******************************************************************************/ package org.aspectj.systemtest; -import junit.framework.Test; -import junit.framework.TestSuite; - import org.aspectj.systemtest.ajc180.AllTestsAspectJ180; import org.aspectj.systemtest.ajc181.AllTestsAspectJ181; -import org.aspectj.systemtest.ajc182.AllTestsAspectJ182; +import org.aspectj.systemtest.ajc182.AllTestsAspectJ182; import org.aspectj.systemtest.ajc183.AllTestsAspectJ183; import org.aspectj.systemtest.ajc184.AllTestsAspectJ184; import org.aspectj.systemtest.ajc185.AllTestsAspectJ185; import org.aspectj.systemtest.ajc186.AllTestsAspectJ186; import org.aspectj.systemtest.ajc187.AllTestsAspectJ187; import org.aspectj.systemtest.ajc188.AllTestsAspectJ188; +import org.aspectj.systemtest.ajc189.AllTestsAspectJ189; + +import junit.framework.Test; +import junit.framework.TestSuite; public class AllTests18 { public static Test suite() { TestSuite suite = new TestSuite("AspectJ System Test Suite - 1.8"); // $JUnit-BEGIN$ + suite.addTest(AllTestsAspectJ189.suite()); suite.addTest(AllTestsAspectJ188.suite()); suite.addTest(AllTestsAspectJ187.suite()); suite.addTest(AllTestsAspectJ186.suite()); diff --git a/tests/src/org/aspectj/systemtest/ajc189/Ajc189Tests.java b/tests/src/org/aspectj/systemtest/ajc189/Ajc189Tests.java new file mode 100644 index 000000000..ac3ceb984 --- /dev/null +++ b/tests/src/org/aspectj/systemtest/ajc189/Ajc189Tests.java @@ -0,0 +1,39 @@ +/******************************************************************************* + * Copyright (c) 2016 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 + * + * Contributors: + * Andy Clement - initial API and implementation + *******************************************************************************/ +package org.aspectj.systemtest.ajc189; + +import java.io.File; + +import junit.framework.Test; + +import org.aspectj.testing.XMLBasedAjcTestCase; + +/** + * @author Andy Clement + */ +public class Ajc189Tests extends org.aspectj.testing.XMLBasedAjcTestCase { + + public void testWhileNPE_486203() throws Exception { + runTest("while npe"); + } + + // --- + + public static Test suite() { + return XMLBasedAjcTestCase.loadSuite(Ajc189Tests.class); + } + + @Override + protected File getSpecFile() { + return getClassResource("ajc189.xml"); + } + +} diff --git a/tests/src/org/aspectj/systemtest/ajc189/AllTestsAspectJ189.java b/tests/src/org/aspectj/systemtest/ajc189/AllTestsAspectJ189.java new file mode 100644 index 000000000..0ccf75cf2 --- /dev/null +++ b/tests/src/org/aspectj/systemtest/ajc189/AllTestsAspectJ189.java @@ -0,0 +1,26 @@ +/******************************************************************************* + * Copyright (c) 2016 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 + * + * Contributors: + * Andy Clement - initial API and implementation + *******************************************************************************/ +package org.aspectj.systemtest.ajc189; + +import junit.framework.Test; +import junit.framework.TestSuite; +import org.aspectj.systemtest.apt.AptTests; + +public class AllTestsAspectJ189 { + + public static Test suite() { + TestSuite suite = new TestSuite("AspectJ 1.8.9 tests"); + // $JUnit-BEGIN$ + suite.addTest(Ajc189Tests.suite()); + // $JUnit-END$ + return suite; + } +} diff --git a/tests/src/org/aspectj/systemtest/ajc189/ajc189.xml b/tests/src/org/aspectj/systemtest/ajc189/ajc189.xml new file mode 100644 index 000000000..f64438a25 --- /dev/null +++ b/tests/src/org/aspectj/systemtest/ajc189/ajc189.xml @@ -0,0 +1,9 @@ +<!DOCTYPE suite SYSTEM "../tests/ajcTestSuite.dtd"[]> + +<suite> + +<ajc-test dir="bugs189/486203" title="while npe"> +<compile files="While.java" options="-1.8"/> +</ajc-test> + +</suite> |