private void calculatePosition() { synchronized (lock) { if (!positionsCalculated) { // The expressions is the argument of the template element, so we prefer it as it's more specific. TemplateObject templateObject = blamedExpression != null ? (TemplateObject) blamedExpression : ( ftlInstructionStackSnapshot != null && ftlInstructionStackSnapshot.length != 0 ? ftlInstructionStackSnapshot[0] : null); // Line number blow 0 means no info, negative means position in ?eval-ed value that we won't use here. if (templateObject != null && templateObject.getBeginLine() > 0) { final Template template = templateObject.getTemplate(); templateName = template != null ? template.getName() : null; templateSourceName = template != null ? template.getSourceName() : null; lineNumber = Integer.valueOf(templateObject.getBeginLine()); columnNumber = Integer.valueOf(templateObject.getBeginColumn()); endLineNumber = Integer.valueOf(templateObject.getEndLine()); endColumnNumber = Integer.valueOf(templateObject.getEndColumn()); } positionsCalculated = true; deleteFTLInstructionStackSnapshotIfNotNeeded(); } } }
private void calculatePosition() { synchronized (lock) { if (!positionsCalculated) { // The expressions is the argument of the template element, so we prefer it as it's more specific. TemplateObject templateObject = blamedExpression != null ? (TemplateObject) blamedExpression : ( ftlInstructionStackSnapshot != null && ftlInstructionStackSnapshot.length != 0 ? ftlInstructionStackSnapshot[0] : null); // Line number blow 0 means no info, negative means position in ?eval-ed value that we won't use here. if (templateObject != null && templateObject.getBeginLine() > 0) { final Template template = templateObject.getTemplate(); templateName = template != null ? template.getName() : null; templateSourceName = template != null ? template.getSourceName() : null; lineNumber = Integer.valueOf(templateObject.getBeginLine()); columnNumber = Integer.valueOf(templateObject.getBeginColumn()); endLineNumber = Integer.valueOf(templateObject.getEndLine()); endColumnNumber = Integer.valueOf(templateObject.getEndColumn()); } positionsCalculated = true; deleteFTLInstructionStackSnapshotIfNotNeeded(); } } }
private void calculatePosition() { synchronized (lock) { if (!positionsCalculated) { // The expressions is the argument of the template element, so we prefer it as it's more specific. TemplateObject templateObject = blamedExpression != null ? (TemplateObject) blamedExpression : ( ftlInstructionStackSnapshot != null && ftlInstructionStackSnapshot.length != 0 ? ftlInstructionStackSnapshot[0] : null); // Line number blow 0 means no info, negative means position in ?eval-ed value that we won't use here. if (templateObject != null && templateObject.getBeginLine() > 0) { final Template template = templateObject.getTemplate(); templateName = template != null ? template.getName() : null; templateSourceName = template != null ? template.getSourceName() : null; lineNumber = Integer.valueOf(templateObject.getBeginLine()); columnNumber = Integer.valueOf(templateObject.getBeginColumn()); endLineNumber = Integer.valueOf(templateObject.getEndLine()); endColumnNumber = Integer.valueOf(templateObject.getEndColumn()); } positionsCalculated = true; deleteFTLInstructionStackSnapshotIfNotNeeded(); } } }