Ignore:
Timestamp:
2018-05-26T09:08:02+02:00 (6 years ago)
Author:
wiktorn
Message:

Sonar fixes and javadoc

  • AddImageryLayerAction - do not use {{ }} initialization as it may be source of leaks
  • AbstractTileSourceLayer - do not expose partially initialized object, first set all the values, then set the class field
  • WMTSCapabilities - add javadocs
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/AddImageryLayerAction.java

    r13830 r13839  
    177177            formats.setToolTipText(tr("Select image format for WMS layer"));
    178178
    179             if (!GraphicsEnvironment.isHeadless() &&
    180                 1 != new ExtendedDialog(Main.parent, tr("Select WMS layers"), tr("Add layers"), tr("Cancel")) { {
    181                     final JScrollPane scrollPane = new JScrollPane(tree.getLayerTree());
    182                     scrollPane.setPreferredSize(new Dimension(400, 400));
    183                     final JPanel panel = new JPanel(new GridBagLayout());
    184                     panel.add(scrollPane, GBC.eol().fill());
    185                     panel.add(formats, GBC.eol().fill(GBC.HORIZONTAL));
    186                     setContent(panel);
    187             } }.showDialog().getValue()) {
    188                 return null;
     179            if (!GraphicsEnvironment.isHeadless()) {
     180                ExtendedDialog dialog = new ExtendedDialog(Main.parent, tr("Select WMS layers"), tr("Add layers"), tr("Cancel"));
     181                final JScrollPane scrollPane = new JScrollPane(tree.getLayerTree());
     182                scrollPane.setPreferredSize(new Dimension(400, 400));
     183                final JPanel panel = new JPanel(new GridBagLayout());
     184                panel.add(scrollPane, GBC.eol().fill());
     185                panel.add(formats, GBC.eol().fill(GBC.HORIZONTAL));
     186                dialog.setContent(panel);
     187
     188                if (dialog.showDialog().getValue() != 1) {
     189                    return null;
     190                }
    189191            }
    190192
Note: See TracChangeset for help on using the changeset viewer.