Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove StringUtils.isEmpty(s) and improve comments #1116

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 26 additions & 9 deletions jraft-core/src/main/java/com/alipay/sofa/jraft/core/State.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,32 @@
* 2018-Apr-08 5:41:54 PM
*/
public enum State {
STATE_LEADER, // It's a leader
STATE_TRANSFERRING, // It's transferring leadership
STATE_CANDIDATE, // It's a candidate
STATE_FOLLOWER, // It's a follower
STATE_ERROR, // It's in error
STATE_UNINITIALIZED, // It's uninitialized
STATE_SHUTTING, // It's shutting down
STATE_SHUTDOWN, // It's shutdown already
STATE_END; // State end
/** The node is a leader */
STATE_LEADER,

/** The node is transferring leadership */
STATE_TRANSFERRING,

/** The node is a candidate */
STATE_CANDIDATE,

/** The node is a follower */
STATE_FOLLOWER,

/** The node is in error */
STATE_ERROR,

/** The node is uninitialized */
STATE_UNINITIALIZED,

/** The node is shutting down */
STATE_SHUTTING,

/** The node is shut down */
STATE_SHUTDOWN,

/** The node is ending */
STATE_END;

public boolean isActive() {
return this.ordinal() < STATE_ERROR.ordinal();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ public String toString() {
*
*/
public boolean parse(final String s) {
if (StringUtils.isEmpty(s) || StringUtils.isBlank(s)) {
if (StringUtils.isBlank(s)) {
return false;
}

Expand Down
Loading