@@ -43,7 +43,7 @@ abstract private class GeneratedType extends RefType {
43
43
final string getStub ( ) {
44
44
result =
45
45
this .stubAbstractModifier ( ) + this .stubStaticModifier ( ) + this .stubAccessibilityModifier ( ) +
46
- this .stubKeyword ( ) + " " + this .getName ( ) + stubGenericArguments ( this ) +
46
+ this .stubKeyword ( ) + " " + this .getName ( ) + stubGenericArguments ( this , true ) +
47
47
stubBaseTypesString ( ) + "\n{\n" + stubMembers ( ) + "}"
48
48
}
49
49
@@ -225,7 +225,7 @@ private string stubTypeName(Type t) {
225
225
then
226
226
result =
227
227
stubQualifier ( t ) + t .( RefType ) .getSourceDeclaration ( ) .getName ( ) +
228
- stubGenericArguments ( t )
228
+ stubGenericArguments ( t , false )
229
229
else result = "<error>"
230
230
}
231
231
@@ -245,22 +245,34 @@ private string stubTypeBound(BoundedType t) {
245
245
)
246
246
}
247
247
248
+ private string maybeStubTypeBound ( BoundedType t , boolean typeVarBounds ) {
249
+ typeVarBounds = true and
250
+ result = stubTypeBound ( t )
251
+ or
252
+ typeVarBounds = false and
253
+ result = ""
254
+ }
255
+
248
256
private string stubQualifier ( RefType t ) {
249
257
if t instanceof NestedType
250
- then result = stubTypeName ( t .( NestedType ) .getEnclosingType ( ) ) + "."
258
+ then
259
+ exists ( RefType et | et = t .( NestedType ) .getEnclosingType ( ) .getSourceDeclaration ( ) |
260
+ result = stubQualifier ( et ) + et .getName ( ) + "."
261
+ )
251
262
else result = ""
252
263
}
253
264
254
265
language [ monotonicAggregates]
255
- private string stubGenericArguments ( RefType t ) {
266
+ private string stubGenericArguments ( RefType t , boolean typeVarBounds ) {
267
+ typeVarBounds = [ true , false ] and
256
268
if t instanceof GenericType
257
269
then
258
270
result =
259
271
"<" +
260
272
concat ( int n , TypeVariable tv |
261
273
tv = t .( GenericType ) .getTypeParameter ( n )
262
274
|
263
- tv .getName ( ) + stubTypeBound ( tv ) , ", " order by n
275
+ tv .getName ( ) + maybeStubTypeBound ( tv , typeVarBounds ) , ", " order by n
264
276
) + ">"
265
277
else
266
278
if t instanceof ParameterizedType
0 commit comments