<commit_before>package com.intellij.vcs.log;

import com.intellij.openapi.util.text.StringUtil;
import org.jetbrains.annotations.NotNull;

import java.util.List;

/**
 * <p>We suppose that the Hash is the unique identifier of the Commit,
 *    i. e. it is the only value that should be checked in equals() and hashCode().</p>
 * <p>equals() and hashCode() are made final to ensure that any descendants of this class are considered equal
 *    if and only if their hashes are equals.</p>
 * <p>This is also the reason why a class and not an interface is provided as the root of the hierarchy of commit data.</p>
 *
 * @author erokhins
 * @author <NAME>
 */
public class CommitParents {

  @NotNull private final Hash myHash;
  @NotNull private final List<Hash> myParents;

  public CommitParents(@NotNull Hash hash, @NotNull List<Hash> parents) {
    myHash = hash;
    myParents = parents;
  }

  @NotNull
  public final Hash getHash() {
    return myHash;
  }

  @NotNull
  public final List<Hash> getParents() {
    return myParents;
  }

  @Override
  public final boolean equals(Object obj) {
    if (this == obj) {
      return true;
    }
    if (!(obj instanceof CommitParents)) {
      return false;
    }
    return myHash.equals(((CommitParents)obj).myHash);
  }

  @Override
  public final int hashCode() {
    return myHash.hashCode();
  }

  @Override
  public String toString() {
    return myHash + "|-" + StringUtil.join(myParents, ",");
  }

}<commit_msg>[log] better toString for CommitParents<commit_after>package com.intellij.vcs.log;

import com.intellij.openapi.util.text.StringUtil;
import com.intellij.util.Function;
import com.intellij.util.containers.ContainerUtil;
import org.jetbrains.annotations.NotNull;

import java.util.List;

/**
 * <p>We suppose that the Hash is the unique identifier of the Commit,
 *    i. e. it is the only value that should be checked in equals() and hashCode().</p>
 * <p>equals() and hashCode() are made final to ensure that any descendants of this class are considered equal
 *    if and only if their hashes are equals.</p>
 * <p>This is also the reason why a class and not an interface is provided as the root of the hierarchy of commit data.</p>
 *
 * @author erokhins
 * @author <NAME>
 */
public class CommitParents {

  @NotNull private final Hash myHash;
  @NotNull private final List<Hash> myParents;

  public CommitParents(@NotNull Hash hash, @NotNull List<Hash> parents) {
    myHash = hash;
    myParents = parents;
  }

  @NotNull
  public final Hash getHash() {
    return myHash;
  }

  @NotNull
  public final List<Hash> getParents() {
    return myParents;
  }

  @Override
  public final boolean equals(Object obj) {
    if (this == obj) {
      return true;
    }
    if (!(obj instanceof CommitParents)) {
      return false;
    }
    return myHash.equals(((CommitParents)obj).myHash);
  }

  @Override
  public final int hashCode() {
    return myHash.hashCode();
  }

  @Override
  public String toString() {
    return myHash.toShortString() + "|-" + StringUtil.join(ContainerUtil.map(myParents, new Function<Hash, String>() {
      @Override
      public String fun(Hash hash) {
        return hash.toShortString();
      }
    }), ",");
  }

}
{'fraction_non_alphanumeric': 0.10845986984815618, 'fraction_numerical': 0.0, 'mean_word_length': 3.344549125168237, 'pattern_counts': {'":': 0, '<': 24, '<?xml version=': 0, '>': 24, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6205431', 'n_tokens_mistral': 1000, 'n_tokens_neox': 982, 'n_words': 334}