Ignore:
Timestamp:
2013-10-04T01:20:31+02:00 (11 years ago)
Author:
Don-vip
Message:

Sonar/Findbugs - fix various problems, javadoc

Location:
trunk/src/org/openstreetmap/josm/gui/preferences/projection
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/preferences/projection/CodeProjectionChoice.java

    r6246 r6295  
    213213
    214214    @Override
    215     public Collection<String> getPreferences(JPanel pnl) {
    216         CodeSelectionPanel csPanel = (CodeSelectionPanel) pnl;
     215    public Collection<String> getPreferences(JPanel panel) {
     216        if (!(panel instanceof CodeSelectionPanel)) {
     217            throw new IllegalArgumentException();
     218        }
     219        CodeSelectionPanel csPanel = (CodeSelectionPanel) panel;
    217220        return Collections.singleton(csPanel.getCode());
    218221    }
  • trunk/src/org/openstreetmap/josm/gui/preferences/projection/CustomProjectionChoice.java

    r6070 r6295  
    4242    private String pref;
    4343
     44    /**
     45     * Constructs a new {@code CustomProjectionChoice}.
     46     */
    4447    public CustomProjectionChoice() {
    4548        super(tr("Custom Projection"), "core:custom");
     
    156159    public static class ParameterInfoDialog extends ExtendedDialog {
    157160
     161        /**
     162         * Constructs a new {@code ParameterInfoDialog}.
     163         */
    158164        public ParameterInfoDialog() {
    159165            super(null, tr("Parameter information"), new String[] { tr("Close") }, false);
     
    225231    @Override
    226232    public Collection<String> getPreferences(JPanel panel) {
     233        if (!(panel instanceof PreferencePanel)) {
     234            throw new IllegalArgumentException();
     235        }
    227236        PreferencePanel prefPanel = (PreferencePanel) panel;
    228237        String pref = prefPanel.input.getText();
  • trunk/src/org/openstreetmap/josm/gui/preferences/projection/GaussKruegerProjectionChoice.java

    r6070 r6295  
    1111    private static String[] zones = { "2", "3", "4", "5" };
    1212
     13    /**
     14     * Constructs a new {@code GaussKruegerProjectionChoice}.
     15     */
    1316    public GaussKruegerProjectionChoice() {
    1417        super(tr("Gau\u00DF-Kr\u00FCger"), "core:gauss-krueger", zones, tr("GK Zone"));
  • trunk/src/org/openstreetmap/josm/gui/preferences/projection/LambertCC9ZonesProjectionChoice.java

    r6070 r6295  
    2828    };
    2929
     30    /**
     31     * Constructs a new {@code LambertCC9ZonesProjectionChoice}.
     32     */
    3033    public LambertCC9ZonesProjectionChoice() {
    3134        super(tr("Lambert CC9 Zone (France)"), "core:lambertcc9", lambert9zones, tr("Lambert CC Zone"));
  • trunk/src/org/openstreetmap/josm/gui/preferences/projection/ListProjectionChoice.java

    r6222 r6295  
    105105    @Override
    106106    public Collection<String> getPreferences(JPanel panel) {
     107        if (!(panel instanceof CBPanel)) {
     108            throw new IllegalArgumentException();
     109        }
    107110        CBPanel p = (CBPanel) panel;
    108111        int index = p.prefcb.getSelectedIndex();
  • trunk/src/org/openstreetmap/josm/gui/preferences/projection/SwissGridProjectionChoice.java

    r5548 r6295  
    1515public class SwissGridProjectionChoice extends SingleProjectionChoice {
    1616
     17    /**
     18     * Constructs a new {@code SwissGridProjectionChoice}.
     19     */
    1720    public SwissGridProjectionChoice() {
    1821        super(tr("Swiss Grid (Switzerland)"), "core:swissgrid", "EPSG:21781");
  • trunk/src/org/openstreetmap/josm/gui/preferences/projection/UTMProjectionChoice.java

    r6083 r6295  
    3333    }
    3434
     35    /**
     36     * Constructs a new {@code UTMProjectionChoice}.
     37     */
    3538    public UTMProjectionChoice() {
    3639        super(tr("UTM"), "core:utm", cbEntries.toArray(), tr("UTM Zone"));
     
    9699    @Override
    97100    public Collection<String> getPreferences(JPanel panel) {
     101        if (!(panel instanceof UTMPanel)) {
     102            throw new IllegalArgumentException();
     103        }
    98104        UTMPanel p = (UTMPanel) panel;
    99105        int index = p.prefcb.getSelectedIndex();
     
    133139        Hemisphere hemisphere = DEFAULT_HEMISPHERE;
    134140
    135         if(args != null) {
     141        if (args != null) {
    136142            String[] array = args.toArray(new String[args.size()]);
    137143
     
    155161        return defaultIndex;
    156162    }
    157 
    158163}
Note: See TracChangeset for help on using the changeset viewer.