@@ -275,7 +275,9 @@ def add_subtype(data_type):
275
275
276
276
277
277
def get_underlying_type (data_type , allow_lists = True ):
278
- if isinstance (data_type , DataTypeWrapper ):
278
+ is_wrapper = isinstance (data_type , DataTypeWrapper )
279
+
280
+ if is_wrapper :
279
281
ctx = data_type ._ctx
280
282
stone_data_type = data_type .as_stone
281
283
else :
@@ -290,7 +292,7 @@ def get_underlying_type(data_type, allow_lists=True):
290
292
else :
291
293
break
292
294
293
- if isinstance ( data_type , DataTypeWrapper ) :
295
+ if is_wrapper :
294
296
return DataTypeWrapper (ctx , stone_data_type )
295
297
else :
296
298
return stone_data_type
@@ -399,9 +401,9 @@ def has_other_namespace(wrappers):
399
401
# namespace must be another namespace
400
402
for stone_route in stone_namespace .routes :
401
403
# no filtering
402
- if (stone_route .arg_data_type == stone_data_type or
403
- stone_route .result_data_type == stone_data_type or
404
- stone_route .error_data_type == stone_data_type ):
404
+ if (get_underlying_type ( stone_route .arg_data_type ) == stone_data_type or
405
+ get_underlying_type ( stone_route .result_data_type ) == stone_data_type or
406
+ get_underlying_type ( stone_route .error_data_type ) == stone_data_type ):
405
407
return True
406
408
407
409
return False
@@ -2722,6 +2724,7 @@ def generate(self, api):
2722
2724
for client_spec in client_specs :
2723
2725
JavaCodeGenerationInstance (ctx ).generate (client_spec )
2724
2726
2727
+
2725
2728
class JavaCodeGenerationInstance (object ):
2726
2729
"""
2727
2730
Java code generation instance for a particular Stone tree (:class:`stone.api.Api`).
0 commit comments