123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267 |
- <!-- XLint Tests -->
-
- <!-- .................................... -Xlint tests -->
- <!-- ............... positive -Xlint tests -->
-
- <ajc-test dir="bugs/lazyTjpXLintWarning"
- title="no XLint warning: thisJoinPoint potentially lazy and nothing stopping it">
- <compile options="-Xlint:warning" files="Scenario1.aj"/>
- </ajc-test>
-
- <ajc-test dir="bugs/lazyTjpXLintWarning"
- title="XLint warning: thisJoinPoint potentially lazy but stopped by around advice which doesn't use tjp">
- <compile options="-Xlint:warning" files="Scenario2.aj">
- <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]"/>
- </compile>
- </ajc-test>
-
- <ajc-test dir="bugs/lazyTjpXLintWarning"
- title="no XLint warning: thisJoinPoint not lazy (no if PCD) but would have been stopped anyway by around advice">
- <compile options="-Xlint:warning" files="Scenario3.aj">
- <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]"/>
- </compile>
- </ajc-test>
-
- <ajc-test dir="bugs/lazyTjpXLintWarning" title="no XLint warning: thisJoinPoint cannot be built lazily">
- <compile options="-Xlint:warning" files="Scenario4.aj">
- <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[]))"/>
- </compile>
- </ajc-test>
-
- <ajc-test dir="bugs/lazyTjpXLintWarning"
- title="XLint warning: thisJoinPoint potentially lazy but stopped by around advice which uses tjp">
- <compile options="-Xlint:warning" files="Scenario5.aj">
- <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]"/>
- </compile>
- </ajc-test>
-
- <ajc-test dir="bugs/lazyTjpXLintWarning"
- title="check for xlazytjp warning if actually supplied">
- <compile options="-XlazyTjp -Xlint:warning" files="Scenario1.aj">
- <message kind="warning" text="-XlazyTjp should no longer be used, build tjps lazily is now the default"/>
- </compile>
- </ajc-test>
-
- <ajc-test dir="bugs/lazyTjpXLintWarning"
- title="lazytjp: warning when around advice uses tjp">
- <compile options="-Xlint:warning" files="LazyTjpTest1.java">
- <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]"/>
- </compile>
- </ajc-test>
-
- <ajc-test dir="bugs/lazyTjpXLintWarning"
- title="lazytjp: warning when if missing on before advice">
- <compile options="-Xlint:warning" files="LazyTjpTest2.java">
- <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())"/>
- </compile>
- </ajc-test>
-
- <ajc-test dir="bugs/lazyTjpXLintWarning"
- title="lazytjp: warning when if missing on after advice">
- <compile options="-Xlint:warning" files="LazyTjpTest3.java">
- <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())"/>
- </compile>
- </ajc-test>
-
- <ajc-test dir="bugs/lazyTjpXLintWarning"
- title="lazytjp: multiple clashing advice preventing lazytjp">
- <compile options="-Xlint:warning" files="LazyTjpTest4.java">
- <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())"/>
- <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"/>
- <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())"/>
- </compile>
- </ajc-test>
-
- <ajc-test dir="bugs/lazyTjpXLintWarning"
- title="lazytjp: interfering before and around">
- <compile options="-Xlint:warning" files="LazyTjpTest5.java">
- <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"/>
- <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())"/>
- </compile>
- </ajc-test>
-
- <ajc-test dir="options"
- title="options -Xlint args()"
- keywords="lint">
- <compile files="XLintTypeArgsPCD.java">
- <message kind="warning" line="10"/>
- </compile>
- </ajc-test>
-
- <ajc-test dir="options"
- title="options declare field on bad type">
- <compile files="XLintTypeDeclareField.java" options="!eclipse">
- <message kind="error" line="10"/>
- </compile>
- </ajc-test>
-
- <ajc-test dir="options"
- title="options declare method on bad type">
- <compile files="XLintTypeDeclareMethod.java" options="!eclipse">
- <message kind="error" line="10"/>
- </compile>
- </ajc-test>
-
- <ajc-test dir="options"
- title="options -Xlint declare parent"
- keywords="lint">
- <compile files="XLintTypeDeclareParent.java">
- <message kind="warning" line="10"/>
- </compile>
- </ajc-test>
-
- <ajc-test dir="options"
- title="options -Xlint target()"
- keywords="lint">
- <compile files="XLintTypeTargetPCD.java">
- <message kind="warning" line="10"/>
- </compile>
- </ajc-test>
-
- <ajc-test dir="options"
- title="options -Xlint this()"
- keywords="lint">
- <compile files="XLintTypeThisPCD.java">
- <message kind="warning" line="10"/>
- </compile>
- </ajc-test>
-
- <!-- ............... negative -Xlint tests -->
- <ajc-test dir="options"
- title="options negative -Xlint args()"
- keywords="lint">
- <compile files="XLintTypeArgsPCD.java" options="-Xlint:ignore"/>
- </ajc-test>
-
- <ajc-test dir="options"
- title="options negative -Xlint declare parent"
- keywords="lint">
- <compile files="XLintTypeDeclareParent.java" options="-Xlint:ignore"/>
- </ajc-test>
-
- <ajc-test dir="options"
- title="options negative -Xlint target()"
- keywords="lint">
- <compile files="XLintTypeTargetPCD.java" options="-Xlint:ignore"/>
- </ajc-test>
-
- <ajc-test dir="options"
- title="options negative -Xlint this()"
- keywords="lint">
- <compile files="XLintTypeThisPCD.java" options="-Xlint:ignore"/>
- </ajc-test>
-
-
- <ajc-test dir="new"
- title="unmatched type name in a declare parents should result in a warning in -Xlint mode"
- keywords="tofix">
- <compile options="-Xlint" files="MissingTypeInDeclareParents.java">
- <message kind="warning" line="20"/>
- </compile>
- <run class="MissingTypeInDeclareParents"/>
- </ajc-test>
-
-
- <!-- The correct behavior of this program is to produce an Xlint
- warning for the lack of access to the needed type, and then
- to generate code with link errors that will throw a NoSuchMethodError
- when run.
- -->
- <ajc-test dir="bugs" pr="906"
- title="privileged access to code outside the control of the compiler">
- <compile files="PrivilegeBeyondScope.java" options="-Xlint:warning">
- <message kind="warning" line="23"/>
- </compile>
- </ajc-test>
-
- <ajc-test dir="bugs" pr="37739"
- title="Unexpected Xlint:unresolvableMember warning with withincode">
- <compile files="CatchSig.java">
- </compile>
- <run class="CatchSig"/>
- </ajc-test>
-
-
- <ajc-test dir="harness"
- title="valid XLintWarningTest file, default level of warning">
- <compile files="XLintWarningTest.java">
- <message kind="warning" line="5"
- text="Xlint:invalidAbsoluteTypeName"/>
- </compile>
- </ajc-test>
-
- <ajc-test dir="harness"
- title="XLint:ignore suppresses XLint warnings">
- <compile files="XLintWarningTest.java" options="-Xlint:ignore"/>
- </ajc-test>
-
- <ajc-test dir="harness"
- title="XLint:error promotes XLint warnings to error">
- <compile files="XLintWarningTest.java" options="-Xlint:error">
- <message kind="error" line="5"
- text="Xlint:invalidAbsoluteTypeName"/>
- </compile>
- </ajc-test>
-
- <ajc-test dir="bugs" pr="49250"
- title="alias getCause for getWrappedThrowable in SoftException">
- <compile files="GetCauseOnSoftException.java" options="-Xlint:warning">
- </compile>
- <run vm="1.3" class="GetCauseOnSoftException"/>
- </ajc-test>
-
- <ajc-test dir="bugs"
- title="XLint warning for call PCD's using subtype of defining type"
- pr="41952"
- >
- <compile
- files="DeclaringTypeWarning.java"
- options="-1.3" >
- <message kind="warning" line="6" text="declaring type">
- <source line="12" file="DeclaringTypeWarning.java" />
- </message>
- <message kind="warning" line="6" text="declaring type">
- <source line="14" file="DeclaringTypeWarning.java" />
- </message>
- </compile>
- </ajc-test>
-
- <ajc-test dir="bugs"
- title="XLint warning for call PCD's using subtype of defining type (-1.3 -Xlint:ignore)"
- pr="41952"
- >
- <compile
- options="-Xlint:ignore,-1.3"
- files="DeclaringTypeWarning.java" >
- </compile>
- </ajc-test>
-
- <!--
- <ajc-test dir="bugs/seven/lint" title="7 lint warnings" pr="91719">
- <compile options="-1.5" files="Main.java">
- <message kind="warning" line="31" text="no match for this type name: java.xxx.Object [Xlint:invalidAbsoluteTypeName]">
- </message>
- <message kind="warning" line="34" text="no match for this type name: java.lang.Xxx [Xlint:invalidAbsoluteTypeName]">
- </message>
- <message kind="warning" line="41" text="no match for this type name: java.lang.Xxx [Xlint:invalidAbsoluteTypeName]">
- </message>
- <message kind="warning" line="69" text="this affected type is not exposed to the weaver: java.lang.Object [Xlint:typeNotExposedToWeaver]">
- </message>
- <message kind="warning" line="87" text="does not match because declaring type is java.lang.Object, if match desired use target(Car) [Xlint:unmatchedSuperTypeInCall]">
- </message>
- <message kind="warning" line="92" text="advice defined in XlintTest has not been applied [Xlint:adviceDidNotMatch]">
- </message>
- <message kind="warning" line="157" text="no interface constructor-execution join point - use java.util.List+ for implementing classes [Xlint:noInterfaceCtorJoinpoint]">
- </message>
- </compile>
- </ajc-test>
- -->
-
- <ajc-test dir="harness"
- title="Two Xlint warnings wth cflow?">
- <compile files="XLintcflow.java" options="-1.5">
- <message kind="warning" line="4" text="advice defined in A has not been applied [Xlint:adviceDidNotMatch]"/>
- </compile>
- </ajc-test>
-
-
|