Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public long getEstimatedProcessingTime() {
if (responseTime == 0 || future.getWindowSize() == 0) {
return 0;
}
return (responseTime / future.getWindowSize());
return responseTime / future.getWindowSize();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,17 +223,17 @@ public Timer getBindTimer() {

@Override
public boolean isStarted() {
return (this.serverChannel != null && this.serverChannel.isBound());
return this.serverChannel != null && this.serverChannel.isBound();
}

@Override
public boolean isStopped() {
return (this.serverChannel == null);
return this.serverChannel == null;
}

@Override
public boolean isDestroyed() {
return (this.serverBootstrap == null);
return this.serverBootstrap == null;
}

@Override
Expand Down
20 changes: 10 additions & 10 deletions src/main/java/com/cloudhopper/smpp/impl/DefaultSmppSession.java
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ public DefaultSmppSession(Type localType, SmppSessionConfiguration configuration
this.configuration = configuration;
this.channel = channel;
this.boundTime = new AtomicLong(0);
this.sessionHandler = (sessionHandler == null ? new DefaultSmppSessionHandler(logger) : sessionHandler);
this.sessionHandler = sessionHandler == null ? new DefaultSmppSessionHandler(logger) : sessionHandler;
this.sequenceNumber = new SequenceNumber();
// always "wrap" the custom pdu transcoder context with a default one
this.transcoder = new DefaultPduTranscoder(new DefaultPduTranscoderContext(this.sessionHandler));
Expand Down Expand Up @@ -245,32 +245,32 @@ public byte getInterfaceVersion() {

@Override
public boolean areOptionalParametersSupported() {
return (this.interfaceVersion >= SmppConstants.VERSION_3_4);
return this.interfaceVersion >= SmppConstants.VERSION_3_4;
}

@Override
public boolean isOpen() {
return (this.state.get() == STATE_OPEN);
return this.state.get() == STATE_OPEN;
}

@Override
public boolean isBinding() {
return (this.state.get() == STATE_BINDING);
return this.state.get() == STATE_BINDING;
}

@Override
public boolean isBound() {
return (this.state.get() == STATE_BOUND);
return this.state.get() == STATE_BOUND;
}

@Override
public boolean isUnbinding() {
return (this.state.get() == STATE_UNBINDING);
return this.state.get() == STATE_UNBINDING;
}

@Override
public boolean isClosed() {
return (this.state.get() == STATE_CLOSED);
return this.state.get() == STATE_CLOSED;
}

@Override
Expand Down Expand Up @@ -302,7 +302,7 @@ public Window<Integer,PduRequest,PduResponse> getSendWindow() {

@Override
public boolean hasCounters() {
return (this.counters != null);
return this.counters != null;
}

@Override
Expand Down Expand Up @@ -626,7 +626,7 @@ public void firePduReceived(Pdu pdu) {
WindowFuture<Integer,PduRequest,PduResponse> future = this.sendWindow.complete(receivedPduSeqNum, responsePdu);
if (future != null) {
logger.trace("Found a future in the window for seqNum [{}]", receivedPduSeqNum);
this.countReceiveResponsePdu(responsePdu, future.getOfferToAcceptTime(), future.getAcceptToDoneTime(), (future.getAcceptToDoneTime() / future.getWindowSize()));
this.countReceiveResponsePdu(responsePdu, future.getOfferToAcceptTime(), future.getAcceptToDoneTime(), future.getAcceptToDoneTime() / future.getWindowSize());

// if this isn't null, we found a match to a request
int callerStateHint = future.getCallerStateHint();
Expand Down Expand Up @@ -947,7 +947,7 @@ public String getSystemType() {

@Override
public boolean isWindowMonitorEnabled() {
return (this.monitorExecutor != null && this.configuration.getWindowMonitorInterval() > 0);
return this.monitorExecutor != null && this.configuration.getWindowMonitorInterval() > 0;
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/cloudhopper/smpp/pdu/BaseSm.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public BaseSm(int commandId, String name) {
}

public int getShortMessageLength() {
return (this.shortMessage == null ? 0 : this.shortMessage.length);
return this.shortMessage == null ? 0 : this.shortMessage.length;
}

public byte[] getShortMessage() {
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/com/cloudhopper/smpp/pdu/Pdu.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public boolean isResponse() {
}

public boolean hasCommandLengthCalculated() {
return (this.commandLength != null);
return this.commandLength != null;
}

public void removeCommandLength() {
Expand Down Expand Up @@ -116,7 +116,7 @@ public int getCommandStatus() {
}

public boolean hasSequenceNumberAssigned() {
return (this.sequenceNumber != null);
return this.sequenceNumber != null;
}

public void removeSequenceNumber() {
Expand Down Expand Up @@ -206,7 +206,7 @@ public Tlv setOptionalParameter(Tlv tlv) {
* @return True if exists, otherwise false
*/
public boolean hasOptionalParameter(short tag) {
return (this.findOptionalParameter(tag) >= 0);
return this.findOptionalParameter(tag) >= 0;
}

protected int findOptionalParameter(short tag) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/cloudhopper/smpp/pdu/ReplaceSm.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public void setMessageId(String messageId){
}

public int getShortMessageLength() {
return (this.shortMessage == null ? 0 : this.shortMessage.length);
return this.shortMessage == null ? 0 : this.shortMessage.length;
}

public byte[] getShortMessage() {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/cloudhopper/smpp/tlv/Tlv.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public short getTag() {
* @return The "unsigned" length of this TLV's value
*/
public int getUnsignedLength() {
return (value == null ? 0 : value.length);
return value == null ? 0 : value.length;
}

public short getLength() {
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/cloudhopper/smpp/type/LoggingOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public void setLogPdu(boolean value) {
}

public boolean isLogPduEnabled() {
return ((this.option & LOG_PDU) > 0);
return (this.option & LOG_PDU) > 0;
}

public void setLogBytes(boolean value) {
Expand All @@ -57,6 +57,6 @@ public void setLogBytes(boolean value) {
}

public boolean isLogBytesEnabled() {
return ((this.option & LOG_BYTES) > 0);
return (this.option & LOG_BYTES) > 0;
}
}
4 changes: 2 additions & 2 deletions src/main/java/com/cloudhopper/smpp/util/PduUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ static public int calculateByteSizeOfAddress(Address value) {

static public boolean isRequestCommandId(int commandId) {
// if the 31st bit is not set, this is a request
return ((commandId & SmppConstants.PDU_CMD_ID_RESP_MASK) == 0);
return (commandId & SmppConstants.PDU_CMD_ID_RESP_MASK) == 0;
}

static public boolean isResponseCommandId(int commandId) {
// if the 31st bit is not set, this is a request
return ((commandId & SmppConstants.PDU_CMD_ID_RESP_MASK) == SmppConstants.PDU_CMD_ID_RESP_MASK);
return (commandId & SmppConstants.PDU_CMD_ID_RESP_MASK) == SmppConstants.PDU_CMD_ID_RESP_MASK;
}
}
20 changes: 10 additions & 10 deletions src/main/java/com/cloudhopper/smpp/util/SmppUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class SmppUtil {
* @return True if the option is set, otherwise false.
*/
static public boolean isMessageTypeAnyDeliveryReceipt(byte esmClass) {
return ((esmClass & SmppConstants.ESM_CLASS_MT_MASK) > 0);
return (esmClass & SmppConstants.ESM_CLASS_MT_MASK) > 0;
}

/**
Expand All @@ -48,7 +48,7 @@ static public boolean isMessageTypeAnyDeliveryReceipt(byte esmClass) {
* @return True if the option is set, otherwise false.
*/
static public boolean isMessageTypeManualUserAcknowledgement(byte esmClass) {
return ((esmClass & SmppConstants.ESM_CLASS_MT_MASK) == SmppConstants.ESM_CLASS_MT_MANUAL_USER_ACK);
return (esmClass & SmppConstants.ESM_CLASS_MT_MASK) == SmppConstants.ESM_CLASS_MT_MANUAL_USER_ACK;
}

/**
Expand All @@ -57,7 +57,7 @@ static public boolean isMessageTypeManualUserAcknowledgement(byte esmClass) {
* @return True if the option is set, otherwise false.
*/
static public boolean isMessageTypeEsmeDeliveryReceipt(byte esmClass) {
return ((esmClass & SmppConstants.ESM_CLASS_MT_MASK) == SmppConstants.ESM_CLASS_MT_ESME_DELIVERY_RECEIPT);
return (esmClass & SmppConstants.ESM_CLASS_MT_MASK) == SmppConstants.ESM_CLASS_MT_ESME_DELIVERY_RECEIPT;
}

/**
Expand All @@ -66,7 +66,7 @@ static public boolean isMessageTypeEsmeDeliveryReceipt(byte esmClass) {
* @return True if the option is set, otherwise false.
*/
static public boolean isMessageTypeIntermediateDeliveryReceipt(byte esmClass) {
return ((esmClass & SmppConstants.ESM_CLASS_INTERMEDIATE_DELIVERY_RECEIPT_FLAG) == SmppConstants.ESM_CLASS_INTERMEDIATE_DELIVERY_RECEIPT_FLAG);
return (esmClass & SmppConstants.ESM_CLASS_INTERMEDIATE_DELIVERY_RECEIPT_FLAG) == SmppConstants.ESM_CLASS_INTERMEDIATE_DELIVERY_RECEIPT_FLAG;
}

/**
Expand All @@ -75,7 +75,7 @@ static public boolean isMessageTypeIntermediateDeliveryReceipt(byte esmClass) {
* @return True if the option is set, otherwise false.
*/
static public boolean isMessageTypeSmscDeliveryReceipt(byte esmClass) {
return ((esmClass & SmppConstants.ESM_CLASS_MT_MASK) == SmppConstants.ESM_CLASS_MT_SMSC_DELIVERY_RECEIPT);
return (esmClass & SmppConstants.ESM_CLASS_MT_MASK) == SmppConstants.ESM_CLASS_MT_SMSC_DELIVERY_RECEIPT;
}

/**
Expand All @@ -84,7 +84,7 @@ static public boolean isMessageTypeSmscDeliveryReceipt(byte esmClass) {
* @return True if the option is set, otherwise false.
*/
static public boolean isUserDataHeaderIndicatorEnabled(byte esmClass) {
return ((esmClass & SmppConstants.ESM_CLASS_UDHI_MASK) == SmppConstants.ESM_CLASS_UDHI_MASK);
return (esmClass & SmppConstants.ESM_CLASS_UDHI_MASK) == SmppConstants.ESM_CLASS_UDHI_MASK;
}

/**
Expand All @@ -93,7 +93,7 @@ static public boolean isUserDataHeaderIndicatorEnabled(byte esmClass) {
* @return True if the option is set, otherwise false.
*/
static public boolean isReplyPathEnabled(byte esmClass) {
return ((esmClass & SmppConstants.ESM_CLASS_REPLY_PATH_MASK) == SmppConstants.ESM_CLASS_REPLY_PATH_MASK);
return (esmClass & SmppConstants.ESM_CLASS_REPLY_PATH_MASK) == SmppConstants.ESM_CLASS_REPLY_PATH_MASK;
}

/**
Expand All @@ -103,7 +103,7 @@ static public boolean isReplyPathEnabled(byte esmClass) {
* @return True if the option is set, otherwise false.
*/
static public boolean isSmscDeliveryReceiptRequested(byte registeredDelivery) {
return ((registeredDelivery & SmppConstants.REGISTERED_DELIVERY_SMSC_RECEIPT_MASK) == SmppConstants.REGISTERED_DELIVERY_SMSC_RECEIPT_REQUESTED);
return (registeredDelivery & SmppConstants.REGISTERED_DELIVERY_SMSC_RECEIPT_MASK) == SmppConstants.REGISTERED_DELIVERY_SMSC_RECEIPT_REQUESTED;
}

/**
Expand All @@ -113,7 +113,7 @@ static public boolean isSmscDeliveryReceiptRequested(byte registeredDelivery) {
* @return True if the option is set, otherwise false.
*/
static public boolean isSmscDeliveryReceiptOnFailureRequested(byte registeredDelivery) {
return ((registeredDelivery & SmppConstants.REGISTERED_DELIVERY_SMSC_RECEIPT_MASK) == SmppConstants.REGISTERED_DELIVERY_SMSC_RECEIPT_ON_FAILURE);
return (registeredDelivery & SmppConstants.REGISTERED_DELIVERY_SMSC_RECEIPT_MASK) == SmppConstants.REGISTERED_DELIVERY_SMSC_RECEIPT_ON_FAILURE;
}

/**
Expand All @@ -122,7 +122,7 @@ static public boolean isSmscDeliveryReceiptOnFailureRequested(byte registeredDel
* @return True if the option is set, otherwise false.
*/
static public boolean isIntermediateReceiptRequested(byte registeredDelivery) {
return ((registeredDelivery & SmppConstants.REGISTERED_DELIVERY_INTERMEDIATE_NOTIFICATION_MASK) == SmppConstants.REGISTERED_DELIVERY_INTERMEDIATE_NOTIFICATION_REQUESTED);
return (registeredDelivery & SmppConstants.REGISTERED_DELIVERY_INTERMEDIATE_NOTIFICATION_MASK) == SmppConstants.REGISTERED_DELIVERY_INTERMEDIATE_NOTIFICATION_REQUESTED;
}

/**
Expand Down