Skip to content

Commit 26da95c

Browse files
author
Karl Rieb
committed
Fix generator bug with data type serializer package visibility.
1 parent 970dab4 commit 26da95c

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

generator/java.stoneg.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,9 @@ def add_subtype(data_type):
275275

276276

277277
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:
279281
ctx = data_type._ctx
280282
stone_data_type = data_type.as_stone
281283
else:
@@ -290,7 +292,7 @@ def get_underlying_type(data_type, allow_lists=True):
290292
else:
291293
break
292294

293-
if isinstance(data_type, DataTypeWrapper):
295+
if is_wrapper:
294296
return DataTypeWrapper(ctx, stone_data_type)
295297
else:
296298
return stone_data_type
@@ -399,9 +401,9 @@ def has_other_namespace(wrappers):
399401
# namespace must be another namespace
400402
for stone_route in stone_namespace.routes:
401403
# 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):
405407
return True
406408

407409
return False
@@ -2722,6 +2724,7 @@ def generate(self, api):
27222724
for client_spec in client_specs:
27232725
JavaCodeGenerationInstance(ctx).generate(client_spec)
27242726

2727+
27252728
class JavaCodeGenerationInstance(object):
27262729
"""
27272730
Java code generation instance for a particular Stone tree (:class:`stone.api.Api`).

0 commit comments

Comments
 (0)