Skip to content

Commit d268252

Browse files
mgaffigantonygermano
authored andcommitted
Simplified checks for login status isSuccess
LoginPanel.java copyright change is based on 3954bc5 Signed-off-by: Mitch Gaffigan <[email protected]>
1 parent b4edd33 commit d268252

File tree

2 files changed

+11
-18
lines changed

2 files changed

+11
-18
lines changed

client/src/com/mirth/connect/client/ui/LoginPanel.java

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
1-
/*
2-
* Copyright (c) Mirth Corporation. All rights reserved.
3-
*
4-
* http://www.mirthcorp.com
5-
*
6-
* The software in this package is published under the terms of the MPL license a copy of which has
7-
* been included with this distribution in the LICENSE.txt file.
8-
*/
1+
// SPDX-License-Identifier: MPL-2.0
2+
// SPDX-FileCopyrightText: Mirth Corporation
3+
// SPDX-FileCopyrightText: 2025 Mitch Gaffigan and Tony Germano
94

105
package com.mirth.connect.client.ui;
116

@@ -451,7 +446,7 @@ public Void doInBackground() {
451446
}
452447

453448
// If SUCCESS or SUCCESS_GRACE_PERIOD
454-
if ((loginStatus != null) && ((loginStatus.getStatus() == LoginStatus.Status.SUCCESS) || (loginStatus.getStatus() == LoginStatus.Status.SUCCESS_GRACE_PERIOD))) {
449+
if (loginStatus != null && loginStatus.isSuccess()) {
455450
if (!handleSuccess(loginStatus)) {
456451
LoginPanel.getInstance().setVisible(false);
457452
LoginPanel.getInstance().initialize(PlatformUI.SERVER_URL, PlatformUI.CLIENT_VERSION, "", "");
@@ -469,7 +464,7 @@ public Void doInBackground() {
469464

470465
loginStatus = plugin.authenticate(LoginPanel.this, client, updatedUsername, loginStatus);
471466

472-
if ((loginStatus != null) && ((loginStatus.getStatus() == LoginStatus.Status.SUCCESS) || (loginStatus.getStatus() == LoginStatus.Status.SUCCESS_GRACE_PERIOD))) {
467+
if (loginStatus != null && loginStatus.isSuccess()) {
473468
errorOccurred = false;
474469
if (!handleSuccess(loginStatus)) {
475470
LoginPanel.getInstance().setVisible(false);

server/src/com/mirth/connect/model/LoginStatus.java

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
1-
/*
2-
* Copyright (c) Mirth Corporation. All rights reserved.
3-
*
4-
* http://www.mirthcorp.com
5-
*
6-
* The software in this package is published under the terms of the MPL license a copy of which has
7-
* been included with this distribution in the LICENSE.txt file.
8-
*/
1+
// SPDX-License-Identifier: MPL-2.0
2+
// SPDX-FileCopyrightText: Mirth Corporation
93

104
package com.mirth.connect.model;
115

@@ -43,4 +37,8 @@ public String getMessage() {
4337
public String getUpdatedUsername() {
4438
return updatedUsername;
4539
}
40+
41+
public boolean isSuccess() {
42+
return status == Status.SUCCESS || status == Status.SUCCESS_GRACE_PERIOD;
43+
}
4644
}

0 commit comments

Comments
 (0)