Changeset 10759 in josm for trunk


Ignore:
Timestamp:
2016-08-07T17:47:01+02:00 (4 years ago)
Author:
Don-vip
Message:

sonar - squid:S2440 - Classes with only "static" methods should not be instantiated

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

Legend:

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

    r10742 r10759  
    211211
    212212    /**
    213      * The data validation handler.
    214      */
    215     public OsmValidator validator;
    216 
    217     /**
    218213     * The file watcher service.
    219214     */
     
    641636            @Override
    642637            public void initialize() {
    643                 validator = new OsmValidator();
     638                OsmValidator.initialize();
    644639            }
    645640        });
  • trunk/src/org/openstreetmap/josm/data/validation/OsmValidator.java

    r10507 r10759  
    7070 * @author Francisco R. Santos <frsantos@gmail.com>
    7171 */
    72 public class OsmValidator {
     72public final class OsmValidator {
     73
     74    private OsmValidator() {
     75        // Hide default constructor for utilities classes
     76    }
    7377
    7478    public static volatile ValidatorLayer errorLayer;
    7579
    7680    /** The validate action */
    77     public ValidateAction validateAction = new ValidateAction();
     81    public static final ValidateAction validateAction = new ValidateAction();
    7882
    7983    /** Grid detail, multiplier of east,north values for valuable cell sizing */
     
    150154
    151155    /**
    152      * Constructs a new {@code OsmValidator}.
    153      */
    154     public OsmValidator() {
     156     * Initializes {@code OsmValidator}.
     157     */
     158    public static void initialize() {
    155159        checkValidatorDir();
    156160        initializeGridDetail();
  • trunk/src/org/openstreetmap/josm/gui/dialogs/ValidatorDialog.java

    r10611 r10759  
    135135        buttons.add(lookupButton);
    136136
    137         buttons.add(new SideButton(Main.main.validator.validateAction));
     137        buttons.add(new SideButton(OsmValidator.validateAction));
    138138
    139139        fixButton = new SideButton(new AbstractAction() {
Note: See TracChangeset for help on using the changeset viewer.