You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ajc1920.xml 24KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481
  1. <!DOCTYPE suite SYSTEM "../tests/ajcTestSuite.dtd"[]>
  2. <!--
  3. Java 20: no new final language features, only preview/incubator ones:
  4. - "JEP 432: Record Patterns (Second Preview)" (###)
  5. - "JEP 433: Pattern Matching for switch (Fourth Preview)" (###)
  6. - "JEP 429: Scoped Values (Incubator)" (API only)
  7. - "JEP 436: Virtual Threads (Second Preview)" (API only)
  8. - "JEP 437: Structured Concurrency (Second Incubator)" (API only)
  9. -->
  10. <suite>
  11. <!-- Java ?? final, Java 17, 18, 19, 20 preview -->
  12. <ajc-test dir="features1920/java20" vm="20" title="switch pattern matching preview 4 java">
  13. <compile files="SwitchPatternPreview4OK.java" options="--enable-preview -20" />
  14. <run class="SwitchPatternPreview4OK" vmargs="--enable-preview">
  15. <message></message>
  16. <stdout>
  17. <line text="null" />
  18. <line text="int 123" />
  19. <line text="long 999" />
  20. <line text="double 12.340000" />
  21. <line text="String foo" />
  22. <line text="[123, foo, 999, 12.34]" />
  23. <line text="Non-circle" />
  24. <line text="Small circle" />
  25. <line text="Large circle" />
  26. <line text="Sealed sub-class A" />
  27. <line text="Sealed sub-class B" />
  28. <line text="Sealed sub-record C" />
  29. <line text="absolute value 1: -1" />
  30. <line text="other integer: 0" />
  31. <line text="positive integer: 42" />
  32. <line text="other integer: -99" />
  33. <line text="positive integer: 123" />
  34. <line text="value unavailable: null" />
  35. </stdout>
  36. </run>
  37. </ajc-test>
  38. <!-- Java ?? final, Java 17, 18, 19, 20 preview -->
  39. <ajc-test dir="features1920/java20" vm="20" title="switch pattern matching preview 4 error">
  40. <compile files="SwitchPatternPreview4Error.java" options="--enable-preview -20">
  41. <!-- TODO: Add correct compiler error message, as soon as JDT Core supports it -->
  42. <message kind="error" file="SwitchPatternPreview4Error.java" text="This case label is dominated by one of the preceding case labels"/>
  43. </compile>
  44. </ajc-test>
  45. <!-- Java ?? final, Java 17, 18, 19, 20 preview -->
  46. <ajc-test dir="features1919/java19" vm="20" title="switch pattern matching preview 3 aspect">
  47. <compile files="SwitchPatternPreview3Aspect.aj" options="--enable-preview -20" />
  48. <run class="Application" vmargs="--enable-preview">
  49. <stdout>
  50. <line text="null" />
  51. <line text="int 123" />
  52. <line text="long 999" />
  53. <line text="double 12.340000" />
  54. <line text="String foo" />
  55. <line text="[123, foo, 999, 12.34]" />
  56. <line text="Non-circle" />
  57. <line text="Small circle" />
  58. <line text="Large circle" />
  59. <line text="Sealed sub-class A" />
  60. <line text="Sealed sub-class B" />
  61. <line text="Sealed sub-record C" />
  62. <line text="absolute value 1: -1" />
  63. <line text="other integer: 0" />
  64. <line text="positive integer: 42" />
  65. <line text="other integer: -99" />
  66. <line text="positive integer: 123" />
  67. <line text="value unavailable: null" />
  68. </stdout>
  69. </run>
  70. </ajc-test>
  71. <!-- Java ?? final, Java 17, 18, 19, 20 preview -->
  72. <ajc-test dir="features198/java17" vm="20" title="switch pattern matching error">
  73. <compile files="SwitchPatternError.java" options="--enable-preview -20">
  74. <!-- TODO: Add correct compiler error message, as soon as JDT Core supports it -->
  75. <message kind="error" file="SwitchPatternError.java" text="This case label is dominated by one of the preceding case labels"/>
  76. </compile>
  77. </ajc-test>
  78. <!-- Java ?? final, Java 17, 18, 19, 20 preview -->
  79. <ajc-test dir="features1919/java19" vm="20" title="switch pattern matching preview 3 error 1">
  80. <compile files="SwitchPatternPreview3Error1.java" options="--enable-preview -20">
  81. <!-- TODO: Add correct compiler error message, as soon as JDT Core supports it -->
  82. <message kind="error" file="SwitchPatternPreview3Error1.java" text="This case label is dominated by one of the preceding case labels"/>
  83. </compile>
  84. </ajc-test>
  85. <!-- Java ?? final, Java 17, 18, 19, 20 preview -->
  86. <ajc-test dir="features1919/java19" vm="20" title="switch pattern matching preview 3 error 2">
  87. <compile files="SwitchPatternPreview3Error2.java" options="--enable-preview -20">
  88. <!-- TODO: Add correct compiler error message, as soon as JDT Core supports it -->
  89. <message kind="error" file="SwitchPatternPreview3Error2.java" text="This case label is dominated by one of the preceding case labels"/>
  90. </compile>
  91. </ajc-test>
  92. <!-- Java ?? final, Java 19, 20 preview -->
  93. <ajc-test dir="features1919/java19" vm="20" title="record patterns">
  94. <compile files="RecordPatternsPreview1OK.java" options="--enable-preview -20"/>
  95. </ajc-test>
  96. <!-- Java ?? final, Java 19, 20 preview -->
  97. <ajc-test dir="features1919/java19" vm="20" title="record patterns error">
  98. <compile files="RecordPatternsPreview1Error.java" options="--enable-preview -20">
  99. <!-- https://github.com/eclipse-jdt/eclipse.jdt.core/issues/450 (fixed for preview 2 in Eclipse 2023-03, 4.27) -->
  100. <!--
  101. <message kind="error" file="RecordPatternsPreview1Error.java" text="Raw types are not allowed in record patterns"/>
  102. <message kind="error" file="RecordPatternsPreview1Error.java" text="Raw types are not allowed in record patterns"/>
  103. -->
  104. </compile>
  105. <run class="RecordPatternsPreview1Error" vmargs="--enable-preview">
  106. <stdout>
  107. <line text="I'm a box"/>
  108. <line text="I'm a box"/>
  109. </stdout>
  110. </run>
  111. </ajc-test>
  112. <!-- Java ?? final, Java 19, 20 preview -->
  113. <ajc-test dir="features1919/java19" vm="20" title="record patterns exhaustiveness 1">
  114. <compile files="RecordPatternsPreview1ExhaustivenessOK1.java" options="--enable-preview -20"/>
  115. <run class="RecordPatternsPreview1ExhaustivenessOK1" vmargs="--enable-preview">
  116. <stdout>
  117. <line text="y"/>
  118. <line text="a"/>
  119. </stdout>
  120. </run>
  121. </ajc-test>
  122. <!-- Java ?? final, Java 19, 20 preview -->
  123. <ajc-test dir="features1919/java19" vm="20" title="record patterns exhaustiveness aspect">
  124. <compile files="RecordPatternsPreview1ExhaustivenessAspect.aj" options="--enable-preview -20"/>
  125. <!-- TODO: Remove redundant default clauses when https://github.com/eclipse-jdt/eclipse.jdt.core/issues/455 has been fixed -->
  126. <run class="RecordPatternsPreview1ExhaustivenessAspect" vmargs="--enable-preview">
  127. <stdout>
  128. <line text="y"/>
  129. <line text="a"/>
  130. <line text="Pair[x=C@000, y=D@000]"/>
  131. </stdout>
  132. </run>
  133. </ajc-test>
  134. <!-- Java ?? final, Java 19, 20 preview -->
  135. <ajc-test dir="features1919/java19" vm="20" title="record patterns aspect">
  136. <compile files="RecordPatternsPreview1Aspect.aj" options="--enable-preview -20"/>
  137. <run class="RecordPatternsPreview1Aspect" vmargs="--enable-preview">
  138. <stdout>
  139. <line text="9"/>
  140. <line text="14"/>
  141. <line text="Doing something with Point[x=2, y=7]"/>
  142. <line text="Upper-left color: RED"/>
  143. <line text="Upper-left color: RED"/>
  144. <line text="Upper-left x coordinate: 1"/>
  145. <line text="Doing something with Rectangle[upperLeft=ColoredPoint[p=Point[x=1, y=6], c=RED], lowerRight=ColoredPoint[p=Point[x=4, y=6], c=BLUE]]"/>
  146. </stdout>
  147. </run>
  148. </ajc-test>
  149. <!-- Java ?? final, Java 19, 20 preview -->
  150. <ajc-test dir="features1919/java19" vm="20" title="record patterns exhaustiveness error">
  151. <compile files="RecordPatternsPreview1ExhaustivenessError.java" options="--enable-preview -20">
  152. <message kind="error" file="RecordPatternsPreview1ExhaustivenessError.java" text="An enhanced switch statement should be exhaustive; a default label expected"/>
  153. </compile>
  154. </ajc-test>
  155. <!-- Java ?? final, Java 19, 20 preview -->
  156. <ajc-test dir="features1919/java19" vm="20" title="record patterns exhaustiveness 2">
  157. <compile files="RecordPatternsPreview1ExhaustivenessOK2.java" options="--enable-preview -20"/>
  158. <run class="RecordPatternsPreview1ExhaustivenessOK2" vmargs="--enable-preview">
  159. <stdout>
  160. <line text="Bob 12"/>
  161. </stdout>
  162. </run>
  163. </ajc-test>
  164. <!-- RuntimeException in BcelWeaver, see https://github.com/eclipse-aspectj/aspectj/issues/190 -->
  165. <ajc-test dir="bugs1920/github_190" vm="1.5" title="switch with Integer.MAX_VALUE case">
  166. <compile files="SwitchCaseWith_Integer_MAX_VALUE.java" options="-1.5 -showWeaveInfo">
  167. <message kind="weave" text="Join point 'method-execution(java.lang.String SwitchCaseWith_Integer_MAX_VALUE.switchTest(int))'"/>
  168. </compile>
  169. <run class="SwitchCaseWith_Integer_MAX_VALUE">
  170. <stdout>
  171. <line text="execution(String SwitchCaseWith_Integer_MAX_VALUE.switchTest(int))"/>
  172. <line text="CASE_1"/>
  173. </stdout>
  174. </run>
  175. </ajc-test>
  176. <!--
  177. 'Syntax error, insert "Expression" to complete Expression' when compiling parenthesised expressions
  178. containing AspectJ keywords, e.g. '(before)', see https://github.com/eclipse-aspectj/aspectj/issues/20
  179. -->
  180. <ajc-test dir="bugs1920/github_20" vm="1.5" title="parenthesised expression with AspectJ keyword">
  181. <compile files="ParenthesisedAJKeywords.java" options="-1.5 -showWeaveInfo"/>
  182. <run class="ParenthesisedAJKeywords">
  183. <stdout>
  184. <line text="before"/>
  185. <line text="after"/>
  186. <line text="around"/>
  187. <line text="aspect"/>
  188. <line text="pointcut"/>
  189. <line text="declare"/>
  190. <line text="privileged"/>
  191. </stdout>
  192. </run>
  193. </ajc-test>
  194. <!--
  195. 'inner aspects must be static' when compiling an interface with an inner aspect which was not explicitly declared
  196. static, see https://github.com/eclipse-aspectj/aspectj/issues/162
  197. -->
  198. <ajc-test dir="bugs1920/github_162" vm="1.5" title="inner aspect of interface is implicitly static">
  199. <compile files="InterfaceWithInnerClass.java" options="-1.5 -showWeaveInfo">
  200. <message kind="weave" text="method-execution(int InterfaceWithInnerClass$ImplicitlyStatic.getNumber())' in Type 'InterfaceWithInnerClass$ImplicitlyStatic'"/>
  201. <message kind="weave" text="method-execution(void InterfaceWithInnerClass$ImplicitlyStatic.main(java.lang.String[]))' in Type 'InterfaceWithInnerClass$ImplicitlyStatic'"/>
  202. </compile>
  203. <run class="InterfaceWithInnerClass$ImplicitlyStatic">
  204. <stdout>
  205. <line text="execution(void InterfaceWithInnerClass.ImplicitlyStatic.main(String[]))"/>
  206. <line text="execution(int InterfaceWithInnerClass.ImplicitlyStatic.getNumber())"/>
  207. <line text="11"/>
  208. </stdout>
  209. </run>
  210. </ajc-test>
  211. <!--
  212. When compiling aspect and target class together, matching works as expected,
  213. see https://github.com/eclipse-aspectj/aspectj/issues/24
  214. -->
  215. <ajc-test dir="bugs1920/github_24" vm="1.5" title="exact array type matching, aspect compiled together with target class">
  216. <compile files="ExactlyMatchingAspect.aj MaybeMissingClass.java" options="-1.5 -showWeaveInfo">
  217. <!-- Even before the bugfix, in this case weaving worked as expected -->
  218. <message kind="weave" text="method-execution(MaybeMissingClass MaybeMissingClass.f1())"/>
  219. <message kind="weave" text="method-execution(MaybeMissingClass[] MaybeMissingClass.f2())"/>
  220. <message kind="weave" text="method-execution(MaybeMissingClass[][] MaybeMissingClass.f3())"/>
  221. <message kind="weave" text="method-execution(int MaybeMissingClass.f4())"/>
  222. <message kind="weave" text="method-execution(int[] MaybeMissingClass.f5())"/>
  223. <message kind="weave" text="method-execution(int[][] MaybeMissingClass.f6())"/>
  224. </compile>
  225. <run class="MaybeMissingClass">
  226. <stdout>
  227. <line text="MaybeMissingClass.f1"/>
  228. <line text="execution(MaybeMissingClass MaybeMissingClass.f1())"/>
  229. <line text="MaybeMissingClass.f2"/>
  230. <line text="execution(MaybeMissingClass[] MaybeMissingClass.f2())"/>
  231. <line text="MaybeMissingClass.f3"/>
  232. <line text="execution(MaybeMissingClass[][] MaybeMissingClass.f3())"/>
  233. <line text="MaybeMissingClass.f4"/>
  234. <line text="execution(int MaybeMissingClass.f4())"/>
  235. <line text="MaybeMissingClass.f5"/>
  236. <line text="execution(int[] MaybeMissingClass.f5())"/>
  237. <line text="MaybeMissingClass.f6"/>
  238. <line text="execution(int[][] MaybeMissingClass.f6())"/>
  239. </stdout>
  240. </run>
  241. </ajc-test>
  242. <!--
  243. When compiling aspect and target class separately, too many joinpoints are matched,
  244. see https://github.com/eclipse-aspectj/aspectj/issues/24
  245. -->
  246. <ajc-test dir="bugs1920/github_24" vm="1.5" title="exact array type matching, aspect compiled separately from target class">
  247. <compile files="ExactlyMatchingAspect.aj" options="-1.5 -showWeaveInfo" outjar="aspect.jar">
  248. <message kind="warning" text="no match for this type name: MaybeMissingClass [Xlint:invalidAbsoluteTypeName]"/>
  249. <message kind="warning" text="advice defined in ExactlyMatchingAspect has not been applied [Xlint:adviceDidNotMatch]"/>
  250. </compile>
  251. <compile files="MaybeMissingClass.java" options="-1.5 -showWeaveInfo" aspectpath="aspect.jar">
  252. <!-- Before the bugfix, f1 would be woven twice, f2 not at all-->
  253. <message kind="weave" text="method-execution(MaybeMissingClass MaybeMissingClass.f1())"/>
  254. <message kind="weave" text="method-execution(MaybeMissingClass[] MaybeMissingClass.f2())"/>
  255. <message kind="weave" text="method-execution(MaybeMissingClass[][] MaybeMissingClass.f3())"/>
  256. <message kind="weave" text="method-execution(int MaybeMissingClass.f4())"/>
  257. <message kind="weave" text="method-execution(int[] MaybeMissingClass.f5())"/>
  258. <message kind="weave" text="method-execution(int[][] MaybeMissingClass.f6())"/>
  259. </compile>
  260. <run class="MaybeMissingClass" classpath="aspect.jar">
  261. <stdout>
  262. <line text="MaybeMissingClass.f1"/>
  263. <line text="execution(MaybeMissingClass MaybeMissingClass.f1())"/>
  264. <line text="MaybeMissingClass.f2"/>
  265. <line text="execution(MaybeMissingClass[] MaybeMissingClass.f2())"/>
  266. <line text="MaybeMissingClass.f3"/>
  267. <line text="execution(MaybeMissingClass[][] MaybeMissingClass.f3())"/>
  268. <line text="MaybeMissingClass.f4"/>
  269. <line text="execution(int MaybeMissingClass.f4())"/>
  270. <line text="MaybeMissingClass.f5"/>
  271. <line text="execution(int[] MaybeMissingClass.f5())"/>
  272. <line text="MaybeMissingClass.f6"/>
  273. <line text="execution(int[][] MaybeMissingClass.f6())"/>
  274. </stdout>
  275. </run>
  276. </ajc-test>
  277. <!--
  278. When compiling aspect and target class together, too many joinpoints are matched,
  279. see https://github.com/eclipse-aspectj/aspectj/issues/24
  280. -->
  281. <ajc-test dir="bugs1920/github_24" vm="1.5" title="fuzzy array type matching, aspect compiled together with target class">
  282. <compile files="FuzzilyMatchingAspect.aj MaybeMissingClass.java" options="-1.5 -showWeaveInfo">
  283. <!-- Before the bugfix, both f1 and f2 would be woven twice -->
  284. <message kind="weave" text="method-execution(MaybeMissingClass MaybeMissingClass.f1())"/>
  285. <message kind="weave" text="method-execution(MaybeMissingClass[] MaybeMissingClass.f2())"/>
  286. <message kind="weave" text="method-execution(MaybeMissingClass[][] MaybeMissingClass.f3())"/>
  287. <message kind="weave" text="method-execution(int MaybeMissingClass.f4())"/>
  288. <message kind="weave" text="method-execution(int[] MaybeMissingClass.f5())"/>
  289. <message kind="weave" text="method-execution(int[][] MaybeMissingClass.f6())"/>
  290. </compile>
  291. <run class="MaybeMissingClass">
  292. <stdout>
  293. <line text="MaybeMissingClass.f1"/>
  294. <line text="execution(MaybeMissingClass MaybeMissingClass.f1())"/>
  295. <line text="MaybeMissingClass.f2"/>
  296. <line text="execution(MaybeMissingClass[] MaybeMissingClass.f2())"/>
  297. <line text="MaybeMissingClass.f3"/>
  298. <line text="execution(MaybeMissingClass[][] MaybeMissingClass.f3())"/>
  299. <line text="MaybeMissingClass.f4"/>
  300. <line text="execution(int MaybeMissingClass.f4())"/>
  301. <line text="MaybeMissingClass.f5"/>
  302. <line text="execution(int[] MaybeMissingClass.f5())"/>
  303. <line text="MaybeMissingClass.f6"/>
  304. <line text="execution(int[][] MaybeMissingClass.f6())"/>
  305. </stdout>
  306. </run>
  307. </ajc-test>
  308. <!--
  309. When compiling aspect and target class separately, too many joinpoints are matched,
  310. see https://github.com/eclipse-aspectj/aspectj/issues/24
  311. -->
  312. <ajc-test dir="bugs1920/github_24" vm="1.5" title="fuzzy array type matching, aspect compiled separately from target class">
  313. <compile files="FuzzilyMatchingAspect.aj" options="-1.5 -showWeaveInfo" outjar="aspect.jar">
  314. <message kind="warning" text="advice defined in FuzzilyMatchingAspect has not been applied [Xlint:adviceDidNotMatch]"/>
  315. </compile>
  316. <compile files="MaybeMissingClass.java" options="-1.5 -showWeaveInfo" aspectpath="aspect.jar">
  317. <!-- Before the bugfix, both f1 and f2 would be woven twice -->
  318. <message kind="weave" text="method-execution(MaybeMissingClass MaybeMissingClass.f1())"/>
  319. <message kind="weave" text="method-execution(MaybeMissingClass[] MaybeMissingClass.f2())"/>
  320. <message kind="weave" text="method-execution(MaybeMissingClass[][] MaybeMissingClass.f3())"/>
  321. <message kind="weave" text="method-execution(int MaybeMissingClass.f4())"/>
  322. <message kind="weave" text="method-execution(int[] MaybeMissingClass.f5())"/>
  323. <message kind="weave" text="method-execution(int[][] MaybeMissingClass.f6())"/>
  324. </compile>
  325. <run class="MaybeMissingClass" classpath="aspect.jar">
  326. <stdout>
  327. <line text="MaybeMissingClass.f1"/>
  328. <line text="execution(MaybeMissingClass MaybeMissingClass.f1())"/>
  329. <line text="MaybeMissingClass.f2"/>
  330. <line text="execution(MaybeMissingClass[] MaybeMissingClass.f2())"/>
  331. <line text="MaybeMissingClass.f3"/>
  332. <line text="execution(MaybeMissingClass[][] MaybeMissingClass.f3())"/>
  333. <line text="MaybeMissingClass.f4"/>
  334. <line text="execution(int MaybeMissingClass.f4())"/>
  335. <line text="MaybeMissingClass.f5"/>
  336. <line text="execution(int[] MaybeMissingClass.f5())"/>
  337. <line text="MaybeMissingClass.f6"/>
  338. <line text="execution(int[][] MaybeMissingClass.f6())"/>
  339. </stdout>
  340. </run>
  341. </ajc-test>
  342. <!--
  343. https://github.com/eclipse-aspectj/aspectj/issues/214
  344. https://github.com/mojohaus/aspectj-maven-plugin/issues/164
  345. Problem with multiple, subsequent weaving steps and '-Xlint:warning' or '-Xlint:unorderedAdviceAtShadow=warning'
  346. java.lang.ArrayIndexOutOfBoundsException: 1
  347. [ERROR] at org.aspectj.weaver.bcel.BcelShadow.prepareForMungers(BcelShadow.java:379)
  348. [ERROR] at org.aspectj.weaver.Shadow.implement(Shadow.java:546)
  349. -->
  350. <ajc-test dir="bugs1920/github_214" vm="1.5" title="ArrayIndexOutOfBoundsException with Xlint unorderedAdviceAtShadow=warning">
  351. <compile files="FirstAspect.java MarkerOne.java" options="-1.8 -showWeaveInfo -Xlint:warning" outjar="first-aspect.jar">
  352. <message kind="warning" text="can not build thisJoinPoint lazily for this advice since it has no suitable guard [Xlint:noGuardForLazyTjp]"/>
  353. <message kind="warning" text="advice defined in FirstAspect has not been applied [Xlint:adviceDidNotMatch]"/>
  354. </compile>
  355. <compile files="Application.java MarkerTwo.java" options="-1.5 -showWeaveInfo -Xlint:warning" classpath="$sandbox/first-aspect.jar" outjar="application.jar"/>
  356. <compile files="SecondAspect.java" options="-1.5 -showWeaveInfo -Xlint:warning" aspectpath="first-aspect.jar" inpath="application.jar" outjar="second-aspect.jar">
  357. <message kind="warning" text="can not build thisJoinPoint lazily for this advice since it has no suitable guard [Xlint:noGuardForLazyTjp]"/>
  358. <message kind="warning" text="at this shadow method-execution(void Application.greet(java.lang.String)) no precedence is specified between advice applying from aspect FirstAspect and aspect SecondAspect [Xlint:unorderedAdviceAtShadow]"/>
  359. <message kind="warning" text="can not implement lazyTjp at joinpoint method-execution(void Application.greet(java.lang.String)) because of advice conflicts, see secondary locations to find conflicting advice [Xlint:multipleAdviceStoppingLazyTjp]"/>
  360. <message kind="weave" text="method-execution(void Application.greet(java.lang.String))' in Type 'Application' (Application.java:4) advised by around advice from 'SecondAspect'"/>
  361. <message kind="weave" text="method-execution(void Application.greet(java.lang.String))' in Type 'Application' (Application.java:4) advised by before advice from 'FirstAspect'"/>
  362. </compile>
  363. <run class="Application" classpath="$sandbox/second-aspect.jar,$sandbox/first-aspect.jar">
  364. <stdout>
  365. <line text="FirstAspect: execution(void Application.greet(String))"/>
  366. <line text="SecondAspect: execution(void Application.greet(String))"/>
  367. <line text="Hello world!"/>
  368. </stdout>
  369. </run>
  370. </ajc-test>
  371. <!-- https://github.com/eclipse-aspectj/aspectj/issues/246 -->
  372. <ajc-test dir="bugs1920/github_246" vm="8" title="add correct annotations to multiple ITD methods with the same name and same number of arguments">
  373. <compile files="First.java Second.java App.java ITDAspect.aj" options="-8"/>
  374. <run class="App">
  375. <stdout>
  376. <line text="[@Second()] public int App.foo(int[])"/>
  377. <line text="[@First()] public void App.foo(java.lang.String)"/>
  378. <line text="[] public void App.foo(java.lang.String[])"/>
  379. <line text="[@First(), @Second()] public void App.foo(java.lang.Object)"/>
  380. <line text="[@Second()] public int App.foo(int)"/>
  381. </stdout>
  382. </run>
  383. </ajc-test>
  384. <!-- https://github.com/eclipse-aspectj/aspectj/issues/250 -->
  385. <ajc-test dir="bugs1920/github_250" vm="8" title="correctly handle overloaded private methods in aspects">
  386. <compile files="MyAspect.aj" options="-8"/>
  387. <run class="MyAspect">
  388. <stdout>
  389. <line text="execution(void Application.doSomething())"/>
  390. <line text="1 / one"/>
  391. <line text="execution(void Application.doSomething())"/>
  392. <line text="2"/>
  393. </stdout>
  394. </run>
  395. </ajc-test>
  396. <!--
  397. https://github.com/spring-projects/spring-framework/issues/27761, AspectJ 1.9.20.1
  398. https://github.com/eclipse-aspectj/aspectj/issues/257
  399. -->
  400. <ajc-test dir="bugs1920/github_spring_27761" vm="8" title="do not match bridge methods">
  401. <!-- (1) Use ASM to generate JpaRepository class with reordered methods -->
  402. <compile files="JpaRepositoryDump.java" options="-8"/>
  403. <run class="JpaRepositoryDump" options="$sandbox"/>
  404. <file deletefile="JpaRepositoryDump.class"/>
  405. <!-- (2) Use AJC to compile the remaining classes and run the test -->
  406. <compile files="RepositoryAspect.aj" options="-8"/>
  407. <run class="RepositoryAspect">
  408. <stdout>
  409. <line text="execution(List RepositoryImpl.saveAll(Iterable))"/>
  410. <line text="Saving [One, Two, Three]"/>
  411. </stdout>
  412. </run>
  413. </ajc-test>
  414. <!-- https://github.com/eclipse-aspectj/aspectj/issues/257, AspectJ 1.9.20.1 -->
  415. <ajc-test dir="bugs1920/github_257" vm="8" title="handle negated type patterns correctly">
  416. <compile files="NegatedTypeAspect.aj" options="-8"/>
  417. <run class="NegatedTypeAspect">
  418. <stdout>
  419. <line text="[SETTER] execution(void Person.setId(int))"/>
  420. <line text="[SETTER] execution(void Person.setFirstName(String))"/>
  421. <line text="[SETTER] execution(void Person.setLastName(String))"/>
  422. <line text="Person(id=11, lastName='Curie', firstName='Marie')"/>
  423. <line text="[GETTER] execution(int Person.getId())"/>
  424. <line text="[NON-STRING GETTER] execution(int Person.getId())"/>
  425. <line text="[NON-STRING-ARRAY GETTER] execution(int Person.getId())"/>
  426. <line text="[NON-STRING-ARRAY-ARRAY GETTER] execution(int Person.getId())"/>
  427. <line text="[GETTER] execution(String Person.getFirstName())"/>
  428. <line text="[NON-STRING-ARRAY GETTER] execution(String Person.getFirstName())"/>
  429. <line text="[NON-STRING-ARRAY-ARRAY GETTER] execution(String Person.getFirstName())"/>
  430. <line text="[GETTER] execution(String Person.getLastName())"/>
  431. <line text="[NON-STRING-ARRAY GETTER] execution(String Person.getLastName())"/>
  432. <line text="[NON-STRING-ARRAY-ARRAY GETTER] execution(String Person.getLastName())"/>
  433. <line text="Marie Curie"/>
  434. <line text="[SETTER] execution(void Person.setFullName(String))"/>
  435. <line text="[SETTER] execution(void Person.setId(int))"/>
  436. <line text="Person(id=22, lastName='Einstein', firstName='Albert')"/>
  437. <line text="Einstein, Albert"/>
  438. <line text="[NON-STRING GETTER] execution(void Person.getVoid())"/>
  439. <line text="[NON-STRING-ARRAY GETTER] execution(void Person.getVoid())"/>
  440. <line text="[NON-STRING-ARRAY-ARRAY GETTER] execution(void Person.getVoid())"/>
  441. <line text="[GETTER] execution(String[] Person.getStringArray())"/>
  442. <line text="[NON-STRING GETTER] execution(String[] Person.getStringArray())"/>
  443. <line text="[STRING-ARRAY GETTER] execution(String[] Person.getStringArray())"/>
  444. <line text="[NON-STRING-ARRAY-ARRAY GETTER] execution(String[] Person.getStringArray())"/>
  445. <line text="[Hello, world]"/>
  446. <line text="[GETTER] execution(String[][] Person.getStringArrayArray())"/>
  447. <line text="[NON-STRING GETTER] execution(String[][] Person.getStringArrayArray())"/>
  448. <line text="[NON-STRING-ARRAY GETTER] execution(String[][] Person.getStringArrayArray())"/>
  449. <line text="[[Hello, world], [Hallo, Welt]]"/>
  450. <line text="AspectJ rules!"/>
  451. </stdout>
  452. </run>
  453. </ajc-test>
  454. </suite>