j***@public.gmane.org
2010-07-23 19:40:49 UTC
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium
New issue 57 by louis...-bJEeYj9oJeDQT0dZR+***@public.gmane.org: Unbalanced section push and pop in the
Java implementation
http://code.google.com/p/json-template/issues/detail?id=57
When the data is missing for the template section, the
SectionStatement.java caused the exception in public Object
pushSection(String sectionName) of the file ScopedContext.java. It starts
happening for the second section of missing data.
Please see my fix bellow.
Regards,
Louis
///////////////////////////////////////////////////////////
public void execute(ScopedContext context, ITemplateRenderCallback
callback) {
// push a context first
Object cursorPosition = context
.pushSection(this.block.getSectionName());
if (!context.isEmptyContext(cursorPosition)) {
TemplateExecutor.execute(this.block.getStatements(), context,
callback);
//context.pop(); // Louis fix, remove this line
} else {
TemplateExecutor.execute(this.block.getStatements("or"), context,
callback);
}
context.pop(); // Louis fix, add this line
}
////////////////////////////////////////////////////////
Owner: ----
Labels: Type-Defect Priority-Medium
New issue 57 by louis...-bJEeYj9oJeDQT0dZR+***@public.gmane.org: Unbalanced section push and pop in the
Java implementation
http://code.google.com/p/json-template/issues/detail?id=57
When the data is missing for the template section, the
SectionStatement.java caused the exception in public Object
pushSection(String sectionName) of the file ScopedContext.java. It starts
happening for the second section of missing data.
Please see my fix bellow.
Regards,
Louis
///////////////////////////////////////////////////////////
public void execute(ScopedContext context, ITemplateRenderCallback
callback) {
// push a context first
Object cursorPosition = context
.pushSection(this.block.getSectionName());
if (!context.isEmptyContext(cursorPosition)) {
TemplateExecutor.execute(this.block.getStatements(), context,
callback);
//context.pop(); // Louis fix, remove this line
} else {
TemplateExecutor.execute(this.block.getStatements("or"), context,
callback);
}
context.pop(); // Louis fix, add this line
}
////////////////////////////////////////////////////////
--
You received this message because you are subscribed to the Google Groups "JSON Template" group.
To post to this group, send email to json-template-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To unsubscribe from this group, send email to json-template+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit this group at http://groups.google.com/group/json-template?hl=en.
You received this message because you are subscribed to the Google Groups "JSON Template" group.
To post to this group, send email to json-template-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To unsubscribe from this group, send email to json-template+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit this group at http://groups.google.com/group/json-template?hl=en.