The -Xlintfile:lint.properties allows fine-grained control. In tools.jar, see
org/aspectj/weaver/XlintDefault.properties for the default behavior and a template to copy.
### AspectJ-specific messages
-compiler.name = AspectJ Compiler 1.8.9
+compiler.name = AspectJ Compiler 1.8.10
compiler.version = Eclipse Compiler Mars.2 #A7BBA8B1, 3.12
compiler.copyright =
}
}
- ((IProgramElement) stack.peek()).addChild(peNode);
+ IProgramElement ipe = (IProgramElement)stack.peek();
+ if (ipe!=null) {
+ // With AspectJ 1.8.9 the type structure must be slightly different as the guard
+ // is required (the null is due to a default constructor).
+ ((IProgramElement) stack.peek()).addChild(peNode);
+ }
stack.push(peNode);
return true;
}
--- /dev/null
+package test;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.stream.Collectors;
+
+import org.aspectj.lang.ProceedingJoinPoint;
+import org.aspectj.lang.annotation.Around;
+import org.aspectj.lang.annotation.Aspect;
+
+@Aspect
+public class FailingAspect {
+
+ SomeContext authenticationContext;
+
+ @SuppressWarnings("unchecked")
+ @Around("execution(* test..SomeServiceImpl.someMethod(test.SomeCriteria))" +
+ "&& @annotation(test.SomeAnno)")
+ public SomePiece<Collection<SomeDTO>> interceptSomeMethod(ProceedingJoinPoint pjp) throws Throwable {
+ SomePiece<Collection<SomeDTO>> piece = (SomePiece<Collection<SomeDTO>>) pjp.proceed();
+ List<SomeDTO> filteredResult = piece.getData().stream().filter(item ->
+ authenticationContext.getPermissionDetails().checkAccess(
+ item.getTag(), SomeEnum.R)).collect(Collectors.toList());
+ return new SomePiece<>(filteredResult, piece.isLast());
+ }
+
+}
--- /dev/null
+package test;
+
+public @interface SomeAnno {
+}
--- /dev/null
+package test;\r
+\r
+public class SomeContext\r
+{\r
+ public SomeContext getPermissionDetails()\r
+ {\r
+ return this;\r
+ }\r
+ \r
+ public boolean checkAccess(String tag, SomeEnum accessType) {\r
+ return false;\r
+ }\r
+}\r
--- /dev/null
+package test;
+
+/**
+ */
+public final class SomeCriteria {
+
+}
--- /dev/null
+package test;
+
+import java.io.Serializable;
+
+public class SomeDTO implements Serializable {
+
+ public String getTag() {
+ return "tag";
+ }
+}
--- /dev/null
+package test;
+
+public enum SomeEnum {
+ R;
+}
--- /dev/null
+package test;
+
+public class SomePiece<T> {
+
+ private T data;
+ private boolean last;
+ private Long totalCount;
+
+ public SomePiece(T data, boolean last) {
+ this.data = data;
+ this.last = last;
+ }
+
+ public T getData() {
+ return data;
+ }
+
+ public boolean isLast() {
+ return last;
+ }
+
+ public Long getTotalCount() {
+ return totalCount;
+ }
+
+ public void setTotalCount(Long totalCount) {
+ this.totalCount = totalCount;
+ }
+
+}
--- /dev/null
+package test;
+
+import java.io.Serializable;
+
+public class SomePropertyDTO implements Serializable, Comparable<SomePropertyDTO> {
+
+ /* (non-Javadoc)
+ * @see java.lang.Comparable#compareTo(java.lang.Object)
+ */
+ @Override
+ public int compareTo(SomePropertyDTO o)
+ {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+}
--- /dev/null
+package test;
+
+import java.util.Collection;
+
+public interface SomeService {
+
+ SomePiece<Collection<SomeDTO>> someMethod(SomeCriteria criteria);
+}
\ No newline at end of file
--- /dev/null
+package test;
+
+import java.util.Collection;
+
+/**
+ */
+public class SomeServiceImpl implements SomeService {
+
+ @Override
+ @SomeAnno
+ public SomePiece<Collection<SomeDTO>> someMethod(SomeCriteria criteria) {
+ System.out.println("stuff");
+
+ return null;
+ }
+}
\ No newline at end of file
import org.aspectj.systemtest.ajc180.AllTestsAspectJ180;
import org.aspectj.systemtest.ajc181.AllTestsAspectJ181;
+import org.aspectj.systemtest.ajc1810.AllTestsAspectJ1810;
import org.aspectj.systemtest.ajc182.AllTestsAspectJ182;
import org.aspectj.systemtest.ajc183.AllTestsAspectJ183;
import org.aspectj.systemtest.ajc184.AllTestsAspectJ184;
public static Test suite() {
TestSuite suite = new TestSuite("AspectJ System Test Suite - 1.8");
// $JUnit-BEGIN$
+ suite.addTest(AllTestsAspectJ1810.suite());
suite.addTest(AllTestsAspectJ189.suite());
suite.addTest(AllTestsAspectJ188.suite());
suite.addTest(AllTestsAspectJ187.suite());
--- /dev/null
+/*******************************************************************************
+ * 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.ajc1810;
+
+import java.io.File;
+
+import junit.framework.Test;
+
+import org.aspectj.apache.bcel.classfile.JavaClass;
+import org.aspectj.testing.XMLBasedAjcTestCase;
+
+/**
+ * @author Andy Clement
+ */
+public class Ajc1810Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
+
+ public void testInvokeDynamic_490315() {
+ runTest("indy");
+ }
+
+// public void testOverweaving_352389() throws Exception {
+// runTest("overweaving");
+// }
+
+ // ---
+
+ public static Test suite() {
+ return XMLBasedAjcTestCase.loadSuite(Ajc1810Tests.class);
+ }
+
+ @Override
+ protected File getSpecFile() {
+ return getClassResource("ajc1810.xml");
+ }
+
+}
--- /dev/null
+/*******************************************************************************
+ * 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.ajc1810;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+public class AllTestsAspectJ1810 {
+
+ public static Test suite() {
+ TestSuite suite = new TestSuite("AspectJ 1.8.10 tests");
+ // $JUnit-BEGIN$
+ suite.addTest(Ajc1810Tests.suite());
+ // $JUnit-END$
+ return suite;
+ }
+}
--- /dev/null
+<!DOCTYPE suite SYSTEM "../tests/ajcTestSuite.dtd"[]>
+
+<suite>
+
+ <ajc-test dir="bugs1810/490315" title="indy">
+ <compile options="-1.8" files="FailingAspect.java SomeAnno.java SomeContext.java SomeCriteria.java SomeDTO.java SomeEnum.java SomePiece.java SomePropertyDTO.java SomeService.java SomeServiceImpl.java"/>
+ </ajc-test>
+
+</suite>
import org.aspectj.apache.bcel.generic.InstructionFactory;
import org.aspectj.apache.bcel.generic.InstructionHandle;
import org.aspectj.apache.bcel.generic.InstructionList;
+import org.aspectj.apache.bcel.generic.InvokeDynamic;
import org.aspectj.apache.bcel.generic.InvokeInstruction;
import org.aspectj.apache.bcel.generic.Type;
import org.aspectj.weaver.AjAttribute;
// open-up method call
if ((inst instanceof InvokeInstruction)) {
InvokeInstruction invoke = (InvokeInstruction) inst;
+ if (invoke instanceof InvokeDynamic) {
+ realizedCannotInline = true;
+ break;
+ }
ResolvedType callee = aspectGen.getWorld().resolve(UnresolvedType.forName(invoke.getClassName(cpg)));
// look in the whole method list and not just declared for super calls and alike