Commit 869d174934cbe0175fb5c79dabb528e73a9fa08b

Authored by Nathanael Jourdane
1 parent aa2a59ba
Exists in master

remove unused loggers and make some attributes private

src/main/java/eu/omp/irap/vespa/epntapclient/EpnTapMainApp.java
... ... @@ -31,7 +31,7 @@ import eu.omp.irap.vespa.epntapclient.controller.EpnTapController;
31 31 public class EpnTapMainApp {
32 32  
33 33 /** The logger for the class EpnTapMainApp. */
34   - static final Logger logger = Logger.getLogger(EpnTapMainApp.class.getName());
  34 + private static final Logger logger = Logger.getLogger(EpnTapMainApp.class.getName());
35 35  
36 36  
37 37 /** Constructor to hide the implicit public one. */
... ... @@ -44,11 +44,11 @@ public class EpnTapMainApp {
44 44 * @param args The program arguments (not used).
45 45 */
46 46 public static void main(final String[] args) {
  47 + EpnTapMainApp.logger.info("Lauching EPN-TAP application...");
47 48 SwingUtilities.invokeLater(new Runnable() {
48 49  
49 50 @Override
50 51 public void run() {
51   - EpnTapMainApp.logger.info("Lauching EPN-TAP application...");
52 52 EpnTapController epnTapControl = new EpnTapController();
53 53 if (args.length != 0) {
54 54 System.console().writer().println("Usage: EpnTapMainApp");
... ...
src/main/java/eu/omp/irap/vespa/epntapclient/utils/Queries.java
... ... @@ -19,7 +19,6 @@ package eu.omp.irap.vespa.epntapclient.utils;
19 19 import java.util.ArrayList;
20 20 import java.util.List;
21 21 import java.util.Map;
22   -import java.util.logging.Logger;
23 22  
24 23 import eu.omp.irap.vespa.epntapclient.votable.utils.Utils.StringJoiner;
25 24  
... ... @@ -30,10 +29,6 @@ import eu.omp.irap.vespa.epntapclient.votable.utils.Utils.StringJoiner;
30 29 */
31 30 public final class Queries {
32 31  
33   - /** The logger for the class Queries. */
34   - @SuppressWarnings("unused")
35   - private Logger logger = Logger.getLogger(Queries.class.getName());
36   -
37 32 // AMDA access_url: http://cdpp-epntap.cesr.fr/__system__/tap/run/tap
38 33 // AMDA table name: amdadb.epn_core
39 34  
... ...
src/main/java/eu/omp/irap/vespa/epntapclient/view/EpnTapMainView.java
... ... @@ -17,7 +17,6 @@
17 17 package eu.omp.irap.vespa.epntapclient.view;
18 18  
19 19 import java.awt.BorderLayout;
20   -import java.util.logging.Logger;
21 20  
22 21 import javax.swing.JOptionPane;
23 22 import javax.swing.JPanel;
... ... @@ -36,10 +35,6 @@ import eu.omp.irap.vespa.epntapclient.votable.view.VOTableView;
36 35 */
37 36 public class EpnTapMainView extends JPanel {
38 37  
39   - /** The logger for the class EpnTapMainView. */
40   - @SuppressWarnings("unused")
41   - private static final Logger logger = Logger.getLogger(EpnTapMainView.class.getName());
42   -
43 38 /** The serial version UID. */
44 39 private static final long serialVersionUID = 1L;
45 40  
... ...
src/main/java/eu/omp/irap/vespa/epntapclient/view/ParamField.java
... ... @@ -59,7 +59,7 @@ public abstract class ParamField extends JPanel {
59 59 private static final long serialVersionUID = 1L;
60 60  
61 61 /** The logger for the class ParamField. */
62   - static final Logger logger = Logger.getLogger(ParamField.class.getName());
  62 + protected static final Logger logger = Logger.getLogger(ParamField.class.getName());
63 63  
64 64 /** The minimum width of the field. */
65 65 private static final int MIN_FIELD_WIDTH = 30;
... ...
src/main/java/eu/omp/irap/vespa/epntapclient/view/panels/BottomBarPanel.java
... ... @@ -17,7 +17,6 @@
17 17 package eu.omp.irap.vespa.epntapclient.view.panels;
18 18  
19 19 import java.awt.BorderLayout;
20   -import java.util.logging.Logger;
21 20  
22 21 import javax.swing.JButton;
23 22 import javax.swing.JLabel;
... ... @@ -33,10 +32,6 @@ public class BottomBarPanel extends JPanel {
33 32 /** The serial version UID. */
34 33 private static final long serialVersionUID = 1L;
35 34  
36   - /** The logger for the class BottomBar. */
37   - @SuppressWarnings("unused")
38   - private static final Logger logger = Logger.getLogger(BottomBarPanel.class.getName());
39   -
40 35 /** A label to display several informations (aka. status bar). */
41 36 private JLabel infoLabel;
42 37  
... ...
src/main/java/eu/omp/irap/vespa/epntapclient/view/panels/RequestPanel.java
... ... @@ -22,7 +22,6 @@ import java.awt.event.ActionEvent;
22 22 import java.awt.event.ActionListener;
23 23 import java.util.ArrayList;
24 24 import java.util.List;
25   -import java.util.logging.Logger;
26 25  
27 26 import javax.swing.BorderFactory;
28 27 import javax.swing.BoxLayout;
... ... @@ -46,10 +45,6 @@ import eu.omp.irap.vespa.epntapclient.view.ParamField.TargetNameField;
46 45 */
47 46 public class RequestPanel extends JPanel implements ActionListener {
48 47  
49   - /** The logger for the class RequestView. */
50   - @SuppressWarnings("unused")
51   - private static final Logger logger = Logger.getLogger(RequestPanel.class.getName());
52   -
53 48 /** The serial version UID. */
54 49 private static final long serialVersionUID = 1L;
55 50  
... ...
src/main/java/eu/omp/irap/vespa/epntapclient/view/panels/ResultsPanel.java
... ... @@ -18,7 +18,6 @@ package eu.omp.irap.vespa.epntapclient.view.panels;
18 18  
19 19 import java.awt.BorderLayout;
20 20 import java.awt.Dimension;
21   -import java.util.logging.Logger;
22 21  
23 22 import javax.swing.JPanel;
24 23  
... ... @@ -34,10 +33,6 @@ public class ResultsPanel extends JPanel {
34 33 /** */
35 34 private static final long serialVersionUID = -3387526562625069156L;
36 35  
37   - /** The logger for the class ResultPanel. */
38   - @SuppressWarnings("unused")
39   - private static final Logger logger = Logger.getLogger(ResultsPanel.class.getName());
40   -
41 36  
42 37 /**
43 38 * Method constructor which customize the result panel, but don't build it from scratch since
... ...
src/main/java/eu/omp/irap/vespa/epntapclient/view/panels/ServicesPanel.java
... ... @@ -18,7 +18,6 @@ package eu.omp.irap.vespa.epntapclient.view.panels;
18 18  
19 19 import java.awt.BorderLayout;
20 20 import java.awt.Dimension;
21   -import java.util.logging.Logger;
22 21  
23 22 import javax.swing.JPanel;
24 23 import javax.swing.event.ListSelectionEvent;
... ... @@ -37,10 +36,6 @@ public class ServicesPanel extends JPanel {
37 36 /** The serial version UID. */
38 37 private static final long serialVersionUID = 1L;
39 38  
40   - /** The logger for the class ServicesView. */
41   - @SuppressWarnings("unused")
42   - private static final Logger logger = Logger.getLogger(ServicesPanel.class.getName());
43   -
44 39 /** The generic view of the VOTable panel. */
45 40 private VOTableView voTableView;
46 41  
... ...
src/main/java/eu/omp/irap/vespa/epntapclient/votable/VOTableApp.java
... ... @@ -35,7 +35,7 @@ import eu.omp.irap.vespa.epntapclient.votable.controller.VOTableException;
35 35 public class VOTableApp {
36 36  
37 37 /** The logger for the class VOTableApp. */
38   - static final Logger logger = Logger.getLogger(VOTableApp.class.getName());
  38 + protected static final Logger logger = Logger.getLogger(VOTableApp.class.getName());
39 39  
40 40  
41 41 /** Private constructor to hide the implicit public one. */
... ... @@ -60,14 +60,13 @@ public class VOTableApp {
60 60 * @param args The program arguments
61 61 */
62 62 public static void main(final String[] args) {
  63 + VOTableApp.logger.info("Lauching VOTable app with arguments:\n" + new Gson().toJson(args));
63 64 SwingUtilities.invokeLater(new Runnable() {
64 65  
65 66 @Override
66 67 public void run() {
67 68 // TODO: Add option to export to CSV and HTML in CLI.
68 69 VOTableController voTableControl;
69   - VOTableApp.logger
70   - .info("Lauching VOTable app with arguments:\n " + new Gson().toJson(args));
71 70 if (args.length == 1) {
72 71 try {
73 72 voTableControl = new VOTableController(args[0]);
... ...
src/main/java/eu/omp/irap/vespa/epntapclient/votable/controller/VOTableController.java
... ... @@ -38,10 +38,10 @@ public class VOTableController {
38 38 private static final Logger logger = Logger.getLogger(VOTableController.class.getName());
39 39  
40 40 /** The view of the VOTable */
41   - VOTableView view;
  41 + private VOTableView view;
42 42  
43 43 /** The VOTable model */
44   - VOTABLE voTable;
  44 + private VOTABLE voTable;
45 45  
46 46  
47 47 /**
... ...
src/main/java/eu/omp/irap/vespa/epntapclient/votable/utils/Utils.java
... ... @@ -18,8 +18,6 @@ package eu.omp.irap.vespa.epntapclient.votable.utils;
18 18  
19 19 import java.io.FileWriter;
20 20 import java.io.IOException;
21   -import java.util.ArrayList;
22   -import java.util.List;
23 21 import java.util.logging.Logger;
24 22  
25 23 import com.google.gson.Gson;
... ... @@ -47,14 +45,11 @@ public class Utils {
47 45 */
48 46 public static class StringJoiner {
49 47  
50   - /** A list of words to join, ie. ["foo", "bar"]. */
51   - List<String> list;
52   -
53 48 /** The string joiner separator to put between each word, ie. ';'. */
54   - String separator;
  49 + private String separator;
55 50  
56 51 /** The resulting string, ie. "foo;bar". */
57   - String string;
  52 + private String string;
58 53  
59 54  
60 55 /**
... ... @@ -64,7 +59,6 @@ public class Utils {
64 59 */
65 60 public StringJoiner(String separator) {
66 61 this.separator = separator;
67   - list = new ArrayList<>();
68 62 string = "";
69 63 }
70 64  
... ...
src/main/java/eu/omp/irap/vespa/epntapclient/votable/view/VOTableView.java
... ... @@ -18,7 +18,6 @@ package eu.omp.irap.vespa.epntapclient.votable.view;
18 18  
19 19 import java.awt.BorderLayout;
20 20 import java.util.List;
21   -import java.util.logging.Logger;
22 21  
23 22 import javax.swing.JPanel;
24 23 import javax.swing.JScrollPane;
... ... @@ -37,15 +36,12 @@ import eu.omp.irap.vespa.epntapclient.votable.utils.Utils;
37 36 */
38 37 public class VOTableView extends JPanel implements TableModelListener {
39 38  
40   - /** The logger for the class VOTableView. */
41   - static final Logger logger = Logger.getLogger(VOTableView.class.getName());
42   -
43 39 // TODO: Create class VOTableCLI the view for a CLI usage
44 40 /** The serial version UID. */
45 41 private static final long serialVersionUID = 1L;
46 42  
47 43 /** The JTable component where the data are displayed. */
48   - JTable table;
  44 + private JTable table;
49 45  
50 46 /** The DataModel representing the VOTable data in the JTable element. */
51 47 private DefaultTableModel tableData;
... ...