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
4 changes: 2 additions & 2 deletions src/main/java/com/cloudhopper/smpp/SmppConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ public class SmppConstants {
public static final Map<Short,String> TAG_NAME_MAP;

static {
STATUS_MESSAGE_MAP = new HashMap<Integer,String>();
STATUS_MESSAGE_MAP = new HashMap<>();
STATUS_MESSAGE_MAP.put(STATUS_OK, "OK");
STATUS_MESSAGE_MAP.put(STATUS_INVMSGLEN, "Message length invalid");
STATUS_MESSAGE_MAP.put(STATUS_INVCMDLEN, "Command length invalid");
Expand Down Expand Up @@ -584,7 +584,7 @@ public class SmppConstants {
STATUS_MESSAGE_MAP.put(STATUS_INVBCASTCNTTYPE, "Broadcast Content Type is invalid");
STATUS_MESSAGE_MAP.put(STATUS_INVBCASTMSGCLASS, "Broadcast Message Class is invalid");

TAG_NAME_MAP = new HashMap<Short,String>();
TAG_NAME_MAP = new HashMap<>();
TAG_NAME_MAP.put(TAG_SOURCE_TELEMATICS_ID, "source_telematics_id");
TAG_NAME_MAP.put(TAG_PAYLOAD_TYPE, "payload_type");
TAG_NAME_MAP.put(TAG_PRIVACY_INDICATOR, "privacy_indicator");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,9 @@ public DefaultSmppSession(Type localType, SmppSessionConfiguration configuration
// different ways to construct the window if monitoring is enabled
if (monitorExecutor != null && configuration.getWindowMonitorInterval() > 0) {
// enable send window monitoring, verify if the monitoringInterval has been set
this.sendWindow = new Window<Integer,PduRequest,PduResponse>(configuration.getWindowSize(), monitorExecutor, configuration.getWindowMonitorInterval(), this, configuration.getName() + ".Monitor");
this.sendWindow = new Window<>(configuration.getWindowSize(), monitorExecutor, configuration.getWindowMonitorInterval(), this, configuration.getName() + ".Monitor");
} else {
this.sendWindow = new Window<Integer,PduRequest,PduResponse>(configuration.getWindowSize());
this.sendWindow = new Window<>(configuration.getWindowSize());
}

// these server-only items are null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ public class PollableSmppSessionHandler implements SmppSessionHandler {
private final AtomicInteger closedCount;

public PollableSmppSessionHandler() {
this.receivedPduRequests = new LinkedBlockingQueue<PduRequest>();
this.receivedExpectedPduResponses = new LinkedBlockingQueue<PduAsyncResponse>();
this.receivedUnexpectedPduResponses = new LinkedBlockingQueue<PduResponse>();
this.throwables = new LinkedBlockingQueue<Throwable>();
this.receivedPduRequests = new LinkedBlockingQueue<>();
this.receivedExpectedPduResponses = new LinkedBlockingQueue<>();
this.receivedUnexpectedPduResponses = new LinkedBlockingQueue<>();
this.throwables = new LinkedBlockingQueue<>();
this.closedCount = new AtomicInteger();
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/cloudhopper/smpp/pdu/Pdu.java
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ public ArrayList<Tlv> getOptionalParameters() {
*/
public void addOptionalParameter(Tlv tlv) {
if (this.optionalParameters == null) {
this.optionalParameters = new ArrayList<Tlv>();
this.optionalParameters = new ArrayList<>();
}
this.optionalParameters.add(tlv);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public class SmppSimulatorServerHandler extends SimpleChannelHandler {

public SmppSimulatorServerHandler(ChannelGroup sessionChannels) {
this.sessionChannels = sessionChannels;
this.sessionQueue = new LinkedBlockingQueue<SmppSimulatorSessionHandler>();
this.sessionQueue = new LinkedBlockingQueue<>();
}

public SmppSimulatorPduProcessor getDefaultPduProcessor() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ public class SmppSimulatorSessionHandler extends FrameDecoder {
public SmppSimulatorSessionHandler(Channel channel, PduTranscoder transcoder) {
this.channel = channel;
this.transcoder = transcoder;
this.pduQueue = new LinkedBlockingQueue<Pdu>();
this.exceptionQueue = new LinkedBlockingQueue<Throwable>();
this.writePduQueue = new LinkedBlockingDeque<Pdu>();
this.pduQueue = new LinkedBlockingQueue<>();
this.exceptionQueue = new LinkedBlockingQueue<>();
this.writePduQueue = new LinkedBlockingDeque<>();
}

public SmppSimulatorPduProcessor getPduProcessor() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ public void validate(KeyStore keyStore, Certificate cert) throws CertificateExce

public void validate(Certificate[] certChain) throws CertificateException {
try {
ArrayList<X509Certificate> certList = new ArrayList<X509Certificate>();
ArrayList<X509Certificate> certList = new ArrayList<>();
for (Certificate item : certChain) {
if (item == null) continue;
if (!(item instanceof X509Certificate)) {
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/com/cloudhopper/smpp/ssl/SslConfiguration.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ public class SslConfiguration
(Security.getProperty("ssl.TrustManagerFactory.algorithm") == null ?
"SunX509" : Security.getProperty("ssl.TrustManagerFactory.algorithm"));

private final Set<String> excludeProtocols = new HashSet<String>();
private final Set<String> excludeProtocols = new HashSet<>();
private Set<String> includeProtocols = null;

private final Set<String> excludeCipherSuites = new HashSet<String>();
private final Set<String> excludeCipherSuites = new HashSet<>();
private Set<String> includeCipherSuites = null;

private String keyStorePath;
Expand Down Expand Up @@ -127,7 +127,7 @@ public String[] getIncludeProtocols() {
* {@link SSLEngine#setEnabledProtocols(String[])}
*/
public void setIncludeProtocols(String... protocols) {
this.includeProtocols = new HashSet<String>(Arrays.asList(protocols));
this.includeProtocols = new HashSet<>(Arrays.asList(protocols));
}

/**
Expand Down Expand Up @@ -169,7 +169,7 @@ public String[] getIncludeCipherSuites() {
* {@link SSLEngine#setEnabledCipherSuites(String[])}
*/
public void setIncludeCipherSuites(String... cipherSuites) {
this.includeCipherSuites = new HashSet<String>(Arrays.asList(cipherSuites));
this.includeCipherSuites = new HashSet<>(Arrays.asList(cipherSuites));
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/cloudhopper/smpp/ssl/SslContextFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ private static boolean contains(Object[] arr, Object obj) {
* @return Array of cipher suites to enable
*/
public String[] selectProtocols(String[] enabledProtocols, String[] supportedProtocols) {
Set<String> selected_protocols = new HashSet<String>();
Set<String> selected_protocols = new HashSet<>();

// Set the starting protocols - either from the included or enabled list
if (sslConfig.getIncludeProtocols() != null) {
Expand Down Expand Up @@ -443,7 +443,7 @@ public String[] selectProtocols(String[] enabledProtocols, String[] supportedPro
* @return Array of cipher suites to enable
*/
public String[] selectCipherSuites(String[] enabledCipherSuites, String[] supportedCipherSuites) {
Set<String> selected_ciphers = new HashSet<String>();
Set<String> selected_ciphers = new HashSet<>();

// Set the starting ciphers - either from the included or enabled list
if (sslConfig.getIncludeCipherSuites() != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public class ConcurrentCommandStatusCounter {
private ConcurrentHashMap<Integer,AtomicInteger> map;

public ConcurrentCommandStatusCounter() {
this.map = new ConcurrentHashMap<Integer,AtomicInteger>();
this.map = new ConcurrentHashMap<>();
}

public void reset() {
Expand Down Expand Up @@ -71,7 +71,7 @@ public int incrementAndGet(int commandStatus) {
}

public SortedMap<Integer,Integer> createSortedMapSnapshot() {
SortedMap<Integer,Integer> sortedMap = new TreeMap<Integer,Integer>();
SortedMap<Integer,Integer> sortedMap = new TreeMap<>();
for (Map.Entry<Integer,AtomicInteger> entry : this.map.entrySet()) {
sortedMap.put(entry.getKey(), new Integer(entry.getValue().get()));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ static public DeliveryReceipt parseShortMessage(String shortMessage,
// create a new DLR with fields set to "uninitialized" values
DeliveryReceipt dlr = new DeliveryReceipt(null, -1, -1, null, null,
(byte) -1, -1, null);
TreeMap<Integer, String> fieldsByStartPos = new TreeMap<Integer, String>();
TreeMap<Integer, String> fieldsByStartPos = new TreeMap<>();

// find location of all possible fields in text of message and add to
// treemap by their startPos so that we'll end up with an ordered list
Expand Down