@@ -158,7 +158,10 @@ string contentToken(Content c) {
158158RefType getRootType ( RefType t ) {
159159 if t instanceof NestedType
160160 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
162165}
163166
164167/**
@@ -495,18 +498,22 @@ predicate isImportable(Type t) {
495498 * if we cannot import it due to a name clash.
496499 */
497500string 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+ )
510517}
511518
512519/**
0 commit comments