Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640
  1. <!DOCTYPE suite SYSTEM "../tests/ajcTestSuite.dtd"[]>
  2. <!-- AspectJ v1.5.1 Tests -->
  3. <suite>
  4. <ajc-test dir="features152/synchronization" title="basic">
  5. <compile files="Basic.java" options="-1.5 -showWeaveInfo -Xjoinpoints:synchronization">
  6. </compile>
  7. <run class="Basic">
  8. <stderr>
  9. <line text="methodWithSyncBlock1"/>
  10. <line text="staticMethodWithSyncBlock1"/>
  11. <line text="methodWithSyncBlock2"/>
  12. <line text="staticMethodWithSyncBlock2"/>
  13. </stderr>
  14. </run>
  15. </ajc-test>
  16. <ajc-test dir="features152/synchronization" title="basic - within">
  17. <compile files="Basic2.java" options="-1.5 -Xjoinpoints:synchronization">
  18. </compile>
  19. <run class="Basic2">
  20. <stderr>
  21. <line text="methodWithSyncBlock1"/>
  22. <line text="Advice running at lock(Object)"/>
  23. <line text="Advice running at unlock(Object)"/>
  24. <line text="staticMethodWithSyncBlock1"/>
  25. <line text="Advice running at lock(Object)"/>
  26. <line text="Advice running at unlock(Object)"/>
  27. <line text="methodWithSyncBlock2"/>
  28. <line text="Advice running at lock(Object)"/>
  29. <line text="Advice running at unlock(Object)"/>
  30. <line text="staticMethodWithSyncBlock2"/>
  31. <line text="Advice running at lock(Object)"/>
  32. <line text="Advice running at unlock(Object)"/>
  33. </stderr>
  34. </run>
  35. </ajc-test>
  36. <ajc-test dir="features152/synchronization" title="basic - within plus args">
  37. <compile files="Basic3.java" options="-1.5 -Xjoinpoints:synchronization">
  38. </compile>
  39. <run class="Basic3">
  40. <stderr>
  41. <line text="methodWithSyncBlock1"/>
  42. <line text="Advice running at lock(Object) with this of type class Basic3 with value Basic3@"/>
  43. <line text="Advice running at unlock(Object) with this of type class Basic3 with value Basic3@"/>
  44. <line text="staticMethodWithSyncBlock1"/>
  45. <line text="Advice running at lock(Object) with this of type class Basic3 with value Basic3@"/>
  46. <line text="Advice running at unlock(Object) with this of type class Basic3 with value Basic3@"/>
  47. <line text="methodWithSyncBlock2"/>
  48. <line text="Advice running at lock(Object) with this of type class Basic3 with value Basic3@"/>
  49. <line text="Advice running at unlock(Object) with this of type class Basic3 with value Basic3@"/>
  50. <line text="staticMethodWithSyncBlock2"/>
  51. <line text="Advice running at lock(Object) with this of type class Basic3 with value Basic3@"/>
  52. <line text="Advice running at unlock(Object) with this of type class Basic3 with value Basic3@"/>
  53. </stderr>
  54. </run>
  55. </ajc-test>
  56. <ajc-test dir="features152/synchronization" title="basic - within plus this">
  57. <compile files="Basic4.java" options="-1.5 -Xjoinpoints:synchronization">
  58. </compile>
  59. <run class="Basic4">
  60. <stderr>
  61. <line text="methodWithSyncBlock1"/>
  62. <line text="Advice running at lock(Object) with args of type class Basic4 with value Basic4@"/>
  63. <line text="Advice running at unlock(Object) with args of type class Basic4 with value Basic4@"/>
  64. <line text="staticMethodWithSyncBlock1"/>
  65. <line text="Advice running at lock(Object) with args of type class java.lang.Class with value class Basic4"/>
  66. <line text="Advice running at unlock(Object) with args of type class java.lang.Class with value class Basic4"/>
  67. <line text="methodWithSyncBlock2"/>
  68. <line text="Advice running at lock(Object) with args of type class Basic4 with value Basic4@"/>
  69. <line text="Advice running at unlock(Object) with args of type class Basic4 with value Basic4@"/>
  70. <line text="staticMethodWithSyncBlock2"/>
  71. <line text="Advice running at lock(Object) with args of type class java.lang.Class with value class Basic4"/>
  72. <line text="Advice running at unlock(Object) with args of type class java.lang.Class with value class Basic4"/>
  73. </stderr>
  74. </run>
  75. </ajc-test>
  76. <ajc-test dir="features152/synchronization" title="basic - within plus target">
  77. <compile files="Basic5.java" options="-1.5 -Xjoinpoints:synchronization">
  78. </compile>
  79. <run class="Basic5">
  80. <stderr>
  81. <line text="Advice running at void Basic5.methodWithSyncBlock1() with target of type class Basic5 with value Basic5@"/>
  82. <line text="Advice running at void Basic5.methodWithSyncBlock1() with target of type class Basic5 with value Basic5@"/>
  83. <line text="methodWithSyncBlock1"/>
  84. <line text="Advice running at void Basic5.staticMethodWithSyncBlock1() with target of type class Basic5 with value Basic5@"/>
  85. <line text="Advice running at void Basic5.staticMethodWithSyncBlock1() with target of type class Basic5 with value Basic5@"/>
  86. <line text="staticMethodWithSyncBlock1"/>
  87. <line text="Advice running at void Basic5.methodWithSyncBlock2() with target of type class Basic5 with value Basic5@"/>
  88. <line text="Advice running at void Basic5.methodWithSyncBlock2() with target of type class Basic5 with value Basic5@"/>
  89. <line text="methodWithSyncBlock2"/>
  90. <line text="Advice running at void Basic5.staticMethodWithSyncBlock2() with target of type class Basic5 with value Basic5@"/>
  91. <line text="Advice running at void Basic5.staticMethodWithSyncBlock2() with target of type class Basic5 with value Basic5@"/>
  92. <line text="staticMethodWithSyncBlock2"/>
  93. </stderr>
  94. </run>
  95. </ajc-test>
  96. <ajc-test dir="features152/synchronization" title="a useful program">
  97. <compile files="Useful1.java" options="-1.5 -Xjoinpoints:synchronization">
  98. </compile>
  99. <run class="Useful1">
  100. <stderr>
  101. <line text="Average lock taking time over 2000"/>
  102. <line text="We did time something!"/>
  103. </stderr>
  104. </run>
  105. </ajc-test>
  106. <ajc-test dir="features152/synchronization" title="parsing - lock">
  107. <compile files="Parsing1.java" options="-1.5 -Xjoinpoints:synchronization">
  108. <message kind="warning" line="5" text="advice defined in Parsing1 has not been applied [Xlint:adviceDidNotMatch]"/>
  109. </compile>
  110. </ajc-test>
  111. <ajc-test dir="features152/synchronization" title="parsing - unlock">
  112. <compile files="Parsing2.java" options="-1.5 -Xjoinpoints:synchronization">
  113. <message kind="warning" line="5" text="advice defined in Parsing2 has not been applied [Xlint:adviceDidNotMatch]"/>
  114. </compile>
  115. </ajc-test>
  116. <ajc-test dir="features152/synchronization" title="parsing - error - lock">
  117. <compile files="Parsing1.java" options="-1.5">
  118. <message kind="warning" line="5" text="advice defined in Parsing1 has not been applied [Xlint:adviceDidNotMatch]"/>
  119. <!-- this next warning comes out twice because we unpack the attributes twice... -->
  120. <message kind="warning" line="5" text="lock() pointcut designator cannot be used without the option -Xjoinpoints:synchronization"/>
  121. </compile>
  122. </ajc-test>
  123. <ajc-test dir="features152/synchronization" title="parsing - error - unlock">
  124. <compile files="Parsing2.java" options="-1.5">
  125. <message kind="warning" line="5" text="advice defined in Parsing2 has not been applied [Xlint:adviceDidNotMatch]"/>
  126. <!-- this next warning comes out twice because we unpack the attributes twice... -->
  127. <message kind="warning" line="5" text="unlock() pointcut designator cannot be used without the option -Xjoinpoints:synchronization"/>
  128. </compile>
  129. </ajc-test>
  130. <ajc-test dir="features152/synchronization" title="parsing and matching - lock and static context">
  131. <compile files="ParsingAndMatching1.java" options="-1.5 -Xjoinpoints:synchronization"/>
  132. <run class="ParsingAndMatching1">
  133. <stderr>
  134. <line text="Advice running at ParsingAndMatching1.java:14"/>
  135. <line text="static method running"/>
  136. </stderr>
  137. </run>
  138. </ajc-test>
  139. <ajc-test dir="features152/synchronization" title="using lock with LTW - missing flag">
  140. <compile files="LockAspect1.java" options="-1.5">
  141. <message kind="warning" line="6" text="lock() pointcut designator cannot be used without the option -Xjoinpoints:synchronization"/>
  142. </compile>
  143. <compile files="BasicProgram1.java" options="-1.5"/>
  144. <run class="BasicProgram1" ltw="aop1.xml">
  145. <stderr>
  146. <!-- warning is something like 'warning at C:\temp\ajcSandbox\ajcTest61975.tmp\LockAspect1.java:6::0 lock() pointcut designator cannot be used without the option -Xjoinpoints:synchronization'/-->
  147. <line text="warning at "/>
  148. <line text="nonstatic method running"/>
  149. <line text="static method running"/>
  150. </stderr>
  151. </run>
  152. </ajc-test>
  153. <ajc-test dir="features152/synchronization/transformed" title="transform with LTW">
  154. <compile files="CaptureLock.aj" options="-1.5"/>
  155. <compile files="Program.java" options="-1.5"/>
  156. <run class="Program" ltw="aop1.xml">
  157. <stdout>
  158. <line text="Before a lock or unlock"/>
  159. <line text="hello from b()"/>
  160. <line text="Before a lock or unlock"/>
  161. <line text="Before a lock or unlock"/>
  162. <line text="bang in c()"/>
  163. <line text="Before a lock or unlock"/>
  164. <line text="Before a lock or unlock"/>
  165. <line text="hello from d()"/>
  166. <line text="Before a lock or unlock"/>
  167. <line text="hello from block in d()"/>
  168. <line text="Before a lock or unlock"/>
  169. <line text="Before a lock or unlock"/>
  170. </stdout>
  171. </run>
  172. </ajc-test>
  173. <ajc-test dir="features152/synchronization" title="using lock with LTW">
  174. <compile files="LockAspect1.java" options="-1.5 -Xjoinpoints:synchronization"/>
  175. <compile files="BasicProgram1.java" options="-1.5 -Xjoinpoints:synchronization"/>
  176. <run class="BasicProgram1" ltw="aop3.xml">
  177. <stderr>
  178. <line text="weaveinfo Join point 'lock(void java.lang.Object.&lt;lock&gt;(java.lang.Object))' in Type 'BasicProgram1' (BasicProgram1.java:11) advised by before advice from 'LockAspect1' (LockAspect1.java:6)"/>
  179. <line text="weaveinfo Join point 'lock(void java.lang.Object.&lt;lock&gt;(java.lang.Object))' in Type 'BasicProgram1' (BasicProgram1.java:17) advised by before advice from 'LockAspect1' (LockAspect1.java:6)"/>
  180. <line text="Lock advice running at BasicProgram1.java:17"/>
  181. <line text="nonstatic method running"/>
  182. <line text="Lock advice running at BasicProgram1.java:11"/>
  183. <line text="static method running"/>
  184. </stderr>
  185. </run>
  186. </ajc-test>
  187. <ajc-test dir="features152/synchronization" title="using unlock with LTW">
  188. <compile files="UnlockAspect1.java" options="-1.5 -Xjoinpoints:synchronization"/>
  189. <compile files="BasicProgram1.java" options="-1.5 -Xjoinpoints:synchronization"/>
  190. <run class="BasicProgram1" ltw="aop4.xml">
  191. <stderr>
  192. <line text="weaveinfo Join point 'unlock(void java.lang.Object.&lt;unlock&gt;(java.lang.Object))' in Type 'BasicProgram1' (BasicProgram1.java:11) advised by before advice from 'UnlockAspect1' (UnlockAspect1.java:6)"/>
  193. <line text="weaveinfo Join point 'unlock(void java.lang.Object.&lt;unlock&gt;(java.lang.Object))' in Type 'BasicProgram1' (BasicProgram1.java:17) advised by before advice from 'UnlockAspect1' (UnlockAspect1.java:6)"/>
  194. <line text="nonstatic method running"/>
  195. <line text="Unlock advice running at BasicProgram1.java:17"/>
  196. <line text="static method running"/>
  197. <line text="Unlock advice running at BasicProgram1.java:11"/>
  198. </stderr>
  199. </run>
  200. </ajc-test>
  201. <ajc-test dir="features152/synchronization" title="using unlock with LTW - missing flag">
  202. <compile files="UnlockAspect1.java" options="-1.5">
  203. <message kind="warning" line="6" text="unlock() pointcut designator cannot be used without the option -Xjoinpoints:synchronization"/>
  204. </compile>
  205. <compile files="BasicProgram1.java" options="-1.5"/>
  206. <run class="BasicProgram1" ltw="aop2.xml">
  207. <stderr>
  208. <line text="warning at "/>
  209. <line text="nonstatic method running"/>
  210. <line text="static method running"/>
  211. </stderr>
  212. </run>
  213. </ajc-test>
  214. <ajc-test dir="features152/synchronization" title="parsing and matching - unlock and static context">
  215. <compile files="ParsingAndMatching2.java" options="-1.5 -Xjoinpoints:synchronization"/>
  216. <run class="ParsingAndMatching2">
  217. <stderr>
  218. <line text="static method running"/>
  219. <line text="Advice running at ParsingAndMatching2.java:14"/>
  220. </stderr>
  221. </run>
  222. </ajc-test>
  223. <ajc-test dir="features152/synchronization" title="parsing and matching - lock and non-static context">
  224. <compile files="ParsingAndMatching3.java" options="-1.5 -Xjoinpoints:synchronization"/>
  225. <run class="ParsingAndMatching3">
  226. <stderr>
  227. <line text="Advice running at ParsingAndMatching3.java:15"/>
  228. <line text="non-static method running"/>
  229. </stderr>
  230. </run>
  231. </ajc-test>
  232. <ajc-test dir="features152/synchronization" title="parsing and matching - unlock and non-static context">
  233. <compile files="ParsingAndMatching4.java" options="-1.5 -Xjoinpoints:synchronization"/>
  234. <run class="ParsingAndMatching4">
  235. <stderr>
  236. <line text="non-static method running"/>
  237. <line text="Advice running at ParsingAndMatching4.java:15"/>
  238. </stderr>
  239. </run>
  240. </ajc-test>
  241. <ajc-test dir="features152/synchronization" title="a useful program - with lock">
  242. <compile files="Useful2.java" options="-1.5 -showWeaveInfo -Xjoinpoints:synchronization">
  243. <message kind="weave" text="Join point 'method-execution(void Useful2.main(java.lang.String[]))' in Type 'Useful2' (Useful2.java:33) advised by afterReturning advice from 'LockMonitor' (Useful2.java:25)"/>
  244. <message kind="weave" text="Join point 'lock(void java.lang.Object.&lt;lock&gt;(java.lang.Object))' in Type 'Useful2' (Useful2.java:42) advised by before advice from 'LockMonitor' (Useful2.java:9) [with runtime test]"/>
  245. <message kind="weave" text="Join point 'unlock(void java.lang.Object.&lt;unlock&gt;(java.lang.Object))' in Type 'Useful2' (Useful2.java:42) advised by after advice from 'LockMonitor' (Useful2.java:14) [with runtime test]"/>
  246. <!-- hope we aren't getting double messages out -->
  247. </compile>
  248. <run class="Useful2">
  249. <stderr>
  250. <line text="Average time spent with lock over"/>
  251. </stderr>
  252. </run>
  253. </ajc-test>
  254. <ajc-test dir="features152/synchronization" title="combining pcds - lock and this">
  255. <compile files="CombiningPCDs1.java" options="-1.5 -Xjoinpoints:synchronization"/>
  256. <run class="CombiningPCDs1">
  257. <stderr>
  258. <line text="static method running"/>
  259. <line text="advice running at CombiningPCDs1.java:17"/>
  260. <line text="non-static method running"/>
  261. </stderr>
  262. </run>
  263. </ajc-test>
  264. <ajc-test dir="features152/synchronization" title="combining pcds - unlock and this">
  265. <compile files="CombiningPCDs2.java" options="-1.5 -Xjoinpoints:synchronization"/>
  266. <run class="CombiningPCDs2">
  267. <stderr>
  268. <line text="static method running"/>
  269. <line text="non-static method running"/>
  270. <line text="advice running at CombiningPCDs2.java:17"/>
  271. </stderr>
  272. </run>
  273. </ajc-test>
  274. <ajc-test dir="features152/synchronization" title="thisjoinpoint - monitor entry">
  275. <compile files="ThisJoinPointLock.java" options="-1.5 -Xjoinpoints:synchronization"/>
  276. <run class="ThisJoinPointLock">
  277. <stderr>
  278. <line text="match.toString(): lock(lock(Object))"/>
  279. <line text="match.toShortString(): lock(lock(Object))"/>
  280. <line text="match.toLongString(): lock(lock(java.lang.Object))"/>
  281. </stderr>
  282. </run>
  283. </ajc-test>
  284. <ajc-test dir="features152/synchronization" title="thisjoinpoint - monitor exit">
  285. <compile files="ThisJoinPointUnlock.java" options="-1.5 -Xjoinpoints:synchronization"/>
  286. <run class="ThisJoinPointUnlock">
  287. <stderr>
  288. <line text="match.toString(): unlock(unlock(Object))"/>
  289. <line text="match.toShortString(): unlock(unlock(Object))"/>
  290. <line text="match.toLongString(): unlock(unlock(java.lang.Object))"/>
  291. </stderr>
  292. </run>
  293. </ajc-test>
  294. <ajc-test dir="features152/synchronization" title="prevent double unlock weaving messages and model contents">
  295. <compile files="ThisJoinPointUnlock.java" options="-1.5 -Xjoinpoints:synchronization -showWeaveInfo -emacssym">
  296. <message kind="weave" text="Join point 'lock(void java.lang.Object.&lt;lock&gt;(java.lang.Object))' in Type 'ThisJoinPointUnlock' (ThisJoinPointUnlock.java:38) advised by before advice from 'TJPAspect' (ThisJoinPointUnlock.java:4)"/>
  297. <message kind="weave" text="Join point 'method-call(void ThisJoinPointUnlock.staticMethod())' in Type 'ThisJoinPointUnlock' (ThisJoinPointUnlock.java:39) advised by before advice from 'TJPAspect' (ThisJoinPointUnlock.java:4)"/>
  298. <message kind="weave" text="Join point 'unlock(void java.lang.Object.&lt;unlock&gt;(java.lang.Object))' in Type 'ThisJoinPointUnlock' (ThisJoinPointUnlock.java:38) advised by before advice from 'TJPAspect' (ThisJoinPointUnlock.java:4)"/>
  299. </compile>
  300. </ajc-test>
  301. <ajc-test dir="features152/synchronization" title="before advice - lock">
  302. <compile files="BeforeLock.java" options="-1.5 -Xjoinpoints:synchronization"/>
  303. <run class="BeforeLock">
  304. <stderr>
  305. <line text="before() lock: advice running at BeforeLock.java:26"/>
  306. <line text="static method running"/>
  307. <line text="before(Foo) lock: advice running at BeforeLock.java:21"/>
  308. <line text="before() lock: advice running at BeforeLock.java:21"/>
  309. <line text="non-static method running"/>
  310. </stderr>
  311. </run>
  312. </ajc-test>
  313. <ajc-test dir="features152/synchronization" title="before advice - unlock">
  314. <compile files="BeforeUnlock.java" options="-1.5 -Xjoinpoints:synchronization"/>
  315. <run class="BeforeUnlock">
  316. <stderr>
  317. <line text="static method running"/>
  318. <line text="before() unlock: advice running at BeforeUnlock.java:26"/>
  319. <line text="non-static method running"/>
  320. <line text="before(Foo) unlock: advice running at BeforeUnlock.java:21"/>
  321. <line text="before() unlock: advice running at BeforeUnlock.java:21"/>
  322. </stderr>
  323. </run>
  324. </ajc-test>
  325. <ajc-test dir="features152/synchronization" title="after advice - lock">
  326. <compile files="AfterLock.java" options="-1.5 -Xjoinpoints:synchronization"/>
  327. <run class="AfterLock">
  328. <stderr>
  329. <line text="after() lock: advice running at AfterLock.java:26"/>
  330. <line text="static method running"/>
  331. <line text="after(Foo) lock: advice running at AfterLock.java:21"/>
  332. <line text="after() lock: advice running at AfterLock.java:21"/>
  333. <line text="non-static method running"/>
  334. </stderr>
  335. </run>
  336. </ajc-test>
  337. <ajc-test dir="features152/synchronization" title="after advice - unlock">
  338. <compile files="AfterUnlock.java" options="-1.5 -Xjoinpoints:synchronization"/>
  339. <run class="AfterUnlock">
  340. <stderr>
  341. <line text="static method running"/>
  342. <line text="after() unlock: advice running at AfterUnlock.java:26"/>
  343. <line text="non-static method running"/>
  344. <line text="after(Foo) unlock: advice running at AfterUnlock.java:21"/>
  345. <line text="after() unlock: advice running at AfterUnlock.java:21"/>
  346. </stderr>
  347. </run>
  348. </ajc-test>
  349. <ajc-test dir="features152/synchronization" title="around advice - lock">
  350. <compile files="AroundLock.java" options="-1.5 -Xjoinpoints:synchronization">
  351. <message kind="warning" line="11" text="Around advice is not supported on the lock and unlock join points (compiler limitation)"/>
  352. <message kind="warning" line="17" text="Around advice is not supported on the lock and unlock join points (compiler limitation)"/>
  353. <message kind="warning" line="31" text="Around advice is not supported on the lock and unlock join points (compiler limitation)"/>
  354. <message kind="warning" line="36" text="Around advice is not supported on the lock and unlock join points (compiler limitation)"/>
  355. <message kind="warning" line="11" text="advice defined in AroundLock has not been applied [Xlint:adviceDidNotMatch]"/>
  356. <message kind="warning" line="17" text="advice defined in AroundLock has not been applied [Xlint:adviceDidNotMatch]"/>
  357. </compile>
  358. <run class="AroundLock">
  359. <stderr>
  360. <!--line text="around() lock: advice running at AroundLock.java:26"/-->
  361. <line text="static method running"/>
  362. <!--line text="around(Foo) lock: advice running at AroundLock.java:21"/>
  363. <line text="around() lock: advice running at AroundLock.java:21"/-->
  364. <line text="non-static method running"/>
  365. </stderr>
  366. </run>
  367. </ajc-test>
  368. <ajc-test dir="features152/synchronization" title="around advice - unlock">
  369. <compile files="AroundUnlock.java" options="-1.5 -Xjoinpoints:synchronization">
  370. <message kind="warning" line="5" text="Around advice is not supported on the lock and unlock join points (compiler limitation)"/>
  371. <message kind="warning" line="10" text="Around advice is not supported on the lock and unlock join points (compiler limitation)"/>
  372. <message kind="warning" line="23" text="Around advice is not supported on the lock and unlock join points (compiler limitation)"/>
  373. <message kind="warning" line="28" text="Around advice is not supported on the lock and unlock join points (compiler limitation)"/>
  374. <message kind="warning" line="5" text="advice defined in AroundUnlock has not been applied [Xlint:adviceDidNotMatch]"/>
  375. <message kind="warning" line="10" text="advice defined in AroundUnlock has not been applied [Xlint:adviceDidNotMatch]"/>
  376. </compile>
  377. <run class="AroundUnlock">
  378. <stderr>
  379. <!--line text="around() unlock: advice running at AroundUnlock.java:26"/-->
  380. <line text="static method running"/>
  381. <!--line text="around(Foo) unlock: advice running at AroundUnlock.java:21"/-->
  382. <!--line text="around() unlock: advice running at AroundUnlock.java:21"/-->
  383. <line text="non-static method running"/>
  384. </stderr>
  385. </run>
  386. </ajc-test>
  387. <ajc-test dir="features152/synchronization/transformed" title="investigation">
  388. <compile files="Investigation.java">
  389. </compile>
  390. </ajc-test>
  391. <ajc-test dir="features152/synchronization/transformed" title="One">
  392. <compile files="One.java -Xjoinpoints:synchronization">
  393. </compile>
  394. <run class="One"/><!-- will check verification ... -->
  395. </ajc-test>
  396. <ajc-test dir="features152/synchronization/transformed" title="Two">
  397. <compile files="Two.java -Xjoinpoints:synchronization">
  398. <message kind="warning" line="14" text="advice matching the synchronized method shadow 'method-execution(void C.ma())' will be executed outside the lock rather than inside (compiler limitation)"/>
  399. </compile>
  400. <run class="Two">
  401. <stderr>
  402. <line text="execution advice running"/>
  403. <line text="hello"/>
  404. </stderr>
  405. </run>
  406. </ajc-test>
  407. <ajc-test dir="features152/synchronization/transformed" title="Three">
  408. <compile files="Three.java -Xjoinpoints:synchronization">
  409. <message kind="warning" line="20" text="advice matching the synchronized method shadow 'method-execution(void C.m3())' will be executed outside the lock rather than inside (compiler limitation)"/>
  410. <message kind="warning" line="24" text="advice matching the synchronized method shadow 'method-execution(void C.m32())' will be executed outside the lock rather than inside (compiler limitation)"/>
  411. </compile>
  412. <run class="Three">
  413. <stderr>
  414. <line text="hello"/>
  415. <line text="execution advice running"/>
  416. <line text="hello"/>
  417. <line text="execution advice running2"/>
  418. <line text="hello"/>
  419. <line text="execution advice running3"/>
  420. <line text="hello"/>
  421. <line text="execution advice running4"/>
  422. </stderr>
  423. </run>
  424. </ajc-test>
  425. <ajc-test dir="features152/synchronization/transformed" title="Four">
  426. <compile files="Four.java -Xjoinpoints:synchronization">
  427. <message kind="warning" line="16" text="advice matching the synchronized method shadow 'method-execution(void C.m())' will be executed outside the lock rather than inside (compiler limitation)"/>
  428. <message kind="warning" line="20" text="advice matching the synchronized method shadow 'method-execution(void C.m2())' will be executed outside the lock rather than inside (compiler limitation)"/>
  429. </compile>
  430. <run class="Four">
  431. <stderr>
  432. <line text="hello"/>
  433. <line text="execution advice running"/>
  434. <line text="hello"/>
  435. <line text="execution advice running2"/>
  436. </stderr>
  437. </run>
  438. </ajc-test>
  439. <ajc-test dir="features152/synchronization/transformed" title="Five - Java5">
  440. <compile files="Five.java -1.5 -Xjoinpoints:synchronization">
  441. </compile>
  442. <run class="Five">
  443. <stderr>
  444. <line text="test"/>
  445. <line text="hello"/>
  446. <line text="test"/>
  447. <line text="hello"/>
  448. <line text="test"/>
  449. <line text="hello"/>
  450. <line text="test"/>
  451. <line text="hello"/>
  452. </stderr>
  453. </run>
  454. </ajc-test>
  455. <ajc-test dir="features152/synchronization/transformed" title="Six - preJava5">
  456. <compile files="Six.java -Xjoinpoints:synchronization">
  457. </compile>
  458. <run class="Six">
  459. <stderr>
  460. <line text="test"/>
  461. <line text="hello"/>
  462. <line text="test"/>
  463. <line text="hello"/>
  464. </stderr>
  465. </run>
  466. </ajc-test>
  467. <ajc-test dir="features152/synchronization/transformed" title="lock pcd on transformed non-static method">
  468. <compile files="Seven.java -Xjoinpoints:synchronization">
  469. </compile>
  470. <run class="Seven">
  471. <stderr>
  472. <line text="Locking occurring at lock(lock(Object))"/>
  473. <line text="Seven.java"/>
  474. <line text="hello"/>
  475. </stderr>
  476. </run>
  477. </ajc-test>
  478. <ajc-test dir="features152/synchronization/transformed" title="unlock pcd on transformed non-static method">
  479. <compile files="Eight.java -Xjoinpoints:synchronization">
  480. </compile>
  481. <run class="Eight">
  482. <stderr>
  483. <line text="hello"/>
  484. <line text="Unlocking occurring at unlock(unlock(Object))"/>
  485. <line text="Eight.java"/>
  486. </stderr>
  487. </run>
  488. </ajc-test>
  489. <ajc-test dir="features152/synchronization/transformed" title="lock pcd on transformed static method - J5">
  490. <compile files="Nine.java -1.5 -Xjoinpoints:synchronization">
  491. </compile>
  492. <run class="Nine">
  493. <stderr>
  494. <line text="Locking occurring at lock(lock(Object))"/>
  495. <line text="Nine.java"/>
  496. <line text="hello"/>
  497. </stderr>
  498. </run>
  499. </ajc-test>
  500. <ajc-test dir="features152/synchronization/transformed" title="unlock pcd on transformed static method - J5">
  501. <compile files="Ten.java -1.5 -Xjoinpoints:synchronization">
  502. </compile>
  503. <run class="Ten">
  504. <stderr>
  505. <line text="hello"/>
  506. <line text="Unlocking occurring at unlock(unlock(Object))"/>
  507. <line text="Ten.java"/>
  508. </stderr>
  509. </run>
  510. </ajc-test>
  511. <ajc-test dir="features152/synchronization/transformed" title="lock pcd on transformed static method - preJ5">
  512. <compile files="Eleven.java -Xjoinpoints:synchronization">
  513. </compile>
  514. <run class="Eleven">
  515. <stderr>
  516. <line text="Locking occurring at lock(lock(Object))"/>
  517. <line text="Eleven.java"/>
  518. <line text="hello"/>
  519. </stderr>
  520. </run>
  521. </ajc-test>
  522. <ajc-test dir="features152/synchronization/transformed" title="unlock pcd on transformed static method - preJ5">
  523. <compile files="Twelve.java" options="-Xjoinpoints:synchronization">
  524. </compile>
  525. <run class="Twelve">
  526. <stderr>
  527. <line text="hello"/>
  528. <line text="Unlocking occurring at unlock(unlock(Object))"/>
  529. <line text="Twelve.java"/>
  530. </stderr>
  531. </run>
  532. </ajc-test>
  533. <ajc-test dir="features152/synchronization/transformed" title="transform static method - preJ5">
  534. <compile files="Fifteen.java" options="-Xjoinpoints:synchronization -1.4">
  535. </compile>
  536. <run class="Fifteen">
  537. <stderr>
  538. <line text="Locking occurring at lock(lock(Object))"/>
  539. <line text="Fifteen.java"/>
  540. <line text="hello"/>
  541. </stderr>
  542. </run>
  543. </ajc-test>
  544. <ajc-test dir="features152/synchronization/transformed" title="transform static method - packages - preJ5">
  545. <compile files="Sixteen.java" options="-Xjoinpoints:synchronization -1.4">
  546. </compile>
  547. <run class="a.b.c.d.Sixteen">
  548. <stderr>
  549. <line text="Locking occurring at lock(lock(Object))"/>
  550. <line text="Sixteen.java"/>
  551. <line text="hello"/>
  552. </stderr>
  553. </run>
  554. </ajc-test>
  555. <ajc-test dir="features152/synchronization" title="obtaining locked object through getArgs">
  556. <compile files="LockingWithTJP.java" options="-Xjoinpoints:synchronization">
  557. </compile>
  558. <run class="LockingWithTJP">
  559. <stderr>
  560. <line text="before() lock: advice running at LockingWithTJP.java:18"/>
  561. <line text="Locked on LockingWithTJP$Foo"/>
  562. <line text="non-static method running"/>
  563. <line text="before() lock: advice running at LockingWithTJP.java:23"/>
  564. <line text="Locked on class java.lang.String"/>
  565. <line text="static method running"/>
  566. </stderr>
  567. </run>
  568. </ajc-test>
  569. <ajc-test dir="features152/synchronization/transformed" title="other targeters">
  570. <compile files="OtherTargeters.java" options="-Xjoinpoints:synchronization">
  571. <message kind="warning" line="8" text="advice matching the synchronized "/>
  572. </compile>
  573. <run class="OtherTargeters">
  574. <stderr>
  575. <line text="advice running"/>
  576. <line text="foo() running"/>
  577. </stderr>
  578. </run>
  579. </ajc-test>
  580. <ajc-test dir="features152/synchronization/transformed" title="joinpoints enabled but no lock">
  581. <compile files="Fourteen.java" options="-Xjoinpoints:synchronization">
  582. <!--message kind="warning" line="8" text="advice matching the synchronized "/-->
  583. </compile>
  584. <run class="Fourteen"/>
  585. </ajc-test>
  586. </suite>