Changeset 10000 in josm for trunk/src/org


Ignore:
Timestamp:
2016-03-16T01:17:59+01:00 (8 years ago)
Author:
Don-vip
Message:

sonar - fix various issues

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

Legend:

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

    r9675 r10000  
    7171     * @param toolbarId identifier for the toolbar preferences. The iconName is used, if this parameter is null
    7272     * @param installAdapters false, if you don't want to install layer changed and selection changed adapters
    73      * TODO: do not pass Icon, pass ImageProvider instead
    7473     */
    7574    public JosmAction(String name, ImageProvider icon, String tooltip, Shortcut shortcut, boolean registerInToolbar,
  • trunk/src/org/openstreetmap/josm/data/imagery/ImageryLayerInfo.java

    r9991 r10000  
    274274    }
    275275
    276     private boolean isSimilar(ImageryInfo iiA, ImageryInfo iiB) {
     276    private static boolean isSimilar(ImageryInfo iiA, ImageryInfo iiB) {
    277277        if (iiA == null)
    278278            return false;
  • trunk/src/org/openstreetmap/josm/data/imagery/WMTSTileSource.java

    r9902 r10000  
    293293        XMLInputFactory factory = XMLInputFactory.newFactory();
    294294        // do not try to load external entities, nor validate the XML
    295         factory.setProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES, false);
    296         factory.setProperty(XMLInputFactory.IS_VALIDATING, false);
    297         factory.setProperty(XMLInputFactory.SUPPORT_DTD, false);
     295        factory.setProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES, Boolean.FALSE);
     296        factory.setProperty(XMLInputFactory.IS_VALIDATING, Boolean.FALSE);
     297        factory.setProperty(XMLInputFactory.SUPPORT_DTD, Boolean.FALSE);
    298298
    299299        try (CachedFile cf = new CachedFile(baseUrl); InputStream in = cf.setHttpHeaders(headers).
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRenderer.java

    r9978 r10000  
    391391    }
    392392
    393     private Polygon buildPolygon(Point center, int radius, int sides) {
     393    private static Polygon buildPolygon(Point center, int radius, int sides) {
    394394        return buildPolygon(center, radius, sides, 0.0);
    395395    }
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/relations/MultipolygonCache.java

    r8870 r10000  
    189189    }
    190190
    191     private void processEvent(AbstractDatasetChangedEvent event, Relation r, Collection<Map<Relation, Multipolygon>> maps) {
     191    private static void processEvent(AbstractDatasetChangedEvent event, Relation r, Collection<Map<Relation, Multipolygon>> maps) {
    192192        if (event instanceof NodeMovedEvent || event instanceof WayNodesChangedEvent) {
    193193            dispatchEvent(event, r, maps);
  • trunk/src/org/openstreetmap/josm/data/projection/CustomProjection.java

    r9790 r10000  
    571571        }
    572572        if (parameters.containsKey(Param.no_off.key) || parameters.containsKey(Param.no_uoff.key)) {
    573             projParams.no_off = true;
     573            projParams.no_off = Boolean.TRUE;
    574574        }
    575575        proj.initialize(projParams);
     
    713713    /**
    714714     * Factor to convert units of east/north coordinates to meters.
    715      * 
     715     *
    716716     * When east/north coordinates are in degrees (geographic CRS), the scale
    717717     * at the equator is taken, i.e. 360 degrees corresponds to the length of
    718718     * the equator in meters.
    719      * 
     719     *
    720720     * @return factor to convert units to meter
    721721     */
     
    780780    }
    781781
    782     private EastNorth getPointAlong(int i, int N, ProjectionBounds r) {
     782    private static EastNorth getPointAlong(int i, int N, ProjectionBounds r) {
    783783        double dEast = (r.maxEast - r.minEast) / N;
    784784        double dNorth = (r.maxNorth - r.minNorth) / N;
  • trunk/src/org/openstreetmap/josm/data/projection/proj/ObliqueMercator.java

    r9998 r10000  
    368368    }
    369369
    370     private double normalizeLonRad(double a) {
     370    private static double normalizeLonRad(double a) {
    371371        return Math.toRadians(LatLon.normalizeLon(Math.toDegrees(a)));
    372372    }
  • trunk/src/org/openstreetmap/josm/data/validation/tests/MultipolygonTest.java

    r9900 r10000  
    114114    }
    115115
    116     private List<GeneralPath> createPolygons(List<Multipolygon.PolyData> joinedWays) {
     116    private static List<GeneralPath> createPolygons(List<Multipolygon.PolyData> joinedWays) {
    117117        List<GeneralPath> result = new ArrayList<>();
    118118        for (Multipolygon.PolyData way : joinedWays) {
  • trunk/src/org/openstreetmap/josm/gui/DefaultNameFormatter.java

    r9706 r10000  
    455455    }
    456456
    457     private String getRelationName(IRelation relation) {
    458         String nameTag = null;
     457    private static String getRelationName(IRelation relation) {
     458        String nameTag;
    459459        for (String n : getNamingtagsForRelations()) {
    460460            nameTag = getNameTagValue(relation, n);
  • trunk/src/org/openstreetmap/josm/gui/MapMover.java

    r9824 r10000  
    2222
    2323import org.openstreetmap.gui.jmapviewer.JMapViewer;
    24 
    2524import org.openstreetmap.josm.Main;
    2625import org.openstreetmap.josm.actions.mapmode.SelectAction;
     26import org.openstreetmap.josm.data.Preferences.PreferenceChangeEvent;
     27import org.openstreetmap.josm.data.Preferences.PreferenceChangedListener;
    2728import org.openstreetmap.josm.data.coor.EastNorth;
    2829import org.openstreetmap.josm.data.preferences.BooleanProperty;
    29 import org.openstreetmap.josm.data.Preferences.PreferenceChangeEvent;
    30 import org.openstreetmap.josm.data.Preferences.PreferenceChangedListener;
    3130import org.openstreetmap.josm.tools.Destroyable;
    3231import org.openstreetmap.josm.tools.Shortcut;
     
    5857        }
    5958
    60         private void updateJMapViewer() {
     59        private static void updateJMapViewer() {
    6160            JMapViewer.zoomReverseWheel = MapMover.PROP_ZOOM_REVERSE_WHEEL.get();
    6261        }
  • trunk/src/org/openstreetmap/josm/gui/conflict/pair/ListMerger.java

    r9990 r10000  
    4949 * @since 1631
    5050 */
    51 public abstract class ListMerger<T extends PrimitiveId> extends JPanel implements PropertyChangeListener, Observer {
     51public abstract class ListMerger<T extends PrimitiveId> extends JPanel implements PropertyChangeListener, Observer, IConflictResolver {
    5252    protected OsmPrimitivesTable myEntriesTable;
    5353    protected OsmPrimitivesTable mergedEntriesTable;
  • trunk/src/org/openstreetmap/josm/gui/conflict/pair/nodes/NodeListMerger.java

    r8510 r10000  
    88import org.openstreetmap.josm.data.osm.OsmPrimitive;
    99import org.openstreetmap.josm.data.osm.Way;
    10 import org.openstreetmap.josm.gui.conflict.pair.IConflictResolver;
    1110import org.openstreetmap.josm.gui.conflict.pair.ListMerger;
    1211
     
    1514 * @since 1622
    1615 */
    17 public class NodeListMerger extends ListMerger<Node> implements IConflictResolver {
     16public class NodeListMerger extends ListMerger<Node> {
    1817
    1918    /**
  • trunk/src/org/openstreetmap/josm/gui/conflict/pair/relation/RelationMemberMerger.java

    r8510 r10000  
    88import org.openstreetmap.josm.data.osm.Relation;
    99import org.openstreetmap.josm.data.osm.RelationMember;
    10 import org.openstreetmap.josm.gui.conflict.pair.IConflictResolver;
    1110import org.openstreetmap.josm.gui.conflict.pair.ListMerger;
    1211
     
    1514 * @since 1631
    1615 */
    17 public class RelationMemberMerger extends ListMerger<RelationMember> implements IConflictResolver {
     16public class RelationMemberMerger extends ListMerger<RelationMember> {
    1817
    1918    /**
  • trunk/src/org/openstreetmap/josm/gui/dialogs/properties/TagEditHelper.java

    r9981 r10000  
    315315    }
    316316
    317     private void warnAboutParseError(SearchCompiler.ParseError parseError) {
     317    private static void warnAboutParseError(SearchCompiler.ParseError parseError) {
    318318        Main.warn(parseError);
    319319        JOptionPane.showMessageDialog(
  • trunk/src/org/openstreetmap/josm/gui/layer/AlignImageryPanel.java

    r9576 r10000  
    6161                    Main.map.removeTopPanel(AlignImageryPanel.class);
    6262                    if (doNotShowAgain.isSelected()) {
    63                         showAgain.put(false);
     63                        showAgain.put(Boolean.FALSE);
    6464                    }
    6565                }
  • trunk/src/org/openstreetmap/josm/gui/mappaint/StyleCache.java

    r9975 r10000  
    5353    }
    5454
    55     private int getIndex(boolean selected) {
     55    private static int getIndex(boolean selected) {
    5656        return selected ? SELECTED : PLAIN;
    5757    }
  • trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSStyleSource.java

    r9854 r10000  
    294294         * @return An arbitrary key this rule depends on or <code>null</code> if there is no such key.
    295295         */
    296         private String findAnyRequiredKey(List<Condition> conds) {
     296        private static String findAnyRequiredKey(List<Condition> conds) {
    297297            String key = null;
    298298            for (Condition c : conds) {
  • trunk/src/org/openstreetmap/josm/gui/preferences/imagery/ImageryPreference.java

    r9778 r10000  
    9797    }
    9898
    99     private void addSettingsSection(final JPanel p, String name, JPanel section) {
     99    private static void addSettingsSection(final JPanel p, String name, JPanel section) {
    100100        addSettingsSection(p, name, section, GBC.eol());
    101101    }
  • trunk/src/org/openstreetmap/josm/io/CertificateAmendment.java

    r9997 r10000  
    106106            }
    107107            if (certificateIsMissing(keyStore, cert)) {
    108                 Main.debug(tr("Adding certificate for TLS connections: {0}", cert.getSubjectX500Principal().getName()));
     108                if (Main.isDebugEnabled()) {
     109                    Main.debug(tr("Adding certificate for TLS connections: {0}", cert.getSubjectX500Principal().getName()));
     110                }
    109111                String alias = "josm:" + new File(CERT_AMEND[i]).getName();
    110112                try {
  • trunk/src/org/openstreetmap/josm/io/OsmApi.java

    r9353 r10000  
    859859     * @throws OsmTransferException if the API response cannot be parsed
    860860     */
    861     private Note parseSingleNote(String xml) throws OsmTransferException {
     861    private static Note parseSingleNote(String xml) throws OsmTransferException {
    862862        try {
    863863            List<Note> newNotes = new NoteReader(xml).parse();
     
    865865                return newNotes.get(0);
    866866            }
    867             //Shouldn't ever execute. Server will either respond with an error (caught elsewhere) or one note
     867            // Shouldn't ever execute. Server will either respond with an error (caught elsewhere) or one note
    868868            throw new OsmTransferException(tr("Note upload failed"));
    869869        } catch (SAXException | IOException e) {
  • trunk/src/org/openstreetmap/josm/io/remotecontrol/RequestProcessor.java

    r9231 r10000  
    266266     *             If the error can not be written
    267267     */
    268     private void sendError(Writer out) throws IOException {
     268    private static void sendError(Writer out) throws IOException {
    269269        sendHeader(out, "500 Internal Server Error", "text/html", true);
    270270        out.write("<HTML>\r\n");
     
    285285     *             If the error can not be written
    286286     */
    287     private void sendNotImplemented(Writer out) throws IOException {
     287    private static void sendNotImplemented(Writer out) throws IOException {
    288288        sendHeader(out, "501 Not Implemented", "text/html", true);
    289289        out.write("<HTML>\r\n");
     
    306306     *             If the error can not be written
    307307     */
    308     private void sendForbidden(Writer out, String help) throws IOException {
     308    private static void sendForbidden(Writer out, String help) throws IOException {
    309309        sendHeader(out, "403 Forbidden", "text/html", true);
    310310        out.write("<HTML>\r\n");
     
    330330     *             If the error can not be written
    331331     */
    332     private void sendBadRequest(Writer out, String help) throws IOException {
     332    private static void sendBadRequest(Writer out, String help) throws IOException {
    333333        sendHeader(out, "400 Bad Request", "text/html", true);
    334334        out.write("<HTML>\r\n");
Note: See TracChangeset for help on using the changeset viewer.