@@ -11,11 +11,13 @@ namespace ServiceStack.NativeTypes.Java
1111 public class JavaGenerator
1212 {
1313 readonly MetadataTypesConfig Config ;
14+ readonly List < MetadataType > AllTypes ;
1415 List < string > conflictTypeNames = new List < string > ( ) ;
1516
1617 public JavaGenerator ( MetadataTypesConfig config )
1718 {
1819 Config = config ;
20+ AllTypes = new List < MetadataType > ( ) ;
1921 }
2022
2123 public static string DefaultGlobalNamespace = "dto" ;
@@ -143,20 +145,18 @@ public string GetCode(MetadataTypes metadata, IRequest request, INativeTypesMeta
143145 . Select ( x => x . Response ) . ToHashSet ( ) ;
144146 var types = metadata . Types . ToHashSet ( ) ;
145147
146- var allTypes = new List < MetadataType > ( ) ;
147- allTypes . AddRange ( types ) ;
148- allTypes . AddRange ( responseTypes ) ;
149- allTypes . AddRange ( requestTypes ) ;
150- allTypes . RemoveAll ( x => x . IgnoreType ( Config ) ) ;
148+ AllTypes . AddRange ( requestTypes ) ;
149+ AllTypes . AddRange ( responseTypes ) ;
150+ AllTypes . AddRange ( types ) ;
151151
152152 //TypeScript doesn't support reusing same type name with different generic airity
153- var conflictPartialNames = allTypes . Map ( x => x . Name ) . Distinct ( )
153+ var conflictPartialNames = AllTypes . Map ( x => x . Name ) . Distinct ( )
154154 . GroupBy ( g => g . SplitOnFirst ( '`' ) [ 0 ] )
155155 . Where ( g => g . Count ( ) > 1 )
156156 . Select ( g => g . Key )
157157 . ToList ( ) ;
158158
159- this . conflictTypeNames = allTypes
159+ this . conflictTypeNames = AllTypes
160160 . Where ( x => conflictPartialNames . Any ( name => x . Name . StartsWith ( name ) ) )
161161 . Map ( x => x . Name ) ;
162162
@@ -167,7 +167,7 @@ public string GetCode(MetadataTypes metadata, IRequest request, INativeTypesMeta
167167 sb . AppendLine ( "{" ) ;
168168
169169 //ServiceStack core interfaces
170- foreach ( var type in allTypes )
170+ foreach ( var type in AllTypes )
171171 {
172172 var fullTypeName = type . GetFullName ( ) ;
173173 if ( requestTypes . Contains ( type ) )
0 commit comments