<commit_before>package ch.elexis.core.model.issue;

import java.util.ResourceBundle;

import ch.elexis.core.interfaces.ILocalizedEnum;
import ch.elexis.core.interfaces.INumericEnum;

public enum Type implements INumericEnum, ILocalizedEnum {

	// @formatter:off
	COMMON(0), 
	PRINT(1), 
	PRINT_DRUG_STICKER(2), 
	SEND_DOCUMENT(3), 
	READ_DOCUMENT(4), 
	CHECK_LAB_RESULT(5), 
	MAKE_APPOINTMENT(6), 
	DISPENSE_MEDICATION(7), 
	PROCESS_SERVICE_RECORDING(8);
	// @formatter:on

	private final int numeric;

	private Type(int numeric) {
		this.numeric = numeric;
	}

	public int numericValue() {
		return numeric;
	}

	public String getLocaleText() {
		try {
			return ResourceBundle.getBundle(ch.elexis.core.l10n.Messages.BUNDLE_NAME)
					.getString(Type.class.getSimpleName() + "_" + this.name());
		} catch (Exception e) {
			return this.name();
		}
	}

	public static Type byNumericSafe(String actionTypeIn) {
		int numeric = Integer.parseInt(actionTypeIn);
		for (Type actionType : Type.values()) {
			if (actionType.numericValue() == numeric) {
				return actionType;
			}
		}
		return Type.COMMON;
	}
}
<commit_msg>[21899] add empty check bevore getting numeric value for Type<commit_after>package ch.elexis.core.model.issue;

import java.util.ResourceBundle;

import org.apache.commons.lang3.StringUtils;

import ch.elexis.core.interfaces.ILocalizedEnum;
import ch.elexis.core.interfaces.INumericEnum;

public enum Type implements INumericEnum, ILocalizedEnum {

	// @formatter:off
	COMMON(0), 
	PRINT(1), 
	PRINT_DRUG_STICKER(2), 
	SEND_DOCUMENT(3), 
	READ_DOCUMENT(4), 
	CHECK_LAB_RESULT(5), 
	MAKE_APPOINTMENT(6), 
	DISPENSE_MEDICATION(7), 
	PROCESS_SERVICE_RECORDING(8);
	// @formatter:on

	private final int numeric;

	private Type(int numeric) {
		this.numeric = numeric;
	}

	public int numericValue() {
		return numeric;
	}

	public String getLocaleText() {
		try {
			return ResourceBundle.getBundle(ch.elexis.core.l10n.Messages.BUNDLE_NAME)
					.getString(Type.class.getSimpleName() + "_" + this.name());
		} catch (Exception e) {
			return this.name();
		}
	}

	public static Type byNumericSafe(String actionTypeIn) {
		if (StringUtils.isNotBlank(actionTypeIn)) {
			try {
				int numeric = Integer.parseInt(actionTypeIn);
				for (Type actionType : Type.values()) {
					if (actionType.numericValue() == numeric) {
						return actionType;
					}
				}
			} catch (NumberFormatException ne) {
				// ignore return common
			}
		}
		return Type.COMMON;
	}
}

{'fraction_non_alphanumeric': 0.12045270816491511, 'fraction_numerical': 0.01131770412287793, 'mean_word_length': 4.145530145530145, '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': '2142088', 'n_tokens_mistral': 985, 'n_tokens_neox': 872, 'n_words': 162}