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.

GenericsTests.java 44KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992
  1. package org.aspectj.systemtest.ajc150;
  2. import java.io.File;
  3. import java.net.MalformedURLException;
  4. import java.net.URL;
  5. import java.net.URLClassLoader;
  6. import java.util.HashSet;
  7. import java.util.Iterator;
  8. import java.util.Set;
  9. import junit.framework.Test;
  10. import org.aspectj.apache.bcel.classfile.Attribute;
  11. import org.aspectj.apache.bcel.classfile.JavaClass;
  12. import org.aspectj.apache.bcel.classfile.Signature;
  13. import org.aspectj.apache.bcel.util.ClassPath;
  14. import org.aspectj.apache.bcel.util.SyntheticRepository;
  15. import org.aspectj.testing.XMLBasedAjcTestCase;
  16. import org.aspectj.tools.ajc.Ajc;
  17. import org.aspectj.util.LangUtil;
  18. public class GenericsTests extends XMLBasedAjcTestCase {
  19. /*==========================================
  20. * Generics test plan for pointcuts.
  21. *
  22. * handler PASS
  23. * - does not permit type var spec
  24. * - does not permit generic type (fail with type not found)
  25. * - does not permit parameterized types
  26. * if PASS
  27. * - does not permit type vars
  28. * cflow PASS
  29. * - does not permit type vars
  30. * cflowbelow PASS
  31. * - does not permit type vars
  32. * @this PASS
  33. * - does not permit type vars PASS
  34. * - does not permit parameterized type PASS
  35. * @target PASS
  36. * - does not permit type vars PASS
  37. * - does not permit parameterized type PASS
  38. * @args PASS
  39. * - does not permit type vars PASS
  40. * - does not permit parameterized type PASS
  41. * @annotation PASS
  42. * - does not permit type vars PASS
  43. * - does not permit parameterized type PASS
  44. * @within, @within code - as above PASS
  45. * annotation type pattern with generic and parameterized types PASS
  46. * - just make sure that annotation interfaces can never be generic first! VERIFIED
  47. * - @Foo<T> should fail PASS
  48. * - @Foo<String> should fail PASS
  49. * - @(Foo || Bar<T>) should fail DEFERRED (not critical)
  50. * staticinitialization PASS
  51. * - error on parameterized type PASS N/A
  52. * - permit parameterized type + PASS N/A
  53. * - matching with parameterized type + N/A
  54. * - wrong number of parameters in parameterized type PASS N/A
  55. * - generic type with one type parameter N/A
  56. * - generic type with n type parameters N/A
  57. * - generic type with bounds [extends, extends + i/f's] N/A
  58. * - generic type with wrong number of type params N/A
  59. * - wildcards in bounds N/A
  60. * within PASS
  61. * - as above, but allows parameterized type (disallowed in simplified plan)
  62. * - wildcards in type parameters N/A
  63. * this PASS
  64. * - no type vars
  65. * - parameterized types - disallowed in simplification plan
  66. * - implements
  67. * - instanceof
  68. * target PASS
  69. * - as this
  70. * args
  71. * - args(List) matches List, List<T>, List<String> PASS
  72. * - args(List<T>) -> invalid absolute type T
  73. * - args(List<String>) matches List<String> but not List<Number> PASS
  74. * - args(List<String>) matches List with unchecked warning PASS
  75. * - args(List<String>) matches List<?> with unchecked warning PASS
  76. * - args(List<Double>) matches List, List<?>, List<? extends Number> with unchecked warning PASS
  77. * matches List<Double> PASS, List<? extends Double> PASS(with warning)
  78. * - args(List<?>) matches List, List<String>, List<?>, ... PASS
  79. * - args(List<? extends Number) matches List<Number>, List<Double>, not List<String> PASS
  80. * matches List, List<?> with unchecked warning PASS
  81. * - args(List<? super Number>) matches List<Object>, List<Number>
  82. * does not match List<Double>
  83. * matches List, List<?> with unchecked warning
  84. * matches List<? super Number>
  85. * matches List<? extends Object> with unchecked warning
  86. * matches List<? extends Number> with unchecked warning
  87. * get & set PASS
  88. * - parameterized declaring type PASS
  89. * - generic declaring type PASS
  90. * - field type is type variable PASS
  91. * - field type is parameterized PASS
  92. * initialization, preinitialization PASS
  93. * - generic declaring type PASS
  94. * - type variables as params PASS
  95. * - parameterized types as params PASS
  96. * - no join points for init, preinit of parameterized types (as per staticinit) PASS
  97. * withincode PASS
  98. * - no generic or parameterized declaring type patterns PASS
  99. * - no parameterized throws patterns PASS
  100. * - return type as type variable PASS
  101. * - return type as parameterized type PASS
  102. * - parameter as type variable PASS
  103. * - parameter as parameterized type PASS
  104. * - no join points within bridge methods PASS
  105. * execution PASS
  106. * - no generic or parameterized declaring type patterns PASS
  107. * - no parameterized throws patterns PASS
  108. * - return type as type variable PASS
  109. * - return type as parameterized type PASS
  110. * - parameter as type variable PASS
  111. * - parameter as parameterized type PASS
  112. * - no join points for bridge methods PASS
  113. * call PASS
  114. * - no generic or parameterized declaring type patterns PASS
  115. * - no parameterized throws patterns PASS
  116. * - return type as type variable PASS
  117. * - return type as parameterized type PASS
  118. * - parameter as type variable PASS
  119. * - parameter as parameterized type PASS
  120. * - calls to a bridge methods PASS
  121. * after throwing - can't use parameterized type pattern
  122. * after returning - same as for args
  123. */
  124. /* ==========================================
  125. * Generics test plan for ITDs.
  126. *
  127. * think about:
  128. * - 'visibility' default/private/public
  129. * - static/nonstatic
  130. * - parameterized ITDs (methods/ctors/fields)
  131. * - ITD target: interface/class/aspect
  132. * - multiple type variables
  133. * - constructor ITDs, method ITDs
  134. * - ITDs sharing type variables with generic types
  135. * - relating to above point, this makes generic ITD fields possible
  136. * - signature attributes for generic ITDs (required? required only for public ITDs?)
  137. * - binary weaving when target type changes over time (might start out 'simple' then sometime later be 'generic')
  138. * - bridge methods - when to create them
  139. * - multiple 'separate' ITDs in a file that share a type variable by 'name'
  140. * - wildcards '?' 'extends' 'super' '&'
  141. * - do type variables assigned to members need to persist across serialization
  142. * - recursive type variable definitions eg. <R extends Comparable<? super R>>
  143. * - super/extends with parameterized types <? extends List<String>>
  144. * - multiple ITDs defined in one type that reuse type variable letters, specifying different bounds
  145. * - generic aspects
  146. *
  147. * PASS parsing generic ITDs
  148. * PASS generic methods
  149. * PASS generic constructors
  150. * PASS ITD visibility
  151. * PASS static/nonstatic
  152. * PASS parameterizedITDs
  153. * PASS differing targets (interface/class/aspect)
  154. * PASS multiple type variables in an ITD
  155. * PASS parsing ITDs that share type variables with target type
  156. * PASS using type variables from the target type in your field ITD
  157. * PASS using type variables from the target type in your method ITD (but no type vars of your own)
  158. * PASS using type variables from the target type in your ctor ITD (but no type vars of your own)
  159. * PASS using type variables from the target type and having your own too (methods)
  160. * PASS using type variables from the target type and having your own too (ctors)
  161. * PASS reusing type variable letter but differing spec across multiple ITDs in one aspect
  162. * PASS wildcards
  163. * PASS recursive type variable definitions
  164. * PASS generic aspects
  165. * PASS parameterizing ITDs with type variables
  166. * PASS using type variables from the target type in your *STATIC* ITD (field/method/ctor) (error scenario)
  167. * PASS basic binary weaving of generic itds
  168. *
  169. * TODO generic aspect binary weaving (or at least multi source file weaving)
  170. * TODO binary weaving with changing types (moving between generic and simple)
  171. * TODO bridge method creation (also relates to covariance overrides..)
  172. * TODO exotic class/interface bounds ('? extends List<String>','? super anything')
  173. * TODO signature attributes for generic ITDs (public only?)
  174. *
  175. */
  176. public static Test suite() {
  177. return XMLBasedAjcTestCase.loadSuite(GenericsTests.class);
  178. }
  179. protected File getSpecFile() {
  180. return new File("../tests/src/org/aspectj/systemtest/ajc150/ajc150.xml");
  181. }
  182. public void testITDReturningParameterizedType() {
  183. runTest("ITD with parameterized type");
  184. }
  185. public void testPR91267_1() {
  186. runTest("NPE using generic methods in aspects 1");
  187. }
  188. public void testParameterizedTypeAndAroundAdvice_PR115250() {
  189. runTest("parameterized type and around advice");
  190. }
  191. public void testParameterizedTypeAndAroundAdvice_PR115250_2() {
  192. runTest("parameterized type and around advice - 2");
  193. }
  194. public void testPR91267_2() {
  195. runTest("NPE using generic methods in aspects 2");
  196. }
  197. public void testPR91053() {
  198. runTest("Generics problem with Set");
  199. }
  200. public void testPR87282() {
  201. runTest("Compilation error on generic member introduction");
  202. }
  203. public void testGenericsOverrides_1() { runTest("generics and ITD overrides - 1"); }
  204. public void testGenericsOverrides_2() { runTest("generics and ITD overrides - 2"); }
  205. public void testGenericsOverrides_3() { runTest("generics and ITD overrides - 3"); }
  206. public void testGenericsOverrides_4() { runTest("generics and ITD overrides - 4"); }
  207. public void testSelfBoundGenerics_pr117296() {
  208. runTest("self bounding generic types");
  209. }
  210. public void testPR88606() {
  211. runTest("Parameterized types on introduced fields not correctly recognized");
  212. }
  213. public void testPR97763() {
  214. runTest("ITD method with generic arg");
  215. }
  216. public void testGenericsBang_pr95993() {
  217. runTest("NPE at ClassScope.java:660 when compiling generic class");
  218. }
  219. // generic aspects
  220. public void testPR96220_GenericAspects1() {runTest("generic aspects - 1");}
  221. public void testPR96220_GenericAspects2() {runTest("generic aspects - 2");}
  222. public void testPR96220_GenericAspects3() {runTest("generic aspects - 3");}
  223. public void testGenericAspects4() {runTest("generic aspects - 4");}
  224. public void testGenericAspects5() {runTest("generic aspects - 5 (ajdk)");} // in separate files
  225. public void testGenericAspects6() {runTest("generic aspects - 6 (ajdk)");} // all in one file
  226. public void testTypeVariablesInDeclareWarning() { runTest("generic aspect with declare warning using type vars");}
  227. public void testTypeVariablesInExecutionAdvice() { runTest("generic aspect with execution advice using type vars");}
  228. public void testTypeVariablesInAnonymousPointcut() { runTest("generic aspect with anonymous pointcut");}
  229. public void testDeclareParentWithParameterizedInterface() {
  230. runTest("generic aspect declare parents");
  231. }
  232. public void testDeclareSoftInGenericAspect() {
  233. runTest("generic aspect declare soft");
  234. }
  235. //////////////////////////////////////////////////////////////////////////////
  236. // Generic/Parameterized ITDs - includes scenarios from developers notebook //
  237. //////////////////////////////////////////////////////////////////////////////
  238. // parsing of generic ITD members
  239. public void testParseItdNonStaticMethod() {runTest("Parsing generic ITDs - 1");}
  240. public void testParseItdStaticMethod() {runTest("Parsing generic ITDs - 2");}
  241. public void testParseItdCtor() {runTest("Parsing generic ITDs - 3");}
  242. public void testParseItdComplexMethod() {runTest("Parsing generic ITDs - 4");}
  243. public void testParseItdSharingVars1() {runTest("Parsing generic ITDs - 5");}
  244. public void testParseItdSharingVars2() {runTest("Parsing generic ITDs - 6");}
  245. // non static
  246. public void testGenericMethodITD1() {runTest("generic method itd - 1");} // <E> ... (List<? extends E>)
  247. public void testGenericMethodITD2() {runTest("generic method itd - 2");} // <E extends Number> ... (List<? extends E>) called incorrectly
  248. public void testGenericMethodITD3() {runTest("generic method itd - 3");} // <E> ... (List<E>,List<E>)
  249. public void testGenericMethodITD4() {runTest("generic method itd - 4");} // <A,B> ... (List<A>,List<B>)
  250. public void testGenericMethodITD5() {runTest("generic method itd - 5");} // <E> ... (List<E>,List<E>) called incorrectly
  251. public void testGenericMethodITD6() {runTest("generic method itd - 6");} // <E extends Number> ... (List<? extends E>)
  252. public void testGenericMethodITD7() {runTest("generic method itd - 7"); } // <E> ... (List<E>,List<? extends E>)
  253. public void testGenericMethodITD8() {runTest("generic method itd - 8"); } // <E> ... (List<E>,List<? extends E>) called incorrectly
  254. public void testGenericMethodITD9() {runTest("generic method itd - 9"); } // <R extends Comparable<? super R>> ... (List<R>)
  255. public void testGenericMethodITD10() {runTest("generic method itd - 10");} // <R extends Comparable<? super R>> ... (List<R>) called incorrectly
  256. public void testGenericMethodITD11() {runTest("generic method itd - 11");} // <R extends Comparable<? extends R>> ... (List<R>)
  257. public void testGenericMethodITD12() {runTest("generic method itd - 12");} // <R extends Comparable<? extends R>> ... (List<R>) called incorrectly
  258. public void testGenericMethodITD13() {runTest("generic method itd - 13");} // <R extends Comparable<? extends R>> ... (List<R>) called correctly in a clever way ;)
  259. public void testGenericMethodITD14() {runTest("generic method itd - 14");} // <R extends Comparable<? super R>> ... (List<R>) called incorrectly in a clever way
  260. public void testGenericMethodITD15() {runTest("generic method itd - 15");} // <R extends Comparable<? super R>> ... (List<R>) called correctly in a clever way
  261. // generic ctors
  262. public void testGenericCtorITD1() {runTest("generic ctor itd - 1");} // <T> new(List<T>)
  263. public void testGenericCtorITD2() {runTest("generic ctor itd - 2");} // <T> new(List<T>,List<? extends T>)
  264. public void testGenericCtorITD3() {runTest("generic ctor itd - 3");} // <T> new(List<T>,Comparator<? super T>)
  265. // parameterized ITDs
  266. public void testParameterizedMethodITD1() {runTest("parameterized method itd - 1");} // (List<? extends Super>)
  267. public void testParameterizedMethodITD2() {runTest("parameterized method itd - 2");} // (List<? extends Number>) called incorrectly
  268. public void testParameterizedMethodITD3() {runTest("parameterized method itd - 3");} // (List<? super A>) called incorrectly
  269. public void testParameterizedMethodITD4() {runTest("parameterized method itd - 4");} // (List<? super B>)
  270. // differing visibilities
  271. public void testPublicITDs() {runTest("public itds");}
  272. public void testPublicITDsErrors() {runTest("public itds with errors");}
  273. public void testPrivateITDs() {runTest("private itds");}
  274. public void testPackageITDs() {runTest("package itds");}
  275. // targetting different types (interface/class/aspect)
  276. public void testTargettingInterface() {runTest("targetting interface");}
  277. public void testTargettingAspect() {runTest("targetting aspect");}
  278. public void testTargettingClass() {runTest("targetting class");}
  279. // using a type variable from the target generic type in your ITD
  280. public void testFieldITDsUsingTargetTypeVars1() {runTest("field itd using type variable from target type - 1");}
  281. public void testFieldITDsUsingTargetTypeVars2() {runTest("field itd using type variable from target type - 2");}
  282. public void testFieldITDsUsingTargetTypeVars3() {runTest("field itd using type variable from target type - 3");}
  283. public void testFieldITDsUsingTargetTypeVars4() {runTest("field itd using type variable from target type - 4");}
  284. public void testFieldITDsUsingTargetTypeVars5() {runTest("field itd using type variable from target type - 5");}
  285. public void testFieldITDsUsingTargetTypeVars6() {runTest("field itd using type variable from target type - 6");}
  286. public void testFieldITDsUsingTargetTypeVars7() {runTest("field itd using type variable from target type - 7");}
  287. public void testFieldITDsUsingTargetTypeVars8() {runTest("field itd using type variable from target type - 8");}
  288. public void testFieldITDsUsingTargetTypeVars9() {runTest("field itd using type variable from target type - 9");}
  289. public void testFieldITDsUsingTargetTypeVars10(){runTest("field itd using type variable from target type -10");}
  290. public void testFieldITDsUsingTargetTypeVars11(){runTest("field itd using type variable from target type -11");}
  291. public void testFieldITDsUsingTargetTypeVars12(){runTest("field itd using type variable from target type -12");}
  292. public void testFieldITDsUsingTargetTypeVars13(){runTest("field itd using type variable from target type -13");}
  293. public void testFieldITDsUsingTargetTypeVars14(){runTest("field itd using type variable from target type -14");}
  294. public void testFieldITDsUsingTargetTypeVars15(){runTest("field itd using type variable from target type -15");}
  295. public void testFieldITDsUsingTargetTypeVars16(){runTest("field itd using type variable from target type -16");}
  296. public void testFieldITDsUsingTargetTypeVars17(){runTest("field itd using type variable from target type -17");}
  297. public void testMethodITDsUsingTargetTypeVarsA1() {runTest("method itd using type variable from target type - A1");}
  298. public void testMethodITDsUsingTargetTypeVarsA2() {runTest("method itd using type variable from target type - A2");}
  299. public void testMethodITDsUsingTargetTypeVarsA3() {runTest("method itd using type variable from target type - A3");}
  300. public void testMethodITDsUsingTargetTypeVarsA4() {runTest("method itd using type variable from target type - A4");}
  301. public void testMethodITDsUsingTargetTypeVarsB1() {runTest("method itd using type variable from target type - B1");}
  302. public void testMethodITDsUsingTargetTypeVarsC1() {runTest("method itd using type variable from target type - C1");}
  303. public void testMethodITDsUsingTargetTypeVarsD1() {runTest("method itd using type variable from target type - D1");}
  304. public void testMethodITDsUsingTargetTypeVarsE1() {runTest("method itd using type variable from target type - E1");}
  305. public void testMethodITDsUsingTargetTypeVarsF1() {runTest("method itd using type variable from target type - F1");}
  306. public void testMethodITDsUsingTargetTypeVarsG1() {runTest("method itd using type variable from target type - G1");}
  307. public void testMethodITDsUsingTargetTypeVarsH1() {runTest("method itd using type variable from target type - H1");}
  308. public void testMethodITDsUsingTargetTypeVarsI1() {runTest("method itd using type variable from target type - I1");}
  309. public void testMethodITDsUsingTargetTypeVarsI2() {runTest("method itd using type variable from target type - I2");}
  310. public void testMethodITDsUsingTargetTypeVarsJ1() {runTest("method itd using type variable from target type - J1");}
  311. public void testMethodITDsUsingTargetTypeVarsK1() {runTest("method itd using type variable from target type - K1");}
  312. public void testMethodITDsUsingTargetTypeVarsL1() {runTest("method itd using type variable from target type - L1");}
  313. public void testMethodITDsUsingTargetTypeVarsM1() {runTest("method itd using type variable from target type - M1");}
  314. public void testMethodITDsUsingTargetTypeVarsM2() {runTest("method itd using type variable from target type - M2");}
  315. public void testMethodITDsUsingTargetTypeVarsN1() {runTest("method itd using type variable from target type - N1");}
  316. public void testMethodITDsUsingTargetTypeVarsO1() {runTest("method itd using type variable from target type - O1");}
  317. public void testMethodITDsUsingTargetTypeVarsO2() {runTest("method itd using type variable from target type - O2");}
  318. public void testMethodITDsUsingTargetTypeVarsP1() {runTest("method itd using type variable from target type - P1");}
  319. public void testMethodITDsUsingTargetTypeVarsQ1() {runTest("method itd using type variable from target type - Q1");}
  320. public void testCtorITDsUsingTargetTypeVarsA1() {runTest("ctor itd using type variable from target type - A1");}
  321. public void testCtorITDsUsingTargetTypeVarsB1() {runTest("ctor itd using type variable from target type - B1");}
  322. public void testCtorITDsUsingTargetTypeVarsC1() {runTest("ctor itd using type variable from target type - C1");}
  323. public void testCtorITDsUsingTargetTypeVarsD1() {runTest("ctor itd using type variable from target type - D1");}
  324. public void testCtorITDsUsingTargetTypeVarsE1() {runTest("ctor itd using type variable from target type - E1");}
  325. public void testCtorITDsUsingTargetTypeVarsF1() {runTest("ctor itd using type variable from target type - F1");}
  326. public void testCtorITDsUsingTargetTypeVarsG1() {runTest("ctor itd using type variable from target type - G1");}
  327. public void testCtorITDsUsingTargetTypeVarsH1() {runTest("ctor itd using type variable from target type - H1");}
  328. public void testCtorITDsUsingTargetTypeVarsI1() {runTest("ctor itd using type variable from target type - I1");}
  329. public void testSophisticatedAspectsA() {runTest("uberaspects - A");}
  330. public void testSophisticatedAspectsB() {runTest("uberaspects - B");}
  331. public void testSophisticatedAspectsC() {runTest("uberaspects - C");}
  332. public void testSophisticatedAspectsD() {runTest("uberaspects - D");}
  333. public void testSophisticatedAspectsE() {runTest("uberaspects - E");}
  334. public void testSophisticatedAspectsF() {runTest("uberaspects - F");}
  335. public void testSophisticatedAspectsG() {runTest("uberaspects - G");}
  336. public void testSophisticatedAspectsH() {runTest("uberaspects - H");}
  337. public void testSophisticatedAspectsI() {runTest("uberaspects - I");}
  338. public void testSophisticatedAspectsJ() {runTest("uberaspects - J");}
  339. //public void testSophisticatedAspectsK() {runTest("uberaspects - K");} // FIXME asc bounds testing is tough!
  340. public void testSophisticatedAspectsK2(){runTest("uberaspects - K2");}
  341. public void testSophisticatedAspectsL() {runTest("uberaspects - L");}
  342. public void testSophisticatedAspectsM() {runTest("uberaspects - M");}
  343. public void testSophisticatedAspectsN() {runTest("uberaspects - N");}
  344. public void testSophisticatedAspectsO() {runTest("uberaspects - O");}
  345. public void testSophisticatedAspectsP() {runTest("uberaspects - P");}
  346. public void testSophisticatedAspectsQ() {runTest("uberaspects - Q");}
  347. public void testSophisticatedAspectsR() {runTest("uberaspects - R");}
  348. public void testSophisticatedAspectsS() {runTest("uberaspects - S");}
  349. public void testSophisticatedAspectsT() {runTest("uberaspects - T");}
  350. public void testSophisticatedAspectsU() {runTest("uberaspects - U");} // includes nasty casts
  351. public void testSophisticatedAspectsV() {runTest("uberaspects - V");} // casts are gone
  352. public void testSophisticatedAspectsW() {runTest("uberaspects - W");}
  353. public void testSophisticatedAspectsX() {runTest("uberaspects - X");} // from the AJDK
  354. public void testSophisticatedAspectsY() {runTest("uberaspects - Y");} // pointcut matching
  355. public void testSophisticatedAspectsZ() {runTest("uberaspects - Z");}
  356. // FIXME asc these two tests have peculiar error messages - generic aspect related
  357. // public void testItdUsingTypeParameter() {runTest("itd using type parameter");}
  358. // public void testItdIncorrectlyUsingTypeParameter() {runTest("itd incorrectly using type parameter");}
  359. public void testUsingSameTypeVariable() {runTest("using same type variable in ITD");}
  360. public void testBinaryWeavingITDsA() {runTest("binary weaving ITDs - A");}
  361. public void testBinaryWeavingITDsB() {runTest("binary weaving ITDs - B");}
  362. public void testBinaryWeavingITDs1() {runTest("binary weaving ITDs - 1");}
  363. public void testBinaryWeavingITDs2() {runTest("binary weaving ITDs - 2");}
  364. public void testBinaryWeavingITDs3() {runTest("binary weaving ITDs - 3");}
  365. public void testGenericITFSharingTypeVariable() {runTest("generic intertype field declaration, sharing type variable");}
  366. // general tests ... usually just more complex scenarios
  367. public void testReusingTypeVariableLetters() {runTest("reusing type variable letters");}
  368. public void testMultipleGenericITDsInOneFile() {runTest("multiple generic itds in one file");}
  369. public void testItdNonStaticMember() {runTest("itd of non static member");}
  370. public void testItdStaticMember() {runTest("itd of static member");}
  371. public void testStaticGenericMethodITD() {runTest("static generic method itd");}
  372. public void testAtOverride0() {runTest("atOverride used with ITDs");}
  373. public void testAtOverride1() {runTest("atOverride used with ITDs - 1");}
  374. public void testAtOverride2() {runTest("atOverride used with ITDs - 2");}
  375. public void testAtOverride3() {runTest("atOverride used with ITDs - 3");}
  376. public void testAtOverride4() {runTest("atOverride used with ITDs - 4");}
  377. public void testAtOverride5() {runTest("atOverride used with ITDs - 5");}
  378. public void testAtOverride6() {runTest("atOverride used with ITDs - 6");}
  379. public void testAtOverride7() {runTest("atOverride used with ITDs - 7");}
  380. // bridge methods
  381. public void testITDBridgeMethodsCovariance1() {runTest("bridging with covariance 1 - normal");}
  382. public void testITDBridgeMethodsCovariance2() {runTest("bridging with covariance 1 - itd");}
  383. public void testITDBridgeMethods1Normal() {runTest("basic bridging with type vars - 1 - normal");}
  384. public void testITDBridgeMethods1Itd() {runTest("basic bridging with type vars - 1 - itd");}
  385. public void testITDBridgeMethods2Normal() {runTest("basic bridging with type vars - 2 - normal");}
  386. public void testITDBridgeMethods2Itd() {runTest("basic bridging with type vars - 2 - itd");}
  387. public void testITDBridgeMethodsPr91381() {runTest("Abstract intertype method and covariant returns");}
  388. // Just normal source compile of two types with a method override between them
  389. public void testGenericITDsBridgeMethods1() {
  390. runTest("bridge methods - 1");
  391. checkMethodsExist("Sub1",new String[]{
  392. "java.lang.Integer Sub1.m()",
  393. "java.lang.Object Sub1.m() [BridgeMethod]"});
  394. }
  395. // Now the same thing but the aspect (which doesn't do much!) is binary woven in.
  396. public void testGenericITDsBridgeMethods1binary() {
  397. runTest("bridge methods - 1 - binary");
  398. checkMethodsExist("Sub1",new String[]{
  399. "java.lang.Integer Sub1.m()",
  400. "java.lang.Object Sub1.m() [BridgeMethod]"});
  401. }
  402. // Now the method is put into the superclass via ITD - there should be a bridge method in the subclass
  403. public void testGenericITDsBridgeMethods2() {
  404. runTest("bridge methods - 2");
  405. checkMethodsExist("Sub2",new String[]{
  406. "java.lang.Integer Sub2.m()",
  407. "java.lang.Object Sub2.m() [BridgeMethod]"});
  408. }
  409. // Now the superclass ITD is done with binary weaving so the weaver (rather than compiler) has to create the bridge method
  410. public void testGenericITDsBridgeMethods2binary() {
  411. runTest("bridge methods - 2 - binary");
  412. checkMethodsExist("Sub2",new String[]{
  413. "java.lang.Integer Sub2.m()",
  414. "java.lang.Object Sub2.m() [BridgeMethod]"});
  415. }
  416. // Now the method is put into the subclass via ITD - there should be a bridge method alongside it in the subclass
  417. public void testGenericITDsBridgeMethods3() {
  418. runTest("bridge methods - 3");
  419. checkMethodsExist("Sub3",new String[]{
  420. "java.lang.Integer Sub3.m()",
  421. "java.lang.Object Sub3.m() [BridgeMethod]"});
  422. }
  423. // Now the subclass ITD is done with binary weaving - the weaver should create the necessary bridge method
  424. public void testGenericITDsBridgeMethods3binary() {
  425. runTest("bridge methods - 3 - binary");
  426. checkMethodsExist("Sub3",new String[]{
  427. "java.lang.Integer Sub3.m()",
  428. "java.lang.Object Sub3.m() [BridgeMethod]"});
  429. }
  430. // Now the two types are disconnected until the aspect supplies a declare parents relationship -
  431. // the bridge method should still be created in the subtype
  432. public void testGenericITDSBridgeMethods4() {
  433. runTest("bridge methods - 4");
  434. checkMethodsExist("Sub4",new String[]{
  435. "java.lang.Integer Sub4.m()",
  436. "java.lang.Object Sub4.m() [BridgeMethod]"});
  437. }
  438. // now the aspect doing the decp between the types is applied via binary weaving - weaver should create the bridge method
  439. public void testGenericITDSBridgeMethods4binary() {
  440. runTest("bridge methods - 4 - binary");
  441. checkMethodsExist("Sub4",new String[]{
  442. "java.lang.Integer Sub4.m()",
  443. "java.lang.Object Sub4.m() [BridgeMethod]"});
  444. }
  445. public void testBinaryBridgeMethodsOne() {
  446. runTest("binary bridge methods - one");
  447. checkMethodsExist("OneB",new String[]{
  448. "java.lang.Number OneB.firstMethod() [BridgeMethod]",
  449. "java.lang.Integer OneB.firstMethod()",
  450. "void OneB.secondMethod(java.lang.Number) [BridgeMethod]",
  451. "void OneB.secondMethod(java.lang.Integer)",
  452. "void OneB.thirdMethod(java.lang.Number,java.lang.Number) [BridgeMethod]",
  453. "void OneB.thirdMethod(java.lang.Integer,java.lang.Integer)",
  454. "void OneB.fourthMethod(java.util.List)",
  455. "java.lang.Number OneB.fifthMethod(java.lang.Number,java.util.List) [BridgeMethod]",
  456. "java.lang.Integer OneB.fifthMethod(java.lang.Integer,java.util.List)"
  457. });
  458. }
  459. public void testBinaryBridgeMethodsTwo() {
  460. runTest("binary bridge methods - two");
  461. checkMethodsExist("TwoB",new String[]{
  462. "java.lang.Number TwoB.firstMethod(java.io.Serializable) [BridgeMethod]",
  463. "java.lang.Integer TwoB.firstMethod(java.lang.String)"
  464. });
  465. }
  466. public void testBinaryBridgeMethodsThree() {
  467. runTest("binary bridge methods - three");
  468. checkMethodsExist("ThreeB",new String[]{
  469. "java.lang.Number ThreeB.m() [BridgeMethod]",
  470. "java.lang.Double ThreeB.m()"
  471. });
  472. }
  473. public void testGenericITDsBridgeMethodsPR91381() {runTest("abstract intertype methods and covariant returns");}
  474. public void testGenericITDsBridgeMethodsPR91381_2() {runTest("abstract intertype methods and covariant returns - error");}
  475. // ----------------------------------------------------------------------------------------
  476. // generic declare parents tests
  477. // ----------------------------------------------------------------------------------------
  478. public void testPR96220_GenericDecp() {
  479. runTest("generic decp - simple");
  480. checkOneSignatureAttribute(ajc,"Basic");
  481. verifyClassSignature(ajc,"Basic","Ljava/lang/Object;LJ<Ljava/lang/Double;>;LI<Ljava/lang/Double;>;");
  482. }
  483. // Both the existing type decl and the one adding via decp are parameterized
  484. public void testGenericDecpMultipleVariantsOfAParameterizedType1() {
  485. runTest("generic decp - implementing two variants #1");
  486. }
  487. // Existing type decl is raw and the one added via decp is parameterized
  488. public void testGenericDecpMultipleVariantsOfAParameterizedType2() {
  489. runTest("generic decp - implementing two variants #2");
  490. }
  491. // Existing type decl is parameterized and the one added via decp is raw
  492. public void testGenericDecpMultipleVariantsOfAParameterizedType3() {
  493. runTest("generic decp - implementing two variants #3");
  494. }
  495. // decp is parameterized but it does match the one already on the type
  496. public void testGenericDecpMultipleVariantsOfAParameterizedType4() {
  497. runTest("generic decp - implementing two variants #4");
  498. }
  499. // same as above four tests for binary weaving
  500. public void testGenericDecpMultipleVariantsOfAParameterizedType1_binaryWeaving() {
  501. runTest("generic decp binary - implementing two variants #1");
  502. }
  503. public void testGenericDecpMultipleVariantsOfAParameterizedType2_binaryWeaving() {
  504. runTest("generic decp binary - implementing two variants #2");
  505. }
  506. // Existing type decl is parameterized and the one added via decp is raw
  507. public void testGenericDecpMultipleVariantsOfAParameterizedType3_binaryWeaving() {
  508. runTest("generic decp binary - implementing two variants #3");
  509. }
  510. // decp is parameterized but it does match the one already on the type
  511. public void testGenericDecpMultipleVariantsOfAParameterizedType4_binaryWeaving() {
  512. runTest("generic decp binary - implementing two variants #4");
  513. }
  514. public void testGenericDecpParameterized() {
  515. runTest("generic decp - with parameterized on the target");
  516. checkOneSignatureAttribute(ajc,"Basic6");
  517. verifyClassSignature(ajc,"Basic6","<J:Ljava/lang/Object;>Ljava/lang/Object;LI<TJ;>;LK<Ljava/lang/Integer;>;");
  518. }
  519. public void testGenericDecpIncorrectNumberOfTypeParams() {
  520. runTest("generic decp - incorrect number of type parameters");
  521. }
  522. public void testGenericDecpSpecifyingBounds() {
  523. runTest("generic decp - specifying bounds");
  524. }
  525. public void testGenericDecpViolatingBounds() {
  526. runTest("generic decp - specifying bounds but breaking them");
  527. }
  528. // need separate compilation test to verify signatures are ok
  529. //
  530. // public void testIllegalGenericDecp() {
  531. // runTest("illegal generic decp");
  532. // }
  533. //
  534. // public void testPR95992_TypeResolvingProblemWithGenerics() {
  535. // runTest("Problems resolving type name inside generic class");
  536. // }
  537. // -- Pointcut tests...
  538. public void testHandlerWithGenerics() {
  539. runTest("handler pcd and generics / type vars");
  540. }
  541. public void testPointcutsThatDontAllowTypeVars() {
  542. runTest("pointcuts that dont allow type vars");
  543. }
  544. public void testParameterizedTypesInAtPCDs() {
  545. runTest("annotation pcds with parameterized types");
  546. }
  547. public void testAnnotationPatternsWithParameterizedTypes() {
  548. runTest("annotation patterns with parameterized types");
  549. }
  550. public void testStaticInitializationWithParameterizedTypes() {
  551. runTest("staticinitialization and parameterized types");
  552. }
  553. // no longer a valid test with generics simplication
  554. // public void testStaticInitializationMatchingWithParameterizedTypes() {
  555. // runTest("staticinitialization and parameterized type matching");
  556. // }
  557. // no longer a valid test in simplified design
  558. // public void testStaticInitializationWithGenericTypes() {
  559. // runTest("staticinitialization with generic types");
  560. // }
  561. // no longer a valid test in simplified design
  562. // public void testStaticInitializationWithGenericTypesAdvanced() {
  563. // runTest("staticinitialization with generic types - advanced");
  564. // }
  565. public void testWithinPointcutErrors() {
  566. runTest("within pcd with various parameterizations and generic types - errors");
  567. }
  568. public void testWithinPointcutWarnings() {
  569. runTest("within pcd with various parameterizations and generic types - warnings");
  570. }
  571. public void testThisTargetPointcutErrors() {
  572. runTest("this and target with various parameterizations and generic types - errors");
  573. }
  574. public void testThisTargetPointcutRuntime() {
  575. runTest("this and target with various parameterizations and generic types - runtime");
  576. }
  577. public void testInitAndPreInitPointcutErrors() {
  578. runTest("init and preinit with parameterized declaring types");
  579. }
  580. public void testInitAndPreInitPointcutMatchingWithGenericDeclaringTypes() {
  581. runTest("init and preinit with raw declaring type pattern");
  582. }
  583. public void testInitAndPreInitPointcutMatchingWithParameterizedParameterTypes() {
  584. runTest("init and preinit with parameterized parameter types");
  585. }
  586. public void testWithinCodePointcutErrors() {
  587. runTest("withincode with various parameterizations and generic types - errors");
  588. }
  589. public void testWithinCodeMatching() {
  590. runTest("withincode with various parameterizations and generic types - matching");
  591. }
  592. public void testWithinCodeOverrideMatchingWithGenericMembers() {
  593. runTest("withincode with overriding of inherited generic members");
  594. }
  595. public void testExecutionWithRawType() {
  596. runTest("execution pcd with raw type matching");
  597. }
  598. public void testExecutionWithRawSignature() {
  599. runTest("execution pcd with raw signature matching");
  600. }
  601. public void testExecutionPointcutErrors() {
  602. runTest("execution with various parameterizations and generic types - errors");
  603. }
  604. public void testExecutionMatching() {
  605. runTest("execution with various parameterizations and generic types - matching");
  606. }
  607. public void testExecutionOverrideMatchingWithGenericMembers() {
  608. runTest("execution with overriding of inherited generic members");
  609. }
  610. public void testCallPointcutErrors() {
  611. runTest("call with various parameterizations and generic types - errors");
  612. }
  613. public void testCallMatching() {
  614. runTest("call with various parameterizations and generic types - matching");
  615. }
  616. public void testCallOverrideMatchingWithGenericMembers() {
  617. runTest("call with overriding of inherited generic members");
  618. }
  619. public void testCallWithBridgeMethods() {
  620. runTest("call with bridge methods");
  621. }
  622. public void testGetAndSetPointcutErrors() {
  623. runTest("get and set with various parameterizations and generic types - errors");
  624. }
  625. public void testGetAndSetPointcutMatchingWithGenericAndParameterizedTypes() {
  626. runTest("get and set with various parameterizations and generic declaring types");
  627. }
  628. public void testGetAndSetPointcutMatchingWithGenericAndParameterizedFieldTypes() {
  629. runTest("get and set with various parameterizations and generic field types");
  630. }
  631. public void testArgsWithRawType() {
  632. runTest("args with raw type and generic / parameterized sigs");
  633. }
  634. public void testArgsParameterizedType() {
  635. runTest("args with parameterized type and generic / parameterized sigs");
  636. }
  637. public void testArgsParameterizedAndWildcards() {
  638. runTest("args with parameterized type and wildcards");
  639. }
  640. public void testArgsWithWildcardVar() {
  641. runTest("args with generic wildcard");
  642. }
  643. public void testArgsWithWildcardExtendsVar() {
  644. runTest("args with generic wildcard extends");
  645. }
  646. public void testArgsWithWildcardSuperVar() {
  647. runTest("args with generic wildcard super");
  648. }
  649. public void testGenericMethodMatching() {
  650. runTest("generic method matching");
  651. }
  652. public void testGenericWildcardsInSignatureMatching() {
  653. runTest("generic wildcards in signature matching");
  654. }
  655. public void testAfterThrowing() {
  656. runTest("after throwing with parameterized throw type");
  657. }
  658. public void testAfterReturningWithRawType() {
  659. runTest("after returning with raw type and generic / parameterized sigs");
  660. }
  661. public void testAfterReturningParameterizedType() {
  662. runTest("after returning with parameterized type and generic / parameterized sigs");
  663. }
  664. public void testAfterReturningParameterizedAndWildcards() {
  665. runTest("after returning with parameterized type and wildcards");
  666. }
  667. public void testAfterReturningWithWildcardVar() {
  668. runTest("after returning with generic wildcard");
  669. }
  670. public void testAfterReturningWithWildcardExtendsVar() {
  671. runTest("after returning with generic wildcard extends");
  672. }
  673. public void testAfterReturningWithWildcardSuperVar() {
  674. runTest("after returning with generic wildcard super");
  675. }
  676. public void testAJDKErasureMatchingExamples() {
  677. runTest("ajdk notebook: erasure matching examples");
  678. }
  679. public void testAJDKParameterizedMatchingSimpleExamples() {
  680. runTest("ajdk notebook: simple parameterized type matching examples");
  681. }
  682. public void testAJDKMixedTypeVarsAndParametersExample() {
  683. runTest("ajdk notebook: mixed parameterized types and generic methods");
  684. }
  685. public void testAJDKSignatureAndWildcardExamples() {
  686. runTest("ajdk notebook: signature matching with generic wildcards");
  687. }
  688. public void testAJDKBridgeMethodExamples() {
  689. runTest("ajdk notebook: bridge method examples");
  690. }
  691. public void testAJDKArgsExamples() {
  692. runTest("ajdk notebook: args examples");
  693. }
  694. public void testAJDKArgsAndWildcardsExamples() {
  695. runTest("ajdk notebook: args and wildcards examples");
  696. }
  697. public void testAJDKAfterReturningExamples() {
  698. runTest("ajdk notebook: after returning examples");
  699. }
  700. public void testAJDKPointcutInGenericClassExample() {
  701. runTest("ajdk notebook: pointcut in generic class example");
  702. }
  703. // TESTS for generic abstract aspects that get extended and parameterized...
  704. public void testStaticPointcutParameterization() {
  705. runTest("static pointcut parameterization suite");
  706. }
  707. public void testDynamicPointcutParameterization() {
  708. runTest("dynamic pointcut parameterization suite");
  709. }
  710. public void testReferenceToPointcutInGenericClass() {
  711. runTest("reference to pointcut in generic class");
  712. }
  713. public void testReferenceToPointcutInGenericClass2() {
  714. runTest("reference to non-parameterized pointcut in generic class");
  715. }
  716. public void testDeclareParentsParameterized() {
  717. runTest("declare parents parameterized");
  718. }
  719. public void testDeclarePrecedenceParameterized() {
  720. runTest("declare precedence parameterized");
  721. }
  722. public void testDeclareAnnotationParameterized() {
  723. runTest("declare annotation parameterized");
  724. }
  725. public void testMultiLevelGenericAspects() {
  726. runTest("multi-level generic abstract aspects");
  727. }
  728. // --- helpers
  729. /**
  730. * When a class has been written to the sandbox directory, you can ask this method to
  731. * verify it contains a particular set of methods. Typically this is used to verify that
  732. * bridge methods have been created.
  733. */
  734. public void checkMethodsExist(String classname,String[] methods) {
  735. Set methodsFound = new HashSet();
  736. StringBuffer debugString = new StringBuffer();
  737. try {
  738. ClassLoader cl = new URLClassLoader(new URL[]{ajc.getSandboxDirectory().toURL()});
  739. Class clz = Class.forName(classname,false,cl);
  740. java.lang.reflect.Method[] ms = clz.getDeclaredMethods();
  741. if (ms!=null) {
  742. for (int i =0;i<ms.length;i++) {
  743. String methodString = ms[i].getReturnType().getName()+" "+ms[i].getDeclaringClass().getName()+"."+
  744. ms[i].getName()+"("+stringify(ms[i].getParameterTypes())+")"+
  745. (isBridge(ms[i])?" [BridgeMethod]":"");
  746. methodsFound.add(methodString);
  747. debugString.append("\n[").append(methodString).append("]");
  748. }
  749. }
  750. } catch (ClassNotFoundException e) {
  751. e.printStackTrace();
  752. } catch (MalformedURLException e) {
  753. e.printStackTrace();
  754. }
  755. // check the methods specified do exist
  756. for (int i = 0; i < methods.length; i++) {
  757. String string = methods[i];
  758. if (!methodsFound.remove(string)) {
  759. fail("Couldn't find ["+string+"] in the set of methods in "+classname+" => "+debugString);
  760. }
  761. }
  762. StringBuffer unexpectedMethods = new StringBuffer();
  763. if (!methodsFound.isEmpty()) {
  764. for (Iterator iter = methodsFound.iterator(); iter.hasNext();) {
  765. String element = (String) iter.next();
  766. unexpectedMethods.append("[").append(element).append("]");
  767. }
  768. fail("These methods weren't expected: "+unexpectedMethods);
  769. }
  770. }
  771. /**
  772. * Use 1.5 API isBridge if available.
  773. * See JLS3 15.12.4.5 Create Frame, Synchronize, Transfer Control
  774. */
  775. public static boolean isBridge(java.lang.reflect.Method m) {
  776. // why not importing java.lang.reflect.Method? No BCEL clash?
  777. if (!LangUtil.is15VMOrGreater()) {
  778. return false;
  779. }
  780. try {
  781. final Class[] noparms = new Class[0];
  782. java.lang.reflect.Method isBridge
  783. = java.lang.reflect.Method.class.getMethod("isBridge", noparms);
  784. Boolean result = (Boolean) isBridge.invoke(m, new Object[0]);
  785. return result.booleanValue();
  786. } catch (Throwable t) {
  787. return false;
  788. }
  789. }
  790. public static JavaClass getClass(Ajc ajc, String classname) {
  791. try {
  792. ClassPath cp =
  793. new ClassPath(ajc.getSandboxDirectory() + File.pathSeparator + System.getProperty("java.class.path"));
  794. SyntheticRepository sRepos = SyntheticRepository.getInstance(cp);
  795. JavaClass clazz = sRepos.loadClass(classname);
  796. return clazz;
  797. } catch (ClassNotFoundException e) {
  798. fail("Couldn't find class "+classname+" in the sandbox directory.");
  799. }
  800. return null;
  801. }
  802. public static Signature getClassSignature(Ajc ajc,String classname) {
  803. JavaClass clazz = getClass(ajc,classname);
  804. Signature sigAttr = null;
  805. Attribute[] attrs = clazz.getAttributes();
  806. for (int i = 0; i < attrs.length; i++) {
  807. Attribute attribute = attrs[i];
  808. if (attribute.getName().equals("Signature")) sigAttr = (Signature)attribute;
  809. }
  810. return sigAttr;
  811. }
  812. public static void checkOneSignatureAttribute(Ajc ajc,String classname) {
  813. JavaClass clazz = getClass(ajc,classname);
  814. Signature sigAttr = null;
  815. Attribute[] attrs = clazz.getAttributes();
  816. int signatureCount = 0;
  817. StringBuffer sb = new StringBuffer();
  818. for (int i = 0; i < attrs.length; i++) {
  819. Attribute attribute = attrs[i];
  820. if (attribute.getName().equals("Signature")) {
  821. signatureCount++;
  822. sb.append("\n"+((Signature)attribute).getSignature());
  823. }
  824. }
  825. if (signatureCount>1) fail("Should be only one signature attribute but found "+signatureCount+sb.toString());
  826. }
  827. // Check the signature attribute on a class is correct
  828. public static void verifyClassSignature(Ajc ajc,String classname,String sig) {
  829. Signature sigAttr = getClassSignature(ajc,classname);
  830. assertTrue("Failed to find signature attribute for class "+classname,sigAttr!=null);
  831. assertTrue("Expected signature to be '"+sig+"' but was '"+sigAttr.getSignature()+"'",
  832. sigAttr.getSignature().equals(sig));
  833. }
  834. private static String stringify(Class[] clazzes) {
  835. if (clazzes==null) return "";
  836. StringBuffer sb = new StringBuffer();
  837. for (int i = 0; i < clazzes.length; i++) {
  838. if (i>0) sb.append(",");
  839. sb.append(clazzes[i].getName());
  840. }
  841. return sb.toString();
  842. }
  843. }