Skip to content
Merged
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 pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
</issueManagement>

<prerequisites>
<maven>3.3.9</maven>
<maven>3.5.0</maven>
</prerequisites>

<modules>
Expand All @@ -77,7 +77,7 @@
<maven-compiler-plugin-version>3.6.1</maven-compiler-plugin-version>
<maven-jar-plugin-version>3.0.2</maven-jar-plugin-version>
<maven-surefire-plugin-version>2.20</maven-surefire-plugin-version>
<maven-pmd-plugin-version>3.7</maven-pmd-plugin-version>
<maven-pmd-plugin-version>3.8</maven-pmd-plugin-version>
<maven-source-plugin-version>3.0.1</maven-source-plugin-version>
<maven-javadoc-plugin-version>2.10.4</maven-javadoc-plugin-version>
<maven-shade-plugin-version>3.0.0</maven-shade-plugin-version>
Expand Down
2 changes: 1 addition & 1 deletion quickfixj-codegenerator/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<dependency>
<groupId>net.sf.saxon</groupId>
<artifactId>Saxon-HE</artifactId>
<version>9.8.0-2</version>
<version>9.8.0-3</version>
</dependency>
</dependencies>

Expand Down
4 changes: 2 additions & 2 deletions quickfixj-core/src/main/java/quickfix/FieldMap.java
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ public void setUtcTimeStamp(int field, LocalDateTime value) {
}

public void setUtcTimeStamp(int field, LocalDateTime value, boolean includeMilliseconds) {
setField(new StringField(field, UtcTimestampConverter.convert(value, (includeMilliseconds == true) ? UtcTimestampPrecision.MILLIS : UtcTimestampPrecision.SECONDS)));
setField(new StringField(field, UtcTimestampConverter.convert(value, includeMilliseconds ? UtcTimestampPrecision.MILLIS : UtcTimestampPrecision.SECONDS)));
}

