Ignore:
Timestamp:
2017-08-22T22:26:32+02:00 (7 years ago)
Author:
Don-vip
Message:

see #15182 - deprecate all Main logging methods and introduce suitable replacements in Logging for most of them

Location:
trunk/src/org/openstreetmap/josm/gui/datatransfer
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/datatransfer/AbstractStackTransferHandler.java

    r11746 r12620  
    1515import org.openstreetmap.josm.gui.layer.OsmDataLayer;
    1616import org.openstreetmap.josm.tools.JosmRuntimeException;
     17import org.openstreetmap.josm.tools.Logging;
    1718import org.openstreetmap.josm.tools.bugreport.BugReport;
    1819
     
    5152            if (df.supports(support)) {
    5253                try {
    53                     if (Main.isDebugEnabled()) {
    54                         Main.debug("{0} pasting {1} at {2}", df.getClass().getSimpleName(), Arrays.toString(support.getDataFlavors()), center);
     54                    if (Logging.isDebugEnabled()) {
     55                        Logging.debug("{0} pasting {1} at {2}",
     56                                df.getClass().getSimpleName(), Arrays.toString(support.getDataFlavors()), center);
    5557                    }
    5658                    if (df.importData(support, layer, center)) {
     
    5860                    }
    5961                } catch (UnsupportedFlavorException | IOException e) {
    60                     Main.warn(e);
     62                    Logging.warn(e);
    6163                } catch (JosmRuntimeException | IllegalArgumentException | IllegalStateException e) {
    6264                    BugReport.intercept(e).put("paster", df).put("flavors", support::getDataFlavors).warn();
  • trunk/src/org/openstreetmap/josm/gui/datatransfer/ClipboardUtils.java

    r11921 r12620  
    1313import java.io.IOException;
    1414
    15 import org.openstreetmap.josm.Main;
    1615import org.openstreetmap.josm.gui.util.GuiHelper;
     16import org.openstreetmap.josm.tools.Logging;
    1717import org.openstreetmap.josm.tools.Utils;
    1818
     
    5050                clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
    5151            } catch (HeadlessException e) {
    52                 Main.warn("Headless. Using fake clipboard.", e);
     52                Logging.warn("Headless. Using fake clipboard.", e);
    5353                clipboard = new Clipboard("fake");
    5454            }
     
    8383            }
    8484        } catch (UnsupportedFlavorException | IOException ex) {
    85             Main.error(ex);
     85            Logging.error(ex);
    8686        }
    8787        return null;
     
    109109                // Clipboard currently unavailable.
    110110                // On some platforms, the system clipboard is unavailable while it is accessed by another application.
    111                 Main.trace("Clipboard unavailable.", e);
     111                Logging.trace("Clipboard unavailable.", e);
    112112                try {
    113113                    Thread.sleep(1);
    114114                } catch (InterruptedException ex) {
    115                     Main.warn(ex, "InterruptedException in " + Utils.class.getSimpleName()
    116                             + " while getting clipboard content");
     115                    Logging.log(Logging.LEVEL_WARN, "InterruptedException in " + Utils.class.getSimpleName()
     116                            + " while getting clipboard content", ex);
    117117                    Thread.currentThread().interrupt();
    118118                }
    119119            } catch (NullPointerException e) { // NOPMD
    120120                // JDK-6322854: On Linux/X11, NPE can happen for unknown reasons, on all versions of Java
    121                 Main.error(e);
     121                Logging.error(e);
    122122            }
    123123        }
     
    145145                return Boolean.TRUE;
    146146            } catch (IllegalStateException ex) {
    147                 Main.error(ex);
     147                Logging.error(ex);
    148148                return Boolean.FALSE;
    149149            }
  • trunk/src/org/openstreetmap/josm/gui/datatransfer/OsmTransferHandler.java

    r12125 r12620  
    2121import org.openstreetmap.josm.gui.datatransfer.importers.TextTagPaster;
    2222import org.openstreetmap.josm.gui.layer.OsmDataLayer;
     23import org.openstreetmap.josm.tools.Logging;
    2324
    2425/**
     
    4748                    }
    4849                } catch (UnsupportedFlavorException | IOException e) {
    49                     Main.warn(e);
     50                    Logging.warn(e);
    5051                }
    5152            }
     
    9697            }
    9798        } catch (IllegalStateException e) {
    98             Main.debug(e);
     99            Logging.debug(e);
    99100        } catch (NullPointerException e) { // NOPMD
    100101            // JDK-6322854: On Linux/X11, NPE can happen for unknown reasons, on all versions of Java
    101             Main.error(e);
     102            Logging.error(e);
    102103        }
    103104        return false;
  • trunk/src/org/openstreetmap/josm/gui/datatransfer/importers/TextTagPaster.java

    r12537 r12620  
    1111import javax.swing.TransferHandler.TransferSupport;
    1212
    13 import org.openstreetmap.josm.Main;
     13import org.openstreetmap.josm.tools.Logging;
    1414import org.openstreetmap.josm.tools.TextTagParser;
    1515
     
    3434            return super.supports(support) && containsValidTags(support);
    3535        } catch (UnsupportedFlavorException | IOException e) {
    36             Main.warn(e);
     36            Logging.warn(e);
    3737            return false;
    3838        }
Note: See TracChangeset for help on using the changeset viewer.