@@ -592,6 +592,19 @@ private IMethodBinding[] getDeclaredMethodsDefaultImpl(ArrayList<Symbol> l) {
592592 .sorted (Comparator .comparing (IMethodBinding ::getName ))
593593 .toArray (IMethodBinding []::new );
594594 }
595+
596+ private ITypeBinding [] getDeclaredTypeDefaultImpl (ArrayList <Symbol > l ) {
597+ return StreamSupport .stream (l .spliterator (), false )
598+ .filter (ClassSymbol .class ::isInstance )
599+ .map (ClassSymbol .class ::cast )
600+ .map (sym -> {
601+ Type t = this .types .memberType (this .type , sym );
602+ return this .resolver .bindings .getTypeBinding (t , isGeneric );
603+ })
604+ .filter (Objects ::nonNull )
605+ .sorted (Comparator .comparing (ITypeBinding ::getName ))
606+ .toArray (ITypeBinding []::new );
607+ }
595608
596609 private IMethodBinding [] getDeclaredMethodsForRecords (ArrayList <Symbol > l ) {
597610 ASTNode node = this .resolver .symbolToDeclaration .get (this .typeSymbol );
@@ -637,11 +650,11 @@ public ITypeBinding[] getDeclaredTypes() {
637650 if (members == null ) {
638651 return new ITypeBinding [0 ];
639652 }
640- return StreamSupport . stream ( members . getSymbols (). spliterator (), false )
641- . filter ( TypeSymbol . class :: isInstance )
642- . map ( TypeSymbol . class :: cast )
643- . map ( sym -> this . resolver . bindings . getTypeBinding ( sym . type ))
644- . toArray ( ITypeBinding []:: new );
653+ ArrayList < Symbol > l = new ArrayList <>();
654+ for ( Symbol s : members . getSymbols ()) {
655+ l . add ( s );
656+ }
657+ return getDeclaredTypeDefaultImpl ( l );
645658 }
646659
647660 @ Override
0 commit comments