diff options
author | Andy Clement <aclement@pivotal.io> | 2016-03-29 10:01:01 -0700 |
---|---|---|
committer | Andy Clement <aclement@pivotal.io> | 2016-03-29 10:01:01 -0700 |
commit | 9eae797dd9c96826c7ab23f1ed9d3c26552c5c88 (patch) | |
tree | 88638bcdfa00f10d06cbf1a46d88ca247a5a89fc /tests/bugs1810/490315 | |
parent | ca093c254584afa382d073abe04144e968cdbccb (diff) | |
download | aspectj-9eae797dd9c96826c7ab23f1ed9d3c26552c5c88.tar.gz aspectj-9eae797dd9c96826c7ab23f1ed9d3c26552c5c88.zip |
Fix 490315 - InvokeDynamic.java:126 there is no classname for invokedynamic
Diffstat (limited to 'tests/bugs1810/490315')
-rwxr-xr-x | tests/bugs1810/490315/FailingAspect.java | 27 | ||||
-rwxr-xr-x | tests/bugs1810/490315/SomeAnno.java | 4 | ||||
-rwxr-xr-x | tests/bugs1810/490315/SomeContext.java | 13 | ||||
-rwxr-xr-x | tests/bugs1810/490315/SomeCriteria.java | 7 | ||||
-rwxr-xr-x | tests/bugs1810/490315/SomeDTO.java | 10 | ||||
-rwxr-xr-x | tests/bugs1810/490315/SomeEnum.java | 5 | ||||
-rwxr-xr-x | tests/bugs1810/490315/SomePiece.java | 30 | ||||
-rwxr-xr-x | tests/bugs1810/490315/SomePropertyDTO.java | 17 | ||||
-rwxr-xr-x | tests/bugs1810/490315/SomeService.java | 8 | ||||
-rwxr-xr-x | tests/bugs1810/490315/SomeServiceImpl.java | 16 |
10 files changed, 137 insertions, 0 deletions
diff --git a/tests/bugs1810/490315/FailingAspect.java b/tests/bugs1810/490315/FailingAspect.java new file mode 100755 index 000000000..4da191447 --- /dev/null +++ b/tests/bugs1810/490315/FailingAspect.java @@ -0,0 +1,27 @@ +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()); + } + +} diff --git a/tests/bugs1810/490315/SomeAnno.java b/tests/bugs1810/490315/SomeAnno.java new file mode 100755 index 000000000..112d3be17 --- /dev/null +++ b/tests/bugs1810/490315/SomeAnno.java @@ -0,0 +1,4 @@ +package test; + +public @interface SomeAnno { +} diff --git a/tests/bugs1810/490315/SomeContext.java b/tests/bugs1810/490315/SomeContext.java new file mode 100755 index 000000000..4eeb7a66a --- /dev/null +++ b/tests/bugs1810/490315/SomeContext.java @@ -0,0 +1,13 @@ +package test;
+
+public class SomeContext
+{
+ public SomeContext getPermissionDetails()
+ {
+ return this;
+ }
+
+ public boolean checkAccess(String tag, SomeEnum accessType) {
+ return false;
+ }
+}
diff --git a/tests/bugs1810/490315/SomeCriteria.java b/tests/bugs1810/490315/SomeCriteria.java new file mode 100755 index 000000000..0a0a90090 --- /dev/null +++ b/tests/bugs1810/490315/SomeCriteria.java @@ -0,0 +1,7 @@ +package test; + +/** + */ +public final class SomeCriteria { + +} diff --git a/tests/bugs1810/490315/SomeDTO.java b/tests/bugs1810/490315/SomeDTO.java new file mode 100755 index 000000000..d7bc67f30 --- /dev/null +++ b/tests/bugs1810/490315/SomeDTO.java @@ -0,0 +1,10 @@ +package test; + +import java.io.Serializable; + +public class SomeDTO implements Serializable { + + public String getTag() { + return "tag"; + } +} diff --git a/tests/bugs1810/490315/SomeEnum.java b/tests/bugs1810/490315/SomeEnum.java new file mode 100755 index 000000000..1ec35b7b6 --- /dev/null +++ b/tests/bugs1810/490315/SomeEnum.java @@ -0,0 +1,5 @@ +package test; + +public enum SomeEnum { + R; +} diff --git a/tests/bugs1810/490315/SomePiece.java b/tests/bugs1810/490315/SomePiece.java new file mode 100755 index 000000000..d12548b3d --- /dev/null +++ b/tests/bugs1810/490315/SomePiece.java @@ -0,0 +1,30 @@ +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; + } + +} diff --git a/tests/bugs1810/490315/SomePropertyDTO.java b/tests/bugs1810/490315/SomePropertyDTO.java new file mode 100755 index 000000000..0f2a835fc --- /dev/null +++ b/tests/bugs1810/490315/SomePropertyDTO.java @@ -0,0 +1,17 @@ +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; + } + +} diff --git a/tests/bugs1810/490315/SomeService.java b/tests/bugs1810/490315/SomeService.java new file mode 100755 index 000000000..b24dea2e9 --- /dev/null +++ b/tests/bugs1810/490315/SomeService.java @@ -0,0 +1,8 @@ +package test; + +import java.util.Collection; + +public interface SomeService { + + SomePiece<Collection<SomeDTO>> someMethod(SomeCriteria criteria); +}
\ No newline at end of file diff --git a/tests/bugs1810/490315/SomeServiceImpl.java b/tests/bugs1810/490315/SomeServiceImpl.java new file mode 100755 index 000000000..98a9978ad --- /dev/null +++ b/tests/bugs1810/490315/SomeServiceImpl.java @@ -0,0 +1,16 @@ +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 |