Skip to content

Commit ae2799d

Browse files
committedSep 1, 2014
Rewrite QBasicConnection.open() and QBasicConnection.close() methods to use QBasicConnection.isConnected() instead of null check
1 parent 6618aad commit ae2799d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎src/main/java/com/exxeleron/qjava/QBasicConnection.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public QBasicConnection(final String host, final int port, final String username
8383
* {@inheritDoc}
8484
*/
8585
public void open() throws IOException, QException {
86-
if ( connection == null ) {
86+
if ( !isConnected() ) {
8787
if ( host != null ) {
8888
initSocket();
8989
initialize();
@@ -127,7 +127,7 @@ private void initialize() throws IOException, QException {
127127
* {@inheritDoc}
128128
*/
129129
public void close() throws IOException {
130-
if ( connection != null ) {
130+
if ( isConnected() ) {
131131
connection.close();
132132
connection = null;
133133
}

0 commit comments

Comments
 (0)
Please sign in to comment.