public void setUtcTimeStamp(int field, LocalDateTime value, UtcTimestampPrecision precision) {
Expand All @@ -201,7 +201,7 @@ public void setUtcTimeOnly(int field, LocalTime value) {
}

public void setUtcTimeOnly(int field, LocalTime value, boolean includeMilliseconds) {
setField(new StringField(field, UtcTimeOnlyConverter.convert(value, (includeMilliseconds == true) ? UtcTimestampPrecision.MILLIS : UtcTimestampPrecision.SECONDS)));
setField(new StringField(field, UtcTimeOnlyConverter.convert(value, includeMilliseconds ? UtcTimestampPrecision.MILLIS : UtcTimestampPrecision.SECONDS)));
}

public void setUtcTimeOnly(int field, LocalTime value, UtcTimestampPrecision precision) {
Expand Down
2 changes: 1 addition & 1 deletion quickfixj-core/src/main/java/quickfix/JdbcUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class JdbcUtil {
static final String CONNECTION_POOL_ALIAS = "quickfixj";

private static final Map<String, ProxoolDataSource> dataSources = new ConcurrentHashMap<>();
private static AtomicInteger dataSourceCounter = new AtomicInteger();
private static final AtomicInteger dataSourceCounter = new AtomicInteger();

static DataSource getDataSource(SessionSettings settings, SessionID sessionID)
throws ConfigError, FieldConvertError {
Expand Down
6 changes: 3 additions & 3 deletions quickfixj-core/src/main/java/quickfix/Session.java
Original file line number Diff line number Diff line change
Expand Up @@ -2801,18 +2801,18 @@ public void setTargetDefaultApplicationVersionID(ApplVerID applVerID) {
}

private static String extractNumber(String txt, int from) {
String ret = "";
final StringBuilder ret = new StringBuilder();
for (int i = from; i != txt.length(); ++i) {
final char c = txt.charAt(i);
if (c >= '0' && c <= '9') {
ret += c;
ret.append(c);
} else {
if (ret.length() != 0) {
break;
}
}
}
return ret.trim();
return ret.toString();
}

protected static Integer extractExpectedSequenceNumber(String txt) {
Expand Down
4 changes: 2 additions & 2 deletions quickfixj-core/src/main/java/quickfix/UtcTimeOnlyField.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ protected UtcTimeOnlyField(int field, LocalTime data, UtcTimestampPrecision prec

public UtcTimeOnlyField(int field, boolean includeMilliseconds) {
super(field, LocalTime.now());
this.precision = (includeMilliseconds == true) ? UtcTimestampPrecision.MILLIS : UtcTimestampPrecision.SECONDS;
this.precision = includeMilliseconds ? UtcTimestampPrecision.MILLIS : UtcTimestampPrecision.SECONDS;
}

protected UtcTimeOnlyField(int field, LocalTime data, boolean includeMilliseconds) {
super(field, data);
this.precision = (includeMilliseconds == true) ? UtcTimestampPrecision.MILLIS : UtcTimestampPrecision.SECONDS;
this.precision = includeMilliseconds ? UtcTimestampPrecision.MILLIS : UtcTimestampPrecision.SECONDS;
}

public UtcTimestampPrecision getPrecision() {
Expand Down
4 changes: 2 additions & 2 deletions quickfixj-core/src/main/java/quickfix/UtcTimeStampField.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ protected UtcTimeStampField(int field, LocalDateTime data, UtcTimestampPrecision

public UtcTimeStampField(int field, boolean includeMilliseconds) {
super(field, LocalDateTime.now());
this.precision = (includeMilliseconds == true) ? UtcTimestampPrecision.MILLIS : UtcTimestampPrecision.SECONDS;
this.precision = includeMilliseconds ? UtcTimestampPrecision.MILLIS : UtcTimestampPrecision.SECONDS;
}

public UtcTimeStampField(int field, UtcTimestampPrecision precision) {
Expand All @@ -53,7 +53,7 @@ public UtcTimeStampField(int field, UtcTimestampPrecision precision) {

protected UtcTimeStampField(int field, LocalDateTime data, boolean includeMilliseconds) {
super(field, data);
this.precision = (includeMilliseconds == true) ? UtcTimestampPrecision.MILLIS : UtcTimestampPrecision.SECONDS;
this.precision = includeMilliseconds ? UtcTimestampPrecision.MILLIS : UtcTimestampPrecision.SECONDS;
}

public UtcTimestampPrecision getPrecision() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
*/
public class UtcDateOnlyConverter extends AbstractDateTimeConverter {

static String TYPE = "date";
static final String TYPE = "date";
static final int DATE_LENGTH = 8;
// SimpleDateFormats are not thread safe. A thread local is being
// used to maintain high concurrency among multiple session threads
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
*/
public class UtcTimeOnlyConverter extends AbstractDateTimeConverter {

static String TYPE = "time";
static final String TYPE = "time";
static final int LENGTH_INCL_SECONDS = 8;
static final int LENGTH_INCL_MILLIS = 12;
static final int LENGTH_INCL_MICROS = 15;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
*/
public class UtcTimestampConverter extends AbstractDateTimeConverter {

static String TYPE = "timestamp";
static final String TYPE = "timestamp";
static final int LENGTH_INCL_SECONDS = 17;
static final int LENGTH_INCL_MILLIS = 21;
static final int LENGTH_INCL_MICROS = 24;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public static TrustManager[] wrap(TrustManager[] trustManagers) {
return wrappers;
}

private X509TrustManager trustManager;
private final X509TrustManager trustManager;

public X509TrustManagerWrapper(final X509TrustManager trustManager) {
this.trustManager = trustManager;
Expand Down
1 change: 0 additions & 1 deletion quickfixj-core/src/test/java/quickfix/SessionTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
import java.util.TimeZone;

import static org.junit.Assert.*;
import static org.mockito.Matchers.anyString;
import static org.mockito.Mockito.*;
import static quickfix.SessionFactoryTestSupport.createSession;

Expand Down
36 changes: 17 additions & 19 deletions quickfixj-core/src/test/java/quickfix/SocketInitiatorTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -268,29 +268,27 @@ public void testConnectedSocketsAreClosedAfterInitiatorClosed() throws Exception
final int port = serverSocket.getLocalPort();

final AtomicBoolean socketConnected = new AtomicBoolean(false);
Thread socketThread = new Thread() {
public void run() {
Socket socket = null;
Thread socketThread = new Thread(() -> {
Socket socket = null;
try {
socket = serverSocket.accept();
socketConnected.set(true);
final InputStream is = socket.getInputStream();
while (is.read() != -1) {
}
} catch (Exception e) {
} finally {
try {
socket = serverSocket.accept();
socketConnected.set(true);
final InputStream is = socket.getInputStream();
while (is.read() != -1) {
}
serverSocket.close();
} catch (Exception e) {
} finally {
try {
serverSocket.close();
} catch (Exception e) {
}
try {
socket.close();
} catch (Exception e) {
}
socketConnected.set(false);
}
try {
socket.close();
} catch (Exception e) {
}
socketConnected.set(false);
}
};
});

socketThread.setDaemon(true);
socketThread.start();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ public void shouldCleanUpAcceptorQFJMessageProcessorThreadAfterStop() throws Exc
@Override
public void run() {
try {
acceptor.block();
acceptor.start();
} catch (Exception e) {
e.printStackTrace();
} finally {
Expand Down Expand Up @@ -251,7 +251,7 @@ public void shouldCleanUpInitiatorQFJMessageProcessorThreadAfterStop() throws Ex
@Override
public void run() {
try {
initiator.block();
initiator.start();
} catch (Exception e) {
e.printStackTrace();
} finally {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -369,10 +369,11 @@ private void doTestMinaDemux(String message) throws Exception {
final IoSessionStub mockSession = new IoSessionStub();

int count = 5;
String data = "";
final StringBuilder builder = new StringBuilder(message.length() * 5);
for (int i = 0; i < count; i++) {
data += message;
builder.append(message);
}
final String data = builder.toString();

for (int i = 1; i < data.length(); i++) {
String chunk1 = data.substring(0, i);
Expand Down
2 changes: 1 addition & 1 deletion quickfixj-dictgenerator/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<!-- used by dictgenerator package -->
<groupId>org.dom4j</groupId>
<artifactId>dom4j</artifactId>
<version>2.0.0</version>
<version>2.0.1</version>
<optional>true</optional>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import org.dom4j.io.SAXReader;

import java.io.File;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashSet;
import java.util.List;
Expand Down Expand Up @@ -159,7 +158,7 @@ private void initFields() {
allFields.put(field.getTag(), field);
// Find enums
List<?> enumNodes = enums.selectNodes("//dataroot/Enums[Tag=" + tag + "]");
Collections.sort(enumNodes, new EnumNodeComparator());
enumNodes.sort(new EnumNodeComparator());
if (!enumNodes.isEmpty()) {
for (Object enumO : enumNodes) {
Node enumNode = (Node) enumO;
Expand Down Expand Up @@ -223,7 +222,7 @@ private void addComponentMsgContent(Component component, String prefix) {

private List<?> getMsgContents(String msgID) {
List<?> nodes = msgContents.selectNodes("//dataroot/MsgContents[MsgID=" + msgID + "]");
Collections.sort(nodes, new MsgContentNodeComparator());
nodes.sort(new MsgContentNodeComparator());
return nodes;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
import quickfix.examples.banzai.OrderTableModel;
import quickfix.examples.banzai.OrderType;

@SuppressWarnings("unchecked")
public class OrderEntryPanel extends JPanel implements Observer {
private boolean symbolEntered = false;
private boolean quantityEntered = false;
Expand Down