[
https://issues.apache.org/jira/browse/BEAM-10265?focusedWorklogId=764278&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-764278
]
ASF GitHub Bot logged work on BEAM-10265:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 29/Apr/22 14:43
Start Date: 29/Apr/22 14:43
Worklog Time Spent: 10m
Work Description: andreigurau commented on code in PR #17477:
URL: https://github.com/apache/beam/pull/17477#discussion_r861873278
##########
sdks/java/core/src/main/java/org/apache/beam/sdk/schemas/utils/StaticSchemaInference.java:
##########
@@ -88,21 +89,48 @@ enum MethodType {
*/
public static Schema schemaFromClass(
Class<?> clazz, FieldValueTypeSupplier fieldValueTypeSupplier) {
+ return schemaFromClass(clazz, fieldValueTypeSupplier, new HashMap<Class,
Schema>());
+ }
+
+ private static Schema schemaFromClass(
+ Class<?> clazz,
+ FieldValueTypeSupplier fieldValueTypeSupplier,
+ HashMap<Class, Schema> alreadyVisitedSchemas) {
Review Comment:
I modified the input parameter to use ```Map``` but I'll see what others
have to say in regards to using a static Map and synchronized methods
Issue Time Tracking
-------------------
Worklog Id: (was: 764278)
Time Spent: 3h 10m (was: 3h)
> GetterBasedSchemaProvider#schemaFor stack overflows when given a recursive
> schema
> ---------------------------------------------------------------------------------
>
> Key: BEAM-10265
> URL: https://issues.apache.org/jira/browse/BEAM-10265
> Project: Beam
> Issue Type: Bug
> Components: sdk-java-core
> Affects Versions: 2.21.0, 2.22.0
> Reporter: Reza ardeshir rokni
> Assignee: Andrei Gurau
> Priority: P3
> Labels: Clarified, starter
> Time Spent: 3h 10m
> Remaining Estimate: 0h
>
> Proto:
> message TSFoo {
> string a = 1;
> string b = 2;
> TSFoo theOlderMe = 3;
> }
> new ProtoMessageSchema().schemaFor(TypeDescriptor.of(Foo.TSFoo.class));
> Causes a stackoverflow.
>
>
--
This message was sent by Atlassian Jira
(v8.20.7#820007)