<commit_before>package org.openlca.git.model;

import org.eclipse.jgit.lib.ObjectId;
import org.openlca.core.model.ModelType;
import org.openlca.git.util.GitUtil;
import org.openlca.util.Strings;

public class Reference {

	public final ModelType type;
	public final String refId;
	public final String fullPath;
	public final String category;
	public final String commitId;
	public final ObjectId objectId;

	public Reference(ModelType type, String refId, String commitId, String fullPath, ObjectId objectId) {
		this.type = type;
		this.refId = refId;
		this.commitId = commitId;
		this.fullPath = GitUtil.decode(fullPath);
		this.objectId = objectId;
		if (fullPath.indexOf("/") == fullPath.lastIndexOf("/")) {
			this.category = "";
		} else {
			String category = fullPath.substring(fullPath.indexOf("/") + 1, fullPath.lastIndexOf("/"));
			this.category = GitUtil.decode(category);
		}
	}

	@Override
	public boolean equals(Object obj) {
		if (!(obj instanceof Reference))
			return false;
		var ref = (Reference) obj;
		return ref.objectId.equals(objectId);
	}

	public String getBinariesPath() {
		var path = type.name();
		if (!Strings.nullOrEmpty(category)) {
			path += "/" + category;
		}
		return path + "/" + refId + GitUtil.BIN_DIR_SUFFIX;
	}

}<commit_msg>Only returning binaries path when refId is not null<commit_after>package org.openlca.git.model;

import org.eclipse.jgit.lib.ObjectId;
import org.openlca.core.model.ModelType;
import org.openlca.git.util.GitUtil;
import org.openlca.util.Strings;

public class Reference {

	public final ModelType type;
	public final String refId;
	public final String fullPath;
	public final String category;
	public final String commitId;
	public final ObjectId objectId;

	public Reference(ModelType type, String refId, String commitId, String fullPath, ObjectId objectId) {
		this.type = type;
		this.refId = refId;
		this.commitId = commitId;
		this.fullPath = GitUtil.decode(fullPath);
		this.objectId = objectId;
		if (fullPath.indexOf("/") == fullPath.lastIndexOf("/")) {
			this.category = "";
		} else {
			String category = fullPath.substring(fullPath.indexOf("/") + 1, fullPath.lastIndexOf("/"));
			this.category = GitUtil.decode(category);
		}
	}

	@Override
	public boolean equals(Object obj) {
		if (!(obj instanceof Reference))
			return false;
		var ref = (Reference) obj;
		return ref.objectId.equals(objectId);
	}

	public String getBinariesPath() {
		if (refId == null)
			return null;
		var path = type.name();
		if (!Strings.nullOrEmpty(category)) {
			path += "/" + category;
		}
		return path + "/" + refId + GitUtil.BIN_DIR_SUFFIX;
	}

}
{'fraction_non_alphanumeric': 0.12571646923958732, 'fraction_numerical': 0.0007642338555598013, 'mean_word_length': 4.194444444444445, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3400138', 'n_tokens_mistral': 916, 'n_tokens_neox': 848, 'n_words': 215}