@@ -364,11 +364,22 @@ private String getKeyWithPossibleGenerics(Type t, TypeSymbol s, Function<ITypeBi
364364 return getKeyWithPossibleGenerics (t , s , parameterizedCallback , false );
365365 }
366366 private String getKeyWithPossibleGenerics (Type t , TypeSymbol s , Function <ITypeBinding , String > parameterizedCallback , boolean useSlashes ) {
367+ if ( !this .isGeneric && this instanceof JavacTypeVariableBinding jctvb ) {
368+ String ret = jctvb .getKeyWithOptionalCaptureCode (false );
369+ return ret ;
370+ }
371+
367372 String base1 = getKey (t , s .flatName (), false , useSlashes );
368373 String base = removeTrailingSemicolon (base1 );
374+ if ( isRawType (t )) {
375+ return base + "<>;" ;
376+ }
377+
378+
379+
369380 if (isGenericType (t )) {
370381 return base + '<'
371- + Arrays .stream (getTypeParameters ( ))
382+ + Arrays .stream (getTypeParametersForBase ( t ))
372383 .map (ITypeBinding ::getName )
373384 .map (name -> 'T' + name + ';' )
374385 .collect (Collectors .joining ())
@@ -377,16 +388,11 @@ private String getKeyWithPossibleGenerics(Type t, TypeSymbol s, Function<ITypeBi
377388 final String base2 = base ;
378389 final int [] counter = new int [] {0 };
379390 return base + '<'
380- + Arrays .stream (getTypeArguments ( ))
391+ + Arrays .stream (getTypeArgumentsForBase ( this . type , this . typeSymbol ))
381392 .map (parameterizedCallback )
382393 .map (x -> prependBaseAndCount (x , base2 , counter ))
383394 .collect (Collectors .joining ())
384395 + ">;" ;
385- } else if ( isRawType (t )) {
386- return base + "<>;" ;
387- } else if ( !this .isGeneric && this instanceof JavacTypeVariableBinding jctvb ) {
388- String ret = jctvb .getKeyWithOptionalCaptureCode (false );
389- return ret ;
390396 }
391397 return base1 ;
392398 }
@@ -1189,12 +1195,24 @@ public IAnnotationBinding[] getTypeAnnotations() {
11891195
11901196 @ Override
11911197 public ITypeBinding [] getTypeArguments () {
1192- if (!isParameterizedType () || isTargettingPreGenerics ()) {
1198+ return getTypeArguments (this .type , this .typeSymbol );
1199+ }
1200+
1201+ private ITypeBinding [] getTypeArgumentsForBase (Type t , TypeSymbol ts ) {
1202+ if ( t instanceof Type .ArrayType at ) {
1203+ return getTypeArguments (at .elemtype , at .tsym );
1204+ }
1205+ return getTypeArguments (t , ts );
1206+ }
1207+
1208+ private ITypeBinding [] getTypeArguments (Type t , TypeSymbol ts ) {
1209+ if (!isParameterizedType (t ) || isTargettingPreGenerics ()) {
11931210 return NO_TYPE_ARGUMENTS ;
11941211 }
1195- return getUncheckedTypeArguments (this . type , this . typeSymbol );
1212+ return getUncheckedTypeArguments (t , ts );
11961213 }
11971214
1215+
11981216 private ITypeBinding [] getUncheckedTypeArguments (Type t , TypeSymbol ts ) {
11991217 return t .getTypeArguments ()
12001218 .stream ()
@@ -1272,14 +1290,26 @@ public ITypeBinding getTypeDeclaration() {
12721290
12731291 @ Override
12741292 public ITypeBinding [] getTypeParameters () {
1275- if (!isGenericType () || isTargettingPreGenerics ()) {
1293+ return getTypeParameters (this .type );
1294+ }
1295+
1296+ public ITypeBinding [] getTypeParametersForBase (Type t ) {
1297+ if ( t instanceof Type .ArrayType at ) {
1298+ return getTypeParameters (at .elemtype );
1299+ }
1300+ return getTypeParameters (t );
1301+ }
1302+
1303+ public ITypeBinding [] getTypeParameters (Type t ) {
1304+ if (!isGenericType (t ) || isTargettingPreGenerics () || !(t instanceof ClassType )) {
12761305 return new ITypeBinding [0 ];
12771306 }
1278- return ((ClassType )this . type ).getTypeArguments ()
1307+ return ((ClassType )t ).getTypeArguments ()
12791308 .map (this .resolver .bindings ::getTypeBinding )
12801309 .toArray (ITypeBinding []::new );
12811310 }
12821311
1312+
12831313 @ Override
12841314 public ITypeBinding getWildcard () {
12851315 if (this .type instanceof Type .CapturedType capturedType ) {
0 commit comments