@@ -158,7 +158,10 @@ string contentToken(Content c) {
158
158
RefType getRootType ( RefType t ) {
159
159
if t instanceof NestedType
160
160
then result = getRootType ( t .( NestedType ) .getEnclosingType ( ) )
161
- else result = t
161
+ else
162
+ if t instanceof Array
163
+ then result = getRootType ( t .( Array ) .getElementType ( ) )
164
+ else result = t
162
165
}
163
166
164
167
/**
@@ -495,18 +498,22 @@ predicate isImportable(Type t) {
495
498
* if we cannot import it due to a name clash.
496
499
*/
497
500
string getShortNameIfPossible ( Type t ) {
498
- getRootSourceDeclaration ( t ) = any ( TestCase tc ) .getADesiredImport ( ) and
499
- if t instanceof RefType
500
- then
501
- exists ( RefType replaced , string nestedName |
502
- replaced = replaceTypeVariable ( t ) .getSourceDeclaration ( ) and
503
- nestedName = replaced .nestedName ( ) .replaceAll ( "$" , "." )
504
- |
505
- if isImportable ( getRootSourceDeclaration ( t ) )
506
- then result = nestedName
507
- else result = replaced .getPackage ( ) .getName ( ) + "." + nestedName
508
- )
509
- else result = t .getName ( )
501
+ if t instanceof Array
502
+ then result = getShortNameIfPossible ( t .( Array ) .getElementType ( ) ) + "[]"
503
+ else (
504
+ getRootSourceDeclaration ( t ) = any ( TestCase tc ) .getADesiredImport ( ) and
505
+ if t instanceof RefType
506
+ then
507
+ exists ( RefType replaced , string nestedName |
508
+ replaced = replaceTypeVariable ( t ) .getSourceDeclaration ( ) and
509
+ nestedName = replaced .nestedName ( ) .replaceAll ( "$" , "." )
510
+ |
511
+ if isImportable ( getRootSourceDeclaration ( t ) )
512
+ then result = nestedName
513
+ else result = replaced .getPackage ( ) .getName ( ) + "." + nestedName
514
+ )
515
+ else result = t .getName ( )
516
+ )
510
517
}
511
518
512
519
/**
0 commit comments