Changeset 9575 in josm for trunk/src/org


Ignore:
Timestamp:
2016-01-23T04:06:51+01:00 (9 years ago)
Author:
Don-vip
Message:

add unit tests

Location:
trunk/src/org/openstreetmap/josm/gui
Files:
3 edited

Legend:

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

    r9059 r9575  
    1717import org.openstreetmap.josm.data.osm.Changeset;
    1818import org.openstreetmap.josm.gui.widgets.JMultilineLabel;
     19import org.openstreetmap.josm.io.Capabilities;
    1920import org.openstreetmap.josm.io.OsmApi;
    2021import org.openstreetmap.josm.tools.ImageProvider;
     
    6768        //
    6869        boolean useOneChangeset = true;
    69         int maxChunkSize = OsmApi.getOsmApi().getCapabilities().getMaxChangesetSize();
     70        Capabilities capabilities = OsmApi.getOsmApi().getCapabilities();
     71        int maxChunkSize = capabilities != null ? capabilities.getMaxChangesetSize() : -1;
    7072        if (maxChunkSize > 0 && numObjects > maxChunkSize) {
    7173            useOneChangeset = false;
  • trunk/src/org/openstreetmap/josm/gui/io/UploadStrategySelectionPanel.java

    r9543 r9575  
    3434import org.openstreetmap.josm.gui.widgets.JMultilineLabel;
    3535import org.openstreetmap.josm.gui.widgets.JosmTextField;
     36import org.openstreetmap.josm.io.Capabilities;
    3637import org.openstreetmap.josm.io.OsmApi;
    3738
     
    226227        add(new JPanel(), gc);
    227228
    228         int maxChunkSize = OsmApi.getOsmApi().getCapabilities().getMaxChangesetSize();
     229        Capabilities capabilities = OsmApi.getOsmApi().getCapabilities();
     230        int maxChunkSize = capabilities != null ? capabilities.getMaxChangesetSize() : -1;
    229231        pnlMultiChangesetPolicyPanel.setVisible(
    230232                maxChunkSize > 0 && numUploadedObjects > maxChunkSize
  • trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletingComboBox.java

    r9484 r9575  
    33
    44import java.awt.Component;
     5import java.awt.GraphicsEnvironment;
    56import java.awt.Toolkit;
    67import java.awt.datatransfer.Clipboard;
     
    132133            final JTextComponent editorComponent = comboBox.getEditorComponent();
    133134            // save unix system selection (middle mouse paste)
    134             Clipboard sysSel = Toolkit.getDefaultToolkit().getSystemSelection();
     135            Clipboard sysSel = GraphicsEnvironment.isHeadless() ? null : Toolkit.getDefaultToolkit().getSystemSelection();
    135136            if (sysSel != null) {
    136137                Transferable old = Utils.getTransferableContent(sysSel);
Note: See TracChangeset for help on using the changeset viewer.