Skip to content

Commit

Permalink
code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
etissieres committed Mar 9, 2014
1 parent 7ffa432 commit a480838
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/main/java/org/mansart/mongocount/Configuration.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import java.util.ArrayList;

public final class Configuration {
private ArrayList<Listener> listeners = new ArrayList<>();
private final ArrayList<Listener> listeners = new ArrayList<>();
private String host = "localhost";
private int port = 27017;
private String dbname = "";
Expand Down
6 changes: 2 additions & 4 deletions src/main/java/org/mansart/mongocount/Counter.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,14 @@
import com.mongodb.DBCollection;
import com.mongodb.MongoClient;

import java.net.UnknownHostException;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;

public final class Counter implements Configuration.Listener, Runnable {
private static final DateFormat DATE_FORMAT = new SimpleDateFormat("HH:mm:ss");
private ArrayList<Listener> listeners = new ArrayList<>();
private MongoClient client = null;
private final ArrayList<Listener> listeners = new ArrayList<>();
private Configuration configuration = null;
private Thread thread = null;

Expand Down Expand Up @@ -88,7 +86,7 @@ public void run() {
this.notifyListenersOfCount(count);
Thread.sleep(this.configuration.getInterval() * 1000);
}
if (this.client != null) this.client.close();
client.close();
} catch (Exception e) {
this.stop();
this.notifyListenersOfCountError();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;

public final class ConfigurationDialog extends JDialog {
final class ConfigurationDialog extends JDialog {
private static final Color[] COLORS = new Color[] {
Color.BLACK,
Color.BLUE,
Expand Down

0 comments on commit a480838

Please sign in to comment.