Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The variable for a union should use a valid identifier #562

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ private void processArrayElementLoop(final Schema arraySchema, final JClass arra

final Schema elementSchema = arraySchema.getElementType();
if (SchemaAssistant.isComplexType(elementSchema)) {
JVar containerVar = declareValueVar(elementSchema.getName(), elementSchema, forBody);
JVar containerVar = declareValueVar(getUniqueName("element"), elementSchema, forBody);
forBody.assign(containerVar, JExpr.invoke(JExpr.cast(arrayClass, arrayExpr), getMethodName).arg(counter));
processComplexType(elementSchema, containerVar, forBody, customizationSupplier);
} else {
Expand Down Expand Up @@ -290,7 +290,7 @@ private void processMap(final Schema mapSchema, JExpression mapExpr, JBlock body

JVar containerVar;
if (SchemaAssistant.isComplexType(valueSchema)) {
containerVar = declareValueVar(valueSchema.getName(), valueSchema, forBody);
containerVar = declareValueVar(getUniqueName("element"), valueSchema, forBody);
forBody.assign(containerVar, JExpr.invoke(JExpr.cast(mapClass, mapExpr), "get").arg(mapKeysLoop.var()));

processComplexType(valueSchema, containerVar, forBody, customizationSupplier);
Expand Down