From: Roland Häder <roland@mxchange.org>
Date: Tue, 31 Jan 2023 14:13:53 +0000 (+0100)
Subject: Continued:
X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=a183f2292f050a535fa98d87535d22ec4e81d647;p=jcore.git

Continued:
- added more checks on parameter
---

diff --git a/src/org/mxchange/jcore/utils/FrameworkUtils.java b/src/org/mxchange/jcore/utils/FrameworkUtils.java
index aef9ac0..dd6ab58 100644
--- a/src/org/mxchange/jcore/utils/FrameworkUtils.java
+++ b/src/org/mxchange/jcore/utils/FrameworkUtils.java
@@ -52,8 +52,23 @@ public class FrameworkUtils {
 	 * @return Array from tokenized string
 	 */
 	public static String[] getArrayFromString (final String str, final String delimiter) {
+		// Check all parameter
+		if (null == str) {
+			// Throw NPE
+			throw new NullPointerException("Parameter 'str' is null"); //NOI18N
+		} else if (str.isEmpty()) {
+			// Throw IAE
+			throw new IllegalArgumentException("Parameter 'str' is empty"); //NOI18N
+		} else if (null == delimiter) {
+			// Throw NPE
+			throw new NullPointerException("Parameter 'delimiter' is null"); //NOI18N
+		} else if (delimiter.isEmpty()) {
+			// Throw IAE
+			throw new IllegalArgumentException("Parameter 'delimiter' is empty"); //NOI18N
+		}
+
 		// Get tokenizer
-		StringTokenizer tokenizer = new StringTokenizer(str, delimiter);
+		final StringTokenizer tokenizer = new StringTokenizer(str, delimiter);
 
 		// Init array and index
 		String[] tokens = new String[tokenizer.countTokens()];