aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src/test/resources/org/aspectj/systemtest/xlint/xlint.xml
blob: d9ffc731f722dd13bdeb65b7b719b2de8bcea238 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
<!DOCTYPE suite SYSTEM "../tests/ajcTestSuite.dtd"[]>
<suite>
   <!-- .................................... -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 [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"/>
		</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"/>
		</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"/>
		</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"/>
		  <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"/>
		</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"/>
		</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" options="-1.8">
        	<message kind="warning" line="5"
        		 text="Xlint:invalidAbsoluteTypeName"/> 
        	<message kind="warning" line="5" text="Xlint:adviceDidNotMatch"/>
        </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>

	<!-- XXX23: this test seems damaged and somewhat irrelevant since it seems to rely on 1.3 code generation. I added the expected
	     message just to get it to pass but it might be a candidate for deletion -->
   <ajc-test dir="bugs"
		title="XLint warning for call PCD's using subtype of defining type (-1.8 -Xlint:ignore)"
		pr="41952"
		>
		<compile
			options="-Xlint:ignore,-1.8" 
			files="DeclaringTypeWarning.java" >
			<message kind="warning" line="12" text="declare warning : call(void B.run())"/>
		</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.8">
        	<message kind="warning" line="4"  text="advice defined in A has not been applied [Xlint:adviceDidNotMatch]"/>
        </compile>
    </ajc-test>
	
 
</suite>