File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
java/ql/src/utils/stub-generator Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -287,18 +287,23 @@ private string stubQualifier(RefType t) {
287
287
288
288
pragma [ nomagic]
289
289
private predicate needsPackageNameHelper ( RefType t , GeneratedTopLevel top , string name ) {
290
- t .getSourceDeclaration ( ) = [ getAReferencedType ( top ) , top ] .getSourceDeclaration ( ) and
290
+ t .getSourceDeclaration ( ) =
291
+ pragma [ only_bind_out ] ( [ getAReferencedType ( top ) , top ] .getSourceDeclaration ( ) ) and
291
292
name = t .getName ( )
292
293
}
293
294
295
+ pragma [ nomagic]
296
+ private predicate describesMultipleTypes ( GeneratedTopLevel top , string name ) {
297
+ 2 <= strictcount ( RefType t | needsPackageNameHelper ( t , top , name ) )
298
+ }
299
+
294
300
/**
295
301
* Holds if `t` may clash with another type of the same name, so should be referred to using the fully qualified name
296
302
*/
297
303
private predicate needsPackageName ( RefType t ) {
298
- exists ( GeneratedTopLevel top , RefType other , string name |
304
+ exists ( GeneratedTopLevel top , string name |
299
305
needsPackageNameHelper ( t , top , name ) and
300
- needsPackageNameHelper ( other , top , name ) and
301
- t != other
306
+ describesMultipleTypes ( top , name )
302
307
)
303
308
}
304
309
You can’t perform that action at this time.
0 commit comments