From 83abd51bd6f3767a11f28a9d09e833208d544803 Mon Sep 17 00:00:00 2001 From: slominskir Date: Thu, 16 May 2024 16:35:59 -0400 Subject: [PATCH] Split on first = only --- .../java/org/jlab/jaws/business/session/ActionFacade.java | 4 ++-- src/main/java/org/jlab/jaws/business/session/AlarmFacade.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/jlab/jaws/business/session/ActionFacade.java b/src/main/java/org/jlab/jaws/business/session/ActionFacade.java index 6467f35f..f8fd4774 100644 --- a/src/main/java/org/jlab/jaws/business/session/ActionFacade.java +++ b/src/main/java/org/jlab/jaws/business/session/ActionFacade.java @@ -287,9 +287,9 @@ private void parseActionLine(String line) throws UserFriendlyException { System.out.println("line: " + line); - String[] tokens = line.split("="); + String[] tokens = line.split("=", 2); // split on FIRST "=" only - if (tokens.length != 2) { + if (tokens.length != 2) { // Make sure there was at least one! throw new UserFriendlyException("Invalid action line: " + line); } diff --git a/src/main/java/org/jlab/jaws/business/session/AlarmFacade.java b/src/main/java/org/jlab/jaws/business/session/AlarmFacade.java index d702766b..ee1f50c7 100644 --- a/src/main/java/org/jlab/jaws/business/session/AlarmFacade.java +++ b/src/main/java/org/jlab/jaws/business/session/AlarmFacade.java @@ -281,9 +281,9 @@ private void parseAlarmLine(String line) throws UserFriendlyException { System.out.println("line: " + line); - String[] tokens = line.split("="); + String[] tokens = line.split("=", 2); // split on FIRST "=" only - if (tokens.length != 2) { + if (tokens.length != 2) { // Make sure there was at least one! throw new UserFriendlyException("Invalid alarm line: " + line); }