aboutsummaryrefslogtreecommitdiffstats
path: root/tests/bugs1810
diff options
context:
space:
mode:
Diffstat (limited to 'tests/bugs1810')
-rwxr-xr-xtests/bugs1810/490315/FailingAspect.java27
-rwxr-xr-xtests/bugs1810/490315/SomeAnno.java4
-rwxr-xr-xtests/bugs1810/490315/SomeContext.java13
-rwxr-xr-xtests/bugs1810/490315/SomeCriteria.java7
-rwxr-xr-xtests/bugs1810/490315/SomeDTO.java10
-rwxr-xr-xtests/bugs1810/490315/SomeEnum.java5
-rwxr-xr-xtests/bugs1810/490315/SomePiece.java30
-rwxr-xr-xtests/bugs1810/490315/SomePropertyDTO.java17
-rwxr-xr-xtests/bugs1810/490315/SomeService.java8
-rwxr-xr-xtests/bugs1810/490315/SomeServiceImpl.java16
-rw-r--r--tests/bugs1810/493554/Cmd.java10
-rw-r--r--tests/bugs1810/493554/Cmd.kt9
-rw-r--r--tests/bugs1810/493554/Code.java5
-rw-r--r--tests/bugs1810/493554/Dep.java14
-rw-r--r--tests/bugs1810/493554/FooAspect.aj17
-rw-r--r--tests/bugs1810/493554/FooAspect.java25
16 files changed, 217 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
diff --git a/tests/bugs1810/493554/Cmd.java b/tests/bugs1810/493554/Cmd.java
new file mode 100644
index 000000000..8954d08af
--- /dev/null
+++ b/tests/bugs1810/493554/Cmd.java
@@ -0,0 +1,10 @@
+package example.kusedep;
+
+import example.dep.Dep;
+
+public class Cmd {
+ public static void main(String[] args) {
+ Dep dep = new Dep();
+ System.out.println(dep);
+ }
+}
diff --git a/tests/bugs1810/493554/Cmd.kt b/tests/bugs1810/493554/Cmd.kt
new file mode 100644
index 000000000..a9a0238eb
--- /dev/null
+++ b/tests/bugs1810/493554/Cmd.kt
@@ -0,0 +1,9 @@
+package example.kusedep;
+
+import example.dep.Dep;
+
+fun main(args: Array<String>) {
+ val dep = Dep()
+ println(dep)
+ System.exit(0)
+}
diff --git a/tests/bugs1810/493554/Code.java b/tests/bugs1810/493554/Code.java
new file mode 100644
index 000000000..16a6a642b
--- /dev/null
+++ b/tests/bugs1810/493554/Code.java
@@ -0,0 +1,5 @@
+public class Code {
+ public static void main(String []argv) {
+ new Runnable() { public void run() {}};
+ }
+}
diff --git a/tests/bugs1810/493554/Dep.java b/tests/bugs1810/493554/Dep.java
new file mode 100644
index 000000000..8ed5c1500
--- /dev/null
+++ b/tests/bugs1810/493554/Dep.java
@@ -0,0 +1,14 @@
+package example.dep;
+
+public class Dep {
+ private int a, b, c;
+
+ public Dep() {
+ a = 5;
+ }
+
+ public String toString() {
+
+ return "Dep";
+ }
+}
diff --git a/tests/bugs1810/493554/FooAspect.aj b/tests/bugs1810/493554/FooAspect.aj
new file mode 100644
index 000000000..4ad4c22cc
--- /dev/null
+++ b/tests/bugs1810/493554/FooAspect.aj
@@ -0,0 +1,17 @@
+package example.aspect;
+
+import example.dep.Dep;
+
+public aspect FooAspect pertarget(setFieldValue(Dep)) {
+
+ // interface ajcMightHaveAspect { }
+
+ pointcut setFieldValue(Dep dep) :
+ set(private * Dep.*) && target(dep);
+
+ void around(Dep dep) : setFieldValue(dep) {
+System.out.println("advised");
+ proceed(dep);
+ }
+
+}
diff --git a/tests/bugs1810/493554/FooAspect.java b/tests/bugs1810/493554/FooAspect.java
new file mode 100644
index 000000000..87406db94
--- /dev/null
+++ b/tests/bugs1810/493554/FooAspect.java
@@ -0,0 +1,25 @@
+
+package example.aspect;
+
+import org.aspectj.lang.*;
+import org.aspectj.lang.annotation.*;
+
+import example.dep.Dep;
+
+@Aspect("pertarget(setFieldValue(example.dep.Dep))")
+public class FooAspect {
+
+ // interface ajcMightHaveAspect { }
+
+ @Pointcut("set(private * example.dep.Dep.*) && target(dep)")
+ public void setFieldValue(Dep dep) {}
+ //pointcut setFieldValue(Dep dep) : set(private * Dep.*) && target(dep);
+
+ @Around("setFieldValue(dep)")
+ public void foo(Dep dep, ProceedingJoinPoint pjp) {
+ //void around(Dep dep) : setFieldValue(dep) {
+System.out.println("advised");
+ pjp.proceed(new Object[]{dep});
+ }
+
+}