mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Jean-Noël Rouvignac
05.10.2016 2a6a436cf43f43eeb25210a5c72301a932598d1c
opendj-server-legacy/src/main/java/org/opends/server/tools/makeldif/Branch.java
@@ -121,54 +121,35 @@
      }
    }
    for (List<Attribute> attrList : entry.getUserAttributes().values())
    {
      for (Attribute a : attrList)
      {
        for (ByteString v : a)
        {
          try
          {
            String[] valueStrings = new String[] { v.toString() };
            Tag[] tags = new Tag[] { new StaticTextTag() };
            tags[0].initializeForBranch(templateFile, this, valueStrings, 0, warnings);
            lineList.add(new TemplateLine(a.getAttributeDescription().getAttributeType(), 0, tags));
          }
          catch (Exception e)
          {
            // This should never happen.
            e.printStackTrace();
          }
        }
      }
    }
    for (List<Attribute> attrList : entry.getOperationalAttributes().values())
    {
      for (Attribute a : attrList)
      {
        for (ByteString v : a)
        {
          try
          {
            String[] valueStrings = new String[] { v.toString() };
            Tag[] tags = new Tag[] { new StaticTextTag() };
            tags[0].initializeForBranch(templateFile, this, valueStrings, 0, warnings);
            lineList.add(new TemplateLine(a.getAttributeDescription().getAttributeType(), 0, tags));
          }
          catch (Exception e)
          {
            // This should never happen.
            e.printStackTrace();
          }
        }
      }
    }
    addLines(lineList, entry.getAllAttributes(), templateFile, warnings);
    rdnLines = new TemplateLine[lineList.size()];
    lineList.toArray(rdnLines);
  }
  private void addLines(List<TemplateLine> lineList, Iterable<Attribute> attrs, TemplateFile templateFile,
      List<LocalizableMessage> warnings)
  {
    for (Attribute a : attrs)
    {
      for (ByteString v : a)
      {
        try
        {
          String[] valueStrings = new String[] { v.toString() };
          Tag[] tags = new Tag[] { new StaticTextTag() };
          tags[0].initializeForBranch(templateFile, this, valueStrings, 0, warnings);
          lineList.add(new TemplateLine(a.getAttributeDescription().getAttributeType(), 0, tags));
        }
        catch (Exception e)
        {
          // This should never happen.
          e.printStackTrace();
        }
      }
    }
  }
  /**