Revision: 18327
          http://sourceforge.net/p/gate/code/18327
Author:   adamfunk
Date:     2014-09-12 14:43:33 +0000 (Fri, 12 Sep 2014)
Log Message:
-----------
All printStackTrace()s converted to logging.

Modified Paths:
--------------
    
gate/branches/twitter-pop-dev/plugins/Twitter/src/gate/corpora/twitter/PopulationConfig.java
    
gate/branches/twitter-pop-dev/plugins/Twitter/src/gate/corpora/twitter/PopulationDialogWrapper.java

Modified: 
gate/branches/twitter-pop-dev/plugins/Twitter/src/gate/corpora/twitter/PopulationConfig.java
===================================================================
--- 
gate/branches/twitter-pop-dev/plugins/Twitter/src/gate/corpora/twitter/PopulationConfig.java
        2014-09-12 14:37:07 UTC (rev 18326)
+++ 
gate/branches/twitter-pop-dev/plugins/Twitter/src/gate/corpora/twitter/PopulationConfig.java
        2014-09-12 14:43:33 UTC (rev 18327)
@@ -13,6 +13,7 @@
 
 
 import gate.Gate;
+
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
 import java.io.File;
@@ -23,6 +24,7 @@
 import java.util.Arrays;
 import java.util.List;
 import javax.swing.JFileChooser;
+import org.apache.log4j.Logger;
 import com.thoughtworks.xstream.XStream;
 import com.thoughtworks.xstream.io.xml.PrettyPrintWriter;
 import com.thoughtworks.xstream.io.xml.StaxDriver;
@@ -33,6 +35,7 @@
   private List<String> featureKeys, contentKeys;
   private int tweetsPerDoc;
   
+  
   public boolean getOneDocCheckbox() {
     return this.tweetsPerDoc == 1;
   }
@@ -162,12 +165,14 @@
 class SaveConfigListener implements ActionListener {
   PopulationDialogWrapper wrapper;
   
+  private static final Logger logger = 
Logger.getLogger(SaveConfigListener.class.getName());
+  
   public SaveConfigListener(PopulationDialogWrapper wrapper) {
     this.wrapper = wrapper;
   }
 
   @Override
-  public void actionPerformed(ActionEvent e) {
+  public void actionPerformed(ActionEvent event) {
     JFileChooser chooser = new JFileChooser();
     chooser.setDialogTitle("Save configuration as XML");
     chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
@@ -177,8 +182,8 @@
         wrapper.updateConfig();
         wrapper.config.saveXML(chooser.getSelectedFile());
       } 
-      catch(IOException e1) {
-        e1.printStackTrace();
+      catch(IOException exception) {
+        logger.warn("Error saving population config", exception);
       }
     }
   }

Modified: 
gate/branches/twitter-pop-dev/plugins/Twitter/src/gate/corpora/twitter/PopulationDialogWrapper.java
===================================================================
--- 
gate/branches/twitter-pop-dev/plugins/Twitter/src/gate/corpora/twitter/PopulationDialogWrapper.java
 2014-09-12 14:37:07 UTC (rev 18326)
+++ 
gate/branches/twitter-pop-dev/plugins/Twitter/src/gate/corpora/twitter/PopulationDialogWrapper.java
 2014-09-12 14:43:33 UTC (rev 18327)
@@ -35,6 +35,7 @@
 import javax.swing.JTextField;
 import javax.swing.SwingConstants;
 import javax.swing.SwingUtilities;
+import org.apache.log4j.Logger;
 
 
 public class PopulationDialogWrapper  {
@@ -46,6 +47,8 @@
   private List<URL> fileUrls;
   private ListEditor featureKeysEditor, contentKeysEditor;
 
+  private static final Logger logger = 
Logger.getLogger(PopulationDialogWrapper.class.getName());
+
   
   public PopulationDialogWrapper() {
     config = new PopulationConfig();
@@ -176,7 +179,7 @@
       }
     }
     catch (MalformedURLException e) {
-      e.printStackTrace();
+      logger.warn("Error loading file", e);
     }
     finally {
       this.dialog.dispose();

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Want excitement?
Manually upgrade your production database.
When you want reliability, choose Perforce
Perforce version control. Predictably reliable.
http://pubads.g.doubleclick.net/gampad/clk?id=157508191&iu=/4140/ostg.clktrk
_______________________________________________
GATE-cvs mailing list
GATE-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gate-cvs

Reply via email to