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

xlint-tests.xml 11KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267
  1. <!-- XLint Tests -->
  2. <!-- .................................... -Xlint tests -->
  3. <!-- ............... positive -Xlint tests -->
  4. <ajc-test dir="bugs/lazyTjpXLintWarning"
  5. title="no XLint warning: thisJoinPoint potentially lazy and nothing stopping it">
  6. <compile options="-Xlint:warning" files="Scenario1.aj"/>
  7. </ajc-test>
  8. <ajc-test dir="bugs/lazyTjpXLintWarning"
  9. title="XLint warning: thisJoinPoint potentially lazy but stopped by around advice which doesn't use tjp">
  10. <compile options="-Xlint:warning" files="Scenario2.aj">
  11. <message kind="warning" line="21" text="can not implement lazyTjp on this joinpoint method-execution(void Test.main(java.lang.String[])) because around advice is used [Xlint:canNotImplementLazyTjp]"/>
  12. </compile>
  13. </ajc-test>
  14. <ajc-test dir="bugs/lazyTjpXLintWarning"
  15. title="no XLint warning: thisJoinPoint not lazy (no if PCD) but would have been stopped anyway by around advice">
  16. <compile options="-Xlint:warning" files="Scenario3.aj">
  17. <message kind="warning" line="14" text="can not build thisJoinPoint lazily for this advice since it has no suitable guard. The advice applies at method-execution(void Test.main(java.lang.String[])) [Xlint:noGuardForLazyTjp]"/>
  18. </compile>
  19. </ajc-test>
  20. <ajc-test dir="bugs/lazyTjpXLintWarning" title="no XLint warning: thisJoinPoint cannot be built lazily">
  21. <compile options="-Xlint:warning" files="Scenario4.aj">
  22. <message kind="warning" line="9" text="can not build thisJoinPoint lazily for this advice since it has no suitable guard. The advice applies at method-execution(void Test.main(java.lang.String[]))"/>
  23. </compile>
  24. </ajc-test>
  25. <ajc-test dir="bugs/lazyTjpXLintWarning"
  26. title="XLint warning: thisJoinPoint potentially lazy but stopped by around advice which uses tjp">
  27. <compile options="-Xlint:warning" files="Scenario5.aj">
  28. <message kind="warning" line="22" text="can not implement lazyTjp on this joinpoint method-execution(void Test.main(java.lang.String[])) because around advice is used [Xlint:canNotImplementLazyTjp]"/>
  29. </compile>
  30. </ajc-test>
  31. <ajc-test dir="bugs/lazyTjpXLintWarning"
  32. title="check for xlazytjp warning if actually supplied">
  33. <compile options="-XlazyTjp -Xlint:warning" files="Scenario1.aj">
  34. <message kind="warning" text="-XlazyTjp should no longer be used, build tjps lazily is now the default"/>
  35. </compile>
  36. </ajc-test>
  37. <ajc-test dir="bugs/lazyTjpXLintWarning"
  38. title="lazytjp: warning when around advice uses tjp">
  39. <compile options="-Xlint:warning" files="LazyTjpTest1.java">
  40. <message kind="warning" line="4" text="can not implement lazyTjp on this joinpoint method-execution(void LazyTjpTest1.test2()) because around advice is used [Xlint:canNotImplementLazyTjp]"/>
  41. </compile>
  42. </ajc-test>
  43. <ajc-test dir="bugs/lazyTjpXLintWarning"
  44. title="lazytjp: warning when if missing on before advice">
  45. <compile options="-Xlint:warning" files="LazyTjpTest2.java">
  46. <message kind="warning" line="16" text="can not build thisJoinPoint lazily for this advice since it has no suitable guard. The advice applies at method-execution(void LazyTjpTest2.test2())"/>
  47. </compile>
  48. </ajc-test>
  49. <ajc-test dir="bugs/lazyTjpXLintWarning"
  50. title="lazytjp: warning when if missing on after advice">
  51. <compile options="-Xlint:warning" files="LazyTjpTest3.java">
  52. <message kind="warning" line="17" text="can not build thisJoinPoint lazily for this advice since it has no suitable guard. The advice applies at method-execution(void LazyTjpTest3.test2())"/>
  53. </compile>
  54. </ajc-test>
  55. <ajc-test dir="bugs/lazyTjpXLintWarning"
  56. title="lazytjp: multiple clashing advice preventing lazytjp">
  57. <compile options="-Xlint:warning" files="LazyTjpTest4.java">
  58. <message kind="warning" line="13" text="can not build thisJoinPoint lazily for this advice since it has no suitable guard. The advice applies at method-execution(void LazyTjpTest4.test1())"/>
  59. <message kind="warning" line="3" text="can not implement lazyTjp at joinpoint method-execution(void LazyTjpTest4.test1()) because of advice conflicts, see secondary locations to find conflicting advice"/>
  60. <message kind="warning" line="17" text="can not build thisJoinPoint lazily for this advice since it has no suitable guard. The advice applies at method-execution(void LazyTjpTest4.test1())"/>
  61. </compile>
  62. </ajc-test>
  63. <ajc-test dir="bugs/lazyTjpXLintWarning"
  64. title="lazytjp: interfering before and around">
  65. <compile options="-Xlint:warning" files="LazyTjpTest5.java">
  66. <message kind="warning" line="3" text="can not implement lazyTjp at joinpoint method-execution(void LazyTjpTest5.test1()) because of advice conflicts, see secondary locations to find conflicting advice"/>
  67. <message kind="warning" line="13" text="can not build thisJoinPoint lazily for this advice since it has no suitable guard. The advice applies at method-execution(void LazyTjpTest5.test1())"/>
  68. </compile>
  69. </ajc-test>
  70. <ajc-test dir="options"
  71. title="options -Xlint args()"
  72. keywords="lint">
  73. <compile files="XLintTypeArgsPCD.java">
  74. <message kind="warning" line="10"/>
  75. </compile>
  76. </ajc-test>
  77. <ajc-test dir="options"
  78. title="options declare field on bad type">
  79. <compile files="XLintTypeDeclareField.java" options="!eclipse">
  80. <message kind="error" line="10"/>
  81. </compile>
  82. </ajc-test>
  83. <ajc-test dir="options"
  84. title="options declare method on bad type">
  85. <compile files="XLintTypeDeclareMethod.java" options="!eclipse">
  86. <message kind="error" line="10"/>
  87. </compile>
  88. </ajc-test>
  89. <ajc-test dir="options"
  90. title="options -Xlint declare parent"
  91. keywords="lint">
  92. <compile files="XLintTypeDeclareParent.java">
  93. <message kind="warning" line="10"/>
  94. </compile>
  95. </ajc-test>
  96. <ajc-test dir="options"
  97. title="options -Xlint target()"
  98. keywords="lint">
  99. <compile files="XLintTypeTargetPCD.java">
  100. <message kind="warning" line="10"/>
  101. </compile>
  102. </ajc-test>
  103. <ajc-test dir="options"
  104. title="options -Xlint this()"
  105. keywords="lint">
  106. <compile files="XLintTypeThisPCD.java">
  107. <message kind="warning" line="10"/>
  108. </compile>
  109. </ajc-test>
  110. <!-- ............... negative -Xlint tests -->
  111. <ajc-test dir="options"
  112. title="options negative -Xlint args()"
  113. keywords="lint">
  114. <compile files="XLintTypeArgsPCD.java" options="-Xlint:ignore"/>
  115. </ajc-test>
  116. <ajc-test dir="options"
  117. title="options negative -Xlint declare parent"
  118. keywords="lint">
  119. <compile files="XLintTypeDeclareParent.java" options="-Xlint:ignore"/>
  120. </ajc-test>
  121. <ajc-test dir="options"
  122. title="options negative -Xlint target()"
  123. keywords="lint">
  124. <compile files="XLintTypeTargetPCD.java" options="-Xlint:ignore"/>
  125. </ajc-test>
  126. <ajc-test dir="options"
  127. title="options negative -Xlint this()"
  128. keywords="lint">
  129. <compile files="XLintTypeThisPCD.java" options="-Xlint:ignore"/>
  130. </ajc-test>
  131. <ajc-test dir="new"
  132. title="unmatched type name in a declare parents should result in a warning in -Xlint mode"
  133. keywords="tofix">
  134. <compile options="-Xlint" files="MissingTypeInDeclareParents.java">
  135. <message kind="warning" line="20"/>
  136. </compile>
  137. <run class="MissingTypeInDeclareParents"/>
  138. </ajc-test>
  139. <!-- The correct behavior of this program is to produce an Xlint
  140. warning for the lack of access to the needed type, and then
  141. to generate code with link errors that will throw a NoSuchMethodError
  142. when run.
  143. -->
  144. <ajc-test dir="bugs" pr="906"
  145. title="privileged access to code outside the control of the compiler">
  146. <compile files="PrivilegeBeyondScope.java" options="-Xlint:warning">
  147. <message kind="warning" line="23"/>
  148. </compile>
  149. </ajc-test>
  150. <ajc-test dir="bugs" pr="37739"
  151. title="Unexpected Xlint:unresolvableMember warning with withincode">
  152. <compile files="CatchSig.java">
  153. </compile>
  154. <run class="CatchSig"/>
  155. </ajc-test>
  156. <ajc-test dir="harness"
  157. title="valid XLintWarningTest file, default level of warning">
  158. <compile files="XLintWarningTest.java">
  159. <message kind="warning" line="5"
  160. text="Xlint:invalidAbsoluteTypeName"/>
  161. </compile>
  162. </ajc-test>
  163. <ajc-test dir="harness"
  164. title="XLint:ignore suppresses XLint warnings">
  165. <compile files="XLintWarningTest.java" options="-Xlint:ignore"/>
  166. </ajc-test>
  167. <ajc-test dir="harness"
  168. title="XLint:error promotes XLint warnings to error">
  169. <compile files="XLintWarningTest.java" options="-Xlint:error">
  170. <message kind="error" line="5"
  171. text="Xlint:invalidAbsoluteTypeName"/>
  172. </compile>
  173. </ajc-test>
  174. <ajc-test dir="bugs" pr="49250"
  175. title="alias getCause for getWrappedThrowable in SoftException">
  176. <compile files="GetCauseOnSoftException.java" options="-Xlint:warning">
  177. </compile>
  178. <run vm="1.3" class="GetCauseOnSoftException"/>
  179. </ajc-test>
  180. <ajc-test dir="bugs"
  181. title="XLint warning for call PCD's using subtype of defining type"
  182. pr="41952"
  183. >
  184. <compile
  185. files="DeclaringTypeWarning.java"
  186. options="-1.3" >
  187. <message kind="warning" line="6" text="declaring type">
  188. <source line="12" file="DeclaringTypeWarning.java" />
  189. </message>
  190. <message kind="warning" line="6" text="declaring type">
  191. <source line="14" file="DeclaringTypeWarning.java" />
  192. </message>
  193. </compile>
  194. </ajc-test>
  195. <ajc-test dir="bugs"
  196. title="XLint warning for call PCD's using subtype of defining type (-1.3 -Xlint:ignore)"
  197. pr="41952"
  198. >
  199. <compile
  200. options="-Xlint:ignore,-1.3"
  201. files="DeclaringTypeWarning.java" >
  202. </compile>
  203. </ajc-test>
  204. <!--
  205. <ajc-test dir="bugs/seven/lint" title="7 lint warnings" pr="91719">
  206. <compile options="-1.5" files="Main.java">
  207. <message kind="warning" line="31" text="no match for this type name: java.xxx.Object [Xlint:invalidAbsoluteTypeName]">
  208. </message>
  209. <message kind="warning" line="34" text="no match for this type name: java.lang.Xxx [Xlint:invalidAbsoluteTypeName]">
  210. </message>
  211. <message kind="warning" line="41" text="no match for this type name: java.lang.Xxx [Xlint:invalidAbsoluteTypeName]">
  212. </message>
  213. <message kind="warning" line="69" text="this affected type is not exposed to the weaver: java.lang.Object [Xlint:typeNotExposedToWeaver]">
  214. </message>
  215. <message kind="warning" line="87" text="does not match because declaring type is java.lang.Object, if match desired use target(Car) [Xlint:unmatchedSuperTypeInCall]">
  216. </message>
  217. <message kind="warning" line="92" text="advice defined in XlintTest has not been applied [Xlint:adviceDidNotMatch]">
  218. </message>
  219. <message kind="warning" line="157" text="no interface constructor-execution join point - use java.util.List+ for implementing classes [Xlint:noInterfaceCtorJoinpoint]">
  220. </message>
  221. </compile>
  222. </ajc-test>
  223. -->
  224. <ajc-test dir="harness"
  225. title="Two Xlint warnings wth cflow?">
  226. <compile files="XLintcflow.java" options="-1.5">
  227. <message kind="warning" line="4" text="advice defined in A has not been applied [Xlint:adviceDidNotMatch]"/>
  228. </compile>
  229. </ajc-test>