Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

ajc150.xml 228KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360
  1. <!DOCTYPE suite SYSTEM "../tests/ajcTestSuite.dtd"[]>
  2. <!-- AspectJ v1.5.0 Tests -->
  3. <suite>
  4. <ajc-test dir="java5/staticImports" title="import static java.lang.System.out">
  5. <compile files="StaticImport.aj" options="-1.5"/>
  6. </ajc-test>
  7. <ajc-test dir="java5/bridgeMethods" pr="72766" title="Ignore bridge methods">
  8. <compile files="AspectX.aj" inpath="testcode.jar" options="-showWeaveInfo">
  9. <!-- <message kind="warning" line="7" text="pointcut did not match on the method call to a bridge method."/>
  10. <message kind="warning" line="7" text="does not match because declaring type is Number"/>-->
  11. <message kind="weave" text="(AspectX.aj:18) advised by before advice from 'AspectX'"/>
  12. <message kind="weave" text="(AspectX.aj:19) advised by before advice from 'AspectX'"/>
  13. <message kind="weave" text="(Number.java:5) advised by before advice from 'AspectX'"/>
  14. </compile>
  15. </ajc-test>
  16. <ajc-test title="intermediate annotation matching" dir="bugs150">
  17. <compile files="AnnotationPlusPatternMatchingError.aj" options="-1.5">
  18. <message kind="warning" line="28" text="matched"/>
  19. </compile>
  20. <run class="AnnotationPlusPatternMatchingError">
  21. <stdout>
  22. <line text="In advice"/>
  23. </stdout>
  24. </run>
  25. </ajc-test>
  26. <ajc-test dir="migration" title="load aspectj 1.2.1 aspects in aspectj 5">
  27. <compile files="Program.java" aspectpath="aspects121.jar">
  28. </compile>
  29. <run class="Program"/>
  30. </ajc-test>
  31. <ajc-test dir="bugs/java5/arrayCloning" pr="72150" vm="1.5"
  32. title="AJC possible bug with static nested classes">
  33. <compile files="A.java,C.java" options="-1.5,-showWeaveInfo">
  34. <message kind="weave" text="Type 'C' (C.java:14) advised by around advice from 'A' (A.java:2)"/>
  35. </compile>
  36. <run class="C"/>
  37. </ajc-test>
  38. <ajc-test dir="java5/pseudoKeywords"
  39. title="method called around in class">
  40. <compile files="MethodCalledAround.java">
  41. </compile>
  42. </ajc-test>
  43. <ajc-test dir="java5/pseudoKeywords"
  44. title="method called around in aspect">
  45. <compile files="MethodCalledAroundAspect.java">
  46. <message kind="error" line="2"/>
  47. </compile>
  48. </ajc-test>
  49. <ajc-test dir="bugs150" pr="64568" title="clear error message on itd with type pattern">
  50. <compile files="pr64568.aj">
  51. <message line="4" kind="error" text="Syntax error on token &quot;*&quot;, delete this token"/>
  52. <message line="4" kind="error" text="foo cannot be resolved to a type"/>
  53. </compile>
  54. </ajc-test>
  55. <ajc-test dir="bugs150" pr="74562" title="before and after are valid identifiers in classes">
  56. <compile files="pr74562.aj">
  57. </compile>
  58. </ajc-test>
  59. <ajc-test dir="bugs150" pr="107486" title="anonymous inner classes">
  60. <compile files="pr107486.aj">
  61. </compile>
  62. </ajc-test>
  63. <ajc-test dir="bugs150" pr="107486" title="multiple anonymous inner classes">
  64. <compile files="pr107486part2.aj">
  65. </compile>
  66. <run class="pr107486part2">
  67. <stdout>
  68. <line text="[advised] f"/>
  69. <line text="[advised] g"/>
  70. </stdout>
  71. </run>
  72. </ajc-test>
  73. <ajc-test dir="bugs150" pr="91114" title="before and after are valid identifiers in classes, part 2">
  74. <compile files="pr91114.aj">
  75. </compile>
  76. </ajc-test>
  77. <ajc-test dir="bugs150" pr="78621" title="void field type in pointcut expression">
  78. <compile files="pr78261.aj">
  79. <message line="3" kind="error" text="fields cannot have a void type"/>
  80. </compile>
  81. </ajc-test>
  82. <ajc-test dir="bugs150" pr="86057" title="overriding final pointcut from super-aspect">
  83. <compile files="pr86057.aj">
  84. <message line="9" kind="error" text="can't override final pointcut Base.foo()"/>
  85. </compile>
  86. </ajc-test>
  87. <ajc-test dir="bugs150" pr="78707" title="before returning advice not allowed!">
  88. <compile files="pr78707.aj">
  89. <message line="3" kind="error" text="Syntax error on token &quot;returning&quot;, delete this token"/>
  90. <message line="3" kind="error" text="Syntax error on token &quot;throwing&quot;, delete this token"/>
  91. </compile>
  92. </ajc-test>
  93. <ajc-test dir="bugs150" pr="104529" title="@SuppressWarnings should suppress">
  94. <compile files="pr104529.aj" options = "-1.5 -warn:+unchecked">
  95. <message line="11" kind="warning" text="needs unchecked conversion"/>
  96. </compile>
  97. </ajc-test>
  98. <ajc-test dir="bugs150" pr="79523" title="declare warning : foo(str) : ...;">
  99. <compile files="pr79523.aj">
  100. <message line="4" kind="warning" text="no match for this type name: str"/>
  101. <message line="4" kind="error" text="bad parameter"/>
  102. <message line="4" kind="error" text="args() pointcut designator cannot be used in declare statement"/>
  103. </compile>
  104. </ajc-test>
  105. <ajc-test dir="bugs150" pr="107059" title="parser crashes on call(void (@a *)(..)">
  106. <compile files="pr107059.aj">
  107. <message line="3" kind="error" text="Syntax error on token &quot;(&quot;, &quot;name pattern&quot; expected"/>
  108. </compile>
  109. </ajc-test>
  110. <ajc-test dir="bugs150" pr="107059" title="target(@Foo *)">
  111. <compile files="pr107059_2.aj" options="-1.5">
  112. <message kind="error" line="4" text="wildcard type pattern not allowed"></message>
  113. </compile>
  114. </ajc-test>
  115. <ajc-test dir="bugs150/pr106130" pr="106130" title="test weaving with > 256 locals">
  116. <compile files="AroundLotsOfVars.java LotsOfVars.java" options="-preserveAllLocals"/>
  117. <run class="LotsOfVars">
  118. <stdout>
  119. <line text="hello"/>
  120. <line text="2"/>
  121. </stdout>
  122. </run>
  123. </ajc-test>
  124. <ajc-test dir="bugs150/pr87376" title="structure model npe on type not found">
  125. <compile files="I.java,NPE.aj" options="-emacssym">
  126. <message kind="error" line="8" text="I cannot be resolved to a type"/>
  127. <message kind="error" line="10" text="I cannot be resolved to a type"/>
  128. </compile>
  129. </ajc-test>
  130. <ajc-test dir="bugs150" pr="83311" title="overriding/polymorphism error on interface method introduction">
  131. <compile files="pr83311.aj"/>
  132. </ajc-test>
  133. <ajc-test dir="bugs150" pr="103266" title="NPE on syntax error">
  134. <compile files="pr103266.aj">
  135. <message kind="error" line="41" text="ConnectionRequestContext cannot be resolved to a type"/>
  136. </compile>
  137. </ajc-test>
  138. <ajc-test title="itd override with no exception clause" dir="bugs150">
  139. <compile files="pr83377.aj"></compile>
  140. </ajc-test>
  141. <ajc-test dir="bugs150/pr84260" vm="1.5" title="static import failures">
  142. <compile files="A.java,I1.java,I2.java" options="-1.5"/>
  143. <run class="I1">
  144. <stderr>
  145. <line text="static method running"/>
  146. </stderr>
  147. </run>
  148. <run class="I2">
  149. <stderr>
  150. <line text="static method running"/>
  151. </stderr>
  152. </run>
  153. </ajc-test>
  154. <ajc-test dir="decp" pr="80249" title="Order of types passed to compiler determines weaving behavior">
  155. <compile files="A.java,B.java,AspectX.java"/>
  156. <run class="B"/>
  157. <compile files="B.java,A.java,AspectX.java"/>
  158. <run class="B"/>
  159. </ajc-test>
  160. <ajc-test dir="bugs150" pr="99228" vm="1.5" title="ITD of a field into a generic class">
  161. <compile files="PR99228.aj" options="-1.5"/>
  162. </ajc-test>
  163. <ajc-test dir="bugs150" pr="98320" vm="1.5" title="intertype with nested generic type">
  164. <compile files="PR98320.aj" options="-1.5"/>
  165. </ajc-test>
  166. <ajc-test dir="decs" pr="42743" title="declare soft of runtime exception">
  167. <compile files="DeclareSoftRuntimeException.aj">
  168. <message kind="warning" line="3" text="MyRuntimeException will not be softened as it is already a RuntimeException"/>
  169. </compile>
  170. <run class="DeclareSoftRuntimeException">
  171. <stdout>
  172. <line text="MyRuntimeException"/>
  173. <line text="org.aspectj.lang.SoftException"/>
  174. <line text="MyRuntimeException"/>
  175. </stdout>
  176. </run>
  177. </ajc-test>
  178. <ajc-test dir="decs" pr="42743" title="declare soft w. catch block">
  179. <compile files="VerifyError.aj">
  180. </compile>
  181. <run class="VerifyError"/>
  182. </ajc-test>
  183. <ajc-test dir="bugs" pr="61568" title="Various kinds of ambiguous bindings">
  184. <compile files="AmbiguousBindings.aj">
  185. <message line="17" text="ambiguous binding of parameter(s) foo across '||' in pointcut"></message>
  186. <message line="19" text="ambiguous binding of parameter(s) foo across '||' in pointcut"></message>
  187. <message line="21" text="ambiguous binding of parameter(s) foo across '||' in pointcut"></message>
  188. <message line="23" text="ambiguous binding of parameter(s) x across '||' in pointcut"></message>
  189. <message line="25" text="ambiguous binding of parameter(s) foo across '||' in pointcut"></message>
  190. </compile>
  191. </ajc-test>
  192. <ajc-test dir="bugs" pr="61658" title="ambiguous args">
  193. <compile files="PR61658.java">
  194. <message line="17" text="ambiguous binding of parameter(s) a, b across '||' in pointcut"></message>
  195. </compile>
  196. </ajc-test>
  197. <ajc-test dir="bugs150" pr="78021" title="Injecting exception into while loop with break statement causes catch block to be ignored">
  198. <compile files="PR78021.java"/>
  199. <run class="PR78021"/>
  200. </ajc-test>
  201. <ajc-test dir="bugs150/pr99089" vm="1.5" pr="99089" title="ArrayIndexOutOfBoundsException - Generics in privileged aspects">
  202. <compile files="DataClass.java,TracingAspect.java" options="-1.5"/>
  203. <run class="DataClass">
  204. <stderr>
  205. <line text="before:Length of v=1"/>
  206. <line text="after:Length of v=2"/>
  207. </stderr>
  208. </run>
  209. </ajc-test>
  210. <ajc-test dir="bugs150" pr="79554" title="Return in try-block disables catch-block if final-block is present">
  211. <compile files="PR79554.java"/>
  212. <run class="PR79554"/>
  213. </ajc-test>
  214. <ajc-test dir="bugs150" pr="82570" title="Weaved code does not include debug lines">
  215. <compile files="PR82570_1.java"/>
  216. </ajc-test>
  217. <ajc-test dir="bugs150" pr="83303" title="compiler error when mixing inheritance, overriding and polymorphism">
  218. <compile files="PR83303.java"/>
  219. </ajc-test>
  220. <ajc-test dir="bugs150" pr="83563" title="pertypewithin() handing of inner classes (1)">
  221. <compile files="PR83563_1.java"/>
  222. <run class="PR83563_1"/>
  223. </ajc-test>
  224. <ajc-test dir="bugs150" pr="83563" title="pertypewithin() handing of inner classes (2)">
  225. <compile files="PR83563_2.java"/>
  226. <run class="PR83563_2"/>
  227. </ajc-test>
  228. <ajc-test dir="bugs150" pr="83645" title="pertypewithin({interface}) illegal field modifier">
  229. <compile files="PR83645.java"/>
  230. <run class="PR83645"/>
  231. </ajc-test>
  232. <ajc-test dir="bugs150" title="bad asm for enums" vm="1.5">
  233. <compile files="Rainbow.java" options="-emacssym,-1.5"/>
  234. </ajc-test>
  235. <ajc-test dir="bugs150" pr="10461" title="missing name pattern">
  236. <compile files="PR106461.aj">
  237. <message kind="error" line="3" text="Syntax error on token &quot;(&quot;, &quot;name pattern&quot; expected"/>
  238. <message kind="error" line="5" text="Syntax error on token &quot;)&quot;, &quot;name pattern&quot; expected"/>
  239. <message kind="error" line="7" text="Syntax error on token &quot;.&quot;, &quot;name pattern&quot; expected"/>
  240. </compile>
  241. </ajc-test>
  242. <ajc-test dir="bugs150" pr="106634" title="IllegalStateException unpacking signature of nested parameterized type">
  243. <compile files="pr106634.aj" options="-1.5"/>
  244. </ajc-test>
  245. <ajc-test dir="bugs150" title="(@Foo *)+ type pattern parse error">
  246. <compile files="AnnotationPlusPatternParseError.aj" options="-1.5"/>
  247. </ajc-test>
  248. <ajc-test dir="bugs150" pr="80571" title="around advice on interface initializer">
  249. <compile files="pr80571.aj"/>
  250. <run class="pr80571">
  251. <stdout>
  252. <line text="before"/>
  253. <line text="after"/>
  254. </stdout>
  255. </run>
  256. </ajc-test>
  257. <ajc-test dir="bugs150" pr="78314" title="good error message for unmatched member syntax">
  258. <compile files="pr78314.aj" options="-1.5">
  259. <message kind="error" line="5" text="Syntax error, insert &quot;body&quot;"/>
  260. <message kind="error" line="5" text="Syntax error on tokens, valid member declaration expected instead"/>
  261. </compile>
  262. <compile files="pr78314.aj">
  263. <message kind="error" line="5" text="Syntax error, insert &quot;body&quot;"/>
  264. <message kind="error" line="5" text="Syntax error on tokens, valid member declaration expected instead"/>
  265. </compile>
  266. </ajc-test>
  267. <ajc-test dir="../docs/dist/doc/examples/introduction" title="introduction sample" vm="1.5">
  268. <compile files="CloneablePoint.java,ComparablePoint.java,HashablePoint.java,Point.java" options="-1.5"/>
  269. </ajc-test>
  270. <ajc-test dir="java5/varargs" title="varargs in constructor sig" vm="1.5">
  271. <compile files="Pr88652.aj" options="-1.5">
  272. <message kind="warning" line="8" text="should match"/>
  273. <message kind="warning" line="9" text="should match"/>
  274. </compile>
  275. </ajc-test>
  276. <ajc-test dir="java5/varargs" title="Varargs with .. in pointcut" vm="1.5">
  277. <compile files="pr93356.aj" options="-1.5">
  278. <message kind="warning" line="5" text="a"/>
  279. <message kind="warning" line="5" text="b"/>
  280. <message kind="warning" line="5" text="c"/>
  281. <message kind="warning" line="5" text="d"/>
  282. <message kind="warning" line="5" text="e"/>
  283. <message kind="warning" line="5" text="k"/>
  284. <message kind="warning" line="5" text="l"/>
  285. <message kind="warning" line="4" text="f"/>
  286. <message kind="warning" line="4" text="g"/>
  287. <message kind="warning" line="4" text="h"/>
  288. <message kind="warning" line="4" text="i"/>
  289. <message kind="warning" line="4" text="j"/>
  290. <message kind="warning" line="7" text="f"/>
  291. </compile>
  292. </ajc-test>
  293. <ajc-test dir="java5/varargs" title="star varargs pattern" vm="1.5">
  294. <compile files="StarVarargsPattern.aj" options="-1.5">
  295. <message kind="warning" line="5" text="you used a varargs signature"/>
  296. <message kind="warning" line="7" text="you used a varargs signature"/>
  297. </compile>
  298. </ajc-test>
  299. <ajc-test dir="java5/annotations" title="invalid cons syntax" vm="1.5">
  300. <compile files="SyntaxError.aj" options="-1.5">
  301. <message kind="error" line="3" text="Syntax error on token &quot;new&quot;, &quot;method name (not constructor)&quot; expected"/>
  302. </compile>
  303. </ajc-test>
  304. <!-- hasmethod / hasfield tests -->
  305. <ajc-test title="declare parents : hasmethod(..) - 1" dir="hasmember">
  306. <compile files="HasMethod.aj">
  307. <message kind="error" line="5" text="the type pattern hasmethod(* print(..)) can only be used when the -XhasMember option is set"/>
  308. </compile>
  309. </ajc-test>
  310. <ajc-test title="declare parents : hasmethod(..) - 1" dir="hasmember">
  311. <compile files="HasMethod.aj" options="-XhasMember">
  312. </compile>
  313. <run class="HasMethod"></run>
  314. </ajc-test>
  315. <ajc-test title="declare parents : hasmethod(..) - 2" dir="hasmember">
  316. <compile files="HasMethodInherited.aj" options="-XhasMember">
  317. </compile>
  318. <run class="HasMethodInherited"></run>
  319. </ajc-test>
  320. <ajc-test title="declare parents : hasmethod(..) - 3" dir="hasmember">
  321. <compile files="HasPrivateMethodInherited.aj" options="-XhasMember">
  322. </compile>
  323. <run class="HasPrivateMethodInherited"></run>
  324. </ajc-test>
  325. <ajc-test title="declare parents : hasmethod(..) - 4" dir="hasmember">
  326. <compile files="HasMethodViaITD.aj" options="-XhasMember">
  327. <message kind="warning" line="15" text="hasmethod matched on ITD ok"/>
  328. </compile>
  329. </ajc-test>
  330. <ajc-test title="declare parents : hasfield(..) - 1" dir="hasmember">
  331. <compile files="HasField.aj" options="-XhasMember">
  332. </compile>
  333. <run class="HasField"></run>
  334. </ajc-test>
  335. <ajc-test title="declare parents : hasfield(..) - 2" dir="hasmember">
  336. <compile files="HasFieldInherited.aj" options="-XhasMember">
  337. </compile>
  338. <run class="HasFieldInherited"></run>
  339. </ajc-test>
  340. <ajc-test title="declare parents : hasfield(..) - 3" dir="hasmember">
  341. <compile files="HasPrivateFieldInherited.aj" options="-XhasMember">
  342. </compile>
  343. <run class="HasPrivateFieldInherited"></run>
  344. </ajc-test>
  345. <!-- Annotation binding tests -->
  346. <ajc-test dir="java5/annotations/binding" vm="1.5" title="call annotation binding 1">
  347. <compile files="CallAnnBinding.aj" options="-1.5"/>
  348. <run class="CallAnnBinding"/>
  349. </ajc-test>
  350. <ajc-test dir="java5/annotations/binding" vm="1.5" title="call annotation binding 2">
  351. <compile files="CallAnnBinding2.aj" options="-1.5"/>
  352. <run class="CallAnnBinding2"/>
  353. </ajc-test>
  354. <ajc-test dir="java5/annotations/binding" vm="1.5" title="call annotation binding 3">
  355. <compile files="CallAnnBinding3.aj" options="-1.5"/>
  356. <run class="CallAnnBinding3"/>
  357. </ajc-test>
  358. <ajc-test dir="java5/annotations/binding" vm="1.5" title="call annotation binding 4">
  359. <compile files="CallAnnBinding4.aj" options="-1.5"/>
  360. <run class="CallAnnBinding4"/>
  361. </ajc-test>
  362. <ajc-test dir="java5/annotations/binding" vm="1.5" title="call annotation binding 5">
  363. <compile files="CallAnnBinding5.aj" options="-1.5"/>
  364. <run class="CallAnnBinding5"/>
  365. </ajc-test>
  366. <ajc-test dir="java5/annotations/binding" vm="1.5" title="call annotation binding 6">
  367. <compile files="CallAnnBinding6.aj" options="-1.5"/>
  368. <run class="CallAnnBinding6"/>
  369. </ajc-test>
  370. <ajc-test dir="java5/annotations/binding" vm="1.5" title="call annotation binding 7">
  371. <compile files="CallAnnBinding7.aj" options="-1.5"/>
  372. <run class="CallAnnBinding7"/>
  373. </ajc-test>
  374. <ajc-test dir="java5/annotations/binding" vm="1.5" title="@target annotation binding 1">
  375. <compile files="AtTarget1.aj" options="-1.5"/>
  376. <run class="AtTarget1"/>
  377. </ajc-test>
  378. <ajc-test dir="java5/annotations/binding" vm="1.5" title="@target annotation binding 2">
  379. <compile files="AtTarget2.aj" options="-1.5"/>
  380. <run class="AtTarget2"/>
  381. </ajc-test>
  382. <ajc-test dir="java5/annotations/binding" vm="1.5" title="@target annotation binding 3">
  383. <compile files="AtTarget3.aj" options="-1.5"/>
  384. <run class="AtTarget3"/>
  385. </ajc-test>
  386. <ajc-test dir="java5/annotations/binding" vm="1.5" title="@target annotation binding 4">
  387. <compile files="AtTarget4.aj" options="-1.5"/>
  388. <run class="AtTarget4"/>
  389. </ajc-test>
  390. <ajc-test dir="java5/annotations/binding/usingPackageNames" vm="1.5" title="@target annotation binding 5">
  391. <compile files="MyAspect.aj,MyAnnotation.java,MyClass.java" options="-1.5"/>
  392. <run class="test.MyClass"/>
  393. </ajc-test>
  394. <ajc-test dir="java5/annotations/binding" vm="1.5" title="@this annotation binding 1">
  395. <compile files="AtThis1.aj" options="-1.5"/>
  396. <run class="AtThis1"/>
  397. </ajc-test>
  398. <ajc-test dir="java5/annotations/binding" vm="1.5" title="@this annotation binding 2">
  399. <compile files="AtThis2.aj" options="-1.5"/>
  400. <run class="AtThis2"/>
  401. </ajc-test>
  402. <ajc-test dir="java5/annotations/binding" vm="1.5" title="@this annotation binding 3">
  403. <compile files="AtThis3.aj" options="-1.5"/>
  404. <run class="AtThis3"/>
  405. </ajc-test>
  406. <ajc-test dir="java5/annotations/binding" vm="1.5" title="@this annotation binding 4">
  407. <compile files="AtThis4.aj" options="-1.5"/>
  408. <run class="AtThis4"/>
  409. </ajc-test>
  410. <ajc-test dir="java5/annotations/binding" vm="1.5" title="@this annotation binding 5">
  411. <compile files="AtThis5.aj" options="-1.5"/>
  412. <run class="AtThis5"/>
  413. </ajc-test>
  414. <ajc-test dir="java5/annotations/binding" vm="1.5" title="@args annotation binding 1">
  415. <compile files="AtArgs1.aj" options="-1.5"/>
  416. <run class="AtArgs1"/>
  417. </ajc-test>
  418. <ajc-test dir="java5/annotations/binding" vm="1.5" title="@args annotation binding 2">
  419. <compile files="AtArgs2.aj" options="-1.5"/>
  420. <run class="AtArgs2"/>
  421. </ajc-test>
  422. <ajc-test dir="java5/annotations/binding" vm="1.5" title="@args annotation binding 3">
  423. <compile files="AtArgs3.aj" options="-1.5"/>
  424. <run class="AtArgs3"/>
  425. </ajc-test>
  426. <ajc-test dir="java5/annotations/binding" vm="1.5" title="@args annotation binding 4">
  427. <compile files="AtArgs4.aj" options="-1.5"/>
  428. <run class="AtArgs4"/>
  429. </ajc-test>
  430. <ajc-test dir="java5/annotations/binding" vm="1.5" title="@args annotation binding 5">
  431. <compile files="AtArgs5.aj" options="-1.5"/>
  432. <run class="AtArgs5"/>
  433. </ajc-test>
  434. <ajc-test dir="java5/annotations/binding" vm="1.5" title="execution and @annotation">
  435. <compile files="ExecutionAnnBinding1.aj" options="-1.5"/>
  436. <run class="ExecutionAnnBinding1"/>
  437. </ajc-test>
  438. <ajc-test dir="java5/annotations/binding" vm="1.5" title="set and @annotation">
  439. <compile files="FieldAnnBinding1.aj" options="-1.5"/>
  440. <run class="FieldAnnBinding1"/>
  441. </ajc-test>
  442. <ajc-test dir="java5/annotations/binding" vm="1.5" title="get and @annotation">
  443. <compile files="FieldAnnBinding2.aj" options="-1.5"/>
  444. <run class="FieldAnnBinding2"/>
  445. </ajc-test>
  446. <ajc-test dir="java5/annotations/binding" vm="1.5" title="get and @annotation with arrays">
  447. <compile files="FieldAnnBinding3.aj" options="-1.5"/>
  448. <run class="FieldAnnBinding3"/>
  449. </ajc-test>
  450. <ajc-test dir="java5/annotations/binding" vm="1.5" title="cons call and @annotation">
  451. <compile files="CtorAnnBinding1.aj" options="-1.5"/>
  452. <run class="CtorAnnBinding1"/>
  453. </ajc-test>
  454. <ajc-test dir="java5/annotations/binding" vm="1.5" title="cons exe and @annotation">
  455. <compile files="CtorAnnBinding2.aj" options="-1.5"/>
  456. <run class="CtorAnnBinding2"/>
  457. </ajc-test>
  458. <ajc-test dir="java5/annotations/binding" vm="1.5" title="staticinit and @annotation">
  459. <compile files="StaticInitBinding.aj" options="-1.5"/>
  460. <run class="StaticInitBinding"/>
  461. </ajc-test>
  462. <ajc-test dir="java5/annotations/binding" vm="1.5" title="preinit and @annotation">
  463. <compile files="PreInitBinding.aj" options="-1.5"/>
  464. <run class="PreInitBinding"/>
  465. </ajc-test>
  466. <ajc-test dir="java5/annotations/binding" vm="1.5" title="init and @annotation">
  467. <compile files="InitBinding.aj" options="-1.5"/>
  468. <run class="InitBinding"/>
  469. </ajc-test>
  470. <ajc-test dir="java5/annotations/binding" vm="1.5" title="adviceexecution and @annotation">
  471. <compile files="AdviceExecBinding.aj" options="-1.5"/>
  472. <run class="AdviceExecBinding"/>
  473. </ajc-test>
  474. <ajc-test dir="java5/annotations/binding" vm="1.5" title="handler and @annotation">
  475. <compile files="HandlerBinding.aj" options="-1.5"/>
  476. <run class="HandlerBinding"/>
  477. </ajc-test>
  478. <ajc-test dir="java5/annotations/binding" vm="1.5" title="@withincode() and call(* println(..))">
  479. <compile files="WithinCodeBinding1.aj" options="-1.5"/>
  480. <run class="WithinCodeBinding1"/>
  481. </ajc-test>
  482. <ajc-test dir="java5/annotations/binding" vm="1.5" title="@within">
  483. <compile files="WithinBinding1.aj" options="-1.5"/>
  484. <run class="WithinBinding1"/>
  485. </ajc-test>
  486. <ajc-test dir="java5/annotations/binding" vm="1.5" title="@within - multiple types">
  487. <compile files="WithinBinding2.aj" options="-1.5"/>
  488. <run class="WithinBinding2"/>
  489. </ajc-test>
  490. <ajc-test dir="java5/annotations/binding/complexExample" vm="1.5" title="packages and no binding">
  491. <compile files="A.java,B.java,Color.java,X.java" options="-1.5"/>
  492. <run class="a.b.c.A"/>
  493. </ajc-test>
  494. <ajc-test dir="java5/annotations/binding/complexExample" vm="1.5" title="packages and binding">
  495. <compile files="A.java,B.java,Color.java,X2.java" options="-1.5"/>
  496. <run class="a.b.c.A"/>
  497. </ajc-test>
  498. <ajc-test dir="java5/annotations/binding" vm="1.5" title="binding with static methods">
  499. <compile files="StaticMethods.java" options="-1.5"/>
  500. <run class="StaticMethods"/>
  501. </ajc-test>
  502. <ajc-test dir="java5/annotations" vm="1.5" title="annotation matching on call">
  503. <weave classesFiles="AnnotatedType.java,SimpleAnnotation.java,SimpleAnnotation2.java"
  504. aspectsFiles="AnnotationAspect02.aj"
  505. options="-1.5,-showWeaveInfo">
  506. <message kind="weave" text="Type 'AnnotatedType' (AnnotatedType.java:3) advised by before advice from 'AnnotationAspect02' (AnnotationAspect02.aj:4)"/>
  507. <message kind="weave" text="Type 'AnnotatedType' (AnnotatedType.java:3) advised by before advice from 'AnnotationAspect02' (AnnotationAspect02.aj:2)"/>
  508. <message kind="weave" text="Type 'AnnotatedType' (AnnotatedType.java:4) advised by before advice from 'AnnotationAspect02' (AnnotationAspect02.aj:4)"/>
  509. </weave>
  510. </ajc-test>
  511. <ajc-test dir="java5/annotations" vm="1.5" title="at annotation matching">
  512. <weave classesFiles="AnnotatedType.java,SimpleAnnotation.java,SimpleAnnotation2.java"
  513. aspectsFiles="AnnotationAspect03.aj"
  514. options="-1.5,-showWeaveInfo">
  515. <message kind="warning" line="8" text="@annotation matched here"/>
  516. </weave>
  517. </ajc-test>
  518. <ajc-test dir="java5/annotations/within_code" vm="1.5" title="annotations and within(code)">
  519. <weave classesFiles="TestingAnnotations.java"
  520. aspectsFiles="WithinAndWithinCodeTests.java"
  521. options="-1.5,-showWeaveInfo">
  522. <message kind="warning" line="31" text="@within match on non-inherited annotation"/>
  523. <message kind="warning" line="39" text="@within match on non-inherited annotation"/>
  524. <message kind="warning" line="39" text="@within match on inheritable annotation"/>
  525. <message kind="warning" line="43" text="@within match on inheritable annotation"/>
  526. <message kind="warning" line="32" text="@withincode match"/>
  527. </weave>
  528. </ajc-test>
  529. <ajc-test dir="java5/annotations/within" vm="1.5" title="annotations and within">
  530. <weave classesFiles="PlainWithin.java"
  531. aspectsFiles="PlainWithinTests.java"
  532. options="-1.5,-showWeaveInfo">
  533. <message kind="warning" line="21" text="positive within match on annotation"/>
  534. <message kind="warning" line="25" text="negative within match on annotation"/>
  535. </weave>
  536. </ajc-test>
  537. <ajc-test dir="java5/annotations/thisOrtarget" vm="1.5" title="must have runtime retention">
  538. <compile options="-1.5" files="NotRuntimeRetention.aj">
  539. <message kind="error" line="20" text="Annotation type MySourceAnnotation does not have runtime retention"/>
  540. <message kind="error" line="21" text="Annotation type MyClassAnnotation does not have runtime retention"/>
  541. <message kind="error" line="22" text="Annotation type MyAnnotation does not have runtime retention"/>
  542. </compile>
  543. </ajc-test>
  544. <ajc-test dir="java5/annotations/thisOrtarget" vm="1.5" title="inheritable or not">
  545. <compile options="-1.5" files="TestingAnnotations.java,ThisOrTargetTests.aj">
  546. </compile>
  547. <run class="TestingAnnotations"/>
  548. </ajc-test>
  549. <ajc-test dir="java5/annotations/thisOrtarget" vm="1.5" title="use of @this/target in deow">
  550. <compile options="-1.5" files="TestingAnnotations.java,DeclareEoW.java">
  551. <message kind="error" line="3" text="this() pointcut designator cannot be used in declare statement"/>
  552. <message kind="error" line="5" text="target() pointcut designator cannot be used in declare statement"/>
  553. </compile>
  554. </ajc-test>
  555. <ajc-test dir="java5/annotations/args" vm="1.5" title="@args tests">
  556. <compile options="-1.5" files="TestingArgsAnnotations.java,AtArgsAspect.java">
  557. </compile>
  558. <run class="TestingArgsAnnotations"/>
  559. </ajc-test>
  560. <ajc-test dir="java5/annotations/args" vm="1.5" title="use of @args in deow">
  561. <compile options="-1.5" files="TestingArgsAnnotations.java,DeclareEoW.java">
  562. <message kind="error" line="3" text="args() pointcut designator cannot be used in declare statement"/>
  563. </compile>
  564. </ajc-test>
  565. <ajc-test dir="java5/annotations" vm="1.5" title="compiling an annotation">
  566. <compile options="-1.5" files="SimpleAnnotation.java">
  567. </compile>
  568. </ajc-test>
  569. <ajc-test dir="java5/annotations" vm="1.5" title="compiling annotated file">
  570. <compile options="-1.5" files="SimpleAnnotation.java,AnnotatedType.java">
  571. </compile>
  572. </ajc-test>
  573. <ajc-test dir="java5/annotations/within" vm="1.5" title="annotations and within (src)">
  574. <compile files="PlainWithin.java,PlainWithinTests.java"
  575. aspectsFiles="PlainWithinTests.java"
  576. options="-1.5">
  577. <message kind="warning" line="21" text="positive within match on annotation"/>
  578. <message kind="warning" line="25" text="negative within match on annotation"/>
  579. </compile>
  580. </ajc-test>
  581. <ajc-test dir="java5/annotations/attarget" vm="1.5" title="losing annotations...">
  582. <compile options="-1.5" files="Program.java,AtTargetAspect.java">
  583. </compile>
  584. </ajc-test>
  585. <ajc-test dir="java5/annotations" vm="1.5" title="no itds on annotation types">
  586. <compile files="AnnotatedType.java,SimpleAnnotation.java,SimpleAnnotation2.java,AnnotationAspect01.aj"
  587. options="-1.5">
  588. <message kind="error" line="4" text="can't make inter-type constructor declarations"/>
  589. <message kind="error" line="8" text="can't make inter-type method declarations"/>
  590. <message kind="error" line="13" text="can't make inter-type field declarations"/>
  591. </compile>
  592. </ajc-test>
  593. <ajc-test dir="java5/annotations" vm="1.5" title="no declare parents on annotation types">
  594. <compile files="AnnotatedType.java,SimpleAnnotation.java,SimpleAnnotation2.java,AnnotationAspect04.aj"
  595. options="-1.5">
  596. <message kind="error" line="7" text="can't use declare parents to alter supertype of annotation type SimpleAnnotation"/>
  597. <message kind="error" line="10" text="can't use declare parents to make 'java.lang.annotation.Annotation' the parent of type"/>
  598. <message kind="error" line="4" text="can't use declare parents to make annotation type SimpleAnnotation implement an interface"/>
  599. </compile>
  600. </ajc-test>
  601. <ajc-test dir="java5/annotations" vm="1.5" title="declare parents wildcards matching annotation types">
  602. <compile files="AnnotatedType.java,SimpleAnnotation.java,SimpleAnnotation2.java,AnnotationAspect05.aj"
  603. options="-1.5">
  604. <message kind="warning" line="4" text="annotation type SimpleAnnotation2 matches a declare parents type pattern but is being ignored"/>
  605. <message kind="warning" line="4" text="annotation type SimpleAnnotation matches a declare parents type pattern but is being ignored"/>
  606. </compile>
  607. </ajc-test>
  608. <ajc-test dir="java5/annotations/binding/complexExample" vm="1.5" title="annotated any pattern">
  609. <compile files="A.java,B.java,C.java,Color.java,X3.java"
  610. options="-1.5">
  611. </compile>
  612. <run class="g.h.i.C"/>
  613. <run class="a.b.c.A"/>
  614. </ajc-test>
  615. <ajc-test dir="java5/annotations/binding/complexExample" vm="1.5" title="annotation not imported">
  616. <compile files="A.java,B.java,C.java,Color.java,X4.java"
  617. options="-1.5">
  618. <message kind="warning" line="6" text="no match for this type name: Color"/>
  619. </compile>
  620. <run class="a.b.c.A"/>
  621. </ajc-test>
  622. <ajc-test dir="java5/annotations/itds" vm="1.5" title="annotated public itds">
  623. <compile files="AtItd2.aj" options="-1.5"/>
  624. <run class="AtItd2"/>
  625. </ajc-test>
  626. <ajc-test dir="java5/annotations/itds" vm="1.5" title="annotated public itds - values">
  627. <compile files="AtItd3.aj" options="-1.5"/>
  628. <run class="AtItd3"/>
  629. </ajc-test>
  630. <ajc-test dir="java5/annotations/itds" vm="1.5" title="annotated public itds - multiple complex annotations">
  631. <compile files="AtItd4.aj" options="-1.5"/>
  632. <run class="AtItd4"/>
  633. </ajc-test>
  634. <ajc-test dir="java5/annotations/itds" vm="1.5" title="nasty annotation and itds test">
  635. <compile files="AnnotationsAndITDs.aj" options="-1.5">
  636. <!-- first two are ITCs, second two are ITCs annotated via declare @ctor, third is default ctor -->
  637. <message kind="warning" line="17" text="execution(@SomeAnnotation ...new(..)"/>
  638. <message kind="warning" line="20" text="execution(@SomeAnnotation ...new(..)"/>
  639. <message kind="warning" line="45" text="execution(@SomeAnnotation ...new(..)"/>
  640. <message kind="warning" line="46" text="execution(@SomeAnnotation ...new(..)"/>
  641. <message kind="warning" line="180" text="execution(@SomeAnnotation ...new(..)"/>
  642. <!-- first four are fields annotated via declare, last two are directly annotated ITDs -->
  643. <message kind="warning" line="59" text="set(@SomeAnnotation...)"/>
  644. <message kind="warning" line="60" text="set(@SomeAnnotation...)"/>
  645. <message kind="warning" line="70" text="set(@SomeAnnotation...)"/>
  646. <message kind="warning" line="71" text="set(@SomeAnnotation...)"/>
  647. <message kind="warning" line="76" text="set(@SomeAnnotation...)"/>
  648. <message kind="warning" line="77" text="set(@SomeAnnotation...)"/>
  649. <!-- annotations added via declare -->
  650. <message kind="warning" line="175" text="si(@SomeAnnotation...)"/>
  651. <message kind="warning" line="180" text="si(@SomeAnnotation...)"/>
  652. <message kind="warning" line="25" text="execution(@SomeAnnotation ...)"/>
  653. <message kind="warning" line="28" text="execution(@SomeAnnotation ...)"/>
  654. <message kind="warning" line="52" text="execution(@SomeAnnotation ...)"/>
  655. <message kind="warning" line="53" text="execution(@SomeAnnotation ...)"/>
  656. <!--message kind="warning" line="70" text="set(@SomeAnnotation...)"/>
  657. <message kind="warning" line="71" text="set(@SomeAnnotation...)"/-->
  658. </compile>
  659. <run class="AnnotationsAndITDs">
  660. <stderr>
  661. <line text="@type java.lang.System (AnnotationsAndITDs.aj:0)"/>
  662. <line text="hello AnnotationsAndITDs (AnnotationsAndITDs.aj:17)"/>
  663. <line text="goodbye java.lang.String (AnnotationsAndITDs.aj:20)"/>
  664. <line text="goodbye java.lang.String (AnnotationsAndITDs.aj:20)"/>
  665. <line text="y java.lang.Integer (AnnotationsAndITDs.aj:28)"/>
  666. <line text="d java.lang.Double (AnnotationsAndITDs.aj:70)"/>
  667. <line text="f java.lang.Double (AnnotationsAndITDs.aj:71)"/>
  668. <line text="@type java.lang.System (AnnotationsAndITDs.aj:0)"/>
  669. <line text="@field ITDMe2 (AnnotationsAndITDs.aj:59)"/>
  670. <line text="@field ITDMe2 (AnnotationsAndITDs.aj:60)"/>
  671. <line text="@cons java.lang.String (AnnotationsAndITDs.aj:45)"/>
  672. <line text="@field ITDMe2 (AnnotationsAndITDs.aj:59)"/>
  673. <line text="@field ITDMe2 (AnnotationsAndITDs.aj:60)"/>
  674. <line text="@cons java.lang.String (AnnotationsAndITDs.aj:46)"/>
  675. <line text="@cons java.lang.String (AnnotationsAndITDs.aj:46)"/>
  676. <line text="@method ITDMe2 (AnnotationsAndITDs.aj:53)"/>
  677. <line text="@field ITDMe2 (AnnotationsAndITDs.aj:76)"/>
  678. <line text="@field ITDMe2 (AnnotationsAndITDs.aj:77)"/>
  679. <!--
  680. <line text="method bar has 1 params, first param annotation is @ParamAnnotation"/>
  681. -->
  682. </stderr>
  683. </run>
  684. </ajc-test>
  685. <ajc-test dir="java5/annotations/declare" pr="91858" title="declare @Type (should be @type)">
  686. <compile files="DeathByPoorSpelling.aj" options="-1.5">
  687. <message kind="error" line="6" text="Syntax error on token &quot;:&quot;, &quot;one of type, method, field, constructor&quot; expected"/>
  688. </compile>
  689. </ajc-test>
  690. <!-- ======================================================================================= -->
  691. <!-- Autoboxing tests -->
  692. <!-- ======================================================================================= -->
  693. <ajc-test dir="java5/autoboxing" vm="1.5" title="simple boxing test">
  694. <compile files="AutoboxingB.java,AutoboxingC.java,AutoboxingD.java,AutoboxingF.java,AutoboxingI.java,AutoboxingJ.java,AutoboxingS.java,AutoboxingZ.java,SimpleAutoboxing.java,SimpleAutoboxingAspect.aj"
  695. options="-1.5,-showWeaveInfo">
  696. <message kind="weave" text="Type 'SimpleAutoboxing' (SimpleAutoboxing.java:7) advised by before advice from 'SimpleAutoboxingAspect' (SimpleAutoboxingAspect.aj:8)"/>
  697. <message kind="weave" text="Type 'SimpleAutoboxing' (SimpleAutoboxing.java:7) advised by before advice from 'SimpleAutoboxingAspect' (SimpleAutoboxingAspect.aj:4)"/>
  698. </compile>
  699. <run class="SimpleAutoboxing">
  700. <stderr>
  701. <line text="Matching by Integer:20000"/>
  702. <line text="Matching by int:20000"/>
  703. <line text="method_takes_Integer=20000"/>
  704. </stderr>
  705. </run>
  706. </ajc-test>
  707. <ajc-test dir="java5/autoboxing" vm="1.5" title="integer boxing">
  708. <compile files="AutoboxingB.java,AutoboxingC.java,AutoboxingD.java,AutoboxingF.java,AutoboxingI.java,AutoboxingJ.java,AutoboxingS.java,AutoboxingZ.java,SimpleAutoboxing.java,AspectInteger.aj"
  709. options="-1.5,-showWeaveInfo">
  710. <message kind="weave" text="Type 'AutoboxingI' (AutoboxingI.java:11) advised by before advice from 'AspectInteger' (AspectInteger.aj:8)"/>
  711. <message kind="weave" text="Type 'AutoboxingI' (AutoboxingI.java:11) advised by before advice from 'AspectInteger' (AspectInteger.aj:4)"/>
  712. <message kind="weave" text="Type 'AutoboxingI' (AutoboxingI.java:12) advised by before advice from 'AspectInteger' (AspectInteger.aj:8)"/>
  713. <message kind="weave" text="Type 'AutoboxingI' (AutoboxingI.java:12) advised by before advice from 'AspectInteger' (AspectInteger.aj:4)"/>
  714. <message kind="weave" text="Type 'AutoboxingI' (AutoboxingI.java:13) advised by before advice from 'AspectInteger' (AspectInteger.aj:8)"/>
  715. <message kind="weave" text="Type 'AutoboxingI' (AutoboxingI.java:13) advised by before advice from 'AspectInteger' (AspectInteger.aj:4)"/>
  716. <message kind="weave" text="Type 'AutoboxingI' (AutoboxingI.java:14) advised by before advice from 'AspectInteger' (AspectInteger.aj:8)"/>
  717. <message kind="weave" text="Type 'AutoboxingI' (AutoboxingI.java:14) advised by before advice from 'AspectInteger' (AspectInteger.aj:4)"/>
  718. </compile>
  719. <run class="AutoboxingI">
  720. <stderr>
  721. <line text="Matching by Integer:10000"/>
  722. <line text="Matching by int:10000"/>
  723. <line text="method_takes_Integer=10000"/>
  724. <line text="Matching by Integer:20000"/>
  725. <line text="Matching by int:20000"/>
  726. <line text="method_takes_Integer=20000"/>
  727. <line text="Matching by Integer:30000"/>
  728. <line text="Matching by int:30000"/>
  729. <line text="method_takes_int=30000"/>
  730. <line text="Matching by Integer:40000"/>
  731. <line text="Matching by int:40000"/>
  732. <line text="method_takes_int=40000"/>
  733. </stderr>
  734. </run>
  735. </ajc-test>
  736. <ajc-test dir="java5/autoboxing" vm="1.5" title="char boxing">
  737. <compile files="AutoboxingB.java,AutoboxingC.java,AutoboxingD.java,AutoboxingF.java,AutoboxingI.java,AutoboxingJ.java,AutoboxingS.java,AutoboxingZ.java,SimpleAutoboxing.java,AspectChar.aj"
  738. options="-1.5,-showWeaveInfo">
  739. <message kind="weave" text="Type 'AutoboxingC' (AutoboxingC.java:11) advised by before advice from 'AspectChar' (AspectChar.aj:8)"/>
  740. <message kind="weave" text="Type 'AutoboxingC' (AutoboxingC.java:11) advised by before advice from 'AspectChar' (AspectChar.aj:4)"/>
  741. <message kind="weave" text="Type 'AutoboxingC' (AutoboxingC.java:12) advised by before advice from 'AspectChar' (AspectChar.aj:8)"/>
  742. <message kind="weave" text="Type 'AutoboxingC' (AutoboxingC.java:12) advised by before advice from 'AspectChar' (AspectChar.aj:4)"/>
  743. <message kind="weave" text="Type 'AutoboxingC' (AutoboxingC.java:13) advised by before advice from 'AspectChar' (AspectChar.aj:8)"/>
  744. <message kind="weave" text="Type 'AutoboxingC' (AutoboxingC.java:13) advised by before advice from 'AspectChar' (AspectChar.aj:4)"/>
  745. <message kind="weave" text="Type 'AutoboxingC' (AutoboxingC.java:14) advised by before advice from 'AspectChar' (AspectChar.aj:8)"/>
  746. <message kind="weave" text="Type 'AutoboxingC' (AutoboxingC.java:14) advised by before advice from 'AspectChar' (AspectChar.aj:4)"/>
  747. </compile>
  748. <run class="AutoboxingC">
  749. <stderr>
  750. <line text="Character:1"/>
  751. <line text="char:1"/>
  752. <line text="method_takes_Character=1"/>
  753. <line text="Character:2"/>
  754. <line text="char:2"/>
  755. <line text="method_takes_Character=2"/>
  756. <line text="Character:3"/>
  757. <line text="char:3"/>
  758. <line text="method_takes_char=3"/>
  759. <line text="Character:4"/>
  760. <line text="char:4"/>
  761. <line text="method_takes_char=4"/>
  762. </stderr>
  763. </run>
  764. </ajc-test>
  765. <ajc-test dir="java5/autoboxing" vm="1.5" title="double boxing">
  766. <compile files="AutoboxingB.java,AutoboxingC.java,AutoboxingD.java,AutoboxingF.java,AutoboxingI.java,AutoboxingJ.java,AutoboxingS.java,AutoboxingZ.java,SimpleAutoboxing.java,AspectDouble.aj"
  767. options="-1.5,-showWeaveInfo">
  768. <message kind="weave" text="Type 'AutoboxingD' (AutoboxingD.java:11) advised by before advice from 'AspectDouble' (AspectDouble.aj:8)"/>
  769. <message kind="weave" text="Type 'AutoboxingD' (AutoboxingD.java:11) advised by before advice from 'AspectDouble' (AspectDouble.aj:4)"/>
  770. <message kind="weave" text="Type 'AutoboxingD' (AutoboxingD.java:12) advised by before advice from 'AspectDouble' (AspectDouble.aj:8)"/>
  771. <message kind="weave" text="Type 'AutoboxingD' (AutoboxingD.java:12) advised by before advice from 'AspectDouble' (AspectDouble.aj:4)"/>
  772. <message kind="weave" text="Type 'AutoboxingD' (AutoboxingD.java:13) advised by before advice from 'AspectDouble' (AspectDouble.aj:8)"/>
  773. <message kind="weave" text="Type 'AutoboxingD' (AutoboxingD.java:13) advised by before advice from 'AspectDouble' (AspectDouble.aj:4)"/>
  774. <message kind="weave" text="Type 'AutoboxingD' (AutoboxingD.java:14) advised by before advice from 'AspectDouble' (AspectDouble.aj:8)"/>
  775. <message kind="weave" text="Type 'AutoboxingD' (AutoboxingD.java:14) advised by before advice from 'AspectDouble' (AspectDouble.aj:4)"/>
  776. </compile>
  777. <run class="AutoboxingD">
  778. <stderr>
  779. <line text="Double:100.0"/>
  780. <line text="double:100.0"/>
  781. <line text="method_takes_Double=100.0"/>
  782. <line text="Double:200.0"/>
  783. <line text="double:200.0"/>
  784. <line text="method_takes_Double=200.0"/>
  785. <line text="Double:300.0"/>
  786. <line text="double:300.0"/>
  787. <line text="method_takes_double=300.0"/>
  788. <line text="Double:400.0"/>
  789. <line text="double:400.0"/>
  790. <line text="method_takes_double=400.0"/>
  791. </stderr>
  792. </run>
  793. </ajc-test>
  794. <ajc-test dir="java5/autoboxing" vm="1.5" title="float boxing">
  795. <compile files="AutoboxingB.java,AutoboxingC.java,AutoboxingD.java,AutoboxingF.java,AutoboxingI.java,AutoboxingJ.java,AutoboxingS.java,AutoboxingZ.java,SimpleAutoboxing.java,AspectFloat.aj"
  796. options="-1.5,-showWeaveInfo">
  797. <message kind="weave" text="Type 'AutoboxingF' (AutoboxingF.java:11) advised by before advice from 'AspectFloat' (AspectFloat.aj:8)"/>
  798. <message kind="weave" text="Type 'AutoboxingF' (AutoboxingF.java:11) advised by before advice from 'AspectFloat' (AspectFloat.aj:4)"/>
  799. <message kind="weave" text="Type 'AutoboxingF' (AutoboxingF.java:12) advised by before advice from 'AspectFloat' (AspectFloat.aj:8)"/>
  800. <message kind="weave" text="Type 'AutoboxingF' (AutoboxingF.java:12) advised by before advice from 'AspectFloat' (AspectFloat.aj:4)"/>
  801. <message kind="weave" text="Type 'AutoboxingF' (AutoboxingF.java:13) advised by before advice from 'AspectFloat' (AspectFloat.aj:8)"/>
  802. <message kind="weave" text="Type 'AutoboxingF' (AutoboxingF.java:13) advised by before advice from 'AspectFloat' (AspectFloat.aj:4)"/>
  803. <message kind="weave" text="Type 'AutoboxingF' (AutoboxingF.java:14) advised by before advice from 'AspectFloat' (AspectFloat.aj:8)"/>
  804. <message kind="weave" text="Type 'AutoboxingF' (AutoboxingF.java:14) advised by before advice from 'AspectFloat' (AspectFloat.aj:4)"/>
  805. </compile>
  806. <run class="AutoboxingF">
  807. <stderr>
  808. <line text="Float:100.0"/>
  809. <line text="float:100.0"/>
  810. <line text="method_takes_Float=100.0"/>
  811. <line text="Float:200.0"/>
  812. <line text="float:200.0"/>
  813. <line text="method_takes_Float=200.0"/>
  814. <line text="Float:300.0"/>
  815. <line text="float:300.0"/>
  816. <line text="method_takes_float=300.0"/>
  817. <line text="Float:400.0"/>
  818. <line text="float:400.0"/>
  819. <line text="method_takes_float=400.0"/>
  820. </stderr>
  821. </run>
  822. </ajc-test>
  823. <ajc-test dir="java5/autoboxing" vm="1.5" title="short boxing">
  824. <compile files="AutoboxingB.java,AutoboxingC.java,AutoboxingD.java,AutoboxingF.java,AutoboxingI.java,AutoboxingJ.java,AutoboxingS.java,AutoboxingZ.java,SimpleAutoboxing.java,AspectShort.aj"
  825. options="-1.5,-showWeaveInfo">
  826. <message kind="weave" text="Type 'AutoboxingS' (AutoboxingS.java:11) advised by before advice from 'AspectShort' (AspectShort.aj:8)"/>
  827. <message kind="weave" text="Type 'AutoboxingS' (AutoboxingS.java:11) advised by before advice from 'AspectShort' (AspectShort.aj:4)"/>
  828. <message kind="weave" text="Type 'AutoboxingS' (AutoboxingS.java:12) advised by before advice from 'AspectShort' (AspectShort.aj:8)"/>
  829. <message kind="weave" text="Type 'AutoboxingS' (AutoboxingS.java:12) advised by before advice from 'AspectShort' (AspectShort.aj:4)"/>
  830. <message kind="weave" text="Type 'AutoboxingS' (AutoboxingS.java:13) advised by before advice from 'AspectShort' (AspectShort.aj:8)"/>
  831. <message kind="weave" text="Type 'AutoboxingS' (AutoboxingS.java:13) advised by before advice from 'AspectShort' (AspectShort.aj:4)"/>
  832. <message kind="weave" text="Type 'AutoboxingS' (AutoboxingS.java:14) advised by before advice from 'AspectShort' (AspectShort.aj:8)"/>
  833. <message kind="weave" text="Type 'AutoboxingS' (AutoboxingS.java:14) advised by before advice from 'AspectShort' (AspectShort.aj:4)"/>
  834. </compile>
  835. <run class="AutoboxingS">
  836. <stderr>
  837. <line text="Short:100"/>
  838. <line text="short:100"/>
  839. <line text="method_takes_Short=100"/>
  840. <line text="Short:200"/>
  841. <line text="short:200"/>
  842. <line text="method_takes_Short=200"/>
  843. <line text="Short:300"/>
  844. <line text="short:300"/>
  845. <line text="method_takes_short=300"/>
  846. <line text="Short:400"/>
  847. <line text="short:400"/>
  848. <line text="method_takes_short=400"/>
  849. </stderr>
  850. </run>
  851. </ajc-test>
  852. <ajc-test dir="java5/autoboxing" vm="1.5" title="long boxing">
  853. <compile files="AutoboxingB.java,AutoboxingC.java,AutoboxingD.java,AutoboxingF.java,AutoboxingI.java,AutoboxingJ.java,AutoboxingS.java,AutoboxingZ.java,SimpleAutoboxing.java,AspectLong.aj"
  854. options="-1.5,-showWeaveInfo">
  855. <message kind="weave" text="Type 'AutoboxingJ' (AutoboxingJ.java:11) advised by before advice from 'AspectLong' (AspectLong.aj:8)"/>
  856. <message kind="weave" text="Type 'AutoboxingJ' (AutoboxingJ.java:11) advised by before advice from 'AspectLong' (AspectLong.aj:4)"/>
  857. <message kind="weave" text="Type 'AutoboxingJ' (AutoboxingJ.java:12) advised by before advice from 'AspectLong' (AspectLong.aj:8)"/>
  858. <message kind="weave" text="Type 'AutoboxingJ' (AutoboxingJ.java:12) advised by before advice from 'AspectLong' (AspectLong.aj:4)"/>
  859. <message kind="weave" text="Type 'AutoboxingJ' (AutoboxingJ.java:13) advised by before advice from 'AspectLong' (AspectLong.aj:8)"/>
  860. <message kind="weave" text="Type 'AutoboxingJ' (AutoboxingJ.java:13) advised by before advice from 'AspectLong' (AspectLong.aj:4)"/>
  861. <message kind="weave" text="Type 'AutoboxingJ' (AutoboxingJ.java:14) advised by before advice from 'AspectLong' (AspectLong.aj:8)"/>
  862. <message kind="weave" text="Type 'AutoboxingJ' (AutoboxingJ.java:14) advised by before advice from 'AspectLong' (AspectLong.aj:4)"/>
  863. </compile>
  864. <run class="AutoboxingJ">
  865. <stderr>
  866. <line text="Long:1000000"/>
  867. <line text="long:1000000"/>
  868. <line text="method_takes_Long=1000000"/>
  869. <line text="Long:2000000"/>
  870. <line text="long:2000000"/>
  871. <line text="method_takes_Long=2000000"/>
  872. <line text="Long:3000000"/>
  873. <line text="long:3000000"/>
  874. <line text="method_takes_long=3000000"/>
  875. <line text="Long:4000000"/>
  876. <line text="long:4000000"/>
  877. <line text="method_takes_long=4000000"/>
  878. </stderr>
  879. </run>
  880. </ajc-test>
  881. <ajc-test dir="java5/autoboxing" vm="1.5" title="boolean boxing">
  882. <compile files="AutoboxingB.java,AutoboxingC.java,AutoboxingD.java,AutoboxingF.java,AutoboxingI.java,AutoboxingJ.java,AutoboxingS.java,AutoboxingZ.java,SimpleAutoboxing.java,AspectBoolean.aj"
  883. options="-1.5,-showWeaveInfo">
  884. <message kind="weave" text="Type 'AutoboxingZ' (AutoboxingZ.java:9) advised by before advice from 'AspectBoolean' (AspectBoolean.aj:8)"/>
  885. <message kind="weave" text="Type 'AutoboxingZ' (AutoboxingZ.java:9) advised by before advice from 'AspectBoolean' (AspectBoolean.aj:4)"/>
  886. <message kind="weave" text="Type 'AutoboxingZ' (AutoboxingZ.java:10) advised by before advice from 'AspectBoolean' (AspectBoolean.aj:8)"/>
  887. <message kind="weave" text="Type 'AutoboxingZ' (AutoboxingZ.java:10) advised by before advice from 'AspectBoolean' (AspectBoolean.aj:4)"/>
  888. <message kind="weave" text="Type 'AutoboxingZ' (AutoboxingZ.java:11) advised by before advice from 'AspectBoolean' (AspectBoolean.aj:8)"/>
  889. <message kind="weave" text="Type 'AutoboxingZ' (AutoboxingZ.java:11) advised by before advice from 'AspectBoolean' (AspectBoolean.aj:4)"/>
  890. <message kind="weave" text="Type 'AutoboxingZ' (AutoboxingZ.java:12) advised by before advice from 'AspectBoolean' (AspectBoolean.aj:8)"/>
  891. <message kind="weave" text="Type 'AutoboxingZ' (AutoboxingZ.java:12) advised by before advice from 'AspectBoolean' (AspectBoolean.aj:4)"/>
  892. </compile>
  893. <run class="AutoboxingZ">
  894. <stderr>
  895. <line text="Boolean:false"/>
  896. <line text="boolean:false"/>
  897. <line text="method_takes_Boolean=false"/>
  898. <line text="Boolean:false"/>
  899. <line text="boolean:false"/>
  900. <line text="method_takes_Boolean=false"/>
  901. <line text="Boolean:false"/>
  902. <line text="boolean:false"/>
  903. <line text="method_takes_boolean=false"/>
  904. <line text="Boolean:false"/>
  905. <line text="boolean:false"/>
  906. <line text="method_takes_boolean=false"/>
  907. </stderr>
  908. </run>
  909. </ajc-test>
  910. <ajc-test dir="java5/autoboxing" vm="1.5" title="byte boxing">
  911. <compile files="AutoboxingB.java,AutoboxingC.java,AutoboxingD.java,AutoboxingF.java,AutoboxingI.java,AutoboxingJ.java,AutoboxingS.java,AutoboxingZ.java,SimpleAutoboxing.java,AspectByte.aj"
  912. options="-1.5,-showWeaveInfo">
  913. <message kind="weave" text="Type 'AutoboxingB' (AutoboxingB.java:11) advised by before advice from 'AspectByte' (AspectByte.aj:8)"/>
  914. <message kind="weave" text="Type 'AutoboxingB' (AutoboxingB.java:11) advised by before advice from 'AspectByte' (AspectByte.aj:4)"/>
  915. <message kind="weave" text="Type 'AutoboxingB' (AutoboxingB.java:12) advised by before advice from 'AspectByte' (AspectByte.aj:8)"/>
  916. <message kind="weave" text="Type 'AutoboxingB' (AutoboxingB.java:12) advised by before advice from 'AspectByte' (AspectByte.aj:4)"/>
  917. <message kind="weave" text="Type 'AutoboxingB' (AutoboxingB.java:13) advised by before advice from 'AspectByte' (AspectByte.aj:8)"/>
  918. <message kind="weave" text="Type 'AutoboxingB' (AutoboxingB.java:13) advised by before advice from 'AspectByte' (AspectByte.aj:4)"/>
  919. <message kind="weave" text="Type 'AutoboxingB' (AutoboxingB.java:14) advised by before advice from 'AspectByte' (AspectByte.aj:8)"/>
  920. <message kind="weave" text="Type 'AutoboxingB' (AutoboxingB.java:14) advised by before advice from 'AspectByte' (AspectByte.aj:4)"/>
  921. </compile>
  922. <run class="AutoboxingB">
  923. <stderr>
  924. <line text="Byte:1"/>
  925. <line text="byte:1"/>
  926. <line text="method_takes_Byte=1"/>
  927. <line text="Byte:50"/>
  928. <line text="byte:50"/>
  929. <line text="method_takes_Byte=50"/>
  930. <line text="Byte:3"/>
  931. <line text="byte:3"/>
  932. <line text="method_takes_byte=3"/>
  933. <line text="Byte:52"/>
  934. <line text="byte:52"/>
  935. <line text="method_takes_byte=52"/>
  936. </stderr>
  937. </run>
  938. </ajc-test>
  939. <ajc-test dir="java5/autoboxing" vm="1.5" title="boxing in after returning">
  940. <compile files="AutoboxingB.java,AutoboxingC.java,AutoboxingD.java,AutoboxingF.java,AutoboxingI.java,AutoboxingJ.java,AutoboxingS.java,AutoboxingZ.java,SimpleAutoboxing.java,AspectAfterReturning.aj"
  941. options="-1.5,-showWeaveInfo">
  942. <message kind="weave" text="Type 'AspectAfterReturning' (AspectAfterReturning.aj:18) advised by afterReturning advice from 'AspectAfterReturning' (AspectAfterReturning.aj:4)"/>
  943. <message kind="weave" text="Type 'AspectAfterReturning' (AspectAfterReturning.aj:18) advised by afterReturning advice from 'AspectAfterReturning' (AspectAfterReturning.aj:8)"/>
  944. <message kind="weave" text="Type 'AspectAfterReturning' (AspectAfterReturning.aj:18) advised by afterReturning advice from 'AspectAfterReturning' (AspectAfterReturning.aj:12)"/>
  945. <message kind="weave" text="Type 'AspectAfterReturning' (AspectAfterReturning.aj:19) advised by afterReturning advice from 'AspectAfterReturning' (AspectAfterReturning.aj:4)"/>
  946. <message kind="weave" text="Type 'AspectAfterReturning' (AspectAfterReturning.aj:19) advised by afterReturning advice from 'AspectAfterReturning' (AspectAfterReturning.aj:8)"/>
  947. <message kind="weave" text="Type 'AspectAfterReturning' (AspectAfterReturning.aj:19) advised by afterReturning advice from 'AspectAfterReturning' (AspectAfterReturning.aj:12)"/>
  948. </compile>
  949. <run class="AspectAfterReturning">
  950. <stderr>
  951. <line text="Returning I=5"/>
  952. <line text="Returning Integer=5"/>
  953. <line text="Returning Object=5"/>
  954. <line text="Returning I=10"/>
  955. <line text="Returning Integer=10"/>
  956. <line text="Returning Object=10"/>
  957. </stderr>
  958. </run>
  959. </ajc-test>
  960. <!-- ======================================================================================= -->
  961. <!-- Covariance tests -->
  962. <!-- ======================================================================================= -->
  963. <ajc-test dir="java5/covariance" vm="1.5" title="covariance 1">
  964. <compile options="-1.5,-showWeaveInfo" files="CovBaseProgram01.java,CovAspect01.aj">
  965. <message kind="weave" text="Type 'CovBaseProgram01' (CovBaseProgram01.java:26) advised by before advice from 'CovAspect01' (CovAspect01.aj:5)"/>
  966. <message kind="weave" text="Type 'CovBaseProgram01' (CovBaseProgram01.java:27) advised by before advice from 'CovAspect01' (CovAspect01.aj:5)"/>
  967. </compile>
  968. </ajc-test>
  969. <ajc-test dir="java5/covariance" vm="1.5" title="covariance 2">
  970. <compile options="-1.5,-showWeaveInfo" files="CovBaseProgram01.java,CovAspect02.aj">
  971. <message kind="weave" text="Type 'CovBaseProgram01' (CovBaseProgram01.java:26) advised by before advice from 'CovAspect02' (CovAspect02.aj:5)"/>
  972. <message kind="weave" text="Type 'CovBaseProgram01' (CovBaseProgram01.java:27) advised by before advice from 'CovAspect02' (CovAspect02.aj:5)"/>
  973. </compile>
  974. </ajc-test>
  975. <ajc-test dir="java5/covariance" vm="1.5" title="covariance 3">
  976. <compile options="-1.5,-showWeaveInfo" files="CovBaseProgram01.java,CovAspect03.aj">
  977. <message kind="weave" text="Type 'CovBaseProgram01' (CovBaseProgram01.java:26) advised by before advice from 'CovAspect03' (CovAspect03.aj:5)"/>
  978. <message kind="weave" text="Type 'CovBaseProgram01' (CovBaseProgram01.java:27) advised by before advice from 'CovAspect03' (CovAspect03.aj:5)"/>
  979. </compile>
  980. </ajc-test>
  981. <ajc-test dir="java5/covariance" vm="1.5" title="covariance 4">
  982. <compile options="-1.5,-showWeaveInfo" files="CovBaseProgram02.java,CovAspect04.aj">
  983. <message kind="weave" text="Type 'CovBaseProgram02' (CovBaseProgram02.java:30) advised by before advice from 'CovAspect04' (CovAspect04.aj:5)"/>
  984. </compile>
  985. </ajc-test>
  986. <ajc-test dir="java5/covariance" vm="1.5" title="covariance 5">
  987. <compile options="-1.5,-showWeaveInfo" files="CovBaseProgram01.java,CovAspect05.aj">
  988. <message kind="weave" text="Type 'CovBaseProgram01' (CovBaseProgram01.java:26) advised by before advice from 'CovAspect05' (CovAspect05.aj:5)"/>
  989. <message kind="weave" text="Type 'CovBaseProgram01' (CovBaseProgram01.java:27) advised by before advice from 'CovAspect05' (CovAspect05.aj:5)"/>
  990. </compile>
  991. </ajc-test>
  992. <ajc-test dir="java5/covariance" vm="1.5" title="covariance 6">
  993. <compile options="-1.5,-showWeaveInfo" files="CovBaseProgram01.java,CovAspect06.aj">
  994. <message kind="warning" line="3" text="does not match because declaring type is Super"/>
  995. </compile>
  996. </ajc-test>
  997. <ajc-test dir="java5/covariance" vm="1.5" title="covariance 7">
  998. <compile options="-1.5,-showWeaveInfo" files="CovBaseProgram01.java,CovAspect07.aj">
  999. <message kind="weave" text="Type 'CovBaseProgram01' (CovBaseProgram01.java:27) advised by before advice from 'CovAspect07' (CovAspect07.aj:5)"/>
  1000. <message kind="warning" line="3" text="does not match because declaring type is Super"/>
  1001. </compile>
  1002. </ajc-test>
  1003. <ajc-test dir="java5/covariance" vm="1.5" title="covariance 8">
  1004. <compile options="-1.5,-showWeaveInfo" files="CovBaseProgram01.java,CovAspect08.aj">
  1005. <message kind="weave" text="Type 'CovBaseProgram01' (CovBaseProgram01.java:27) advised by before advice from 'CovAspect08' (CovAspect08.aj:11)"/>
  1006. <message kind="weave" text="Type 'CovBaseProgram01' (CovBaseProgram01.java:27) advised by before advice from 'CovAspect08' (CovAspect08.aj:5)"/>
  1007. </compile>
  1008. </ajc-test>
  1009. <ajc-test dir="java5/covariance" vm="1.5" title="covariance 9">
  1010. <compile options="-1.5,-showWeaveInfo" files="CovBaseProgram01.java,CovAspect09.aj">
  1011. </compile>
  1012. </ajc-test>
  1013. <ajc-test dir="java5/covariance" vm="1.5" title="covariance 10">
  1014. <compile options="-1.5,-showWeaveInfo" files="CovBaseProgram01.java,CovAspect10.aj">
  1015. <message kind="weave" text="Type 'CovBaseProgram01' (CovBaseProgram01.java:26) advised by before advice from 'CovAspect10' (CovAspect10.aj:5)"/>
  1016. <message kind="weave" text="Type 'CovBaseProgram01' (CovBaseProgram01.java:27) advised by before advice from 'CovAspect10' (CovAspect10.aj:5)"/>
  1017. </compile>
  1018. </ajc-test>
  1019. <!-- ======================================================================================= -->
  1020. <!-- Enum tests -->
  1021. <!-- ======================================================================================= -->
  1022. <ajc-test dir="java5/enums" vm="1.5" title="cant itd constructor on enum">
  1023. <compile files="SimpleEnum.java,SimpleEnum2.java,EnumAspect01.aj" options="-1.5">
  1024. <message kind="error" line="2" text="can't make inter-type constructor declarations on enum types"/>
  1025. </compile>
  1026. </ajc-test>
  1027. <ajc-test dir="java5/enums" vm="1.5" title="cant itd field or method on enum">
  1028. <compile files="SimpleEnum.java,SimpleEnum2.java,EnumAspect02.aj" options="-1.5">
  1029. <message kind="error" line="2" text="can't make inter-type method declarations on enum types"/>
  1030. <message kind="error" line="6" text="can't make inter-type field declarations on enum types"/>
  1031. </compile>
  1032. </ajc-test>
  1033. <ajc-test dir="java5/enums" vm="1.5" title="declare parents and enums">
  1034. <compile files="SimpleEnum.java,SimpleEnum2.java,EnumAspect03.aj" options="-1.5">
  1035. <message kind="error" line="5" text="can't use declare parents to make enum type SimpleEnum implement an interface"/>
  1036. <message kind="error" line="8" text="can't use declare parents to alter supertype of enum type SimpleEnum"/>
  1037. <message kind="error" line="11" text="can't use declare parents to make 'java.lang.Enum' the parent of type EnumAspect03$D"/>
  1038. </compile>
  1039. </ajc-test>
  1040. <ajc-test dir="java5/enums" vm="1.5" title="wildcard enum match in itd">
  1041. <compile files="SimpleEnum.java,SimpleEnum2.java,EnumAspect04.aj" options="-1.5">
  1042. <message kind="warning" line="5" text="enum type SimpleEnum2 matches a declare parents type pattern but is being ignored"/>
  1043. <message kind="warning" line="5" text="enum type SimpleEnum matches a declare parents type pattern but is being ignored"/>
  1044. </compile>
  1045. </ajc-test>
  1046. <!-- ======================================================================================= -->
  1047. <!-- pertypewithin tests -->
  1048. <!-- ======================================================================================= -->
  1049. <ajc-test dir="java5/pertypewithin" title="basic ptw test">
  1050. <compile files="A.java,B.java,C.java,D.java,Main.java,X.java"/>
  1051. <run class="p.A">
  1052. <stderr>
  1053. <line text="hi from A"/>
  1054. <line text="after() returning from a method call to sayhi()"/>
  1055. <line text="hi from A"/>
  1056. <line text="after() returning from a method call to sayhi()"/>
  1057. <line text="Tests in A have passed"/>
  1058. <line text="callcount = 2"/>
  1059. </stderr>
  1060. </run>
  1061. </ajc-test>
  1062. <ajc-test dir="java5/pertypewithin" title="ptw hasAspect">
  1063. <compile files="A.java,B.java,C.java,D.java,Main.java,X.java"/>
  1064. <run class="p.B">
  1065. <stderr>
  1066. <line text="hi from B"/>
  1067. <line text="after() returning from a method call to sayhi()"/>
  1068. <line text="hi from B"/>
  1069. <line text="after() returning from a method call to sayhi()"/>
  1070. <line text="hi from B"/>
  1071. <line text="after() returning from a method call to sayhi()"/>
  1072. <line text="callcount = 3"/>
  1073. </stderr>
  1074. </run>
  1075. </ajc-test>
  1076. <ajc-test dir="java5/pertypewithin" title="ptw aspectOf">
  1077. <compile files="A.java,B.java,C.java,D.java,Main.java,X.java"/>
  1078. <run class="p.C"/>
  1079. </ajc-test>
  1080. <ajc-test dir="java5/pertypewithin" title="ptw multi-aspects">
  1081. <compile files="P.java,Q.java,R.java"/>
  1082. <run class="P">
  1083. <stderr>
  1084. <line text="Q reporting 2"/>
  1085. <line text="R reporting 3"/>
  1086. </stderr>
  1087. </run>
  1088. </ajc-test>
  1089. <ajc-test dir="java5/pertypewithin" title="ptw binary">
  1090. <weave classesFiles="G.java" aspectsFiles="H.java"/>
  1091. <run class="G">
  1092. <stderr>
  1093. <line text="advice running"/>
  1094. </stderr>
  1095. </run>
  1096. </ajc-test>
  1097. <ajc-test dir="java5/pertypewithin" title="ptw binary aspect">
  1098. <compile files="H.java" outjar="aspects.jar">
  1099. <message kind="warning" line="1" text="no match for this type name: G"/>
  1100. </compile>
  1101. <compile files="G.java" aspectpath="aspects.jar"/>
  1102. <run class="G">
  1103. <stderr>
  1104. <line text="advice running"/>
  1105. </stderr>
  1106. </run>
  1107. </ajc-test>
  1108. <!-- ======================================================================================= -->
  1109. <!-- varargs tests -->
  1110. <!-- ======================================================================================= -->
  1111. <ajc-test dir="java5/varargs" vm="1.5" title="varargs not matched by Object[] (call)">
  1112. <compile files="SimpleVarargs.java,VarargsAspect01.aj" options="-1.5,-showWeaveInfo">
  1113. </compile>
  1114. </ajc-test>
  1115. <ajc-test dir="java5/varargs" vm="1.5" title="varargs not matched by Object[] (exe)">
  1116. <compile files="SimpleVarargs.java,VarargsAspect02.aj" options="-1.5,-showWeaveInfo">
  1117. </compile>
  1118. </ajc-test>
  1119. <ajc-test dir="java5/varargs" vm="1.5" title="varargs not matched by Object[] (init)">
  1120. <compile files="SimpleVarargs.java,VarargsAspect03.aj" options="-1.5,-showWeaveInfo">
  1121. </compile>
  1122. </ajc-test>
  1123. <ajc-test dir="java5/varargs" vm="1.5" title="varargs not matched by Object[] (withincode)">
  1124. <compile files="SimpleVarargs.java,VarargsAspect04.aj" options="-1.5,-showWeaveInfo">
  1125. </compile>
  1126. </ajc-test>
  1127. <ajc-test dir="java5/varargs" vm="1.5" title="call with varargs signature">
  1128. <compile files="SimpleVarargs.java,VarargsAspect05.aj" options="-1.5,-showWeaveInfo">
  1129. <message kind="weave" text="Type 'SimpleVarargs' (SimpleVarargs.java:20) advised by before advice from 'VarargsAspect05' (VarargsAspect05.aj:3)"/>
  1130. <message kind="weave" text="Type 'SimpleVarargs' (SimpleVarargs.java:21) advised by before advice from 'VarargsAspect05' (VarargsAspect05.aj:3)"/>
  1131. <message kind="weave" text="Type 'SimpleVarargs' (SimpleVarargs.java:22) advised by before advice from 'VarargsAspect05' (VarargsAspect05.aj:3)"/>
  1132. </compile>
  1133. </ajc-test>
  1134. <ajc-test dir="java5/varargs" vm="1.5" title="call with varargs multi-signature">
  1135. <compile files="SimpleVarargs.java,VarargsAspect06.aj" options="-1.5,-showWeaveInfo">
  1136. <message kind="weave" text="Type 'SimpleVarargs' (SimpleVarargs.java:25) advised by before advice from 'VarargsAspect06' (VarargsAspect06.aj:3)"/>
  1137. <message kind="weave" text="Type 'SimpleVarargs' (SimpleVarargs.java:26) advised by before advice from 'VarargsAspect06' (VarargsAspect06.aj:3)"/>
  1138. <message kind="weave" text="Type 'SimpleVarargs' (SimpleVarargs.java:27) advised by before advice from 'VarargsAspect06' (VarargsAspect06.aj:3)"/>
  1139. </compile>
  1140. </ajc-test>
  1141. <ajc-test dir="java5/suppressedWarnings" vm="1.5" title="suppressing non-matching advice warnings">
  1142. <compile files="Suppression1.aj" options="-1.5,-showWeaveInfo">
  1143. <message kind="warning" line="13"/>
  1144. <message kind="warning" line="21"/>
  1145. </compile>
  1146. </ajc-test>
  1147. <ajc-test dir="java5/suppressedWarnings" vm="1.5" title="suppressing non-matching advice warnings when multiple source files involved">
  1148. <compile files="A.java,A1.aj,A2.aj,A3.aj" options="-1.5,-showWeaveInfo">
  1149. <message kind="warning" line="4" file="A1.aj"/>
  1150. <message kind="warning" line="4" file="A2.aj"/>
  1151. <message kind="warning" line="11" file="A2.aj"/>
  1152. <message kind="warning" line="4" file="A3.aj"/>
  1153. <message kind="warning" line="11" file="A3.aj"/>
  1154. </compile>
  1155. </ajc-test>
  1156. <ajc-test dir="bugs150" title="XLint warning for advice not applied with cflow(execution)" pr="93345">
  1157. <compile options="-Xlint,-1.5" files="PR93345.aj" >
  1158. <message kind="warning" line="7" text="advice defined in AnAspect has not been applied [Xlint:adviceDidNotMatch]"/>
  1159. </compile>
  1160. </ajc-test>
  1161. <ajc-test dir="bugs150" title="NPE in reflect implementation" pr="94167">
  1162. <compile files="PR94167.java"/>
  1163. <run class="reflect.PR94167"/>
  1164. </ajc-test>
  1165. <!-- ======================================================================================= -->
  1166. <!-- annotated aspect members -->
  1167. <!-- ======================================================================================= -->
  1168. <ajc-test dir="java5/annotations/aspectMembers" title="annotated annotations (@Target)">
  1169. <compile files="a/Annotations.java,a/Foo.java" options="-1.5">
  1170. <message kind="error" line="16" text="The annotation @MethodAnnotation is disallowed for this location"/>
  1171. </compile>
  1172. </ajc-test>
  1173. <ajc-test dir="java5/annotations/aspectMembers" title="simple annotated aspect members">
  1174. <compile files="a/Annotations.java,a/AnnotatedAspect.aj" options="-1.5">
  1175. <message kind="warning" line="4" text="annotated type"/>
  1176. <message kind="warning" line="6" text="annotated field"/>
  1177. <message kind="warning" line="8" text="annotated method"/>
  1178. <message kind="warning" line="11" text="annotated constructor"/>
  1179. </compile>
  1180. </ajc-test>
  1181. <ajc-test dir="java5/annotations/aspectMembers" title="simple annotated aspect members with bad target">
  1182. <compile files="a/Annotations.java,a/AnnotatedAspect02.aj" options="-1.5">
  1183. <message kind="error" line="3" text="The annotation @MethodAnnotation is disallowed for this location"/>
  1184. <message kind="error" line="6" text="The annotation @TypeAnnotation is disallowed for this location"/>
  1185. <message kind="error" line="8" text="The annotation @FieldAnnotation is disallowed for this location"/>
  1186. <message kind="error" line="10" text="The annotation @AnnotationAnnotation is disallowed for this location"/>
  1187. </compile>
  1188. </ajc-test>
  1189. <ajc-test dir="java5/annotations/aspectMembers" title="annotated itds">
  1190. <compile files="a/Annotations.java,a/AnnotatedAspect03.aj" options="-1.5">
  1191. <message kind="warning" line="4" text="annotated type"/>
  1192. <message kind="warning" line="6" text="annotated field"/>
  1193. <message kind="warning" line="8" text="annotated field"/>
  1194. <message kind="warning" line="10" text="annotated method"/>
  1195. <message kind="warning" line="12" text="annotated constructor"/>
  1196. <message kind="warning" line="12" text="annotated field"/>
  1197. </compile>
  1198. </ajc-test>
  1199. <ajc-test dir="java5/annotations/aspectMembers" title="annotated itds with bad target">
  1200. <compile files="a/Annotations.java,a/AnnotatedAspect04.aj" options="-1.5">
  1201. <message kind="error" line="6" text="The annotation @ConstructorAnnotation is disallowed for this location"/>
  1202. <message kind="error" line="8" text="The annotation @FieldAnnotation is disallowed for this location"/>
  1203. <message kind="error" line="10" text="The annotation @TypeAnnotation is disallowed for this location"/>
  1204. <!-- known limitation...
  1205. <message kind="error" line="12" text="The annotation @MethodAnnotation is disallowed for this location"/>
  1206. -->
  1207. </compile>
  1208. </ajc-test>
  1209. <ajc-test dir="java5/annotations/aspectMembers" title="annotated advice">
  1210. <compile files="a/Annotations.java,a/AnnotatedAspect05.aj" options="-1.5">
  1211. <message kind="warning" line="17"/>
  1212. </compile>
  1213. <run class="a.AnnotatedAspect05"/>
  1214. </ajc-test>
  1215. <ajc-test dir="java5/annotations/aspectMembers" title="annotated advice with bad target">
  1216. <compile files="a/Annotations.java,a/AnnotatedAspect06.aj" options="-1.5">
  1217. <message kind="error" line="6" text="The annotation @ConstructorAnnotation is disallowed for this location"/>
  1218. </compile>
  1219. </ajc-test>
  1220. <ajc-test dir="java5/annotations/aspectMembers" title="annotated pointcut">
  1221. <compile files="a/Annotations.java,a/AnnotatedAspect07.aj" options="-1.5">
  1222. </compile>
  1223. </ajc-test>
  1224. <ajc-test dir="java5/annotations/aspectMembers" title="annotated declare statements">
  1225. <compile files="a/Annotations.java,a/AnnotatedAspect08.aj" options="-1.5">
  1226. </compile>
  1227. </ajc-test>
  1228. <!-- ======================================================================================= -->
  1229. <!-- ajdk examples -->
  1230. <!-- ======================================================================================= -->
  1231. <ajc-test dir="java5/annotations/ajdkExamples" title="ajdk: annotating aspects chapter">
  1232. <compile files="AnnotatingAspects.aj" options="-1.5">
  1233. </compile>
  1234. </ajc-test>
  1235. <ajc-test dir="java5/annotations/ajdkExamples" title="ajdk: annotating aspects chapter, ex 2">
  1236. <compile files="SuppressAj.aj" options="-1.5">
  1237. </compile>
  1238. </ajc-test>
  1239. <ajc-test dir="java5/annotations/ajdkExamples" title="ajdk: annotation pattern matching">
  1240. <compile files="AnnotationPatternMatching.aj,org/xyz/OrgXYZAnnotation.java" options="-1.5">
  1241. <message kind="warning" line="25" text="@Immutable"/>
  1242. <message kind="warning" line="25" text="!@Persistent"/>
  1243. <message kind="warning" line="29" text="!@Persistent"/>
  1244. <message kind="warning" line="31" text="!@Persistent"/>
  1245. <message kind="warning" line="33" text="!@Persistent"/>
  1246. <message kind="warning" line="29" text="@Foo @Goo"/>
  1247. <message kind="warning" line="29" text="@(Foo || Goo)"/>
  1248. <message kind="warning" line="31" text="@(Foo || Goo)"/>
  1249. <message kind="warning" line="33" text="@(org.xyz..*)"/>
  1250. </compile>
  1251. </ajc-test>
  1252. <ajc-test dir="java5/annotations/ajdkExamples" title="ajdk: annotation type pattern matching">
  1253. <compile files="AnnotationsInTypePatterns.aj,org/xyz/OrgXYZAnnotation.java,org/xyz/Types.java,org/abc/Types.java,anns/Immutable.java,anns/NonPersistent.java" options="-1.5">
  1254. <message kind="warning" line="23" text="(@Immutable *)"/>
  1255. <message kind="warning" line="32" text="(@Immutable *)"/>
  1256. <message kind="warning" line="3" text="(@Immutable *)"/>
  1257. <message kind="warning" line="5" text="(@Immutable *)"/>
  1258. <message kind="warning" line="8" text="(@Immutable *)"/>
  1259. <message kind="warning" line="25" text="(!@Immutable *)"/>
  1260. <message kind="warning" line="27" text="(!@Immutable *)"/>
  1261. <message kind="warning" line="29" text="(!@Immutable *)"/>
  1262. <message kind="warning" line="5" text="(!@Immutable *)"/>
  1263. <message kind="warning" line="6" text="(!@Immutable *)"/>
  1264. <message kind="warning" line="2" text="(!@Immutable *)"/>
  1265. <message kind="warning" line="2" text="(!@Immutable *)"/>
  1266. <message kind="warning" line="5" text="(!@Immutable *)"/>
  1267. <message kind="warning" line="3" text="@Immutable (org.xyz.* || org.abc.*)"/>
  1268. <message kind="warning" line="5" text="@Immutable (org.xyz.* || org.abc.*)"/>
  1269. <message kind="warning" line="8" text="@Immutable (org.xyz.* || org.abc.*)"/>
  1270. <message kind="warning" line="32" text="((@Immutable Foo+) || Goo)"/>
  1271. <message kind="warning" line="27" text="((@Immutable Foo+) || Goo)"/>
  1272. <message kind="warning" line="3" text="@(Immutable || NonPersistent) org.xyz..*"/>
  1273. <message kind="warning" line="6" text="@(Immutable || NonPersistent) org.xyz..*"/>
  1274. <message kind="warning" line="8" text="@(Immutable || NonPersistent) org.xyz..*"/>
  1275. <message kind="warning" line="8" text="@Immutable @NonPersistent org.xyz..*"/>
  1276. <message kind="warning" line="6" text="@(@Inherited *) org.xyz..*"/>
  1277. <message kind="warning" line="8" text="@(@Inherited *) org.xyz..*"/>
  1278. </compile>
  1279. </ajc-test>
  1280. <ajc-test dir="java5/annotations/ajdkExamples" title="ajdk: annotations in sig patterns">
  1281. <compile files="AnnotationsInSignaturePatterns.aj,anns/Cachable.java,anns/SensitiveData.java,anns/Persisted.java,Classified.java,anns/Immutable.java,Secure.java,Catastrophic.java,Oneway.java,anns/Transaction.java,org/xyz/SignatureTypes.java" options="-1.5">
  1282. <message kind="warning" line="32" text="@SensitiveData * *"/>
  1283. <message kind="warning" line="7" text="@SensitiveData * *"/>
  1284. <message kind="warning" line="13" text="@SensitiveData * *"/>
  1285. <message kind="warning" line="7" text="@SensitiveData List org.xyz..*.*"/>
  1286. <message kind="warning" line="11" text="(@SensitiveData *) org.xyz..*.*"/>
  1287. <message kind="warning" line="13" text="(@SensitiveData *) org.xyz..*.*"/>
  1288. <message kind="warning" line="50" text="@Foo (@Goo *) (@Hoo *).*"/>
  1289. <message kind="warning" line="38" text="@Persisted @Classified * *"/>
  1290. <message kind="warning" line="44" text="@Oneway * *(..)"/>
  1291. <message kind="warning" line="18" text="@Transaction * (@Persisted org.xyz..*).*(..)"/>
  1292. <message kind="warning" line="52" text="* *.*(@Immutable *,..)"/>
  1293. <message kind="warning" line="53" text="* *.*(@Immutable *,..)"/>
  1294. <message kind="warning" line="54" text="* *.*(@Immutable *,..)"/>
  1295. <message kind="warning" line="62" text="within(@Secure *)"/>
  1296. <message kind="warning" line="63" text="within(@Secure *)"/>
  1297. <message kind="warning" line="66" text="staticinitialization(@Persisted *)"/>
  1298. <message kind="warning" line="17" text="staticinitialization(@Persisted *)"/>
  1299. <message kind="warning" line="56" text="call(@Oneway * *(..))"/>
  1300. <message kind="warning" line="28" text="execution(public (@Immutable *) org.xyz..*.*(..))"/>
  1301. <message kind="warning" line="26" text="set(@Cachable * *)"/>
  1302. <message kind="warning" line="80" text="handler(!@Catastrophic *)"/>
  1303. </compile>
  1304. </ajc-test>
  1305. <ajc-test dir="java5/annotations/ajdkExamples" title="ajdk: runtime annotations">
  1306. <compile files="RuntimeTypeMatching.aj" options="-1.5">
  1307. <message kind="warning" line="121" text="@within(Foo)"/>
  1308. <message kind="warning" line="122" text="@within(Foo)"/>
  1309. </compile>
  1310. <run class="RuntimeTypeMatching">
  1311. <stdout>
  1312. <line text="This information is TOP-SECRET"/>
  1313. <line text="@target(Classified) at call(void A.a())"/>
  1314. <line text="@this(Foo) at execution(void B.b())"/>
  1315. <line text="Classified data being passed at call(void B.callA(A))"/>
  1316. <line text="Classified data being passed at execution(void B.callA(A))"/>
  1317. <line text="This information is TOP-SECRET"/>
  1318. <line text="@target(Classified) at call(Class java.lang.Object.getClass())"/>
  1319. <line text="1 @Foo()"/>
  1320. <line text="1 @Foo()"/>
  1321. <line text="1 @Classified(classification=TOP-SECRET)"/>
  1322. <line text="This information is TOP-SECRET"/>
  1323. <line text="Entering critical join point with priority 3"/>
  1324. <line text="Entering critical join point with reflectively obtained priority 3"/>
  1325. <line text="@target(Classified) at call(void A.a())"/>
  1326. <line text="@this(Foo) at execution(void B.callA(A))"/>
  1327. <line text="(Class) Transaction required at execution(void ByeByeEJB.method1())"/>
  1328. <line text="(Method) Transaction required at execution(void ByeByeEJB.method1())"/>
  1329. <line text="(Class) Transaction required at execution(void ByeByeEJB.method2())"/>
  1330. <line text="(Method) Transaction required at execution(void ByeByeEJB.method2())"/>
  1331. <line text="(Class) Transaction required at execution(void ByeByeEJB.method3())"/>
  1332. </stdout>
  1333. </run>
  1334. </ajc-test>
  1335. <ajc-test dir="java5/annotations/ajdkExamples" title="ajdk: @retention checking">
  1336. <compile files="RetentionTime.aj" options="-1.5">
  1337. <message kind="error" line="8" text="Annotation type Goo does not have runtime retention"/>
  1338. <message kind="error" line="13" text="Annotation type Goo does not have runtime retention"/>
  1339. <message kind="error" line="18" text="Annotation type Goo does not have runtime retention"/>
  1340. </compile>
  1341. </ajc-test>
  1342. <ajc-test dir="java5/annotations/ajdkExamples" title="ajdk: @inherited">
  1343. <compile files="AnnotationInheritance.aj" options="-1.5">
  1344. <message kind="warning" line="16" text="annotatedMethodCall()"/>
  1345. <message kind="warning" line="17" text="annotatedMethodCall()"/>
  1346. </compile>
  1347. </ajc-test>
  1348. <ajc-test dir="java5/annotations/ajdkExamples" title="ajdk: deow-ann">
  1349. <compile files="DeclaresWithAnnotations.aj,org/xyz/model/Model.java" options="-1.5">
  1350. <message kind="warning" line="27" text="Expensive operation called from within performance critical section"/>
  1351. <message kind="error" line="26" text="Untrusted code should not call the model classes directly"/>
  1352. </compile>
  1353. </ajc-test>
  1354. <ajc-test dir="java5/annotations/ajdkExamples" title="ajdk: decp-ann">
  1355. <compile files="DecpAnnotations.aj" options="-1.5">
  1356. </compile>
  1357. <run class="DecpAnnotations">
  1358. <stdout>
  1359. <line text="Test Foo is not secured: PASS"/>
  1360. <line text="Test Goo is secured: PASS"/>
  1361. <line text="goo credentials: none"/>
  1362. <line text="Test BankAccount is not secured: PASS"/>
  1363. <line text="Test PrivateBankAccount is not secured: PASS"/>
  1364. <line text="Test BusinessBankAccount is secured: PASS"/>
  1365. </stdout>
  1366. </run>
  1367. </ajc-test>
  1368. <ajc-test dir="java5/annotations/ajdkExamples" title="ajdk: dec precedence">
  1369. <compile files="PrecedenceAnnotations.aj" options="-1.5">
  1370. </compile>
  1371. <run class="PrecedenceAnnotations">
  1372. <stdout>
  1373. <line text="@Security S2"/>
  1374. <line text="S1"/>
  1375. <line text="@Performance P2"/>
  1376. <line text="P1"/>
  1377. </stdout>
  1378. </run>
  1379. </ajc-test>
  1380. <ajc-test dir="java5/annotations/ajdkExamples" title="ajdk: dec annotation">
  1381. <compile files="DeclareAnnotation.aj,org/xyz/model/Model.java" options="-1.5">
  1382. <message kind="warning" line="3" text="@BusinessDomain"/>
  1383. <message kind="warning" line="43" text="@Secured"/>
  1384. <message kind="warning" line="44" text="@Secured"/>
  1385. <message kind="warning" line="55" text="@Secured"/>
  1386. <message kind="warning" line="62" text="@Persisted"/>
  1387. <message kind="warning" line="68" text="@Persisted"/>
  1388. <message kind="warning" line="41" text="@Secured"/>
  1389. <message kind="warning" line="51" text="@Secured"/>
  1390. </compile>
  1391. <run class="DeclareAnnotation"/>
  1392. </ajc-test>
  1393. <ajc-test dir="java5/covariance/ajdk" title="ajdk: covariance">
  1394. <compile files="AJDKExamples.aj" options="-1.5">
  1395. <message kind="warning" line="43" text="call(* whoAreYou())"/>
  1396. <message kind="warning" line="44" text="call(* whoAreYou())"/>
  1397. <message kind="warning" line="43" text="call(* A.whoAreYou())"/>
  1398. <message kind="warning" line="44" text="call(* A.whoAreYou())"/>
  1399. <message kind="warning" line="43" text="call(A whoAreYou())"/>
  1400. <message kind="warning" line="44" text="call(A whoAreYou())"/>
  1401. <message kind="warning" line="44" text="call(A+ B.whoAreYou())"/>
  1402. <message kind="warning" line="44" text="call(B whoAreYou())"/>
  1403. <message kind="warning" line="44" text="call(B B.whoAreYou())"/>
  1404. </compile>
  1405. </ajc-test>
  1406. <ajc-test dir="java5/varargs/ajdk" title="ajdk: varargs">
  1407. <compile files="AJDKExamples.aj,org/xyz/Foo.java,org/xyz/Goo.java,org/xyz/Hoo.java" options="-1.5">
  1408. <message kind="warning" line="8" text="call vararg match"/>
  1409. <message kind="warning" line="14" text="execution vararg match"/>
  1410. <message kind="warning" line="5" text="init vararg match"/>
  1411. <message kind="warning" line="6" text="init vararg match"/>
  1412. <message kind="warning" line="27" text="single vararg"/>
  1413. <message kind="warning" line="28" text="single String[]"/>
  1414. <message kind="warning" line="18" text="single String[]"/>
  1415. </compile>
  1416. <run class="AJDKExamples">
  1417. <stdout>
  1418. <line text="Matched at call(void X.foo(int, String[]))"/>
  1419. </stdout>
  1420. </run>
  1421. </ajc-test>
  1422. <ajc-test dir="java5/pertypewithin/ajdk" title="ajdk: ptw">
  1423. <compile files="AJDKExamples.aj" options="-1.5"/>
  1424. <run class="org.xyz.foo.AJDKExamples">
  1425. <stdout>
  1426. <line text="true"/>
  1427. <line text="true"/>
  1428. <line text="There are 2 As"/>
  1429. <line text="There are 3 Bs"/>
  1430. </stdout>
  1431. </run>
  1432. </ajc-test>
  1433. <!-- ======================================================================================= -->
  1434. <!-- declare annotation -->
  1435. <!-- ======================================================================================= -->
  1436. <ajc-test dir="java5/annotations/declare" title="basic declare annotation parse test">
  1437. <compile files="BasicParseTest.aj" options="-1.5">
  1438. </compile>
  1439. </ajc-test>
  1440. <!-- ======================================================================================= -->
  1441. <!-- declare annotation (@type) -->
  1442. <!-- ======================================================================================= -->
  1443. <ajc-test dir="java5/annotations/declare" title="declare @type 1">
  1444. <compile files="DecaType1.java" options="-1.5"/>
  1445. <run class="DecaType1">
  1446. <stderr>
  1447. <line text="annotation is @MyAnnotation()"/>
  1448. </stderr>
  1449. </run>
  1450. </ajc-test>
  1451. <ajc-test dir="java5/annotations/declare" title="declare @type 2">
  1452. <compile files="DecaType2.java" options="-1.5,-Xlint:ignore" >
  1453. </compile>
  1454. <run class="DecaType2">
  1455. <stderr>
  1456. <line text="annotation on DecaType2 is @MyAnnotation()"/>
  1457. <line text="annotation on X is @MyAnnotation()"/>
  1458. <line text="annotation on MyAnnotation is @MyAnnotation()"/>
  1459. </stderr>
  1460. </run>
  1461. </ajc-test>
  1462. <ajc-test dir="java5/annotations/declare" title="declare @type - with matching pointcut">
  1463. <compile files="DecaType3.java" options="-1.5"/>
  1464. <run class="DecaType3">
  1465. <stderr>
  1466. <line text="hello world"/>
  1467. <line text="advice running"/>
  1468. </stderr>
  1469. </run>
  1470. </ajc-test>
  1471. <ajc-test dir="java5/annotations/declare" title="declare @type - binary weaving">
  1472. <weave classesFiles="BaseTypes.java"
  1473. aspectsFiles="DecaTypeBin1.aj,Colored.java"
  1474. options="-1.5" xlintfile="ignoreTypeNotExposed.properties">
  1475. </weave>
  1476. <run class="BaseTypes">
  1477. <stderr>
  1478. <line text="Color identified on class X"/>
  1479. <line text="A.m() running"/>
  1480. <line text="A.m() running"/>
  1481. <line text="A.m() running"/>
  1482. </stderr>
  1483. </run>
  1484. </ajc-test>
  1485. <ajc-test dir="java5/annotations/declare" title="declare @type - complex annotation - binary weaving">
  1486. <weave classesFiles="BaseTypes.java" aspectsFiles="DecaTypeBin2.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties"/>
  1487. <run class="BaseTypes">
  1488. <stderr>
  1489. <line text="ComplexAnnotation identified on execution(void A.m())"/>
  1490. <line text="A.m() running"/>
  1491. <line text="A.m() running"/>
  1492. <line text="A.m() running"/>
  1493. </stderr>
  1494. </run>
  1495. </ajc-test>
  1496. <ajc-test dir="java5/annotations/declare" title="declare @type - complex annotation - source weaving">
  1497. <compile files="BaseTypes.java,DecaTypeBin2.aj" options="-1.5"/>
  1498. <run class="BaseTypes">
  1499. <stderr>
  1500. <line text="ComplexAnnotation identified on execution(void A.m())"/>
  1501. <line text="A.m() running"/>
  1502. <line text="A.m() running"/>
  1503. <line text="A.m() running"/>
  1504. </stderr>
  1505. </run>
  1506. </ajc-test>
  1507. <ajc-test dir="java5/annotations/declare" title="declare @type - two annotations hit one type - source weaving">
  1508. <compile files="BaseTypes.java,DecaTypeBin3.aj" options="-1.5"/>
  1509. <run class="BaseTypes">
  1510. <stderr>
  1511. <line text="Color identified on execution(void A.m())"/>
  1512. <line text="Fruit identified on execution(void A.m())"/>
  1513. <line text="A.m() running"/>
  1514. <line text="A.m() running"/>
  1515. <line text="A.m() running"/>
  1516. </stderr>
  1517. </run>
  1518. </ajc-test>
  1519. <ajc-test dir="java5/annotations/declare" title="declare @type - two annotations hit one type - binary weaving">
  1520. <weave classesFiles="BaseTypes.java" aspectsFiles="DecaTypeBin3.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties"/>
  1521. <run class="BaseTypes">
  1522. <stderr>
  1523. <line text="Color identified on execution(void A.m())"/>
  1524. <line text="Fruit identified on execution(void A.m())"/>
  1525. <line text="A.m() running"/>
  1526. <line text="A.m() running"/>
  1527. <line text="A.m() running"/>
  1528. </stderr>
  1529. </run>
  1530. </ajc-test>
  1531. <ajc-test dir="java5/annotations/declare" title="declare @type - declare parents interactions (order 1) - binary weaving">
  1532. <weave classesFiles="BaseTypes.java" aspectsFiles="DecaDecpInteractions1.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties"/>
  1533. <run class="BaseTypes">
  1534. <stderr>
  1535. <line text="Marker interface identified on execution(void A.m())"/>
  1536. <line text="Color annotation identified on execution(void A.m())"/>
  1537. <line text="A.m() running"/>
  1538. <line text="Marker interface identified on execution(void A.m())"/>
  1539. <line text="A.m() running"/>
  1540. <line text="Marker interface identified on execution(void A.m())"/>
  1541. <line text="A.m() running"/>
  1542. </stderr>
  1543. </run>
  1544. </ajc-test>
  1545. <ajc-test dir="java5/annotations/declare" title="declare @type - declare parents interactions (order 1) - source weaving">
  1546. <compile files="BaseTypes.java,DecaDecpInteractions1.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties"/>
  1547. <run class="BaseTypes">
  1548. <stderr>
  1549. <line text="Marker interface identified on execution(void A.m())"/>
  1550. <line text="Color annotation identified on execution(void A.m())"/>
  1551. <line text="A.m() running"/>
  1552. <line text="Marker interface identified on execution(void A.m())"/>
  1553. <line text="A.m() running"/>
  1554. <line text="Marker interface identified on execution(void A.m())"/>
  1555. <line text="A.m() running"/>
  1556. </stderr>
  1557. </run>
  1558. </ajc-test>
  1559. <ajc-test dir="java5/annotations/declare" title="declare @type - declare parents interactions (order 2) - binary weaving">
  1560. <weave classesFiles="BaseTypes.java" aspectsFiles="DecaDecpInteractions2.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties"/>
  1561. <run class="BaseTypes">
  1562. <stderr>
  1563. <line text="Marker interface identified on execution(void A.m())"/>
  1564. <line text="Color annotation identified on execution(void A.m())"/>
  1565. <line text="A.m() running"/>
  1566. <line text="Marker interface identified on execution(void A.m())"/>
  1567. <line text="A.m() running"/>
  1568. <line text="Marker interface identified on execution(void A.m())"/>
  1569. <line text="A.m() running"/>
  1570. </stderr>
  1571. </run>
  1572. </ajc-test>
  1573. <ajc-test dir="java5/annotations/declare" title="declare @type - declare parents interactions (order 2) - source weaving">
  1574. <compile files="BaseTypes.java,DecaDecpInteractions2.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties"/>
  1575. <run class="BaseTypes">
  1576. <stderr>
  1577. <line text="Marker interface identified on execution(void A.m())"/>
  1578. <line text="Color annotation identified on execution(void A.m())"/>
  1579. <line text="A.m() running"/>
  1580. <line text="Marker interface identified on execution(void A.m())"/>
  1581. <line text="A.m() running"/>
  1582. <line text="Marker interface identified on execution(void A.m())"/>
  1583. <line text="A.m() running"/>
  1584. </stderr>
  1585. </run>
  1586. </ajc-test>
  1587. <ajc-test dir="java5/annotations/declare" title="declare @type - declare parents interactions (order 3) - binary weaving">
  1588. <weave classesFiles="BaseTypes.java" aspectsFiles="DecaDecpInteractions3.aj" options="-1.5,-Xlint:ignore"/>
  1589. <run class="BaseTypes">
  1590. <stderr>
  1591. <line text="Marker interface identified on execution(void A.m())"/>
  1592. <line text="Color annotation identified on execution(void A.m())"/>
  1593. <line text="A.m() running"/>
  1594. <line text="Marker interface identified on execution(void A.m())"/>
  1595. <line text="Color annotation identified on execution(void A.m())"/>
  1596. <line text="A.m() running"/>
  1597. <line text="Marker interface identified on execution(void A.m())"/>
  1598. <line text="Color annotation identified on execution(void A.m())"/>
  1599. <line text="A.m() running"/>
  1600. </stderr>
  1601. </run>
  1602. </ajc-test>
  1603. <ajc-test dir="java5/annotations/declare" title="declare @type - declare parents interactions (order 3) - source weaving">
  1604. <compile files="BaseTypes.java,DecaDecpInteractions3.aj" options="-1.5,-Xlint:ignore"/>
  1605. <run class="BaseTypes">
  1606. <stderr>
  1607. <line text="Marker interface identified on execution(void A.m())"/>
  1608. <line text="Color annotation identified on execution(void A.m())"/>
  1609. <line text="A.m() running"/>
  1610. <line text="Marker interface identified on execution(void A.m())"/>
  1611. <line text="Color annotation identified on execution(void A.m())"/>
  1612. <line text="A.m() running"/>
  1613. <line text="Marker interface identified on execution(void A.m())"/>
  1614. <line text="Color annotation identified on execution(void A.m())"/>
  1615. <line text="A.m() running"/>
  1616. </stderr>
  1617. </run>
  1618. </ajc-test>
  1619. <ajc-test dir="java5/annotations/declare" title="declare @type - declare parents interactions (order 4) - binary weaving">
  1620. <weave classesFiles="BaseTypes.java" aspectsFiles="DecaDecpInteractions4.aj" options="-1.5,-Xlint:ignore"/>
  1621. <run class="BaseTypes">
  1622. <stderr>
  1623. <line text="Marker interface identified on execution(void A.m())"/>
  1624. <line text="Color annotation identified on execution(void A.m())"/>
  1625. <line text="A.m() running"/>
  1626. <line text="Marker interface identified on execution(void A.m())"/>
  1627. <line text="Color annotation identified on execution(void A.m())"/>
  1628. <line text="A.m() running"/>
  1629. <line text="Marker interface identified on execution(void A.m())"/>
  1630. <line text="Color annotation identified on execution(void A.m())"/>
  1631. <line text="A.m() running"/>
  1632. </stderr>
  1633. </run>
  1634. </ajc-test>
  1635. <ajc-test dir="java5/annotations/declare" title="declare @type - declare parents interactions (order 4) - source weaving">
  1636. <compile files="BaseTypes.java,DecaDecpInteractions4.aj" options="-1.5,-Xlint:ignore"/>
  1637. <run class="BaseTypes">
  1638. <stderr>
  1639. <line text="Marker interface identified on execution(void A.m())"/>
  1640. <line text="Color annotation identified on execution(void A.m())"/>
  1641. <line text="A.m() running"/>
  1642. <line text="Marker interface identified on execution(void A.m())"/>
  1643. <line text="Color annotation identified on execution(void A.m())"/>
  1644. <line text="A.m() running"/>
  1645. <line text="Marker interface identified on execution(void A.m())"/>
  1646. <line text="Color annotation identified on execution(void A.m())"/>
  1647. <line text="A.m() running"/>
  1648. </stderr>
  1649. </run>
  1650. </ajc-test>
  1651. <ajc-test dir="java5/annotations/declare" title="declare @type - annotating an already annotated type - binary weaving">
  1652. <weave classesFiles="AnnotatedType.java" aspectsFiles="DecaTypeBin4.aj" options="-1.5,-Xlint:ignore"/>
  1653. <run class="AnnotatedType">
  1654. <stderr>
  1655. <line text="Color identified on execution(void AnnotatedType.m())"/>
  1656. <line text="Fruit identified on execution(void AnnotatedType.m())"/>
  1657. <line text="m() running"/>
  1658. </stderr>
  1659. </run>
  1660. </ajc-test>
  1661. <ajc-test dir="java5/annotations/declare" title="declare @type - annotating an already annotated type - source weaving">
  1662. <compile files="AnnotatedType.java,DecaTypeBin4.aj" options="-1.5,-Xlint:ignore"/>
  1663. <run class="AnnotatedType">
  1664. <stderr>
  1665. <line text="Color identified on execution(void AnnotatedType.m())"/>
  1666. <line text="Fruit identified on execution(void AnnotatedType.m())"/>
  1667. <line text="m() running"/>
  1668. </stderr>
  1669. </run>
  1670. </ajc-test>
  1671. <!--ajc-test dir="java5/annotations/declare" title="declare @type - annotations with different targets - binary weaving">
  1672. <weave classesFiles="BaseTypes.java" aspectsFiles="DecaTypeBin5.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties">
  1673. <message kind="error" line="15" text="The annotation @ColorM is disallowed for this location"/>
  1674. <message kind="error" line="16" text="The annotation @ColorC is disallowed for this location"/>
  1675. <message kind="error" line="18" text="The annotation @ColorF is disallowed for this location"/>
  1676. <message kind="error" line="19" text="The annotation @ColorP is disallowed for this location"/>
  1677. <message kind="error" line="20" text="The annotation @ColorL is disallowed for this location"/>
  1678. <message kind="error" line="21" text="The annotation @ColorPkg is disallowed for this location"/>
  1679. </weave>
  1680. <run class="BaseTypes">
  1681. <stderr>
  1682. <line text="ColorT identified on execution(void A.m())"/>
  1683. <line text="A.m() running"/>
  1684. <line text="A.m() running"/>
  1685. <line text="A.m() running"/>
  1686. </stderr>
  1687. </run>
  1688. </ajc-test-->
  1689. <ajc-test dir="java5/annotations/declare" title="declare @type - annotations with different targets - source weaving">
  1690. <compile files="BaseTypes.java,DecaTypeBin5.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties">
  1691. <message kind="error" line="15" text="The annotation @ColorM is disallowed for this location"/>
  1692. <message kind="error" line="16" text="The annotation @ColorC is disallowed for this location"/>
  1693. <message king="error" line="17" text="A is not a valid target for annotation ColorA"/>
  1694. <message kind="error" line="18" text="The annotation @ColorF is disallowed for this location"/>
  1695. <message kind="error" line="19" text="The annotation @ColorP is disallowed for this location"/>
  1696. <message kind="error" line="20" text="The annotation @ColorL is disallowed for this location"/>
  1697. <message kind="error" line="21" text="The annotation @ColorPkg is disallowed for this location"/>
  1698. </compile>
  1699. </ajc-test>
  1700. <!--ajc-test dir="java5/annotations/declare" title="declare @type - annotations with different targets (using type patterns) - binary weaving">
  1701. <weave classesFiles="BaseTypes.java" aspectsFiles="DecaTypeBin6.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties">
  1702. <message kind="warning" line="15" text="A is not a valid target for annotation ColorM"/>
  1703. <message kind="warning" line="16" text="A is not a valid target for annotation ColorC"/>
  1704. <message kind="warning" line="17" text="A is not a valid target for annotation ColorL"/>
  1705. <message kind="warning" line="17" text="B is not a valid target for annotation ColorL"/>
  1706. <message kind="warning" line="17" text="C is not a valid target for annotation ColorL"/>
  1707. </weave>
  1708. <run class="BaseTypes">
  1709. <stderr>
  1710. <line text="ColorT identified on execution(void A.m())"/>
  1711. <line text="A.m() running"/>
  1712. <line text="ColorT identified on execution(void A.m())"/>
  1713. <line text="A.m() running"/>
  1714. <line text="ColorT identified on execution(void A.m())"/>
  1715. <line text="A.m() running"/>
  1716. </stderr>
  1717. </run>
  1718. </ajc-test-->
  1719. <ajc-test dir="java5/annotations/declare" title="declare @type - annotations with different targets (using type patterns) - source weaving">
  1720. <compile files="BaseTypes.java,DecaTypeBin6.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties">
  1721. <message kind="error" line="15" text="The annotation @ColorM is disallowed for this location"/>
  1722. <message kind="error" line="16" text="The annotation @ColorC is disallowed for this location"/>
  1723. <message kind="error" line="17" text="The annotation @ColorL is disallowed for this location"/>
  1724. <message kind="error" line="18" text="The annotation @ColorF is disallowed for this location"/>
  1725. </compile>
  1726. </ajc-test>
  1727. <ajc-test dir="java5/annotations/declare" title="declare @type - complex decp decAtType interactions - binary weaving">
  1728. <weave classesFiles="BaseTypes.java" aspectsFiles="DecaTypeBin7.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties">
  1729. </weave>
  1730. <run class="BaseTypes">
  1731. <stderr>
  1732. <line text="Color identified on execution(void A.m())"/>
  1733. <line text="Fruit identified on execution(void A.m())"/>
  1734. <line text="Chocolate identified on execution(void A.m())"/>
  1735. <line text="M1 at execution(void A.m())"/>
  1736. <line text="M2 at execution(void A.m())"/>
  1737. <line text="M3 at execution(void A.m())"/>
  1738. <line text="A.m() running"/>
  1739. <line text="Fruit identified on execution(void B.m())"/>
  1740. <line text="Chocolate identified on execution(void B.m())"/>
  1741. <line text="M1 at execution(void B.m())"/>
  1742. <line text="M2 at execution(void B.m())"/>
  1743. <line text="M3 at execution(void B.m())"/>
  1744. <line text="B.m() running"/>
  1745. <line text="Fruit identified on execution(void C.m())"/>
  1746. <line text="Chocolate identified on execution(void C.m())"/>
  1747. <line text="M1 at execution(void C.m())"/>
  1748. <line text="M2 at execution(void C.m())"/>
  1749. <line text="M3 at execution(void C.m())"/>
  1750. <line text="C.m() running"/>
  1751. </stderr>
  1752. </run>
  1753. </ajc-test>
  1754. <ajc-test dir="java5/annotations/declare" title="declare @type - complex decp decAtType interactions - source weaving">
  1755. <compile files="BaseTypes.java,DecaTypeBin7.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties"/>
  1756. <run class="BaseTypes">
  1757. <stderr>
  1758. <line text="Color identified on execution(void A.m())"/>
  1759. <line text="Fruit identified on execution(void A.m())"/>
  1760. <line text="Chocolate identified on execution(void A.m())"/>
  1761. <line text="M1 at execution(void A.m())"/>
  1762. <line text="M2 at execution(void A.m())"/>
  1763. <line text="M3 at execution(void A.m())"/>
  1764. <line text="A.m() running"/>
  1765. <line text="Fruit identified on execution(void B.m())"/>
  1766. <line text="Chocolate identified on execution(void B.m())"/>
  1767. <line text="M1 at execution(void B.m())"/>
  1768. <line text="M2 at execution(void B.m())"/>
  1769. <line text="M3 at execution(void B.m())"/>
  1770. <line text="B.m() running"/>
  1771. <line text="Fruit identified on execution(void C.m())"/>
  1772. <line text="Chocolate identified on execution(void C.m())"/>
  1773. <line text="M1 at execution(void C.m())"/>
  1774. <line text="M2 at execution(void C.m())"/>
  1775. <line text="M3 at execution(void C.m())"/>
  1776. <line text="C.m() running"/>
  1777. </stderr>
  1778. </run>
  1779. </ajc-test>
  1780. <ajc-test dir="java5/annotations/declare" title="declare @type - trying to put annotation targetting annos on normal types - source weaving">
  1781. <compile files="BaseTypes.java,DecaTypeBin8.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties">
  1782. <message kind="error" line="8" text="A is not a valid target for annotation ColorA"/>
  1783. </compile>
  1784. </ajc-test>
  1785. <ajc-test dir="java5/annotations/declare" title="declare @type - trying to put annotation targetting annos on normal types - binary weaving">
  1786. <weave classesFiles="BaseTypes.java" aspectsFiles="DecaTypeBin8.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties">
  1787. <message kind="error" line="8" text="A is not a valid target for annotation ColorA"/>
  1788. </weave>
  1789. </ajc-test>
  1790. <ajc-test dir="java5/annotations/declare" title="declare @type - trying to put annotation targetting annos on normal types (uses pattern) - source weaving">
  1791. <compile files="BaseTypes.java,DecaTypeBin9.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties">
  1792. <message kind="warning" line="8" text="A is not a valid target for annotation ColorA"/>
  1793. </compile>
  1794. </ajc-test>
  1795. <ajc-test dir="java5/annotations/declare" title="declare @type - trying to put annotation targetting annos on normal types (uses pattern) - binary weaving">
  1796. <weave classesFiles="BaseTypes.java" aspectsFiles="DecaTypeBin9.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties">
  1797. <message kind="warning" line="8" text="A is not a valid target for annotation ColorA"/>
  1798. </weave>
  1799. </ajc-test>
  1800. <ajc-test dir="java5/annotations/declare" title="declare @type - covering enum and class element values - source weaving">
  1801. <compile files="EnumAndClassValues.aj,FunkyAnnotations.java" options="-1.5" xlintfile="ignoreTypeNotExposed.properties"/>
  1802. <run class="FunkyAnnotations">
  1803. <stderr>
  1804. <line text="hello world"/>
  1805. </stderr>
  1806. </run>
  1807. </ajc-test>
  1808. <ajc-test dir="java5/annotations/declare" title="declare @type - covering enum and class element values - binary weaving">
  1809. <weave aspectsFiles="EnumAndClassValues.aj" classesFiles="FunkyAnnotations.java" options="-1.5" xlintfile="ignoreTypeNotExposed.properties"/>
  1810. <run class="FunkyAnnotations">
  1811. <stderr>
  1812. <line text="advice running: Red"/>
  1813. <line text="advice running: class java.lang.Integer"/>
  1814. <line text="method running"/>
  1815. </stderr>
  1816. </run>
  1817. </ajc-test>
  1818. <!-- ======================================================================================= -->
  1819. <!-- declare annotation (@field) -->
  1820. <!-- ======================================================================================= -->
  1821. <ajc-test dir="java5/annotations/declare/atfield" title="declare @field - simple source weaving">
  1822. <compile files="Base.java,Colored.java,AtField1.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties"/>
  1823. <run class="Base">
  1824. <stderr>
  1825. <line text="Colored field access at set(int Base.publicIntField)"/>
  1826. </stderr>
  1827. </run>
  1828. </ajc-test>
  1829. <ajc-test dir="java5/annotations/declare/atfield" title="declare @field - simple binary weaving">
  1830. <weave classesFiles="Base.java,Colored.java" aspectsFiles="AtField1.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties"/>
  1831. <run class="Base">
  1832. <stderr>
  1833. <line text="Colored field access at set(int Base.publicIntField)"/>
  1834. </stderr>
  1835. </run>
  1836. </ajc-test>
  1837. <ajc-test dir="java5/annotations/declare/atfield" title="declare @field - two the same on one - source weaving">
  1838. <compile files="Base.java,Colored.java,TwoOnOneField.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties">
  1839. <message kind="warning" text="int Base.publicIntField - already has an annotation of type Colored"/>
  1840. </compile>
  1841. <run class="Base">
  1842. <stderr>
  1843. <line text="Colored field access at set(int Base.publicIntField)"/>
  1844. </stderr>
  1845. </run>
  1846. </ajc-test>
  1847. <ajc-test dir="java5/annotations/declare/atfield" title="declare @field - two the same on one - binary weaving">
  1848. <weave classesFiles="Base.java,Colored.java" aspectsFiles="TwoOnOneField.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties">
  1849. <message kind="warning" text="int Base.publicIntField - already has an annotation of type Colored"/>
  1850. </weave>
  1851. <run class="Base">
  1852. <stderr>
  1853. <line text="Colored field access at set(int Base.publicIntField)"/>
  1854. </stderr>
  1855. </run>
  1856. </ajc-test>
  1857. <ajc-test dir="java5/annotations/declare/atfield" title="declare @field - two different on one - source weaving">
  1858. <compile files="Base.java,Colored.java,Fruit.java,TwoOnOneField2.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties">
  1859. </compile>
  1860. <run class="Base">
  1861. <stderr>
  1862. <line text="Colored field access at set(int Base.publicIntField)"/>
  1863. <line text="Fruit field access at set(int Base.publicIntField)"/>
  1864. </stderr>
  1865. </run>
  1866. </ajc-test>
  1867. <ajc-test dir="java5/annotations/declare/atfield" title="declare @field - two different on one - binary weaving">
  1868. <weave classesFiles="Base.java,Colored.java,Fruit.java" aspectsFiles="TwoOnOneField2.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties">
  1869. </weave>
  1870. <run class="Base">
  1871. <stderr>
  1872. <line text="Colored field access at set(int Base.publicIntField)"/>
  1873. <line text="Fruit field access at set(int Base.publicIntField)"/>
  1874. </stderr>
  1875. </run>
  1876. </ajc-test>
  1877. <ajc-test dir="java5/annotations/declare/atfield" title="declare @field - wrong target - source weaving">
  1878. <compile files="Base.java,Colored.java,WrongTarget.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties">
  1879. <message kind="error" line="8" text="The annotation @MethodColoring is disallowed for this location"/>
  1880. <message kind="error" line="9" text="The annotation @TypeColoring is disallowed for this location"/>
  1881. </compile>
  1882. </ajc-test>
  1883. <ajc-test dir="java5/annotations/declare/atfield" title="declare @field - right target - source weaving">
  1884. <compile files="Base.java,Colored.java,RightTarget.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties"/>
  1885. <run class="Base">
  1886. <stderr>
  1887. <line text="Colored field access at set(int Base.publicIntField)"/>
  1888. </stderr>
  1889. </run>
  1890. </ajc-test>
  1891. <ajc-test dir="java5/annotations/declare/atfield" title="declare @field - right target - binary weaving">
  1892. <weave classesFiles="Base.java,Colored.java" aspectsFiles="RightTarget.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties"/>
  1893. <run class="Base">
  1894. <stderr>
  1895. <line text="Colored field access at set(int Base.publicIntField)"/>
  1896. </stderr>
  1897. </run>
  1898. </ajc-test>
  1899. <ajc-test dir="java5/annotations/declare/atfield" title="declare @field - recursive application - source weaving">
  1900. <compile files="Base.java,Colored.java,Fruit.java,RecursiveFields.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties"/>
  1901. <run class="Base">
  1902. <stderr>
  1903. <line text="Fruit field access at set(int Base.publicIntField)"/>
  1904. </stderr>
  1905. </run>
  1906. </ajc-test>
  1907. <ajc-test dir="java5/annotations/declare/atfield" title="declare @field - recursive application - binary weaving">
  1908. <weave classesFiles="Base.java,Colored.java,Fruit.java" aspectsFiles="RecursiveFields.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties"/>
  1909. <run class="Base">
  1910. <stderr>
  1911. <line text="Fruit field access at set(int Base.publicIntField)"/>
  1912. </stderr>
  1913. </run>
  1914. </ajc-test>
  1915. <ajc-test dir="java5/annotations/declare/atfield" title="declare @field - recursive application (other order) - source weaving">
  1916. <compile files="Base.java,Colored.java,Fruit.java,RecursiveFields2.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties"/>
  1917. <run class="Base">
  1918. <stderr>
  1919. <line text="Fruit field access at set(int Base.publicIntField)"/>
  1920. </stderr>
  1921. </run>
  1922. </ajc-test>
  1923. <ajc-test dir="java5/annotations/declare/atfield" title="declare @field - recursive application (other order) - binary weaving">
  1924. <weave classesFiles="Base.java,Colored.java,Fruit.java" aspectsFiles="RecursiveFields2.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties"/>
  1925. <run class="Base">
  1926. <stderr>
  1927. <line text="Fruit field access at set(int Base.publicIntField)"/>
  1928. </stderr>
  1929. </run>
  1930. </ajc-test>
  1931. <!-- incorrect target type for annotation on field -->
  1932. <!-- incorrect target type for annotation on method -->
  1933. <!-- two annotations on one method -->
  1934. <!-- two of the same annotation on one method - error -->
  1935. <!-- two of the same on one using pattern spec - lint -->
  1936. <!-- need some incorrect signatures in the declare @statements - e.g. declare @constructor: public Base(int): XXX; will blow things up as it uses Base rather than new -->
  1937. <!-- incorrect target type for annotation on ctor -->
  1938. <!-- two annotations on one ctor -->
  1939. <!-- two of the same annotation on one ctor - error -->
  1940. <!-- two of the same on one using pattern spec - lint -->
  1941. <ajc-test dir="java5/annotations/declare/atmethodctor" title="declare @method - simple source weaving">
  1942. <compile files="Base.java,Colored.java,AtMethod1.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties"/>
  1943. <run class="Base">
  1944. <stderr>
  1945. <line text="Colored method invocation at call(void Base.m1())"/>
  1946. <line text="m1() running"/>
  1947. <line text="m2() running"/>
  1948. <line text="m3() running"/>
  1949. </stderr>
  1950. </run>
  1951. </ajc-test>
  1952. <ajc-test dir="java5/annotations/declare/atmethodctor" title="declare @method - simple binary weaving">
  1953. <weave classesFiles="Base.java,Colored.java" aspectsFiles="AtMethod1.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties"/>
  1954. <run class="Base">
  1955. <stderr>
  1956. <line text="Colored method invocation at call(void Base.m1())"/>
  1957. <line text="m1() running"/>
  1958. <line text="m2() running"/>
  1959. <line text="m3() running"/>
  1960. </stderr>
  1961. </run>
  1962. </ajc-test>
  1963. <ajc-test dir="java5/annotations/declare/atmethodctor" title="declare @constructor - simple source weaving">
  1964. <compile files="Base.java,Colored.java,AtCtor1.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties"/>
  1965. <run class="Base">
  1966. <stderr>
  1967. <line text="Colored constructor invocation at call(Base(int))"/>
  1968. <line text="m1() running"/>
  1969. <line text="m2() running"/>
  1970. <line text="m3() running"/>
  1971. </stderr>
  1972. </run>
  1973. </ajc-test>
  1974. <ajc-test dir="java5/annotations/declare/atmethodctor" title="declare @constructor - simple binary weaving">
  1975. <weave classesFiles="Base.java,Colored.java" aspectsFiles="AtCtor1.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties"/>
  1976. <run class="Base">
  1977. <stderr>
  1978. <line text="Colored constructor invocation at call(Base(int))"/>
  1979. <line text="m1() running"/>
  1980. <line text="m2() running"/>
  1981. <line text="m3() running"/>
  1982. </stderr>
  1983. </run>
  1984. </ajc-test>
  1985. <!-- These tests verify both @method and @ctor behavior - they are so similar it is OK to have them together... -->
  1986. <ajc-test dir="java5/annotations/declare/atmethodctor" title="declare @method @ctor - wrong target - source weaving">
  1987. <compile files="Base.java,Colored.java,WrongTarget.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties">
  1988. <message kind="error" line="8" text="The annotation @MethodColoring is disallowed for this location"/>
  1989. <message kind="error" line="9" text="The annotation @TypeColoring is disallowed for this location"/>
  1990. <message kind="error" line="10" text="The annotation @MethodColoring is disallowed for this location"/>
  1991. <message kind="error" line="11" text="The annotation @TypeColoring is disallowed for this location"/>
  1992. </compile>
  1993. </ajc-test>
  1994. <ajc-test dir="java5/annotations/declare/atmethodctor" title="declare @method @ctor - right target - source weaving">
  1995. <compile files="Base.java,Colored.java,RightTarget.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties"/>
  1996. <run class="Base">
  1997. <stderr>
  1998. <line text="Colored ctor call at call(Base(int))"/>
  1999. <line text="Colored method call at call(void Base.m1())"/>
  2000. <line text="m1() running"/>
  2001. <line text="m2() running"/>
  2002. <line text="m3() running"/>
  2003. </stderr>
  2004. </run>
  2005. </ajc-test>
  2006. <ajc-test dir="java5/annotations/declare/atmethodctor" title="declare @method @ctor - right target - binary weaving">
  2007. <weave classesFiles="Base.java,Colored.java" aspectsFiles="RightTarget.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties"/>
  2008. <run class="Base">
  2009. <stderr>
  2010. <line text="Colored ctor call at call(Base(int))"/>
  2011. <line text="Colored method call at call(void Base.m1())"/>
  2012. <line text="m1() running"/>
  2013. <line text="m2() running"/>
  2014. <line text="m3() running"/>
  2015. </stderr>
  2016. </run>
  2017. </ajc-test>
  2018. <!-- check @method/@ctor/@field recursively applying, can only happen if a pattern for one of them includes an annotation -->
  2019. <ajc-test dir="java5/annotations/declare/atmethodctor" title="declare @method @ctor - two the same on one - source weaving">
  2020. <compile files="Base.java,Colored.java,TwoOnOneMember.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties">
  2021. <message kind="warning" text="void Base.m1() - already has an annotation of type Colored"/>
  2022. <message kind="warning" text="void Base.&lt;init&gt;(int) - already has an annotation of type Colored"/>
  2023. </compile>
  2024. </ajc-test>
  2025. <ajc-test dir="java5/annotations/declare/atmethodctor" title="declare @method @ctor - two the same on one - binary weaving">
  2026. <weave classesFiles="Base.java,Colored.java" aspectsFiles="TwoOnOneMember.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties">
  2027. <message kind="warning" text="void Base.m1() - already has an annotation of type Colored"/>
  2028. <message kind="warning" text="void Base.&lt;init&gt;(int) - already has an annotation of type Colored"/>
  2029. </weave>
  2030. </ajc-test>
  2031. <ajc-test dir="java5/annotations/declare/atmethodctor" title="declare @method @ctor - two different on one - source weaving">
  2032. <compile files="Base.java,Colored.java,Fruit.java,TwoOnOneMember2.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties">
  2033. </compile>
  2034. <run class="Base">
  2035. <stderr>
  2036. <line text="Colored ctor call at Base.java:11"/>
  2037. <line text="Fruit ctor call at Base.java:11"/>
  2038. <line text="Colored method call at Base.java:15"/>
  2039. <line text="Fruit method call at Base.java:15"/>
  2040. <line text="m1() running"/>
  2041. <line text="m2() running"/>
  2042. <line text="m3() running"/>
  2043. </stderr>
  2044. </run>
  2045. </ajc-test>
  2046. <ajc-test dir="java5/annotations/declare/atmethodctor" title="declare @method @ctor - two different on one - binary weaving">
  2047. <weave classesFiles="Base.java,Colored.java,Fruit.java" aspectsFiles="TwoOnOneMember2.aj" options="-1.5" xlintfile="ignoreTypeNotExposed.properties">
  2048. </weave>
  2049. <run class="Base">
  2050. <stderr>
  2051. <line text="Colored ctor call at Base.java:11"/>
  2052. <line text="Fruit ctor call at Base.java:11"/>
  2053. <line text="Colored method call at Base.java:15"/>
  2054. <line text="Fruit method call at Base.java:15"/>
  2055. <line text="m1() running"/>
  2056. <line text="m2() running"/>
  2057. <line text="m3() running"/>
  2058. </stderr>
  2059. </run>
  2060. </ajc-test>
  2061. <ajc-test dir="java5/annotations/declare" title="declare all annotations on one class - source weaving">
  2062. <compile files="DeathByAnnotations.aj" options="-1.5,-emacssym" xlintfile="ignoreTypeNotExposed.properties"/>
  2063. <run class="p.q.DeathByAnnotations"/>
  2064. </ajc-test>
  2065. <!-- ======================================================================================= -->
  2066. <!-- annotation binding with ITDs -->
  2067. <!-- ======================================================================================= -->
  2068. <ajc-test dir="java5/annotations/binding" title="simple binding annotation values where itd method is annotated">
  2069. <compile files="BindingWithAnnotatedItds1.aj" options="-1.5"/>
  2070. <run class="BindingWithAnnotatedItds1">
  2071. <stderr>
  2072. <line text="Found apple at jp execution(int A.m()) (BindingWithAnnotatedItds1.aj:8)"/>
  2073. </stderr>
  2074. </run>
  2075. </ajc-test>
  2076. <ajc-test dir="java5/annotations/binding" title="simple binding annotation values where itd field is annotated">
  2077. <compile files="BindingWithAnnotatedItds2.aj" options="-1.5"/>
  2078. <run class="BindingWithAnnotatedItds2">
  2079. <stderr>
  2080. <line text="Found banana at jp set(int A.i) (BindingWithAnnotatedItds2.aj:16)"/>
  2081. <line text="Found apple at jp set(String A.j) (BindingWithAnnotatedItds2.aj:17)"/>
  2082. <line text="Found orange at jp set(int[] A.k) (BindingWithAnnotatedItds2.aj:18)"/>
  2083. </stderr>
  2084. </run>
  2085. </ajc-test>
  2086. <ajc-test dir="java5/annotations/binding" title="simple binding annotation values where itd ctor is annotated">
  2087. <compile files="BindingWithAnnotatedItds3.aj" options="-1.5"/>
  2088. <run class="BindingWithAnnotatedItds3">
  2089. <stderr>
  2090. <line text="Found pear at jp execution(A(String)) (BindingWithAnnotatedItds3.aj:8)"/>
  2091. <line text="Found orange at jp execution(A(int)) (BindingWithAnnotatedItds3.aj:10)"/>
  2092. <line text="Found tomato at jp execution(A(boolean)) (BindingWithAnnotatedItds3.aj:12)"/>
  2093. </stderr>
  2094. </run>
  2095. </ajc-test>
  2096. <!-- ======================================================================================= -->
  2097. <!-- declare annotation targetting ITDs -->
  2098. <!-- ======================================================================================= -->
  2099. <ajc-test dir="java5/annotations/binding" title="simple binding annotation values where itd method is annotated via declare">
  2100. <compile files="BindingWithDeclaredAnnotationItds1.aj" options="-1.5,-emacssym"/>
  2101. <run class="BindingWithDeclaredAnnotationItds1">
  2102. <stderr>
  2103. <line text="Found orange at jp call(int A.m()) (BindingWithDeclaredAnnotationItds1.aj:16)"/>
  2104. <line text="Found orange at jp execution(int A.m()) (BindingWithDeclaredAnnotationItds1.aj:8)"/>
  2105. <line text="Found banana at jp call(int A.n()) (BindingWithDeclaredAnnotationItds1.aj:17)"/>
  2106. <line text="Found banana at jp execution(int A.n()) (BindingWithDeclaredAnnotationItds1.aj:10)"/>
  2107. <line text="Found tomato at jp call(int A.o()) (BindingWithDeclaredAnnotationItds1.aj:18)"/>
  2108. <line text="Found tomato at jp execution(int A.o()) (BindingWithDeclaredAnnotationItds1.aj:12)"/>
  2109. </stderr>
  2110. </run>
  2111. </ajc-test>
  2112. <ajc-test dir="java5/annotations/binding" title="simple binding annotation values where itd field is annotated via declare">
  2113. <compile files="BindingWithDeclaredAnnotationItds2.aj" options="-1.5,-emacssym"/>
  2114. <run class="BindingWithDeclaredAnnotationItds2">
  2115. <stderr>
  2116. <line text="Found orange at jp set(int A.i) (BindingWithDeclaredAnnotationItds2.aj:16)"/>
  2117. <line text="Found banana at jp set(String A.j) (BindingWithDeclaredAnnotationItds2.aj:17)"/>
  2118. <line text="Found apple at jp set(boolean[] A.k) (BindingWithDeclaredAnnotationItds2.aj:18)"/>
  2119. </stderr>
  2120. </run>
  2121. </ajc-test>
  2122. <ajc-test dir="java5/annotations/binding" title="simple binding annotation values where itd field is annotated multiple times via declare">
  2123. <compile files="BindingWithDeclaredAnnotationItds3.aj" options="-1.5,-emacssym"/>
  2124. <run class="BindingWithDeclaredAnnotationItds3">
  2125. <stderr>
  2126. <line text="Found fruit orange at jp set(int A.i) (BindingWithDeclaredAnnotationItds3.aj:13)"/>
  2127. <line text="Found drink margarita at jp set(int A.i) (BindingWithDeclaredAnnotationItds3.aj:13)"/>
  2128. </stderr>
  2129. </run>
  2130. </ajc-test>
  2131. <ajc-test dir="java5/annotations/binding" title="simple binding annotation values where itd ctor is annotated via declare">
  2132. <compile files="BindingWithDeclaredAnnotationItds4.aj" options="-1.5,-emacssym"/>
  2133. <run class="BindingWithDeclaredAnnotationItds4">
  2134. <stderr>
  2135. <line text="Found pear at jp execution(A(String)) (BindingWithDeclaredAnnotationItds4.aj:8)"/>
  2136. <line text="Found orange at jp execution(A(int)) (BindingWithDeclaredAnnotationItds4.aj:10)"/>
  2137. <line text="Found tomato at jp execution(A(boolean)) (BindingWithDeclaredAnnotationItds4.aj:12)"/>
  2138. </stderr>
  2139. </run>
  2140. </ajc-test>
  2141. <!-- ============================================================== -->
  2142. <ajc-test dir="options/aspectpath" title="dirs on aspectpath">
  2143. <compile files="MyAspect.aj" options="-d out"/>
  2144. <compile files="MyClass.java" options="-aspectpath out">
  2145. <message kind="warning" line="3" text="a method"/>
  2146. </compile>
  2147. </ajc-test>
  2148. <!-- ============================================================== -->
  2149. <!-- Start of generics tests -->
  2150. <!-- ============================================================== -->
  2151. <ajc-test dir="java5/generics" title="ITD with parameterized type" vm="1.5">
  2152. <compile files="ITDReturningParameterizedType.aj" options="-1.5"/>
  2153. <run class="ITDReturningParameterizedType"/>
  2154. </ajc-test>
  2155. <ajc-test dir="java5/annotations/binding/bugs" title="AtArgs causes a VerifyError: Unable to pop operand off an empty stack" vm="1.5">
  2156. <compile files="Test3.java" options="-1.5"/>
  2157. <run class="Test3"/>
  2158. </ajc-test>
  2159. <ajc-test dir="java5/generics/bugs/pr91267" title="NPE using generic methods in aspects 1" vm="1.5">
  2160. <compile files="TestBug1.aj" options="-1.5"/>
  2161. <run class="TestBug1"/>
  2162. </ajc-test>
  2163. <ajc-test dir="java5/generics/bugs/pr91267" title="NPE using generic methods in aspects 2" vm="1.5">
  2164. <compile files="TestBug2.aj" options="-1.5"/>
  2165. <run class="TestBug2"/>
  2166. </ajc-test>
  2167. <ajc-test dir="java5/generics/bugs" title="Generics problem with Set" vm="1.5">
  2168. <compile files="PR91053.aj" options="-1.5"/>
  2169. <run class="PR91053"/>
  2170. </ajc-test>
  2171. <ajc-test dir="java5/generics/bugs" title="Compilation error on generic member introduction" vm="1.5">
  2172. <compile files="PR87282.aj" options="-1.5"/>
  2173. </ajc-test>
  2174. <ajc-test dir="java5/generics/bugs" title="Parameterized types on introduced fields not correctly recognized" vm="1.5">
  2175. <compile files="PR88606.aj" options="-1.5"/>
  2176. </ajc-test>
  2177. <ajc-test dir="bugs150" title="enum called Enum, annotation called Annotation, etc">
  2178. <compile files="PR90827.aj" options="-1.5"/>
  2179. </ajc-test>
  2180. <ajc-test dir="bugs150" title="Internal compiler error">
  2181. <compile files="PR86832.aj" options="-1.5"/>
  2182. </ajc-test>
  2183. <ajc-test dir="bugs150" title="Exploding compile time with if() statements in pointcut">
  2184. <compile files="PR94086.aj" options="-1.5"/>
  2185. </ajc-test>
  2186. <!-- generic bugs -->
  2187. <ajc-test dir="java5/generics/bugs" title="ITD method with generic arg">
  2188. <compile files="PR97763.aj" options="-1.5"/>
  2189. <run class="PR97763">
  2190. <stderr>
  2191. <line text="Number of entries=2"/>
  2192. </stderr>
  2193. </run>
  2194. </ajc-test>
  2195. <ajc-test dir="bugs150" title="NPE at ClassScope.java:660 when compiling generic class">
  2196. <compile files="PR95993.java" options="-1.5"/>
  2197. </ajc-test>
  2198. <ajc-test dir="java5/generics/bugs" title="Problems resolving type name inside generic class">
  2199. <compile files="PR95992.java" options="-1.5"/>
  2200. </ajc-test>
  2201. <ajc-test dir="bugs150" pr="100227" title="inner class with generic enclosing class">
  2202. <compile files="pr100227.aj" options="-1.5"/>
  2203. <run class="pr100227">
  2204. <stderr>
  2205. <line text="Outer.Inner.inner=2"/>
  2206. <line text="Outer.Inner.p() executing"/>
  2207. <line text="Generic_Outer.Inner.inner=4"/>
  2208. <line text="Generic_Outer.Inner.p() executing"/>
  2209. </stderr>
  2210. </run>
  2211. </ajc-test>
  2212. <ajc-test dir="bugs150" pr="100260" title="methods inherited from a generic parent">
  2213. <compile files="pr100260.aj" options="-1.5"/>
  2214. <run class="pr100260"/>
  2215. </ajc-test>
  2216. <!-- end of generic bugs -->
  2217. <!-- generic aspects -->
  2218. <ajc-test dir="java5/generics/genericaspects" title="generic aspects - 1">
  2219. <compile files="GenericAspect1.aj" options="-1.5">
  2220. <message kind="error" line="2" text="only abstract aspects can have type parameters"/>
  2221. </compile>
  2222. </ajc-test>
  2223. <ajc-test dir="java5/generics/genericaspects" title="generic aspects - 2">
  2224. <compile files="GenericAspect2.aj" options="-1.5">
  2225. <message kind="error" line="9" text="a generic super-aspect must be fully parameterized in an extends clause"/>
  2226. </compile>
  2227. </ajc-test>
  2228. <ajc-test dir="java5/generics/genericaspects" title="generic aspects - 3">
  2229. <compile files="GenericAspect3.aj" options="-1.5"/>
  2230. <run class="GenericAspect3">
  2231. <stderr>
  2232. <line text="A"/>
  2233. <line text="B"/>
  2234. </stderr>
  2235. </run>
  2236. </ajc-test>
  2237. <ajc-test dir="java5/generics/genericaspects" title="generic aspects - 4">
  2238. <compile files="ParentChildRelationship.aj" options="-1.5"/>
  2239. </ajc-test>
  2240. <ajc-test dir="java5/generics/genericaspects" title="generic aspect with declare warning using type vars">
  2241. <compile files="DeclareWarningInGenericAspect.aj" options="-1.5">
  2242. <message kind="warning" line="16" text="this method takes a T!"/>
  2243. </compile>
  2244. </ajc-test>
  2245. <ajc-test dir="java5/generics/genericaspects" title="generic aspect with execution advice using type vars">
  2246. <compile files="ExecutionAdviceInGenericAspect.aj" options="-1.5">
  2247. </compile>
  2248. <run class="ExecutionAdviceInGenericAspect">
  2249. <stdout>
  2250. <line text="I matched at execution(void C.foo(String))"/>
  2251. </stdout>
  2252. </run>
  2253. </ajc-test>
  2254. <ajc-test dir="java5/generics/genericaspects" title="generic aspect with anonymous pointcut">
  2255. <compile files="AnonymousPointcutInGenericAspect.aj" options="-1.5">
  2256. </compile>
  2257. <run class="AnonymousPointcutInGenericAspect">
  2258. <stdout>
  2259. <line text="I matched at execution(void C.foo(String))"/>
  2260. </stdout>
  2261. </run>
  2262. </ajc-test>
  2263. <ajc-test dir="java5/generics/genericaspects" title="generic aspect declare parents">
  2264. <compile files="DeclareParentsWithTypeVars.aj" options="-1.5">
  2265. </compile>
  2266. <run class="DeclareParentsWithTypeVars">
  2267. </run>
  2268. </ajc-test>
  2269. <ajc-test dir="java5/generics/genericaspects" title="generic aspect declare soft">
  2270. <compile files="DeclareSoftWithTypeVars.aj" options="-1.5">
  2271. </compile>
  2272. <run class="DeclareSoftWithTypeVars">
  2273. <stderr>
  2274. <line text="handled exception: io, io, it's off to work we go..."/>
  2275. <line text="Successfully converted to domain exception"/>
  2276. </stderr>
  2277. </run>
  2278. </ajc-test>
  2279. <!-- ajdk example -->
  2280. <ajc-test dir="java5/generics/genericaspects" title="generic aspects - 5 (ajdk)">
  2281. <compile files="Blob.java,BlobContainment.aj,ParentChildRelationship.aj" options="-1.5"/>
  2282. <run class="BlobContainment"/>
  2283. </ajc-test>
  2284. <!-- end of generic aspects -->
  2285. <!-- generic ITDs -->
  2286. <ajc-test dir="java5/generics/itds" title="ITDs on generic type">
  2287. <compile files="Parse5.java" options="-1.5">
  2288. <message kind="error" line="9"/>
  2289. <message kind="error" line="11"/>
  2290. <message kind="error" line="13"/>
  2291. <message kind="error" line="15"/>
  2292. </compile>
  2293. </ajc-test>
  2294. <ajc-test dir="java5/generics/itds" title="itd of non static member">
  2295. <compile files="A.java" options="-1.5"/>
  2296. <run class="A">
  2297. <stderr>
  2298. <line text="min(2,4)=>2"/>
  2299. <line text="max(2,4)=>4"/>
  2300. </stderr>
  2301. </run>
  2302. </ajc-test>
  2303. <ajc-test dir="java5/generics/itds" title="itd of static member">
  2304. <compile files="B.java" options="-1.5"/>
  2305. <run class="B">
  2306. <stderr>
  2307. <line text="min(2,4)=>2"/>
  2308. <line text="max(2,4)=>4"/>
  2309. </stderr>
  2310. </run>
  2311. </ajc-test>
  2312. <ajc-test dir="java5/generics/itds" title="itd using type parameter">
  2313. <compile files="C.java" options="-1.5"/>
  2314. <run class="C">
  2315. <stderr>
  2316. <line text="fillthisin..."/>
  2317. </stderr>
  2318. </run>
  2319. </ajc-test>
  2320. <ajc-test dir="java5/generics/itds" title="itd incorrectly using type parameter">
  2321. <compile files="D.java" options="-1.5"/>
  2322. <run class="D">
  2323. <stderr>
  2324. <line text="fillthisin..."/>
  2325. </stderr>
  2326. </run>
  2327. </ajc-test>
  2328. <ajc-test dir="java5/generics/itds" title="static generic method itd">
  2329. <compile files="StaticGenericMethodITD.aj" options="-1.5"/>
  2330. <run class="StaticGenericMethodITD">
  2331. <stderr>
  2332. <line text="First=10"/>
  2333. </stderr>
  2334. </run>
  2335. </ajc-test>
  2336. <ajc-test dir="java5/generics/itds" title="generic ctor itd - 1">
  2337. <compile files="GenericCtorITD1.aj" options="-1.5"/>
  2338. <run class="GenericCtorITD1"/>
  2339. </ajc-test>
  2340. <ajc-test dir="java5/generics/itds" title="generic ctor itd - 2">
  2341. <compile files="GenericCtorITD2.aj" options="-1.5"/>
  2342. <run class="GenericCtorITD2"/>
  2343. </ajc-test>
  2344. <ajc-test dir="java5/generics/itds" title="generic ctor itd - 3">
  2345. <compile files="GenericCtorITD3.aj" options="-1.5"/>
  2346. <run class="GenericCtorITD3"/>
  2347. </ajc-test>
  2348. <ajc-test dir="java5/generics/itds" title="parameterized method itd - 1">
  2349. <compile files="ParameterizedMethodITD1.aj" options="-1.5"/>
  2350. <run class="ParameterizedMethodITD1"/>
  2351. </ajc-test>
  2352. <ajc-test dir="java5/generics/itds" title="parameterized method itd - 2">
  2353. <compile files="ParameterizedMethodITD2.aj" options="-1.5">
  2354. <message kind="error" line="9" text="The method simple(List&lt;? extends Number&gt;) in the type Base is not applicable for the arguments (List&lt;A&gt;)"/>
  2355. </compile>
  2356. </ajc-test>
  2357. <ajc-test dir="java5/generics/itds" title="parameterized method itd - 3">
  2358. <compile files="ParameterizedMethodITD3.aj" options="-1.5">
  2359. <message kind="error" line="9" text="The method simple(List&lt;? super A&gt;) in the type Base is not applicable for the arguments (List&lt;B&gt;)"/>
  2360. </compile>
  2361. </ajc-test>
  2362. <ajc-test dir="java5/generics/itds" title="parameterized method itd - 4">
  2363. <compile files="ParameterizedMethodITD4.aj" options="-1.5"/>
  2364. <run class="ParameterizedMethodITD4"/>
  2365. </ajc-test>
  2366. <ajc-test dir="java5/generics/itds" title="generic method itd - 1">
  2367. <compile files="GenericMethodITD1.aj" options="-1.5"/>
  2368. <run class="GenericMethodITD1"/>
  2369. </ajc-test>
  2370. <ajc-test dir="java5/generics/itds" title="generic method itd - 2">
  2371. <compile files="GenericMethodITD2.aj" options="-1.5">
  2372. <message kind="error" line="9" text="Bound mismatch: The generic method simple(List&lt;? extends E&gt;) of type Base is not applicable for the arguments (List&lt;A&gt;). The inferred type A is not a valid substitute for the bounded parameter &lt;E extends Number&gt;"/>
  2373. </compile>
  2374. </ajc-test>
  2375. <ajc-test dir="java5/generics/itds" title="generic method itd - 3">
  2376. <compile files="GenericMethodITD3.aj" options="-1.5"/>
  2377. <run class="GenericMethodITD3"/>
  2378. </ajc-test>
  2379. <ajc-test dir="java5/generics/itds" title="generic method itd - 4">
  2380. <compile files="GenericMethodITD4.aj" options="-1.5"/>
  2381. <run class="GenericMethodITD4"/>
  2382. </ajc-test>
  2383. <ajc-test dir="java5/generics/itds" title="generic method itd - 5">
  2384. <compile files="GenericMethodITD5.aj" options="-1.5">
  2385. <message kind="error" line="10" text="The method simple(List&lt;E&gt;, List&lt;E&gt;) in the type Base is not applicable for the arguments (List&lt;A&gt;, List&lt;B&gt;)"/>
  2386. </compile>
  2387. </ajc-test>
  2388. <ajc-test dir="java5/generics/itds" title="generic method itd - 6">
  2389. <compile files="GenericMethodITD6.aj" options="-1.5"/>
  2390. <run class="GenericMethodITD6"/>
  2391. </ajc-test>
  2392. <ajc-test dir="java5/generics/itds" title="generic method itd - 7">
  2393. <compile files="GenericMethodITD7.aj" options="-1.5"/>
  2394. <run class="GenericMethodITD7"/>
  2395. </ajc-test>
  2396. <ajc-test dir="java5/generics/itds" title="generic method itd - 8">
  2397. <compile files="GenericMethodITD8.aj" options="-1.5">
  2398. <message kind="error" line="10" text="The method simple(List&lt;E&gt;, List&lt;? extends E&gt;) in the type Base is not applicable for the arguments (List&lt;Number&gt;, List&lt;String&gt;)"/>
  2399. </compile>
  2400. </ajc-test>
  2401. <ajc-test dir="java5/generics/itds" title="generic method itd - 9">
  2402. <compile files="GenericMethodITD9.aj" options="-1.5"/>
  2403. <run class="GenericMethodITD9"/>
  2404. </ajc-test>
  2405. <ajc-test dir="java5/generics/itds" title="generic method itd - 10">
  2406. <compile files="GenericMethodITD10.aj" options="-1.5">
  2407. <message kind="error" line="10" text="Bound mismatch: The generic method crazy(List&lt;R&gt;) of type Base is not applicable for the arguments (List&lt;A&gt;). The inferred type A is not a valid substitute for the bounded parameter &lt;R extends Object &amp; Comparable&lt;? super R&gt;&gt;"/>
  2408. </compile>
  2409. </ajc-test>
  2410. <ajc-test dir="java5/generics/itds" title="generic method itd - 11">
  2411. <compile files="GenericMethodITD11.aj" options="-1.5"/>
  2412. <run class="GenericMethodITD11"/>
  2413. </ajc-test>
  2414. <ajc-test dir="java5/generics/itds" title="generic method itd - 12">
  2415. <compile files="GenericMethodITD12.aj" options="-1.5">
  2416. <message kind="error" line="10" text="Bound mismatch: The generic method crazy(List&lt;R&gt;) of type Base is not applicable for the arguments (List&lt;A&gt;). The inferred type A is not a valid substitute for the bounded parameter &lt;R extends Object &amp; Foo&lt;? extends R&gt;&gt;"/>
  2417. </compile>
  2418. </ajc-test>
  2419. <ajc-test dir="java5/generics/itds" title="generic method itd - 13">
  2420. <compile files="GenericMethodITD13.aj" options="-1.5"/>
  2421. <run class="GenericMethodITD13"/>
  2422. </ajc-test>
  2423. <ajc-test dir="java5/generics/itds" title="generic method itd - 14">
  2424. <compile files="GenericMethodITD14.aj" options="-1.5">
  2425. <message kind="error" line="10" text="Bound mismatch: The generic method crazy(List&lt;R&gt;) of type Base is not applicable for the arguments (List&lt;A&gt;). The inferred type A is not a valid substitute for the bounded parameter &lt;R extends Object &amp; Foo&lt;? super R&gt;&gt;"/>
  2426. </compile>
  2427. </ajc-test>
  2428. <ajc-test dir="java5/generics/itds" title="generic method itd - 15">
  2429. <compile files="GenericMethodITD15.aj" options="-1.5"/>
  2430. <run class="GenericMethodITD15"/>
  2431. </ajc-test>
  2432. <!-- visibility -->
  2433. <ajc-test dir="java5/generics/itds/visibility" title="public itds">
  2434. <compile files="PublicITDs.aj" options="-1.5"/>
  2435. <run class="PublicITDs"/>
  2436. </ajc-test>
  2437. <ajc-test dir="java5/generics/itds/visibility" title="private itds">
  2438. <compile files="PrivateITDs.aj" options="-1.5"/>
  2439. <run class="PrivateITDs"/>
  2440. </ajc-test>
  2441. <ajc-test dir="java5/generics/itds/visibility" title="package itds">
  2442. <compile files="PackageITDs.aj" options="-1.5"/>
  2443. <run class="PackageITDs"/>
  2444. </ajc-test>
  2445. <ajc-test dir="java5/generics/itds/visibility" title="public itds with errors">
  2446. <compile files="PublicITDsErrors.aj" options="-1.5">
  2447. <message kind="error" line="13" text="The method publicMethod2(List&lt;R&gt;, List&lt;R&gt;) in the type Base is not applicable for the arguments (List&lt;Double&gt;, List&lt;Float&gt;)"/>
  2448. <message kind="error" line="15" text="The constructor Base(List&lt;Double&gt;, Map&lt;Integer,String&gt;) is undefined"/>
  2449. </compile>
  2450. </ajc-test>
  2451. <!-- targetting different types -->
  2452. <ajc-test dir="java5/generics/itds/differingTargets" title="targetting interface">
  2453. <compile files="TargettingInterface.aj" options="-1.5"/>
  2454. <run class="TargettingInterface"/>
  2455. </ajc-test>
  2456. <ajc-test dir="java5/generics/itds/differingTargets" title="targetting aspect">
  2457. <compile files="TargettingAspect.aj" options="-1.5"/>
  2458. <run class="TargettingAspect"/>
  2459. </ajc-test>
  2460. <ajc-test dir="java5/generics/itds/differingTargets" title="targetting class">
  2461. <compile files="TargettingClass.aj" options="-1.5"/>
  2462. <run class="TargettingClass"/>
  2463. </ajc-test>
  2464. <!-- sharing type variables between the ITD and the generic type -->
  2465. <ajc-test dir="java5/generics/itds/sharing" title="field itd using type variable from target type - 1">
  2466. <compile files="FieldA.aj" options="-1.5"/>
  2467. <run class="FieldA"/>
  2468. </ajc-test>
  2469. <ajc-test dir="java5/generics/itds/sharing" title="field itd using type variable from target type - 2">
  2470. <compile files="FieldB.aj" options="-1.5">
  2471. <message kind="error" line="16" text="Incorrect number of type parameters supplied. The generic type Base&lt;N,M&gt; has 2 type parameters, not 1."/>
  2472. </compile>
  2473. </ajc-test>
  2474. <ajc-test dir="java5/generics/itds/sharing" title="field itd using type variable from target type - 3">
  2475. <compile files="FieldC.aj" options="-1.5"/>
  2476. <run class="FieldC"/>
  2477. </ajc-test>
  2478. <ajc-test dir="java5/generics/itds/sharing" title="field itd using type variable from target type - 4">
  2479. <compile files="FieldD.aj" options="-1.5"/>
  2480. <run class="FieldD"/>
  2481. </ajc-test>
  2482. <ajc-test dir="java5/generics/itds/sharing" title="field itd using type variable from target type - 5">
  2483. <compile files="FieldE.aj" options="-1.5"/>
  2484. <run class="FieldE"/>
  2485. </ajc-test>
  2486. <ajc-test dir="java5/generics/itds/sharing" title="field itd using type variable from target type - 6">
  2487. <compile files="FieldF.aj" options="-1.5"/>
  2488. <run class="FieldF"/>
  2489. </ajc-test>
  2490. <ajc-test dir="java5/generics/itds/sharing" title="field itd using type variable from target type - 7">
  2491. <compile files="FieldG.aj" options="-1.5"/>
  2492. <run class="FieldG"/>
  2493. </ajc-test>
  2494. <ajc-test dir="java5/generics/itds/sharing" title="field itd using type variable from target type - 8">
  2495. <compile files="FieldH.aj" options="-1.5"/>
  2496. <run class="FieldH"/>
  2497. </ajc-test>
  2498. <ajc-test dir="java5/generics/itds/sharing" title="field itd using type variable from target type - 9">
  2499. <compile files="FieldI.aj" options="-1.5">
  2500. <message kind="error" line="7" text="Type mismatch: cannot convert from List&lt;String&gt; to List&lt;Integer&gt;"/>
  2501. </compile>
  2502. </ajc-test>
  2503. <ajc-test dir="java5/generics/itds/sharing" title="field itd using type variable from target type -10">
  2504. <compile files="FieldJ.aj" options="-1.5"/>
  2505. <run class="FieldJ"/>
  2506. </ajc-test>
  2507. <ajc-test dir="java5/generics/itds/sharing" title="field itd using type variable from target type -11">
  2508. <compile files="FieldK.aj" options="-1.5"/>
  2509. <run class="FieldK"/>
  2510. </ajc-test>
  2511. <ajc-test dir="java5/generics/itds/sharing" title="field itd using type variable from target type -12">
  2512. <compile files="FieldL.aj" options="-1.5"/>
  2513. <run class="FieldL"/>
  2514. </ajc-test>
  2515. <ajc-test dir="java5/generics/itds/sharing" title="field itd using type variable from target type -13">
  2516. <compile files="FieldM.aj" options="-1.5"/>
  2517. <run class="FieldM"/>
  2518. </ajc-test>
  2519. <ajc-test dir="java5/generics/itds/sharing" title="field itd using type variable from target type -14">
  2520. <compile files="FieldN.aj" options="-1.5">
  2521. <message kind="error" line="11" text="Type parameters can not be specified in the ITD target type - the target type I is not generic."/>
  2522. </compile>
  2523. </ajc-test>
  2524. <ajc-test dir="java5/generics/itds/sharing" title="field itd using type variable from target type -15">
  2525. <compile files="FieldO.aj" options="-1.5">
  2526. <message kind="error" line="11" text="Intertype declarations can only be made on the generic type, not on a parameterized type. The name 'String' cannot be used as a type parameter, since it refers to a real type."/>
  2527. </compile>
  2528. </ajc-test>
  2529. <ajc-test dir="java5/generics/itds/sharing" title="field itd using type variable from target type -16">
  2530. <compile files="FieldP.aj" options="-1.5">
  2531. <message kind="error" line="10" text="static intertype field declarations cannot refer to type variables from the target generic type"/>
  2532. </compile>
  2533. </ajc-test>
  2534. <!-- Now intertype declared methods on generic types that use the target types type vars -->
  2535. <ajc-test dir="java5/generics/itds/sharing" title="method itd using type variable from target type - A1">
  2536. <compile files="MethodA.aj" options="-1.5"/>
  2537. <run class="MethodA"/>
  2538. </ajc-test>
  2539. <ajc-test dir="java5/generics/itds/sharing" title="method itd using type variable from target type - A2">
  2540. <compile files="MethodA2.aj" options="-1.5"/>
  2541. <run class="MethodA2"/>
  2542. </ajc-test>
  2543. <ajc-test dir="java5/generics/itds/sharing" title="method itd using type variable from target type - A3">
  2544. <compile files="MethodA3.aj" options="-1.5"/>
  2545. <run class="MethodA3"/>
  2546. </ajc-test>
  2547. <ajc-test dir="java5/generics/itds/sharing" title="method itd using type variable from target type - A4">
  2548. <compile files="MethodA4.aj" options="-1.5"/>
  2549. <run class="MethodA4"/>
  2550. </ajc-test>
  2551. <ajc-test dir="java5/generics/itds/sharing" title="method itd using type variable from target type - B1">
  2552. <compile files="MethodB.aj" options="-1.5">
  2553. <message kind="error" line="16" text="Incorrect number of type parameters supplied. The generic type Base&lt;N,M&gt; has 2 type parameters, not 1."/>
  2554. </compile>
  2555. </ajc-test>
  2556. <ajc-test dir="java5/generics/itds/sharing" title="method itd using type variable from target type - C1">
  2557. <compile files="MethodC.aj" options="-1.5"/>
  2558. <run class="MethodC"/>
  2559. </ajc-test>
  2560. <ajc-test dir="java5/generics/itds/sharing" title="method itd using type variable from target type - D1">
  2561. <compile files="MethodD.aj" options="-1.5"/>
  2562. <run class="MethodD"/>
  2563. </ajc-test>
  2564. <ajc-test dir="java5/generics/itds/sharing" title="method itd using type variable from target type - E1">
  2565. <compile files="MethodE.aj" options="-1.5"/>
  2566. <run class="MethodE"/>
  2567. </ajc-test>
  2568. <ajc-test dir="java5/generics/itds/sharing" title="method itd using type variable from target type - F1">
  2569. <compile files="MethodF.aj" options="-1.5"/>
  2570. <run class="MethodF"/>
  2571. </ajc-test>
  2572. <ajc-test dir="java5/generics/itds/sharing" title="method itd using type variable from target type - G1">
  2573. <compile files="MethodG.aj" options="-1.5"/>
  2574. <run class="MethodG"/>
  2575. </ajc-test>
  2576. <ajc-test dir="java5/generics/itds/sharing" title="method itd using type variable from target type - H1">
  2577. <compile files="MethodH.aj" options="-1.5"/>
  2578. <run class="MethodH"/>
  2579. </ajc-test>
  2580. <ajc-test dir="java5/generics/itds/sharing" title="method itd using type variable from target type - I1">
  2581. <compile files="MethodI.aj" options="-1.5">
  2582. <message kind="error" line="6" text="Type mismatch: cannot convert from List&lt;Integer&gt; to List&lt;String&gt;"/>
  2583. </compile>
  2584. </ajc-test>
  2585. <ajc-test dir="java5/generics/itds/sharing" title="method itd using type variable from target type - I2">
  2586. <compile files="MethodI2.aj" options="-1.5">
  2587. <message kind="error" line="7" text="The method m(List&lt;Integer&gt;) in the type Base&lt;N&gt; is not applicable for the arguments (List&lt;String&gt;)"/>
  2588. </compile>
  2589. </ajc-test>
  2590. <ajc-test dir="java5/generics/itds/sharing" title="method itd using type variable from target type - J1">
  2591. <compile files="MethodJ.aj" options="-1.5"/>
  2592. <run class="MethodJ"/>
  2593. </ajc-test>
  2594. <ajc-test dir="java5/generics/itds/sharing" title="method itd using type variable from target type - K1">
  2595. <compile files="MethodK.aj" options="-1.5"/>
  2596. <run class="MethodK"/>
  2597. </ajc-test>
  2598. <ajc-test dir="java5/generics/itds/sharing" title="method itd using type variable from target type - L1">
  2599. <compile files="MethodL.aj" options="-1.5"/>
  2600. <run class="MethodL"/>
  2601. </ajc-test>
  2602. <ajc-test dir="java5/generics/itds/sharing" title="method itd using type variable from target type - M1">
  2603. <compile files="MethodM.aj" options="-1.5"/>
  2604. <run class="MethodM"/>
  2605. </ajc-test>
  2606. <ajc-test dir="java5/generics/itds/sharing" title="method itd using type variable from target type - M2">
  2607. <compile files="MethodM2.aj" options="-1.5"/>
  2608. <run class="MethodM2"/>
  2609. </ajc-test>
  2610. <ajc-test dir="java5/generics/itds/sharing" title="method itd using type variable from target type - N1">
  2611. <compile files="MethodN.aj" options="-1.5">
  2612. <message kind="error" line="11" text="Type parameters can not be specified in the ITD target type - the target type I is not generic."/>
  2613. </compile>
  2614. </ajc-test>
  2615. <ajc-test dir="java5/generics/itds/sharing" title="method itd using type variable from target type - O1">
  2616. <compile files="MethodO.aj" options="-1.5">
  2617. <message kind="error" line="11" text="Intertype declarations can only be made on the generic type, not on a parameterized type. The name 'String' cannot be used as a type parameter, since it refers to a real type."/>
  2618. </compile>
  2619. </ajc-test>
  2620. <ajc-test dir="java5/generics/itds/sharing" title="method itd using type variable from target type - O2">
  2621. <compile files="MethodO2.aj" options="-1.5">
  2622. <message kind="error" line="11" text="Intertype declarations can only be made on the generic type, not on a parameterized type. The name 'String' cannot be used as a type parameter, since it refers to a real type."/>
  2623. </compile>
  2624. </ajc-test>
  2625. <ajc-test dir="java5/generics/itds/sharing" title="method itd using type variable from target type - P1">
  2626. <compile files="MethodP.aj" options="-1.5"/>
  2627. <run class="MethodP"/>
  2628. </ajc-test>
  2629. <ajc-test dir="java5/generics/itds/sharing" title="method itd using type variable from target type - Q1">
  2630. <compile files="MethodQ.aj" options="-1.5"/>
  2631. <run class="MethodQ"/>
  2632. </ajc-test>
  2633. <!-- Now intertype declared constructors on generic types that use the target types type vars -->
  2634. <ajc-test dir="java5/generics/itds/sharing" title="ctor itd using type variable from target type - A1">
  2635. <compile files="CtorA.aj" options="-1.5"/>
  2636. <run class="CtorA"/>
  2637. </ajc-test>
  2638. <ajc-test dir="java5/generics/itds/sharing" title="ctor itd using type variable from target type - B1">
  2639. <compile files="CtorB.aj" options="-1.5">
  2640. <message kind="error" line="15" text="Incorrect number of type parameters supplied. The generic type Base&lt;N,M&gt; has 2 type parameters, not 1."/>
  2641. </compile>
  2642. </ajc-test>
  2643. <ajc-test dir="java5/generics/itds/sharing" title="ctor itd using type variable from target type - C1">
  2644. <compile files="CtorC.aj" options="-1.5"/>
  2645. <run class="CtorC"/>
  2646. </ajc-test>
  2647. <ajc-test dir="java5/generics/itds/sharing" title="ctor itd using type variable from target type - D1">
  2648. <compile files="CtorD.aj" options="-1.5"/>
  2649. <run class="CtorD"/>
  2650. </ajc-test>
  2651. <ajc-test dir="java5/generics/itds/sharing" title="ctor itd using type variable from target type - E1">
  2652. <compile files="CtorE.aj" options="-1.5"/>
  2653. <run class="CtorE"/>
  2654. </ajc-test>
  2655. <ajc-test dir="java5/generics/itds/sharing" title="ctor itd using type variable from target type - F1">
  2656. <compile files="CtorF.aj" options="-1.5"/>
  2657. <run class="CtorF"/>
  2658. </ajc-test>
  2659. <ajc-test dir="java5/generics/itds/sharing" title="ctor itd using type variable from target type - G1">
  2660. <compile files="CtorG.aj" options="-1.5"/>
  2661. <run class="CtorG"/>
  2662. </ajc-test>
  2663. <ajc-test dir="java5/generics/itds/sharing" title="ctor itd using type variable from target type - H1">
  2664. <compile files="CtorH.aj" options="-1.5"/>
  2665. <run class="CtorH"/>
  2666. </ajc-test>
  2667. <ajc-test dir="java5/generics/itds/sharing" title="ctor itd using type variable from target type - I1">
  2668. <compile files="CtorI.aj" options="-1.5"/>
  2669. <run class="CtorI"/>
  2670. </ajc-test>
  2671. <!-- putting it all together, fields/methods/ctors and decps -->
  2672. <ajc-test dir="java5/generics/genericaspects/" title="uberaspects - A">
  2673. <compile files="GenericAspectA.aj" options="-1.5"/>
  2674. <run class="GenericAspectA"/>
  2675. </ajc-test>
  2676. <ajc-test dir="java5/generics/genericaspects/" title="uberaspects - B">
  2677. <compile files="GenericAspectB.aj" options="-1.5"/>
  2678. <run class="GenericAspectB"/>
  2679. </ajc-test>
  2680. <ajc-test dir="java5/generics/genericaspects/" title="uberaspects - C">
  2681. <compile files="GenericAspectC.aj" options="-1.5"/>
  2682. <run class="GenericAspectC"/>
  2683. </ajc-test>
  2684. <ajc-test dir="java5/generics/genericaspects/" title="uberaspects - D">
  2685. <compile files="GenericAspectD.aj" options="-1.5"/>
  2686. <run class="GenericAspectD"/>
  2687. </ajc-test>
  2688. <ajc-test dir="java5/generics/genericaspects/" title="uberaspects - E">
  2689. <compile files="GenericAspectE.aj" options="-1.5"/>
  2690. <run class="GenericAspectE"/>
  2691. </ajc-test>
  2692. <ajc-test dir="java5/generics/genericaspects/" title="uberaspects - F">
  2693. <compile files="GenericAspectF.aj" options="-1.5"/>
  2694. <run class="GenericAspectF"/>
  2695. </ajc-test>
  2696. <ajc-test dir="java5/generics/genericaspects/" title="uberaspects - G">
  2697. <compile files="GenericAspectG.aj" options="-1.5"/>
  2698. <run class="GenericAspectG"/>
  2699. </ajc-test>
  2700. <ajc-test dir="java5/generics/genericaspects/" title="uberaspects - H">
  2701. <compile files="GenericAspectH.aj" options="-1.5">
  2702. <message kind="error" line="7" text="Type java.lang.String does not meet the specification for type parameter 1 (N extends java.lang.Number) in generic type GenericAspect$SimpleI"/>
  2703. <message kind="error" line="16" text="The method m4(String) is undefined for the type Base"/>
  2704. </compile>
  2705. </ajc-test>
  2706. <ajc-test dir="java5/generics/genericaspects/" title="uberaspects - I">
  2707. <compile files="GenericAspectI.aj" options="-1.5"/>
  2708. <run class="GenericAspectI"/>
  2709. </ajc-test>
  2710. <ajc-test dir="java5/generics/genericaspects/" title="uberaspects - J">
  2711. <compile files="GenericAspectJ.aj" options="-1.5"/>
  2712. <run class="GenericAspectJ"/>
  2713. </ajc-test>
  2714. <ajc-test dir="java5/generics/genericaspects/" title="uberaspects - K">
  2715. <compile files="GenericAspectK.aj" options="-1.5">
  2716. <message kind="error" line="16" text="The method m4(String) is undefined for the type Base"/>
  2717. </compile>
  2718. </ajc-test>
  2719. <ajc-test dir="java5/generics/genericaspects/" title="uberaspects - L">
  2720. <compile files="GenericAspectL.aj" options="-1.5"/>
  2721. <run class="GenericAspectL"/>
  2722. </ajc-test>
  2723. <ajc-test dir="java5/generics/genericaspects/" title="uberaspects - M">
  2724. <compile files="GenericAspectM.aj" options="-1.5">
  2725. <message kind="error" line="23" text="The method m0(Integer) in the type GenericAspect&lt;A,B&gt;.SimpleI&lt;L&gt; is not applicable for the arguments (String)"/>
  2726. <message kind="error" line="24" text="The method m1(List&lt;Integer&gt;) in the type GenericAspect&lt;A,B&gt;.SimpleI&lt;L&gt; is not applicable for the arguments (List&lt;String&gt;)"/>
  2727. <message kind="error" line="25" text="Type mismatch: cannot convert from String to Integer"/>
  2728. <message kind="error" line="26" text="Type mismatch: cannot convert from List&lt;String&gt; to List&lt;Integer&gt;"/>
  2729. </compile>
  2730. </ajc-test>
  2731. <ajc-test dir="java5/generics/genericaspects/" title="uberaspects - N">
  2732. <compile files="GenericAspectN.aj" options="-1.5"/>
  2733. <run class="GenericAspectN"/>
  2734. </ajc-test>
  2735. <ajc-test dir="java5/generics/genericaspects/" title="uberaspects - O">
  2736. <compile files="GenericAspectO.aj" options="-1.5">
  2737. <message kind="error" line="24" text="Cannot make a static reference to the non-static field Bottom.parent"/>
  2738. <message kind="error" line="26" text="The method add(Bottom) in the type List&lt;E&gt; is not applicable for the arguments (Top)"/>
  2739. <message kind="error" line="27" text="Cannot make a static reference to the non-static field Top.children"/>
  2740. </compile>
  2741. </ajc-test>
  2742. <ajc-test dir="java5/generics/genericaspects/" title="uberaspects - P">
  2743. <compile files="GenericAspectP.aj" options="-1.5"/>
  2744. <run class="GenericAspectP"/>
  2745. </ajc-test>
  2746. <ajc-test dir="java5/generics/genericaspects/" title="uberaspects - Q">
  2747. <compile files="GenericAspectQ.aj" options="-1.5"/>
  2748. <run class="GenericAspectQ"/>
  2749. </ajc-test>
  2750. <ajc-test dir="java5/generics/genericaspects/" title="uberaspects - R">
  2751. <compile files="GenericAspectR.aj" options="-1.5"/>
  2752. <run class="GenericAspectR"/>
  2753. </ajc-test>
  2754. <ajc-test dir="java5/generics/genericaspects/" title="uberaspects - S">
  2755. <compile files="GenericAspectS.aj" options="-1.5"/>
  2756. <run class="GenericAspectS"/>
  2757. </ajc-test>
  2758. <ajc-test dir="java5/generics/genericaspects/" title="uberaspects - T">
  2759. <compile files="GenericAspectT.aj" options="-1.5"/>
  2760. </ajc-test>
  2761. <ajc-test dir="java5/generics/genericaspects/" title="uberaspects - U">
  2762. <compile files="GenericAspectU.aj" options="-1.5"/>
  2763. <run class="GenericAspectU"/>
  2764. </ajc-test>
  2765. <ajc-test dir="java5/generics/itds/sharing" title="method itd sharing type variable with generic type">
  2766. <compile files="Simple.aj" options="-1.5"/>
  2767. <run class="Simple"/>
  2768. </ajc-test>
  2769. <ajc-test dir="java5/generics/itds/sharing" title="field itd sharing type variable with generic type">
  2770. <compile files="Simple2.aj" options="-1.5"/>
  2771. <run class="Simple2"/>
  2772. </ajc-test>
  2773. <ajc-test dir="java5/generics/itds" title="non static generic method itd - 2">
  2774. <compile files="NonstaticGenericCtorITD2.aj" options="-1.5"/>
  2775. <run class="NonstaticGenericCtorITD2"/>
  2776. </ajc-test>
  2777. <ajc-test dir="java5/generics/itds" title="reusing type variable letters">
  2778. <compile files="ReusingLetters.aj" options="-1.5"/>
  2779. <run class="ReusingLetters"/>
  2780. </ajc-test>
  2781. <ajc-test dir="java5/generics/itds" title="multiple generic itds in one file">
  2782. <compile files="BizarroSignatures.aj" options="-1.5"/>
  2783. <run class="BizarroSignatures"/>
  2784. </ajc-test>
  2785. <ajc-test dir="java5/generics/itds" title="generic intertype field declaration, sharing type variable">
  2786. <compile files="FieldITDOnGeneric.aj" options="-1.5"/>
  2787. <run class="FieldITDOnGeneric">
  2788. <stderr>
  2789. <line text="foo"/>
  2790. </stderr>
  2791. </run>
  2792. </ajc-test>
  2793. <ajc-test dir="java5/generics/itds" title="Parsing generic ITDs - 1">
  2794. <compile files="Parse1.java" options="-1.5"/>
  2795. </ajc-test>
  2796. <ajc-test dir="java5/generics/itds" title="Parsing generic ITDs - 2">
  2797. <compile files="Parse2.java" options="-1.5"/>
  2798. </ajc-test>
  2799. <ajc-test dir="java5/generics/itds" title="Parsing generic ITDs - 3">
  2800. <compile files="Parse3.java" options="-1.5"/>
  2801. </ajc-test>
  2802. <ajc-test dir="java5/generics/itds" title="Parsing generic ITDs - 4">
  2803. <compile files="Parse4.java" options="-1.5"/>
  2804. </ajc-test>
  2805. <ajc-test dir="java5/generics/itds" title="Parsing generic ITDs - 5">
  2806. <compile files="Parse5.java" options="-1.5">
  2807. <message kind="error" line="11" text="Incorrect number of type parameters supplied. The generic type Parse5&lt;T,S&gt; has 2 type parameters, not 3."/>
  2808. <message kind="error" line="13" text="Incorrect number of type parameters supplied. The generic type Parse5&lt;T,S&gt; has 2 type parameters, not 1."/>
  2809. <message kind="error" line="15" text="Intertype declarations can only be made on the generic type, not on a parameterized type. The name 'String' cannot be used as a type parameter, since it refers to a real type."/>
  2810. </compile>
  2811. </ajc-test>
  2812. <ajc-test dir="java5/generics/itds" title="Parsing generic ITDs - 6">
  2813. <compile files="Parse6.java" options="-1.5"/>
  2814. </ajc-test>
  2815. <!-- end of generic ITDs -->
  2816. <!-- generic decps -->
  2817. <ajc-test dir="java5/generics/decp" title="generic decp - simple">
  2818. <compile files="Basic.aj" options="-1.5"/>
  2819. <run class="Basic"/>
  2820. </ajc-test>
  2821. <ajc-test dir="java5/generics/decp" title="generic decp - implementing two variants #1">
  2822. <compile files="Basic2.aj" options="-1.5">
  2823. <message kind="error" line="11" text="Cannot declare parent I&lt;java.lang.Integer&gt; onto type Basic2 since it already has I&lt;java.lang.String&gt; in its hierarchy"/>
  2824. </compile>
  2825. </ajc-test>
  2826. <ajc-test dir="java5/generics/decp" title="generic decp - implementing two variants #2">
  2827. <compile files="Basic2b.aj" options="-1.5">
  2828. <message kind="error" line="10" text="Cannot declare parent I&lt;java.lang.Integer&gt; onto type Basic2b since it already has I in its hierarchy"/>
  2829. </compile>
  2830. </ajc-test>
  2831. <ajc-test dir="java5/generics/decp" title="generic decp - implementing two variants #3">
  2832. <compile files="Basic2c.aj" options="-1.5">
  2833. <message kind="error" line="10" text="Cannot declare parent I onto type Basic2c since it already has I&lt;java.lang.Double&gt; in its hierarchy"/>
  2834. </compile>
  2835. </ajc-test>
  2836. <ajc-test dir="java5/generics/decp" title="generic decp - implementing two variants #4">
  2837. <compile files="Basic2d.aj" options="-1.5"/>
  2838. </ajc-test>
  2839. <ajc-test dir="java5/generics/decp/binary" title="generic decp binary - implementing two variants #1">
  2840. <weave classesFiles="Base1.java" aspectsFiles="Asp1.aj" options="-1.5,-showWeaveInfo">
  2841. <message kind="error" line="2" text="Cannot declare parent I&lt;java.lang.Integer&gt; onto type Base1 since it already has I&lt;java.lang.String&gt; in its hierarchy"/>
  2842. </weave>
  2843. </ajc-test>
  2844. <ajc-test dir="java5/generics/decp/binary" title="generic decp binary - implementing two variants #2">
  2845. <weave classesFiles="Base2.java" aspectsFiles="Asp2.aj" options="-1.5,-showWeaveInfo">
  2846. <message kind="error" line="2" text="Cannot declare parent I&lt;java.lang.Integer&gt; onto type Base2 since it already has I in its hierarchy"/>
  2847. </weave>
  2848. </ajc-test>
  2849. <ajc-test dir="java5/generics/decp/binary" title="generic decp binary - implementing two variants #3">
  2850. <weave classesFiles="Base3.java" aspectsFiles="Asp3.aj" options="-1.5,-showWeaveInfo">
  2851. <message kind="error" line="2" text="Cannot declare parent I onto type Base3 since it already has I&lt;java.lang.Double&gt; in its hierarchy"/>
  2852. </weave>
  2853. </ajc-test>
  2854. <ajc-test dir="java5/generics/decp/binary" title="generic decp binary - implementing two variants #4">
  2855. <weave classesFiles="Base4.java" aspectsFiles="Asp4.aj" options="-1.5,-showWeaveInfo"/>
  2856. </ajc-test>
  2857. <ajc-test dir="java5/generics/decp" title="generic decp - incorrect number of type parameters">
  2858. <compile files="Basic3.aj" options="-1.5">
  2859. <message kind="error" line="10" text="Type pattern does not match because the wrong number of type parameters are specified: Type I requires 1 parameter(s)"/>
  2860. </compile>
  2861. </ajc-test>
  2862. <ajc-test dir="java5/generics/decp" title="generic decp - specifying bounds">
  2863. <compile files="Basic4.aj" options="-1.5"/>
  2864. <run class="Basic4"/>
  2865. </ajc-test>
  2866. <ajc-test dir="java5/generics/decp" title="generic decp - specifying bounds but breaking them">
  2867. <compile files="Basic5.aj" options="-1.5">
  2868. <message kind="error" line="7" text="Type java.lang.String does not meet the specification for type parameter 1 (T extends java.lang.Number) in generic type I"/>
  2869. </compile>
  2870. </ajc-test>
  2871. <ajc-test dir="java5/generics/decp" title="generic decp - with parameterized on the target">
  2872. <compile files="Basic6.aj" options="-1.5,-showWeaveInfo">
  2873. <message kind="weave" text="Extending interface set for type 'Basic6' (Basic6.aj) to include 'K&lt;java.lang.Integer&gt;' (Basic6.aj)"/>
  2874. </compile>
  2875. <run class="Basic6"/>
  2876. </ajc-test>
  2877. <!-- end of generic decps -->
  2878. <!-- generics/itds and binary weaving -->
  2879. <ajc-test dir="java5/generics/itds/binaryweaving" vm="1.5" title="binary weaving ITDs - A">
  2880. <compile files="TestA_generictype.java" outjar="code.jar" options="-1.5,-Xreweavable"/>
  2881. <compile files="TestA_aspect.aj,TestA_class.java" inpath="code.jar" options="-1.5,-Xreweavable"/>
  2882. <run class="TestA_class"/>
  2883. </ajc-test>
  2884. <ajc-test dir="java5/generics/itds/binaryweaving" vm="1.5" title="binary weaving ITDs - 1">
  2885. <compile files="BaseClass.java" outjar="code.jar" options="-1.5,-Xreweavable"/>
  2886. <compile files="A1.aj" inpath="code.jar" options="-1.5,-Xreweavable"/>
  2887. <run class="BaseClass">
  2888. <stderr>
  2889. <line text="Advice count=1"/>
  2890. </stderr>
  2891. </run>
  2892. </ajc-test>
  2893. <ajc-test dir="java5/generics/itds/binaryweaving" vm="1.5" title="binary weaving ITDs - 2">
  2894. <compile files="BaseClass.java,A1.aj" outjar="code.jar" options="-1.5,-Xreweavable,-showWeaveInfo">
  2895. <message kind="weave" text="Type 'BaseClass' (BaseClass.java) has intertyped field from 'A1' (A1.aj:'java.util.List BaseClass.list1')"/>
  2896. <message kind="weave" text="Type 'BaseClass' (BaseClass.java:12) advised by after advice from 'A1' (A1.aj:7)"/>
  2897. </compile>
  2898. <compile files="A2.aj" inpath="code.jar" options="-1.5,-Xreweavable,-showWeaveInfo">
  2899. <message kind="weave" text="Type 'BaseClass' (BaseClass.java) has intertyped field from 'A1' (A1.aj:'java.util.List BaseClass.list1')"/>
  2900. <message kind="weave" text="Type 'BaseClass' (BaseClass.java:12) advised by after advice from 'A1' (A1.aj:7)"/>
  2901. <message kind="weave" text="Type 'BaseClass' (BaseClass.java) has intertyped field from 'A2' (A2.aj:'java.util.List BaseClass.list2')"/>
  2902. <message kind="weave" text="Type 'BaseClass' (BaseClass.java:13) advised by after advice from 'A2' (A2.aj:8)"/>
  2903. </compile>
  2904. <run class="BaseClass">
  2905. <stderr>
  2906. <line text="Advice count=2"/>
  2907. </stderr>
  2908. </run>
  2909. </ajc-test>
  2910. <ajc-test dir="java5/generics/itds/binaryweaving" vm="1.5" title="binary weaving ITDs - 3">
  2911. <compile files="BaseClass.java,A1.aj,A2.aj" outjar="code.jar" options="-1.5,-Xreweavable"/>
  2912. <compile files="A3.aj" inpath="code.jar" options="-1.5,-Xreweavable"/>
  2913. <run class="BaseClass">
  2914. <stderr>
  2915. <line text="Advice count=3"/>
  2916. </stderr>
  2917. </run>
  2918. </ajc-test>
  2919. <!-- end of generics/itds and binary weaving -->
  2920. <!-- generics and pointcuts -->
  2921. <ajc-test dir="java5/generics/pointcuts" title="handler pcd and generics / type vars">
  2922. <compile files="GenericInterface.java,HandlerPointcutTests.aj" options="-1.5">
  2923. <message kind="error" line="4" text="Syntax error on token"/>
  2924. <message kind="error" line="8" text="a parameterized type pattern may not be used in a handler pointcut expression"/>
  2925. <message kind="warning" line="8" text="no match for this type name: T"/>
  2926. <message kind="error" line="11" text="a parameterized type pattern may not be used in a handler pointcut expression"/>
  2927. </compile>
  2928. </ajc-test>
  2929. <ajc-test dir="java5/generics/pointcuts" title="pointcuts that dont allow type vars">
  2930. <compile files="PointcutsThatDontAllowTypeVars.aj" options="-1.5">
  2931. <message kind="error" line="3" text="Syntax error on token"/>
  2932. <message kind="error" line="5" text="Syntax error on token"/>
  2933. <message kind="error" line="7" text="Syntax error on token"/>
  2934. <message kind="error" line="9" text="Syntax error on token"/>
  2935. <message kind="error" line="11" text="Syntax error on token"/>
  2936. <message kind="error" line="13" text="Syntax error on token"/>
  2937. <message kind="error" line="15" text="Syntax error on token"/>
  2938. <message kind="error" line="17" text="Syntax error on token"/>
  2939. <message kind="error" line="19" text="Syntax error on token"/>
  2940. <message kind="error" line="21" text="Syntax error on token"/>
  2941. <message kind="error" line="23" text="Syntax error on token"/>
  2942. <message kind="error" line="25" text="Syntax error on token"/>
  2943. <message kind="error" line="27" text="Syntax error on token"/>
  2944. </compile>
  2945. </ajc-test>
  2946. <ajc-test dir="java5/generics/pointcuts" title="annotation pcds with parameterized types">
  2947. <compile files="ParameterizedTypesInAtPCDs.aj" options="-1.5">
  2948. <message kind="error" line="3" text="Syntax error on token"/>
  2949. <message kind="error" line="5" text="Syntax error on token"/>
  2950. <message kind="error" line="7" text="Syntax error on token"/>
  2951. <message kind="error" line="9" text="Syntax error on token"/>
  2952. <message kind="error" line="11" text="Syntax error on token"/>
  2953. <message kind="error" line="13" text="Syntax error on token"/>
  2954. </compile>
  2955. </ajc-test>
  2956. <ajc-test dir="java5/generics/pointcuts" title="annotation patterns with parameterized types">
  2957. <compile files="ParameterizedTypesInAnnotationPatterns.aj" options="-1.5">
  2958. <message kind="error" line="5" text="is not an annotation type"/>
  2959. </compile>
  2960. </ajc-test>
  2961. <ajc-test dir="java5/generics/pointcuts" title="staticinitialization and parameterized types">
  2962. <compile files="GenericInterface.java,GenericImplementingClass.java,StaticInitializationWithParameterizedTypes.aj" options="-1.5">
  2963. <message kind="error" line="4" text="no static initialization join points for parameterized types, use raw type instead"/>
  2964. <message kind="error" line="6" text="no static initialization join points for parameterized types, use raw type instead"/>
  2965. <message kind="error" line="9" text="no static initialization join points for parameterized types, use raw type instead"/>
  2966. <message kind="error" line="11" text="no static initialization join points for parameterized types, use raw type instead"/>
  2967. <message kind="error" line="14" text="no static initialization join points for parameterized types, use raw type instead"/>
  2968. </compile>
  2969. </ajc-test>
  2970. <ajc-test dir="java5/generics/pointcuts" title="staticinitialization and parameterized type matching">
  2971. <compile files="GenericInterface.java,GenericImplementingClass.java,ConcreteImplementingClass.java,ConcreteExtendingClass.java,StaticInitializationWithParameterizedTypesMatching.aj" options="-1.5">
  2972. <message kind="warning" line="1" text="clinit(GenericInterface&lt;Double&gt;+)"/>
  2973. <message kind="warning" line="3" text="clinit(GenericInterface&lt;Double&gt;+)"/>
  2974. <message kind="warning" line="3" text="clinit(GenericImplementingClass&lt;Double&gt;+)"/>
  2975. <message kind="warning" line="15" text="Type java.lang.String does not meet the specification for type parameter 1 (N extends java.lang.Number) in generic type GenericInterface"/>
  2976. <message kind="warning" line="19" text="Type pattern does not match because the wrong number of type parameters are specified: Type GenericInterface requires 1 parameter(s)"/>
  2977. </compile>
  2978. </ajc-test>
  2979. <ajc-test dir="java5/generics/pointcuts" title="staticinitialization with generic types">
  2980. <compile files="GenericInterface.java,GenericImplementingClass.java,StaticInitializationWithGenericTypes.aj" options="-1.5">
  2981. <message kind="warning" line="1" text="one generic param, correct bounds"/>
  2982. <message kind="warning" line="1" text="doesn't matter what type variable name you use"/>
  2983. <message kind="warning" line="1" text="works with classes too"/>
  2984. <message kind="warning" line="4" text="Type T does not meet the specification for type parameter 1 (N extends java.lang.Number) in generic type GenericInterface"/>
  2985. <message kind="warning" line="20" text="Type pattern does not match because the wrong number of type parameters are specified: Type GenericImplementingClass requires 1 parameter(s)"/>
  2986. <message kind="warning" line="24" text="Type N extends java.lang.Number &amp; java.lang.Comparable does not meet the specification for type parameter 1 (N extends java.lang.Number) in generic type GenericImplementingClass"/>
  2987. </compile>
  2988. </ajc-test>
  2989. <ajc-test dir="java5/generics/pointcuts" title="staticinitialization with generic types - advanced">
  2990. <compile files="StaticInitializationWithGenericTypesAdvanced.aj" options="-1.5">
  2991. <message kind="warning" line="76" text="simple match"/>
  2992. <message kind="warning" line="76" text="matches since R and R extends Object are equivalent"/>
  2993. <message kind="warning" line="63" text="raw type should match"/>
  2994. <message kind="warning" line="63" text="matches all bounds"/>
  2995. <message kind="warning" line="63" text="still matches with interfaces specified in a different order"/>
  2996. <message kind="warning" line="69" text="matches with type variable inter-dependencies"/>
  2997. <message kind="warning" line="76" text="matches any generic type with one unbound type var"/>
  2998. <message kind="warning" line="82" text="any generic type with one type var bound to Number or subtype"/>
  2999. <message kind="warning" line="63" text="matches a generic type with any upper bound and i/f bounds"/>
  3000. <message kind="warning" line="76" text="matches a generic type with any upper bound and i/f bounds"/>
  3001. <message kind="warning" line="82" text="matches a generic type with any upper bound and i/f bounds"/>
  3002. <message kind="warning" line="19" text="Type X does not meet the specification for type parameter 1 (T extends java.lang.Number &amp; java.lang.Comparable &amp; java.io.Serializable) in generic type ClassWithInterfaceBounds"/>
  3003. <message kind="warning" line="23" text="Type Y extends java.lang.Number does not meet the specification for type parameter 1 (T extends java.lang.Number &amp; java.lang.Comparable &amp; java.io.Serializable) in generic type ClassWithInterfaceBounds"/>
  3004. <message kind="warning" line="27" text="Type Z extends java.lang.Number &amp; java.lang.Comparable does not meet the specification for type parameter 1 (T extends java.lang.Number &amp; java.lang.Comparable &amp; java.io.Serializable) in generic type ClassWithInterfaceBounds"/>
  3005. </compile>
  3006. </ajc-test>
  3007. <ajc-test dir="java5/generics/pointcuts" title="within pcd with various parameterizations and generic types - errors">
  3008. <compile files="WithinPointcutMatching.aj" options="-1.5">
  3009. <message kind="warning" line="4" text="no match for this type name: T"/>
  3010. <message kind="error" line="4" text="parameterized type pattern not supported by 'within', use a raw type pattern instead"/>
  3011. <message kind="error" line="5" text="parameterized type pattern not supported by 'within', use a raw type pattern instead"/>
  3012. <message kind="error" line="6" text="parameterized type pattern not supported by 'within', use a raw type pattern instead"/>
  3013. </compile>
  3014. </ajc-test>
  3015. <ajc-test dir="java5/generics/pointcuts" title="within pcd with various parameterizations and generic types - warnings">
  3016. <compile files="WithinPointcutMatchingWarnings.aj" options="-1.5">
  3017. <message kind="warning" line="16" text="matched set correctly"/>
  3018. <message kind="warning" line="18" text="matched execution correctly"/>
  3019. <message kind="warning" line="24" text="init matched correctly"/>
  3020. <message kind="warning" line="32" text="matched parameterization ok"/>
  3021. </compile>
  3022. </ajc-test>
  3023. <ajc-test dir="java5/generics/pointcuts" title="this and target with various parameterizations and generic types - errors">
  3024. <compile files="ThisAndTargetPointcutMatching.aj" options="-1.5">
  3025. <message kind="warning" line="4" text="no match for this type name: T"/>
  3026. <message kind="warning" line="5" text="no match for this type name: T"/>
  3027. <message kind="error" line="4" text="parameterized types not supported for this and target pointcuts (erasure limitation)"/>
  3028. <message kind="error" line="5" text="parameterized types not supported for this and target pointcuts (erasure limitation)"/>
  3029. <message kind="error" line="6" text="parameterized types not supported for this and target pointcuts (erasure limitation)"/>
  3030. <message kind="error" line="7" text="parameterized types not supported for this and target pointcuts (erasure limitation)"/>
  3031. </compile>
  3032. </ajc-test>
  3033. <ajc-test dir="java5/generics/pointcuts" title="this and target with various parameterizations and generic types - runtime">
  3034. <compile files="ThisAndTargetPointcutMatchingRuntime.aj" options="-1.5">
  3035. </compile>
  3036. <run class="ThisAndTargetPointcutMatchingRuntime">
  3037. <stdout>
  3038. <line text="set and this matched ok"/>
  3039. <line text="set and target matched ok"/>
  3040. <line text="call and target matched ok"/>
  3041. <line text="execution and this matched ok"/>
  3042. <line text="execution and target matched ok"/>
  3043. <line text="parameterized call and target matched ok"/>
  3044. <line text="parameterized call and this matched ok"/>
  3045. <line text="parameterized call and target matched ok"/>
  3046. </stdout>
  3047. </run>
  3048. </ajc-test>
  3049. <ajc-test dir="java5/generics/pointcuts" title="get and set with various parameterizations and generic types - errors">
  3050. <compile files="GetAndSetPointcutMatching.aj" options="-1.5">
  3051. <message kind="warning" line="4" text="no match for this type name: T"/>
  3052. <message kind="warning" line="5" text="no match for this type name: T"/>
  3053. <message kind="error" line="4" text="can't use parameterized type patterns for the declaring type of a get or set pointcut expression (use the raw type instead)"/>
  3054. <message kind="error" line="5" text="can't use parameterized type patterns for the declaring type of a get or set pointcut expression (use the raw type instead)"/>
  3055. <message kind="error" line="6" text="can't use parameterized type patterns for the declaring type of a get or set pointcut expression (use the raw type instead)"/>
  3056. <message kind="error" line="7" text="can't use parameterized type patterns for the declaring type of a get or set pointcut expression (use the raw type instead)"/>
  3057. <message kind="error" line="8" text="can't use parameterized type patterns for the declaring type of a get or set pointcut expression (use the raw type instead)"/>
  3058. </compile>
  3059. </ajc-test>
  3060. <ajc-test dir="java5/generics/pointcuts" title="get and set with various parameterizations and generic declaring types">
  3061. <compile files="GetAndSetPointcutMatchingDeclaringType.aj" options="-1.5">
  3062. <message kind="warning" line="15" text="generic/param get matching ok"/>
  3063. <message kind="warning" line="33" text="generic/param get matching ok"/>
  3064. <message kind="warning" line="12" text="generic/param set matching ok"/>
  3065. <message kind="warning" line="32" text="generic/param set matching ok"/>
  3066. </compile>
  3067. </ajc-test>
  3068. <ajc-test dir="java5/generics/pointcuts" title="get and set with various parameterizations and generic field types">
  3069. <compile files="GetAndSetPointcutMatchingFieldType.aj" options="-1.5">
  3070. <message kind="warning" line="13" text="raw field type matching in get ok"/>
  3071. <message kind="warning" line="14" text="raw field type matching in set ok"/>
  3072. <message kind="warning" line="49" text="erasure matching in get ok"/>
  3073. <message kind="warning" line="45" text="erasure matching in set ok"/>
  3074. <message kind="warning" line="53" text="erasure matching in get with params ok"/>
  3075. <message kind="warning" line="46" text="erasure matching in set with params ok"/>
  3076. <message kind="warning" line="72" text="parameterized type matching in set ok"/>
  3077. <message kind="warning" line="73" text="parameterized type matching in get ok"/>
  3078. <message kind="warning" line="74" text="parameterized type matching in set ok x2"/>
  3079. <message kind="warning" line="75" text="parameterized type matching in get ok x2"/>
  3080. <message kind="warning" line="83" text="wildcard set matching ok"/>
  3081. <message kind="warning" line="84" text="wildcard get matching ok"/>
  3082. <message kind="warning" line="85" text="wildcard extends set matching ok"/>
  3083. <message kind="warning" line="86" text="wildcard extends get matching ok"/>
  3084. <message kind="warning" line="87" text="wildcard super set matching ok"/>
  3085. <message kind="warning" line="88" text="wildcard super get matching ok"/>
  3086. <message kind="warning" line="73" text="the really wild show"/>
  3087. <message kind="warning" line="84" text="the really wild show"/>
  3088. <message kind="warning" line="86" text="the really wild show"/>
  3089. <message kind="warning" line="88" text="the really wild show"/>
  3090. <message kind="warning" line="53" text="the really wild show"/>
  3091. </compile>
  3092. </ajc-test>
  3093. <ajc-test dir="java5/generics/pointcuts" title="init and preinit with parameterized declaring types">
  3094. <compile files="InitializationPointcutMatching.aj" options="-1.5">
  3095. <message kind="warning" line="4" text="no match for this type name: T"/>
  3096. <message kind="warning" line="5" text="no match for this type name: T"/>
  3097. <message kind="error" line="4" text="no [pre]initialization join points for parameterized types, use raw type instead"/>
  3098. <message kind="error" line="5" text="no [pre]initialization join points for parameterized types, use raw type instead"/>
  3099. <message kind="error" line="6" text="no [pre]initialization join points for parameterized types, use raw type instead"/>
  3100. <message kind="error" line="7" text="no [pre]initialization join points for parameterized types, use raw type instead"/>
  3101. <message kind="error" line="8" text="no [pre]initialization join points for parameterized types, use raw type instead"/>
  3102. <message kind="error" line="9" text="invalid throws pattern: a generic class may not be a direct or indirect subclass of Throwable"/>
  3103. </compile>
  3104. </ajc-test>
  3105. <ajc-test dir="java5/generics/pointcuts" title="init and preinit with raw declaring type pattern">
  3106. <compile files="InitializationPointcutMatchingDeclaringType.aj" options="-1.5">
  3107. <message kind="warning" line="10" text="generic/param init matching ok"/>
  3108. <message kind="warning" line="10" text="generic/param preinit matching ok"/>
  3109. </compile>
  3110. </ajc-test>
  3111. <ajc-test dir="java5/generics/pointcuts" title="init and preinit with parameterized parameter types">
  3112. <compile files="InitializationPointcutMatchingParamTypes.aj" options="-1.5">
  3113. <message kind="warning" line="36" text="raw param type matching in init ok"/>
  3114. <message kind="warning" line="36" text="raw param type matching in preinit ok"/>
  3115. <message kind="warning" line="37" text="erasure matching in init ok"/>
  3116. <message kind="warning" line="37" text="erasure matching in preinit ok"/>
  3117. <message kind="warning" line="38" text="erasure matching in init with params ok"/>
  3118. <message kind="warning" line="38" text="erasure matching in preinit with params ok"/>
  3119. <message kind="warning" line="48" text="parameterized type matching in init ok"/>
  3120. <message kind="warning" line="48" text="parameterized type matching in preinit ok"/>
  3121. <message kind="warning" line="49" text="parameterized type matching in init ok x2"/>
  3122. <message kind="warning" line="49" text="parameterized type matching in preinit ok x2"/>
  3123. <message kind="warning" line="50" text="wildcard init matching ok"/>
  3124. <message kind="warning" line="50" text="wildcard preinit matching ok"/>
  3125. <message kind="warning" line="51" text="wildcard extends init matching ok"/>
  3126. <message kind="warning" line="51" text="wildcard extends preinit matching ok"/>
  3127. <message kind="warning" line="52" text="wildcard super init matching ok"/>
  3128. <message kind="warning" line="52" text="wildcard super preinit matching ok"/>
  3129. <message kind="warning" line="48" text="the really wild show"/>
  3130. <message kind="warning" line="50" text="the really wild show"/>
  3131. <message kind="warning" line="51" text="the really wild show"/>
  3132. <message kind="warning" line="52" text="the really wild show"/>
  3133. </compile>
  3134. </ajc-test>
  3135. <ajc-test dir="java5/generics/pointcuts" title="withincode with various parameterizations and generic types - errors">
  3136. <compile files="WithincodePointcutMatching.aj" options="-1.5">
  3137. <message kind="warning" line="4" text="no match for this type name: T"/>
  3138. <message kind="error" line="4" text="can't use parameterized type patterns for the declaring type of a withincode pointcut expression (use the raw type instead)"/>
  3139. <message kind="error" line="5" text="can't use parameterized type patterns for the declaring type of a withincode pointcut expression (use the raw type instead)"/>
  3140. <message kind="error" line="6" text="invalid throws pattern: a generic class may not be a direct or indirect subclass of Throwable"/>
  3141. </compile>
  3142. </ajc-test>
  3143. <ajc-test dir="java5/generics/pointcuts" title="withincode with various parameterizations and generic types - matching">
  3144. <compile files="WithinCodePointcutMatchingParamAndReturnTypes.aj" options="-1.5">
  3145. <message kind="warning" line="35" text="raw param type matching in withincode ok"/>
  3146. <message kind="warning" line="36" text="raw param type matching in withincode ok"/>
  3147. <message kind="warning" line="67" text="raw return type matching in withincode ok"/>
  3148. <message kind="warning" line="38" text="erasure type matching in withincode ok"/>
  3149. <message kind="warning" line="39" text="erasure type matching in withincode ok"/>
  3150. <message kind="warning" line="42" text="erasure type matching in withincode ok"/>
  3151. <message kind="warning" line="62" text="withincode and parameterized method ok"/>
  3152. <message kind="warning" line="62" text="withincode and generic interface ok"/>
  3153. <message kind="warning" line="65" text="withincode and interface control test"/>
  3154. <message kind="warning" line="35" text="match on parameterized args"/>
  3155. <message kind="warning" line="36" text="match on parameterized args"/>
  3156. <message kind="warning" line="67" text="match on parameterized return type"/>
  3157. </compile>
  3158. </ajc-test>
  3159. <ajc-test dir="java5/generics/pointcuts" title="withincode with overriding of inherited generic members">
  3160. <compile files="WithinCodeOverriding.aj" options="-1.5">
  3161. <message kind="warning" line="37" text="wildcard declaring type match on erasure"/>
  3162. <message kind="warning" line="50" text="wildcard declaring type match on erasure"/>
  3163. <message kind="warning" line="63" text="wildcard declaring type match on erasure"/>
  3164. <message kind="warning" line="37" text="base declaring type match on erasure"/>
  3165. <message kind="warning" line="50" text="base declaring type match on erasure"/>
  3166. <message kind="warning" line="63" text="base declaring type match on erasure"/>
  3167. <message kind="warning" line="50" text="sub type match on erasure"/>
  3168. <message kind="warning" line="63" text="parameterized match on erasure"/>
  3169. <message kind="warning" line="80" text="erasure match on base interface"/>
  3170. <message kind="warning" line="80" text="wildcard match on erasure"/>
  3171. <message kind="warning" line="80" text="parameterized match"/>
  3172. </compile>
  3173. </ajc-test>
  3174. <ajc-test dir="java5/generics/pointcuts" title="execution pcd with raw type matching">
  3175. <compile files="GenericInterface.java,ConcreteImplementingClass.java,GenericImplementingClass.java,RawTypeMatching.aj" options="-1.5">
  3176. <message kind="warning" line="4" text="execution(* GenericInterface.*(..))"/>
  3177. <message kind="warning" line="5" text="execution(* GenericInterface.*(..))"/>
  3178. </compile>
  3179. </ajc-test>
  3180. <ajc-test dir="java5/generics/pointcuts" title="execution pcd with raw signature matching">
  3181. <compile files="GenericInterface.java,ConcreteImplementingClass.java,GenericImplementingClass.java,RawSignatureMatching.aj" options="-1.5">
  3182. <message kind="warning" line="4" text="execution(* GenericInterface.asInt(Number))"/>
  3183. <message kind="warning" line="5" text="execution(* GenericInterface.asInt(Number))"/>
  3184. </compile>
  3185. </ajc-test>
  3186. <ajc-test dir="java5/generics/pointcuts" title="execution with various parameterizations and generic types - errors">
  3187. <compile files="ExecutionPointcutMatchingErrorCases.aj" options="-1.5">
  3188. <message kind="warning" line="4" text="no match for this type name: T"/>
  3189. <message kind="error" line="4" text="can't use parameterized type patterns for the declaring type of an execution pointcut expression (use the raw type instead)"/>
  3190. <message kind="error" line="5" text="can't use parameterized type patterns for the declaring type of an execution pointcut expression (use the raw type instead)"/>
  3191. <message kind="error" line="6" text="invalid throws pattern: a generic class may not be a direct or indirect subclass of Throwable"/>
  3192. </compile>
  3193. </ajc-test>
  3194. <ajc-test dir="java5/generics/pointcuts" title="execution with various parameterizations and generic types - matching">
  3195. <compile files="ExecutionPointcutMatchingParamAndReturnTypes.aj" options="-1.5">
  3196. <message kind="warning" line="35" text="raw param type matching in execution ok"/>
  3197. <message kind="warning" line="67" text="raw return type matching in execution ok"/>
  3198. <message kind="warning" line="38" text="erasure type matching in execution ok"/>
  3199. <message kind="warning" line="42" text="erasure type matching in execution ok"/>
  3200. <message kind="warning" line="61" text="execution and parameterized method ok"/>
  3201. <message kind="warning" line="61" text="execution and generic interface ok"/>
  3202. <message kind="warning" line="65" text="execution and interface control test"/>
  3203. <message kind="warning" line="35" text="match on parameterized args"/>
  3204. <message kind="warning" line="67" text="match on parameterized return type"/>
  3205. </compile>
  3206. </ajc-test>
  3207. <ajc-test dir="java5/generics/pointcuts" title="execution with overriding of inherited generic members">
  3208. <compile files="ExecutionOverriding.aj" options="-1.5">
  3209. <message kind="warning" line="36" text="wildcard declaring type match on erasure"/>
  3210. <message kind="warning" line="49" text="wildcard declaring type match on erasure"/>
  3211. <message kind="warning" line="62" text="wildcard declaring type match on erasure"/>
  3212. <message kind="warning" line="36" text="base declaring type match on erasure"/>
  3213. <message kind="warning" line="49" text="base declaring type match on erasure"/>
  3214. <message kind="warning" line="62" text="base declaring type match on erasure"/>
  3215. <message kind="warning" line="49" text="sub type match on erasure"/>
  3216. <message kind="warning" line="62" text="parameterized match on erasure"/>
  3217. <message kind="warning" line="79" text="erasure match on base interface"/>
  3218. <message kind="warning" line="79" text="wildcard match on erasure"/>
  3219. <message kind="warning" line="79" text="parameterized match"/>
  3220. </compile>
  3221. </ajc-test>
  3222. <ajc-test dir="java5/generics/pointcuts" title="execution pcd with generic declaring type and erased parameter types">
  3223. <compile files="GenericInterface.java,ConcreteImplementingClass.java,GenericImplementingClass.java,GenericDeclaringTypeWithParameterErasure.aj" options="-1.5">
  3224. </compile>
  3225. </ajc-test>
  3226. <ajc-test dir="java5/generics/pointcuts" title="execution pcd with generic signature matching">
  3227. <compile files="GenericInterface.java,ConcreteImplementingClass.java,GenericImplementingClass.java,GenericSignatureMatching.aj" options="-1.5">
  3228. <message kind="warning" line="4" text="execution&lt;T&gt;(* GenericInterface&lt;T extends Number&gt;.asInt(T))"/>
  3229. <message kind="warning" line="5" text="execution&lt;T&gt;(* GenericInterface&lt;T extends Number&gt;.asInt(T))"/>
  3230. </compile>
  3231. </ajc-test>
  3232. <ajc-test dir="java5/generics/pointcuts" title="call with various parameterizations and generic types - errors">
  3233. <compile files="CallPointcutMatchingErrorCases.aj" options="-1.5">
  3234. <message kind="warning" line="4" text="no match for this type name: T"/>
  3235. <message kind="error" line="4" text="can't use parameterized type patterns for the declaring type of a call pointcut expression (use the raw type instead)"/>
  3236. <message kind="error" line="5" text="can't use parameterized type patterns for the declaring type of a call pointcut expression (use the raw type instead)"/>
  3237. <message kind="error" line="6" text="invalid throws pattern: a generic class may not be a direct or indirect subclass of Throwable"/>
  3238. </compile>
  3239. </ajc-test>
  3240. <ajc-test dir="java5/generics/pointcuts" title="call with various parameterizations and generic types - matching">
  3241. <compile files="CallPointcutMatchingParamAndReturnTypes.aj" options="-1.5">
  3242. <message kind="warning" line="7" text="raw param type matching in call ok"/>
  3243. <message kind="warning" line="8" text="raw return type matching in call ok"/>
  3244. <message kind="warning" line="9" text="erasure type matching in call ok"/>
  3245. <message kind="warning" line="10" text="erasure type matching in call ok"/>
  3246. <message kind="warning" line="11" text="call and parameterized method ok"/>
  3247. <message kind="warning" line="11" text="call and generic interface ok"/>
  3248. <message kind="warning" line="12" text="call and interface control test"/>
  3249. <message kind="warning" line="7" text="match on parameterized args"/>
  3250. <message kind="warning" line="8" text="match on parameterized return type"/>
  3251. </compile>
  3252. </ajc-test>
  3253. <ajc-test dir="java5/generics/pointcuts" title="call with overriding of inherited generic members">
  3254. <compile files="CallOverriding.aj" options="-1.5">
  3255. <message kind="warning" line="8" text="wildcard declaring type match on erasure"/>
  3256. <message kind="warning" line="9" text="wildcard declaring type match on erasure"/>
  3257. <message kind="warning" line="10" text="wildcard declaring type match on erasure"/>
  3258. <message kind="warning" line="8" text="base declaring type match on erasure"/>
  3259. <message kind="warning" line="9" text="base declaring type match on erasure"/>
  3260. <message kind="warning" line="10" text="base declaring type match on erasure"/>
  3261. <message kind="warning" line="9" text="sub type match on erasure"/>
  3262. <message kind="warning" line="10" text="parameterized match on erasure"/>
  3263. <message kind="warning" line="87" text="erasure match on base interface"/>
  3264. <message kind="warning" line="87" text="wildcard match on erasure"/>
  3265. <message kind="warning" line="87" text="parameterized match"/>
  3266. </compile>
  3267. </ajc-test>
  3268. <ajc-test dir="java5/generics/pointcuts" title="call with bridge methods">
  3269. <compile files="CallWithBridgeMethods.aj" options="-1.5">
  3270. <message kind="warning" line="23" text="should match call to bridge method on L23, this is a real call!"/>
  3271. </compile>
  3272. </ajc-test>
  3273. <ajc-test dir="java5/generics/pointcuts" title="args with raw type and generic / parameterized sigs">
  3274. <compile files="RawArgs.aj" options="-1.5">
  3275. </compile>
  3276. <run class="RawArgs">
  3277. <stdout>
  3278. <line text="args(List) match at call(void Generic.foo(List))"/>
  3279. <line text="args(List) match at call(void Generic.bar(List))"/>
  3280. <line text="args(List) match at call(void Generic.tada(List))"/>
  3281. <line text="args(List) match at call(void Generic.tada(List))"/>
  3282. <line text="args(List) match at call(void Generic.tada(List))"/>
  3283. </stdout>
  3284. </run>
  3285. </ajc-test>
  3286. <ajc-test dir="java5/generics/pointcuts" title="args with parameterized type and generic / parameterized sigs">
  3287. <compile files="ArgsParameterized.aj" options="-1.5">
  3288. <message kind="warning" line="28" text="unchecked match of List&lt;String&gt; with List"/>
  3289. </compile>
  3290. <run class="ArgsParameterized">
  3291. <stdout>
  3292. <line text="args(List&lt;String&gt; matched at call(void Generic.foo(List))"/>
  3293. <line text="args(List&lt;String&gt; matched at call(void Generic.bar(List))"/>
  3294. <line text="args(List&lt;String&gt; matched at call(void Generic.tada(List))"/>
  3295. <line text="args(List&lt;String&gt; matched at call(void Generic.something(List))"/>
  3296. <line text="args(List&lt;String&gt; matched at call(void MustBeString.listit(List))"/>
  3297. </stdout>
  3298. </run>
  3299. </ajc-test>
  3300. <ajc-test dir="java5/generics/pointcuts" title="args with parameterized type and wildcards">
  3301. <compile files="ArgsParameterizedWithWildcards.aj" options="-1.5">
  3302. <message kind="warning" line="10" text="unchecked match of List&lt;Double&gt; with List when argument is an instance of List"/>
  3303. <message kind="warning" line="10" text="unchecked match of List&lt;Double&gt; with List&lt;? extends Double&gt; when argument is an instance of List"/>
  3304. <message kind="warning" line="10" text="unchecked match of List&lt;Double&gt; with List&lt;? extends Number&gt; when argument is an instance of List"/>
  3305. <message kind="warning" line="10" text="unchecked match of List&lt;Double&gt; with List&lt;?&gt; when argument is an instance of List"/>
  3306. </compile>
  3307. <run class="ArgsParameterizedWithWildcards">
  3308. <stdout>
  3309. <line text="List&lt;Double&gt; matched at execution(void C.rawList(List))"/>
  3310. <line text="List&lt;Double&gt; matched at execution(void C.listOfSomething(List))"/>
  3311. <line text="List&lt;Double&gt; matched at execution(void C.listOfSomeNumber(List))"/>
  3312. <line text="List&lt;Double&gt; matched at execution(void C.listOfDouble(List))"/>
  3313. <line text="List&lt;Double&gt; matched at execution(void C.listOfSomeDouble(List))"/>
  3314. </stdout>
  3315. </run>
  3316. </ajc-test>
  3317. <ajc-test dir="java5/generics/pointcuts" title="args with generic wildcard">
  3318. <compile files="ArgsListOfSomething.aj" options="-1.5">
  3319. </compile>
  3320. <run class="ArgsListOfSomething">
  3321. <stdout>
  3322. <line text="List&lt;?&gt; matches execution(void ArgsListOfSomething.rawList(List))"/>
  3323. <line text="List&lt;?&gt; matches execution(void ArgsListOfSomething.listOfString(List))"/>
  3324. <line text="List&lt;?&gt; matches execution(void ArgsListOfSomething.listOfSomething(List))"/>
  3325. <line text="List&lt;?&gt; matches execution(void ArgsListOfSomething.listOfSomethingExtends(List))"/>
  3326. <line text="List&lt;?&gt; matches execution(void ArgsListOfSomething.listOfSomethingSuper(List))"/>
  3327. <line text="wild map matches execution(void ArgsListOfSomething.mapit(Map))"/>
  3328. <line text="exact wild map matches execution(void ArgsListOfSomething.mapit(Map))"/>
  3329. <line text="super type exact matches execution(void ArgsListOfSomething.setOf(HashSet))"/>
  3330. <line text="super wild type matches execution(void ArgsListOfSomething.setOf(HashSet))"/>
  3331. </stdout>
  3332. </run>
  3333. </ajc-test>
  3334. <ajc-test dir="java5/generics/pointcuts" title="args with generic wildcard extends">
  3335. <compile files="ArgsListOfSomethingExtends.aj" options="-1.5">
  3336. <message kind="warning" line="27" text="unchecked match of List&lt;? extends Number&gt; with List"/>
  3337. <message kind="warning" line="27" text="unchecked match of List&lt;? extends Number&gt; with List&lt;?&gt;"/>
  3338. </compile>
  3339. <run class="ArgsListOfSomethingExtends">
  3340. <stdout>
  3341. <line text="List&lt;? extends Number&gt; matches execution(void ArgsListOfSomethingExtends.rawList(List))"/>
  3342. <line text="List&lt;? extends Number&gt; matches execution(void ArgsListOfSomethingExtends.listOfNumber(List))"/>
  3343. <line text="List&lt;? extends Number&gt; matches execution(void ArgsListOfSomethingExtends.listOfDouble(List))"/>
  3344. <line text="List&lt;? extends Number&gt; matches execution(void ArgsListOfSomethingExtends.listOfSomething(List))"/>
  3345. <line text="List&lt;? extends Number&gt; matches execution(void ArgsListOfSomethingExtends.listOfSomethingExtends(List))"/>
  3346. </stdout>
  3347. </run>
  3348. </ajc-test>
  3349. <ajc-test dir="java5/generics/pointcuts" title="args with generic wildcard super">
  3350. <compile files="ArgsListOfSomethingSuper.aj" options="-1.5">
  3351. <message kind="warning" line="32" text="unchecked match of List&lt;? super Number&gt; with List"/>
  3352. <message kind="warning" line="32" text="unchecked match of List&lt;? super Number&gt; with List&lt;?&gt;"/>
  3353. <message kind="warning" line="32" text="unchecked match of List&lt;? super Number&gt; with List&lt;? extends Number&gt;"/>
  3354. </compile>
  3355. <run class="ArgsListOfSomethingSuper">
  3356. <stdout>
  3357. <line text="List&lt;? super Number&gt; matches execution(void ArgsListOfSomethingSuper.rawList(List))"/>
  3358. <line text="List&lt;? super Number&gt; matches execution(void ArgsListOfSomethingSuper.listOfObject(List))"/>
  3359. <line text="List&lt;? super Number&gt; matches execution(void ArgsListOfSomethingSuper.listOfNumber(List))"/>
  3360. <line text="List&lt;? super Number&gt; matches execution(void ArgsListOfSomethingSuper.listOfSomething(List))"/>
  3361. <line text="List&lt;? super Number&gt; matches execution(void ArgsListOfSomethingSuper.listOfSomethingSuper(List))"/>
  3362. <line text="List&lt;? super Number&gt; matches execution(void ArgsListOfSomethingSuper.listOfSomethingExtendsNumber(List))"/>
  3363. </stdout>
  3364. </run>
  3365. </ajc-test>
  3366. <ajc-test dir="java5/generics/pointcuts" title="generic method matching">
  3367. <compile files="GenericMethods.aj" options="-1.5">
  3368. <message kind="warning" line="19" text="static generic method match"/>
  3369. <message kind="warning" line="34" text="static generic method match"/>
  3370. <message kind="warning" line="24" text="instance generic method match"/>
  3371. <message kind="warning" line="39" text="instance generic method match"/>
  3372. </compile>
  3373. </ajc-test>
  3374. <ajc-test dir="java5/generics/pointcuts" title="generic wildcards in signature matching">
  3375. <compile files="GenericWildcardsInSignatureMatching.aj" options="-1.5">
  3376. <message kind="warning" line="5" text="set of a list"/>
  3377. <message kind="warning" line="7" text="exact nested wildcard match"/>
  3378. <message kind="warning" line="7" text="wildcard nested wildcard match"/>
  3379. <message kind="warning" line="11" text="super"/>
  3380. <message kind="warning" line="15" text="super wild match"/>
  3381. </compile>
  3382. </ajc-test>
  3383. <!-- end of generics and pointcuts tests -->
  3384. <ajc-test dir="java5/generics/afterAdvice" title="after throwing with parameterized throw type">
  3385. <compile files="AfterThrowing.aj" options="-1.5">
  3386. <message kind="error" line="6" text="cannot convert from List&lt;String&gt; to Throwable"/>
  3387. </compile>
  3388. </ajc-test>
  3389. <ajc-test dir="java5/generics/afterAdvice" title="after returning with raw type and generic / parameterized sigs">
  3390. <compile files="AfterReturningRawType.aj" options="-1.5">
  3391. </compile>
  3392. <run class="AfterReturningRawType">
  3393. <stdout>
  3394. <line text="returning(List) match at call(List Generic.foo(List))"/>
  3395. <line text="returning(List) match at call(List Generic.bar(List))"/>
  3396. <line text="returning(List) match at call(List Generic.tada(List))"/>
  3397. <line text="returning(List) match at call(List Generic.tada(List))"/>
  3398. <line text="returning(List) match at call(List Generic.tada(List))"/>
  3399. </stdout>
  3400. </run>
  3401. </ajc-test>
  3402. <ajc-test dir="java5/generics/afterAdvice" title="after returning with parameterized type and generic / parameterized sigs">
  3403. <compile files="AfterReturningParameterized.aj" options="-1.5">
  3404. <message kind="warning" line="28" text="unchecked match of List&lt;String&gt; with List"/>
  3405. </compile>
  3406. <run class="AfterReturningParameterized">
  3407. <stdout>
  3408. <line text="returning(List&lt;String&gt; matched at call(List Generic.foo(List))"/>
  3409. <line text="returning(List&lt;String&gt; matched at call(List Generic.bar(List))"/>
  3410. <line text="returning(List&lt;String&gt; matched at call(List Generic.tada(List))"/>
  3411. <line text="returning(List&lt;String&gt; matched at call(List Generic.something(List))"/>
  3412. <line text="returning(List&lt;String&gt; matched at call(List MustBeString.listit(List))"/>
  3413. </stdout>
  3414. </run>
  3415. </ajc-test>
  3416. <ajc-test dir="java5/generics/afterAdvice" title="after returning with parameterized type and wildcards">
  3417. <compile files="AfterReturningParameterizedWithWildcards.aj" options="-1.5">
  3418. <message kind="warning" line="10" text="unchecked match of List&lt;Double&gt; with List when argument is an instance of List"/>
  3419. <message kind="warning" line="10" text="unchecked match of List&lt;Double&gt; with List&lt;? extends Double&gt; when argument is an instance of List"/>
  3420. <message kind="warning" line="10" text="unchecked match of List&lt;Double&gt; with List&lt;? extends Number&gt; when argument is an instance of List"/>
  3421. <message kind="warning" line="10" text="unchecked match of List&lt;Double&gt; with List&lt;?&gt; when argument is an instance of List"/>
  3422. </compile>
  3423. <run class="AfterReturningParameterizedWithWildcards">
  3424. <stdout>
  3425. <line text="List&lt;Double&gt; matched at call(List C.rawList(List))"/>
  3426. <line text="List&lt;Double&gt; matched at call(List C.listOfSomething(List))"/>
  3427. <line text="List&lt;Double&gt; matched at call(List C.listOfSomeNumber(List))"/>
  3428. <line text="List&lt;Double&gt; matched at call(List C.listOfDouble(List))"/>
  3429. <line text="List&lt;Double&gt; matched at call(List C.listOfSomeDouble(List))"/>
  3430. </stdout>
  3431. </run>
  3432. </ajc-test>
  3433. <ajc-test dir="java5/generics/afterAdvice" title="after returning with generic wildcard">
  3434. <compile files="AfterReturningListOfSomething.aj" options="-1.5">
  3435. </compile>
  3436. <run class="AfterReturningListOfSomething">
  3437. <stdout>
  3438. <line text="List&lt;?&gt; matches execution(List AfterReturningListOfSomething.rawList(List))"/>
  3439. <line text="List&lt;?&gt; matches execution(List AfterReturningListOfSomething.listOfString(List))"/>
  3440. <line text="List&lt;?&gt; matches execution(List AfterReturningListOfSomething.listOfSomething(List))"/>
  3441. <line text="List&lt;?&gt; matches execution(List AfterReturningListOfSomething.listOfSomethingExtends(List))"/>
  3442. <line text="List&lt;?&gt; matches execution(List AfterReturningListOfSomething.listOfSomethingSuper(List))"/>
  3443. <line text="wild map matches execution(Map AfterReturningListOfSomething.mapit(Map))"/>
  3444. <line text="exact wild map matches execution(Map AfterReturningListOfSomething.mapit(Map))"/>
  3445. <line text="super type exact matches execution(HashSet AfterReturningListOfSomething.setOf(HashSet))"/>
  3446. <line text="super wild type matches execution(HashSet AfterReturningListOfSomething.setOf(HashSet))"/>
  3447. </stdout>
  3448. </run>
  3449. </ajc-test>
  3450. <ajc-test dir="java5/generics/afterAdvice" title="after returning with generic wildcard extends">
  3451. <compile files="AfterReturningListOfSomethingExtends.aj" options="-1.5">
  3452. <message kind="warning" line="27" text="unchecked match of List&lt;? extends Number&gt; with List"/>
  3453. <message kind="warning" line="27" text="unchecked match of List&lt;? extends Number&gt; with List&lt;?&gt;"/>
  3454. </compile>
  3455. <run class="AfterReturningListOfSomethingExtends">
  3456. <stdout>
  3457. <line text="List&lt;? extends Number&gt; matches execution(List AfterReturningListOfSomethingExtends.rawList(List))"/>
  3458. <line text="List&lt;? extends Number&gt; matches execution(List AfterReturningListOfSomethingExtends.listOfNumber(List))"/>
  3459. <line text="List&lt;? extends Number&gt; matches execution(List AfterReturningListOfSomethingExtends.listOfDouble(List))"/>
  3460. <line text="List&lt;? extends Number&gt; matches execution(List AfterReturningListOfSomethingExtends.listOfSomething(List))"/>
  3461. <line text="List&lt;? extends Number&gt; matches execution(List AfterReturningListOfSomethingExtends.listOfSomethingExtends(List))"/>
  3462. </stdout>
  3463. </run>
  3464. </ajc-test>
  3465. <ajc-test dir="java5/generics/afterAdvice" title="after returning with generic wildcard super">
  3466. <compile files="AfterReturningListOfSomethingSuper.aj" options="-1.5">
  3467. <message kind="warning" line="32" text="unchecked match of List&lt;? super Number&gt; with List"/>
  3468. <message kind="warning" line="32" text="unchecked match of List&lt;? super Number&gt; with List&lt;?&gt;"/>
  3469. <message kind="warning" line="32" text="unchecked match of List&lt;? super Number&gt; with List&lt;? extends Number&gt;"/>
  3470. </compile>
  3471. <run class="AfterReturningListOfSomethingSuper">
  3472. <stdout>
  3473. <line text="List&lt;? super Number&gt; matches execution(List AfterReturningListOfSomethingSuper.rawList(List))"/>
  3474. <line text="List&lt;? super Number&gt; matches execution(List AfterReturningListOfSomethingSuper.listOfObject(List))"/>
  3475. <line text="List&lt;? super Number&gt; matches execution(List AfterReturningListOfSomethingSuper.listOfNumber(List))"/>
  3476. <line text="List&lt;? super Number&gt; matches execution(List AfterReturningListOfSomethingSuper.listOfSomething(List))"/>
  3477. <line text="List&lt;? super Number&gt; matches execution(List AfterReturningListOfSomethingSuper.listOfSomethingSuper(List))"/>
  3478. <line text="List&lt;? super Number&gt; matches execution(List AfterReturningListOfSomethingSuper.listOfSomethingExtendsNumber(List))"/>
  3479. </stdout>
  3480. </run>
  3481. </ajc-test>
  3482. <ajc-test title="ajdk notebook: erasure matching examples" dir="java5/generics/ajdk">
  3483. <compile files="ErasureMatching.aj" options="-1.5">
  3484. <message kind="warning" line="18" text="static generic method match"/>
  3485. <message kind="warning" line="21" text="instance generic method match"/>
  3486. <message kind="warning" line="31" text="method in generic type match"/>
  3487. <message kind="warning" line="28" text="field in generic type match"/>
  3488. </compile>
  3489. </ajc-test>
  3490. <ajc-test title="ajdk notebook: simple parameterized type matching examples" dir="java5/generics/ajdk">
  3491. <compile files="SimpleParameterizedTypeExamples.aj" options="-1.5">
  3492. <message kind="warning" line="34" text="get myStrings 1"/>
  3493. <message kind="warning" line="34" text="get myStrings 2"/>
  3494. <message kind="warning" line="38" text="get myStrings 1"/>
  3495. <message kind="warning" line="38" text="get myStrings 2"/>
  3496. <message kind="warning" line="35" text="get myFloats 1"/>
  3497. <message kind="warning" line="35" text="get myFloats 2"/>
  3498. <message kind="warning" line="35" text="get myFloats 3"/>
  3499. <message kind="warning" line="34" text="getter 1"/>
  3500. <message kind="warning" line="35" text="getter 1"/>
  3501. <message kind="warning" line="34" text="getter 2"/>
  3502. <message kind="warning" line="35" text="getter 2"/>
  3503. <message kind="warning" line="34" text="getter 3"/>
  3504. <message kind="warning" line="35" text="getter 4"/>
  3505. <message kind="warning" line="25" text="call 1"/>
  3506. <message kind="warning" line="25" text="call 2"/>
  3507. </compile>
  3508. </ajc-test>
  3509. <ajc-test title="ajdk notebook: mixed parameterized types and generic methods" dir="java5/generics/ajdk">
  3510. <compile files="MixedParameterizedAndTypeVariables.aj" options="-1.5">
  3511. <message kind="warning" line="13" text="erasure match"/>
  3512. <message kind="warning" line="13" text="mixed match"/>
  3513. <message kind="warning" line="13" text="params only match"/>
  3514. </compile>
  3515. </ajc-test>
  3516. <ajc-test title="ajdk notebook: signature matching with generic wildcards" dir="java5/generics/ajdk">
  3517. <compile files="SignatureWildcards.aj" options="-1.5">
  3518. <message kind="warning" line="13" text="any list"/>
  3519. <message kind="warning" line="15" text="any list"/>
  3520. <message kind="warning" line="17" text="any list"/>
  3521. <message kind="warning" line="13" text="only foo"/>
  3522. <message kind="warning" line="15" text="some list"/>
  3523. <message kind="warning" line="13" text="any list with upper bound"/>
  3524. <message kind="warning" line="15" text="any list with upper bound"/>
  3525. </compile>
  3526. </ajc-test>
  3527. <ajc-test title="ajdk notebook: bridge method examples" dir="java5/generics/ajdk">
  3528. <compile files="BridgeMethodExamples.aj" options="-1.5">
  3529. <message kind="warning" line="17" text="double match"/>
  3530. <message kind="warning" line="25" text="double match"/>
  3531. <message kind="warning" line="9" text="match"/>
  3532. <message kind="warning" line="11" text="match"/>
  3533. </compile>
  3534. </ajc-test>
  3535. <ajc-test title="ajdk notebook: args examples" dir="java5/generics/ajdk">
  3536. <compile files="ArgsExamples.aj" options="-1.5">
  3537. <message kind="warning" line="15" text="unchecked match of List&lt;Double&gt; with List&lt;? extends Number&gt; when argument is an instance of List at join point method-execution(void C.goo(List&lt;? extends Number&gt;)) [Xlint:uncheckedArgument]"/>
  3538. <message kind="warning" line="53" text="unchecked match"/>
  3539. </compile>
  3540. <run class="ArgsExamples">
  3541. <stdout>
  3542. <line text="args(List)"/>
  3543. <line text="args List of String"/>
  3544. <line text="args(List)"/>
  3545. <line text="args List of Double"/>
  3546. <line text="args(List)"/>
  3547. <line text="args List of Double"/>
  3548. </stdout>
  3549. </run>
  3550. </ajc-test>
  3551. <ajc-test title="ajdk notebook: after returning examples" dir="java5/generics/ajdk">
  3552. <compile files="AfterReturningExamples.aj" options="-1.5">
  3553. <message kind="warning" line="20" text="unchecked match of List&lt;Double&gt; with List&lt;? extends Number&gt;"/>
  3554. </compile>
  3555. <run class="AfterReturningExamples">
  3556. <stdout>
  3557. <line text="execution(List C.foo(List))"/>
  3558. <line text="raw s1"/>
  3559. <line text="raw s2"/>
  3560. <line text="execution(List C.bar(List))"/>
  3561. <line text="raw 5.0"/>
  3562. <line text="raw 10.0"/>
  3563. <line text="a1 5.0"/>
  3564. <line text="a1 10.0"/>
  3565. <line text="a2 5.0"/>
  3566. <line text="a2 10.0"/>
  3567. <line text="a3 5.0"/>
  3568. <line text="a3 10.0"/>
  3569. <line text="execution(List C.goo(List))"/>
  3570. <line text="raw 5.0"/>
  3571. <line text="raw 10.0"/>
  3572. <line text="a1 5.0"/>
  3573. <line text="a1 10.0"/>
  3574. <line text="a3 5.0"/>
  3575. <line text="a3 10.0"/>
  3576. </stdout>
  3577. </run>
  3578. </ajc-test>
  3579. <ajc-test title="ajdk notebook: args and wildcards examples" dir="java5/generics/ajdk">
  3580. <compile files="WildcardArgsExamples.aj" options="-1.5">
  3581. <message kind="warning" line="6" text="unchecked match of List&lt;? extends Number&gt; with List"/>
  3582. </compile>
  3583. <run class="WildcardArgsExamples">
  3584. <stdout>
  3585. <line text="advice match at call(void C.foo(Object))"/>
  3586. <line text="advice match at call(void C.foo(Object))"/>
  3587. <line text="advice match 2 at call(void C.goo1(List))"/>
  3588. <line text="advice match 2 at call(void C.goo2(List))"/>
  3589. <line text="advice match 2 at call(void C.goo4(List))"/>
  3590. </stdout>
  3591. </run>
  3592. </ajc-test>
  3593. <ajc-test title="ajdk notebook: pointcut in generic class example" dir="java5/generics/ajdk">
  3594. <compile files="PointcutInGenericClassExample.aj" options="-1.5">
  3595. <message kind="warning" line="23" text="parameterized with C"/>
  3596. <message kind="warning" line="29" text="parameterized with D"/>
  3597. </compile>
  3598. </ajc-test>
  3599. <!-- ============================================================== -->
  3600. <!-- End of generics tests -->
  3601. <!-- ============================================================== -->
  3602. <ajc-test dir="bugs150/pr98901" title="public method with declare @method">
  3603. <compile files="Case01.aj" options="-1.5 -Xlint:error"/>
  3604. <run class="B01">
  3605. <stdout>
  3606. <line text="@anInterface()"/>
  3607. </stdout>
  3608. </run>
  3609. </ajc-test>
  3610. <ajc-test dir="bugs150/pr98901" title="public method on the aspect that declares @method on it">
  3611. <compile files="Case02.aj" options="-1.5 -Xlint:error"/>
  3612. <run class="B02">
  3613. <stdout>
  3614. <line text="@anInterface()"/>
  3615. </stdout>
  3616. </run>
  3617. </ajc-test>
  3618. <ajc-test dir="bugs150/pr98901" title="public annotated method">
  3619. <compile files="Case03.aj" options="-1.5 -Xlint:error"/>
  3620. <run class="B03">
  3621. <stdout>
  3622. <line text="@anInterface()"/>
  3623. </stdout>
  3624. </run>
  3625. </ajc-test>
  3626. <ajc-test dir="bugs150/pr98901" title="public ITD method with declare @method">
  3627. <compile files="Case04.aj" options="-1.5 -Xlint:error"/>
  3628. <run class="B04">
  3629. <stdout>
  3630. <line text="@anInterface()"/>
  3631. </stdout>
  3632. </run>
  3633. </ajc-test>
  3634. <ajc-test dir="bugs150/pr98901" title="public annotated ITD method">
  3635. <compile files="Case05.aj" options="-1.5 -Xlint:error"/>
  3636. <run class="B05">
  3637. <stdout>
  3638. <line text="@anInterface()"/>
  3639. </stdout>
  3640. </run>
  3641. </ajc-test>
  3642. <ajc-test dir="bugs150/pr98901" title="public ITD-on-itself method with declare @method">
  3643. <compile files="Case06.aj" options="-1.5 -Xlint:error"/>
  3644. <run class="B06">
  3645. <stdout>
  3646. <line text="@anInterface()"/>
  3647. </stdout>
  3648. </run>
  3649. </ajc-test>
  3650. <ajc-test dir="bugs150/pr98901" title="public annotated ITD-on-itself method">
  3651. <compile files="Case07.aj" options="-1.5 -Xlint:error"/>
  3652. <run class="B07">
  3653. <stdout>
  3654. <line text="@anInterface()"/>
  3655. </stdout>
  3656. </run>
  3657. </ajc-test>
  3658. <ajc-test dir="bugs150/pr98901" title="public method on an Interface with declare @method">
  3659. <compile files="Case08.aj" options="-1.5 -Xlint:error"/>
  3660. <run class="B08">
  3661. <stdout>
  3662. <line text="@anInterface()"/>
  3663. </stdout>
  3664. </run>
  3665. </ajc-test>
  3666. <ajc-test dir="bugs150/pr98901" title="public annotated method on an Interface">
  3667. <compile files="Case09.aj" options="-1.5 -Xlint:error"/>
  3668. <run class="B09">
  3669. <stdout>
  3670. <line text="@anInterface()"/>
  3671. </stdout>
  3672. </run>
  3673. </ajc-test>
  3674. <ajc-test dir="bugs150/pr98901" title="public ITD method onto an Interface with declare @method">
  3675. <compile files="Case10.aj" options="-1.5 -Xlint:error"/>
  3676. <run class="B10">
  3677. <stdout>
  3678. <line text="@anInterface()"/>
  3679. </stdout>
  3680. </run>
  3681. </ajc-test>
  3682. <ajc-test dir="bugs150/pr98901" title="public annotated ITD method onto an Interface">
  3683. <compile files="Case11.aj" options="-1.5 -Xlint:error"/>
  3684. <run class="B11">
  3685. <stdout>
  3686. <line text="@anInterface()"/>
  3687. </stdout>
  3688. </run>
  3689. </ajc-test>
  3690. <ajc-test dir="bugs150/pr98901" title="public abstract method with declare @method">
  3691. <compile files="Case12.aj" options="-1.5 -Xlint:error"/>
  3692. <run class="B12">
  3693. <stdout>
  3694. <line text="@anInterface()"/>
  3695. </stdout>
  3696. </run>
  3697. </ajc-test>
  3698. <ajc-test dir="bugs150/pr98901" title="public abstract method on the aspect that declares @method on it">
  3699. <compile files="Case13.aj" options="-1.5 -Xlint:error"/>
  3700. <run class="B13">
  3701. <stdout>
  3702. <line text="@anInterface()"/>
  3703. </stdout>
  3704. </run>
  3705. </ajc-test>
  3706. <ajc-test dir="bugs150/pr98901" title="public abstract annotated method">
  3707. <compile files="Case14.aj" options="-1.5 -Xlint:error"/>
  3708. <run class="B14">
  3709. <stdout>
  3710. <line text="@anInterface()"/>
  3711. </stdout>
  3712. </run>
  3713. </ajc-test>
  3714. <ajc-test dir="bugs150/pr98901" title="public abstract ITD method with declare @method">
  3715. <compile files="Case15.aj" options="-1.5 -Xlint:error"/>
  3716. <run class="B15">
  3717. <stdout>
  3718. <line text="@anInterface()"/>
  3719. </stdout>
  3720. </run>
  3721. </ajc-test>
  3722. <ajc-test dir="bugs150/pr98901" title="public abstract annotated ITD method">
  3723. <compile files="Case16.aj" options="-1.5 -Xlint:error"/>
  3724. <run class="B16">
  3725. <stdout>
  3726. <line text="@anInterface()"/>
  3727. </stdout>
  3728. </run>
  3729. </ajc-test>
  3730. <ajc-test dir="bugs150/pr98901" title="public abstract ITD-on-itself method with declare @method">
  3731. <compile files="Case17.aj" options="-1.5 -Xlint:error"/>
  3732. <run class="B17">
  3733. <stdout>
  3734. <line text="@anInterface()"/>
  3735. </stdout>
  3736. </run>
  3737. </ajc-test>
  3738. <ajc-test dir="bugs150/pr98901" title="public abstract annotated ITD-on-itself method">
  3739. <compile files="Case18.aj" options="-1.5 -Xlint:error"/>
  3740. <run class="B18">
  3741. <stdout>
  3742. <line text="@anInterface()"/>
  3743. </stdout>
  3744. </run>
  3745. </ajc-test>
  3746. <ajc-test dir="bugs150/pr98901" title="public abstract method on an Interface with declare @method">
  3747. <compile files="Case19.aj" options="-1.5 -Xlint:error"/>
  3748. <run class="B19">
  3749. <stdout>
  3750. <line text="@anInterface()"/>
  3751. </stdout>
  3752. </run>
  3753. </ajc-test>
  3754. <ajc-test dir="bugs150/pr98901" title="public abstract annotated method on an Interface">
  3755. <compile files="Case20.aj" options="-1.5 -Xlint:error"/>
  3756. <run class="B20">
  3757. <stdout>
  3758. <line text="@anInterface()"/>
  3759. </stdout>
  3760. </run>
  3761. </ajc-test>
  3762. <ajc-test dir="bugs150/pr98901" title="public abstract ITD method onto an Interface with declare @method">
  3763. <compile files="Case21.aj" options="-1.5 -Xlint:error"/>
  3764. <run class="B21">
  3765. <stdout>
  3766. <line text="@anInterface()"/>
  3767. </stdout>
  3768. </run>
  3769. </ajc-test>
  3770. <ajc-test dir="bugs150/pr98901" title="public abstract annotated ITD method onto an Interface">
  3771. <compile files="Case22.aj" options="-1.5 -Xlint:error"/>
  3772. <run class="B22">
  3773. <stdout>
  3774. <line text="@anInterface()"/>
  3775. </stdout>
  3776. </run>
  3777. </ajc-test>
  3778. <ajc-test dir="bugs150/pr98901" title="public field with declare @field">
  3779. <compile files="Case23.aj" options="-1.5 -Xlint:error"/>
  3780. <run class="B23">
  3781. <stdout>
  3782. <line text="@anInterface()"/>
  3783. </stdout>
  3784. </run>
  3785. </ajc-test>
  3786. <ajc-test dir="bugs150/pr98901" title="public field on the aspect that declares @field on it">
  3787. <compile files="Case24.aj" options="-1.5 -Xlint:error"/>
  3788. <run class="B24">
  3789. <stdout>
  3790. <line text="@anInterface()"/>
  3791. </stdout>
  3792. </run>
  3793. </ajc-test>
  3794. <ajc-test dir="bugs150/pr98901" title="public annotated field">
  3795. <compile files="Case25.aj" options="-1.5 -Xlint:error"/>
  3796. <run class="B25">
  3797. <stdout>
  3798. <line text="@anInterface()"/>
  3799. </stdout>
  3800. </run>
  3801. </ajc-test>
  3802. <ajc-test dir="bugs150/pr98901" title="public ITD field with declare @field">
  3803. <compile files="Case26.aj" options="-1.5 -Xlint:error"/>
  3804. <run class="B26">
  3805. <stdout>
  3806. <line text="@anInterface()"/>
  3807. </stdout>
  3808. </run>
  3809. </ajc-test>
  3810. <ajc-test dir="bugs150/pr98901" title="public annotated ITD field">
  3811. <compile files="Case27.aj" options="-1.5 -Xlint:error"/>
  3812. <run class="B27">
  3813. <stdout>
  3814. <line text="@anInterface()"/>
  3815. </stdout>
  3816. </run>
  3817. </ajc-test>
  3818. <ajc-test dir="bugs150/pr98901" title="public ITD-on-itself field with declare @field">
  3819. <compile files="Case28.aj" options="-1.5 -Xlint:error"/>
  3820. <run class="B28">
  3821. <stdout>
  3822. <line text="@anInterface()"/>
  3823. </stdout>
  3824. </run>
  3825. </ajc-test>
  3826. <ajc-test dir="bugs150/pr98901" title="public annotated ITD-on-itself field">
  3827. <compile files="Case29.aj" options="-1.5 -Xlint:error"/>
  3828. <run class="B29">
  3829. <stdout>
  3830. <line text="@anInterface()"/>
  3831. </stdout>
  3832. </run>
  3833. </ajc-test>
  3834. </suite>