Changeset 10121 in josm


Ignore:
Timestamp:
2016-04-08T19:52:27+02:00 (8 years ago)
Author:
Don-vip
Message:

add more debug messages + assertions to debug failing unit test

Location:
trunk
Files:
4 edited

Legend:

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

    r10117 r10121  
    225225        public void beginTask(String title) {
    226226            if (title != null) {
     227                if (Main.isDebugEnabled()) {
     228                    Main.debug(title);
     229                }
    227230                final MeasurableTask task = new MeasurableTask(title);
    228231                tasks.add(task);
     
    283286            if (task instanceof MeasurableTask) {
    284287                ((MeasurableTask) task).finish();
    285                 Main.debug(tr("{0} completed in {1}", title, ((MeasurableTask) task).duration));
     288                if (Main.isDebugEnabled()) {
     289                    Main.debug(tr("{0} completed in {1}", title, ((MeasurableTask) task).duration));
     290                }
    286291                listener.stateChanged(null);
    287292            }
  • trunk/src/org/openstreetmap/josm/gui/progress/NullProgressMonitor.java

    r6362 r10121  
    66import org.openstreetmap.josm.Main;
    77
     8/**
     9 * A singleton progress monitor that does nothing.
     10 * @since 1811
     11 */
    812public final class NullProgressMonitor implements ProgressMonitor {
    913
     14    /** The unique instance */
    1015    public static final ProgressMonitor INSTANCE = new NullProgressMonitor();
    1116
     
    2025    @Override
    2126    public void beginTask(String title) {
     27        if (Main.isDebugEnabled()) {
     28            Main.debug(title);
     29        }
    2230    }
    2331
    2432    @Override
    2533    public void beginTask(String title, int ticks) {
     34        if (Main.isDebugEnabled()) {
     35            Main.debug(title);
     36        }
    2637    }
    2738
     
    5061    @Override
    5162    public void indeterminateSubTask(String title) {
     63        if (Main.isDebugEnabled()) {
     64            Main.debug(title);
     65        }
    5266    }
    5367
     
    93107    @Override
    94108    public void subTask(String title) {
     109        if (Main.isDebugEnabled()) {
     110            Main.debug(title);
     111        }
    95112    }
    96113
  • trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java

    r10093 r10121  
    881881        try {
    882882            monitor.beginTask(tr("Determine plugins to load..."));
    883             Set<String> plugins = new HashSet<>();
    884             plugins.addAll(Main.pref.getCollection("plugins", new LinkedList<String>()));
    885             if (System.getProperty("josm.plugins") != null) {
    886                 plugins.addAll(Arrays.asList(System.getProperty("josm.plugins").split(",")));
     883            Set<String> plugins = new HashSet<>(Main.pref.getCollection("plugins", new LinkedList<String>()));
     884            if (Main.isDebugEnabled()) {
     885                Main.debug("Plugins list initialized to " + plugins);
     886            }
     887            String systemProp = System.getProperty("josm.plugins");
     888            if (systemProp != null) {
     889                plugins.addAll(Arrays.asList(systemProp.split(",")));
     890                if (Main.isDebugEnabled()) {
     891                    Main.debug("josm.plugins system property set to '" + systemProp+"'. Plugins list is now " + plugins);
     892                }
    887893            }
    888894            monitor.subTask(tr("Removing deprecated plugins..."));
     
    890896            monitor.subTask(tr("Removing unmaintained plugins..."));
    891897            filterUnmaintainedPlugins(parent, plugins);
     898            if (Main.isDebugEnabled()) {
     899                Main.debug("Plugins list is finally set to " + plugins);
     900            }
    892901            Map<String, PluginInformation> infos = loadLocallyAvailablePluginInformation(monitor.createSubTaskMonitor(1, false));
    893902            List<PluginInformation> ret = new LinkedList<>();
  • trunk/test/unit/org/openstreetmap/josm/gui/MainApplicationTest.java

    r10093 r10121  
    3939        try {
    4040            System.setProperty("josm.plugins", "buildings_tools,plastic_laf");
     41            assertEquals("buildings_tools,plastic_laf", System.getProperty("josm.plugins"));
    4142            SplashProgressMonitor monitor = new SplashProgressMonitor("foo", new ChangeListener() {
    4243                @Override
     
    4647            });
    4748            Collection<PluginInformation> plugins = MainApplication.updateAndLoadEarlyPlugins(null, monitor);
     49            assertEquals("buildings_tools,plastic_laf", System.getProperty("josm.plugins"));
    4850            assertEquals(2, plugins.size());
    4951            assertNotNull(PluginHandler.getPlugin("plastic_laf"));
Note: See TracChangeset for help on using the changeset viewer.