Skip to content

Commit

Permalink
Template parser; inlineBinding incrementation desynchronized, some docs
Browse files Browse the repository at this point in the history
  • Loading branch information
hugithordarson committed Feb 9, 2024
1 parent 20745c4 commit 963c492
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ public class NGTemplateParser {
private NGDynamicHTMLTag _currentDynamicTag = new NGDynamicHTMLTag();

/**
* The parsed declarationString
* Keeps track of declarations. Will initially contain the parsed declarationString (if present) and any inline bindings will get added here as well.
*/
private Map<String, NGDeclaration> _declarations;

/**
* Keeps track of how many inline bindings have been parsed, used in the generated declaration's name
* Keeps track of how many inline tags have been parsed. Used only to generate the tag declaration's name.
*/
private int _inlineBindingCount;

Expand Down Expand Up @@ -241,10 +241,11 @@ else if( currentBuffer == valueBuffer ) {

String elementName;

synchronized( this ) {
elementName = "_" + elementType + "_" + _inlineBindingCount;
_inlineBindingCount++;
}
// FIXME: Don't think we need this to be synchronized, since I don't see this being invoked concurrently?
// synchronized( this ) {
elementName = "_" + elementType + "_" + _inlineBindingCount;
_inlineBindingCount++;
// }

final NGDeclaration declaration = new NGDeclaration( elementName, elementType, associations );

Expand Down

0 comments on commit 963c492

Please sign in to comment.