summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoraclement <aclement>2006-02-21 16:13:44 +0000
committeraclement <aclement>2006-02-21 16:13:44 +0000
commit3fa1bddb79a5e20a38cb39555e932df46f3d4dfa (patch)
tree2e20f46bb85f4f9ac9d69d15f9942a7a507739ac
parent89d66dc89110db0f89538a7b78308db61e5539cc (diff)
downloadaspectj-3fa1bddb79a5e20a38cb39555e932df46f3d4dfa.tar.gz
aspectj-3fa1bddb79a5e20a38cb39555e932df46f3d4dfa.zip
test and fix for 122742 (more @AJ thisJoinPoint problems...)
-rw-r--r--tests/bugs151/pr122742/AfterReturningTest.java52
-rw-r--r--tests/bugs151/pr122742/AfterThrowingTest.java50
-rw-r--r--tests/src/org/aspectj/systemtest/ajc151/Ajc151Tests.java8
-rw-r--r--tests/src/org/aspectj/systemtest/ajc151/ajc151.xml16
-rw-r--r--weaver/src/org/aspectj/weaver/Advice.java14
5 files changed, 138 insertions, 2 deletions
diff --git a/tests/bugs151/pr122742/AfterReturningTest.java b/tests/bugs151/pr122742/AfterReturningTest.java
new file mode 100644
index 000000000..9ec10a43e
--- /dev/null
+++ b/tests/bugs151/pr122742/AfterReturningTest.java
@@ -0,0 +1,52 @@
+import org.aspectj.lang.JoinPoint;
+import org.aspectj.lang.annotation.AfterReturning;
+import org.aspectj.lang.annotation.Aspect;
+
+@Aspect
+public class AfterReturningTest {
+
+ public static void main(String[] args) {
+ new B1().start();
+ }
+
+ // include "JoinPoint" in the argument list
+ @AfterReturning(pointcut = "execution(public B1 B1.start())", returning = "r")
+ public void afterJP(JoinPoint jp, B1 r) {
+ r.stop();
+ }
+
+ // include "JoinPoint.StaticPart" in the argument list
+ @AfterReturning(pointcut = "execution(public B1 B1.start())", returning = "r")
+ public void afterJPSP(JoinPoint.StaticPart jp, B1 r) {
+ r.stop();
+ }
+
+ // include "JoinPoint.EnclosingStaticPart" in the argument list
+ @AfterReturning(pointcut = "execution(public B1 B1.start())", returning = "r")
+ public void afterJPESP(JoinPoint.EnclosingStaticPart jp, B1 r) {
+ r.stop();
+ }
+
+ // include "JoinPoint and JoinPoint.EnclosingStaticPart" in the argument list
+ @AfterReturning(pointcut = "execution(public B1 B1.start())", returning = "r")
+ public void afterJPESP2(JoinPoint jp1, JoinPoint.EnclosingStaticPart jp, B1 r) {
+ r.stop();
+ }
+
+ // make sure it still works if "JoinPoint" is second in the argument list
+ @AfterReturning(pointcut = "execution(public B1 B1.start())", returning = "r")
+ public void afterJP2(B1 r, JoinPoint jp) {
+ r.stop();
+ }
+}
+
+class B1 {
+
+ public B1 start() {
+ return new B1();
+ }
+
+ public void stop() {
+ }
+
+}
diff --git a/tests/bugs151/pr122742/AfterThrowingTest.java b/tests/bugs151/pr122742/AfterThrowingTest.java
new file mode 100644
index 000000000..449893e37
--- /dev/null
+++ b/tests/bugs151/pr122742/AfterThrowingTest.java
@@ -0,0 +1,50 @@
+import org.aspectj.lang.JoinPoint;
+import org.aspectj.lang.annotation.AfterThrowing;
+import org.aspectj.lang.annotation.Aspect;
+
+@Aspect
+public class AfterThrowingTest {
+
+ public static void main(String[] args) {
+ try {
+ new B().start();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ // include "JoinPoint" in the argument list
+ @AfterThrowing(pointcut = "execution(public void B.start())", throwing = "ex")
+ public void handleExceptionJP(JoinPoint jp, Exception ex) {
+ }
+
+ // include "JoinPoint.StaticPart" in the argument list
+ @AfterThrowing(pointcut = "execution(public void B.start())", throwing = "ex")
+ public void handleExceptionJPSP(JoinPoint.StaticPart jp, Exception ex) {
+ }
+
+ // include "JoinPoint.EnclosingStaticPart" in the argument list
+ @AfterThrowing(pointcut = "execution(public void B.start())", throwing = "ex")
+ public void handleExceptionJPESP(JoinPoint.EnclosingStaticPart jp, Exception ex) {
+ }
+
+ // include "JoinPoint" and "JoinPoint.EnclosingStaticPart" in the argument list
+ @AfterThrowing(pointcut = "execution(public void B.start())", throwing = "ex")
+ public void handleExceptionJPESP(JoinPoint jp1, JoinPoint.EnclosingStaticPart jp, Exception ex) {
+ }
+
+ // make sure it still works if "JoinPoint" is second on the argument list
+ @AfterThrowing(pointcut = "execution(public void B.start())", throwing = "ex")
+ public void handleExceptionJP2(JoinPoint jp, Exception ex) {
+ }
+}
+
+class B implements I {
+ public void start() throws Exception {
+ throw new IllegalArgumentException();
+ }
+}
+
+interface I {
+ public void start() throws Exception;
+}
diff --git a/tests/src/org/aspectj/systemtest/ajc151/Ajc151Tests.java b/tests/src/org/aspectj/systemtest/ajc151/Ajc151Tests.java
index 2672caa3e..922d278cd 100644
--- a/tests/src/org/aspectj/systemtest/ajc151/Ajc151Tests.java
+++ b/tests/src/org/aspectj/systemtest/ajc151/Ajc151Tests.java
@@ -87,6 +87,14 @@ public class Ajc151Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
runTest("swallowed exceptions");
}
+ public void testAtAspectVerifyErrorWithAfterThrowingAndthisJoinPoint_pr122742() {
+ runTest("@AJ VerifyError with @AfterThrowing and thisJoinPoint argument");
+ }
+
+ public void testAtAspectVerifyErrorWithAfterReturningAndthisJoinPoint_pr122742() {
+ runTest("@AJ VerifyError with @AfterReturning and thisJoinPoint argument");
+ }
+
public void testSwallowedExceptionIgnored() {
runTest("swallowed exceptions with xlint");
}
diff --git a/tests/src/org/aspectj/systemtest/ajc151/ajc151.xml b/tests/src/org/aspectj/systemtest/ajc151/ajc151.xml
index d340d0778..9c6a85b45 100644
--- a/tests/src/org/aspectj/systemtest/ajc151/ajc151.xml
+++ b/tests/src/org/aspectj/systemtest/ajc151/ajc151.xml
@@ -14,8 +14,20 @@
<ajc-test dir="bugs151/pr127299" title="missing import gives funny message">
<compile files="ModelErrorConversion.aj" options="-1.5"/>
- </ajc-test>
-
+ </ajc-test>
+
+ <ajc-test dir="bugs151/pr122742" title="@AJ VerifyError with @AfterThrowing and thisJoinPoint argument">
+ <compile files="AfterThrowingTest.java" options="-1.5"/>
+ <run class="AfterThrowingTest">
+ </run>
+ </ajc-test>
+
+ <ajc-test dir="bugs151/pr122742" title="@AJ VerifyError with @AfterReturning and thisJoinPoint argument">
+ <compile files="AfterReturningTest.java" options="-1.5"/>
+ <run class="AfterReturningTest">
+ </run>
+ </ajc-test>
+
<ajc-test dir="bugs151/pr120527" title="incorrect unused interface message">
<compile files="Bugs.aj" options="-warn:unusedPrivate"/>
</ajc-test>
diff --git a/weaver/src/org/aspectj/weaver/Advice.java b/weaver/src/org/aspectj/weaver/Advice.java
index f8b26a41e..4f663de6a 100644
--- a/weaver/src/org/aspectj/weaver/Advice.java
+++ b/weaver/src/org/aspectj/weaver/Advice.java
@@ -285,6 +285,20 @@ public abstract class Advice extends ShadowMunger {
public UnresolvedType getExtraParameterType() {
if (!hasExtraParameter()) return ResolvedType.MISSING;
if (signature instanceof ResolvedMember) {
+ if (getConcreteAspect().isAnnotationStyleAspect()) {
+ // bug 122742 - if we're an annotation style aspect then one
+ // of the extra parameters could be JoinPoint which we want
+ // to ignore
+ int baseParmCnt = getBaseParameterCount();
+ UnresolvedType[] genericParameterTypes = ((ResolvedMember)signature).getGenericParameterTypes();
+ while ((baseParmCnt + 1 < genericParameterTypes.length)
+ && (genericParameterTypes[baseParmCnt].equals(AjcMemberMaker.TYPEX_JOINPOINT)
+ || genericParameterTypes[baseParmCnt].equals(AjcMemberMaker.TYPEX_STATICJOINPOINT)
+ || genericParameterTypes[baseParmCnt].equals(AjcMemberMaker.TYPEX_ENCLOSINGSTATICJOINPOINT))) {
+ baseParmCnt++;
+ }
+ return ((ResolvedMember)signature).getGenericParameterTypes()[baseParmCnt];
+ }
return ((ResolvedMember)signature).getGenericParameterTypes()[getBaseParameterCount()];
} else {
return signature.getParameterTypes()[getBaseParameterCount()];
e30 Nextcloud server, a safe home for all your data: https://github.com/nextcloud/serverwww-data
summaryrefslogtreecommitdiffstats
path: root/l10n/vi/files.po
blob: 556eb3d9acb2fc82264c7bd9c74bb624804e4caf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224