private static void addPropertyReferences(@NotNull ConvertContext context, final XmlAttributeValue xmlAttributeValue, final Collection<? super PsiReference> result) {
    final String value = xmlAttributeValue.getValue();
    final DomElement contextElement = context.getInvocationElement();
    
    final XmlAttribute attrib = PsiTreeUtil.getParentOfType(xmlAttributeValue, XmlAttribute.class);
    if (attrib != null) {
      final String name = attrib.getName();
      if ("if".equals(name) || "unless".equals(name)) {
        // special handling of if/unless attributes
        final AntDomPropertyReference ref = new AntDomPropertyReference(
          contextElement, xmlAttributeValue, ElementManipulators.getValueTextRange(xmlAttributeValue)
        );
        // in runtime, if execution reaches this task the property is defined since it is used in if-condition
        // so it is would be a mistake to highlight this as unresolved prop
        ref.setShouldBeSkippedByAnnotator(true);
        result.add(ref);
        return;
      }
    }

    final int valueBeginingOffset =
      Math.abs(xmlAttributeValue.getTextRange().getStartOffset() - xmlAttributeValue.getValueTextRange().getStartOffset());
    int startIndex;
    int endIndex = -1;
    while ((startIndex = value.indexOf("${", endIndex + 1)) > endIndex) {
      if (startIndex > 0 && value.charAt(startIndex - 1) == '$') {
        // the '$' is escaped
        endIndex = startIndex + 1;
        continue;
      }
      startIndex += 2;
      endIndex = startIndex;
      int nestedBrackets = 0;
      while (value.length() > endIndex) {
        final char ch = value.charAt(endIndex);
        if (ch == '}') {
          if (nestedBrackets == 0) {
            break;
          }
          --nestedBrackets;
        }
        else if (ch == '{') {
          ++nestedBrackets;
        }
        ++endIndex;
      }
      if (nestedBrackets > 0 || endIndex > value.length()) return;
      if (endIndex >= startIndex) {
        //final String propName = value.substring(startIndex, endIndex);
        //if (antFile.isEnvironmentProperty(propName) && antFile.getProperty(propName) == null) {
        //  continue;
        //}
        final AntDomPropertyReference ref = new AntDomPropertyReference(
          contextElement, xmlAttributeValue, new TextRange(valueBeginingOffset + startIndex, valueBeginingOffset + endIndex)
        );
        
        result.add(ref);
      }
      endIndex = startIndex;
    }
  }
private static void addPropertyReferences(@NotNull ConvertContext context, final XmlAttributeValue xmlAttributeValue, final Collection<? super PsiReference> result)