code: protected static void unpackEdition(String edition, CpeBuilder cb, boolean lenient) throws CpeParsingException {
          if (edition == null || edition.isEmpty()) {
              return;
          }
          try {
              String[] unpacked = edition.split("~");
              if (edition.startsWith("~")) {
                  if (unpacked.length > 1) {
                      cb.wfEdition(Convert.cpeUriToWellFormed(unpacked[1], lenient));
                  }
                  if (unpacked.length > 2) {
                      cb.wfSwEdition(Convert.cpeUriToWellFormed(unpacked[2], lenient));
                  }
                  if (unpacked.length > 3) {
                      cb.wfTargetSw(Convert.cpeUriToWellFormed(unpacked[3], lenient));
                  }
                  if (unpacked.length > 4) {
                      cb.wfTargetHw(Convert.cpeUriToWellFormed(unpacked[4], lenient));
                  }
                  if (unpacked.length > 5) {
                      cb.wfOther(Convert.cpeUriToWellFormed(unpacked[5], lenient));
                  }
                  if (unpacked.length > 6) {
                      throw new CpeParsingException("Invalid packed edition");
                  }
              } else {
                  cb.wfEdition(Convert.cpeUriToWellFormed(edition, lenient));
              }
          } catch (CpeEncodingException ex) {
              throw new CpeParsingException(ex.getMessage());
          }
      }
docs: In a CPE 2.2 URI the new fields from CPE 2.3 may be "packed" into the
  edition field. If present, each field will be preceeded by a '~'.
  Example, "~edition~swEdition~targetSw~targetHw~other".
  
  @param edition the edition string to unpack
  @param cb a reference to the CPE Builder to unpack the edition into
  @param lenient whether or not to use lenient parsing
  @throws CpeParsingException thrown if the edition value is invalid