Skip to content

Commit

Permalink
Split on first = only
Browse files Browse the repository at this point in the history
  • Loading branch information
slominskir committed May 16, 2024
1 parent 59484a0 commit 83abd51
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/jlab/jaws/business/session/AlarmFacade.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 83abd51

Please sign in to comment.