Changeset 11851 in josm for trunk/src/org/openstreetmap


Ignore:
Timestamp:
2017-04-08T00:54:24+02:00 (8 years ago)
Author:
Don-vip
Message:

sonar - squid:S1444 - "public static" fields should be constant

File:
1 edited

Legend:

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

    r8510 r11851  
    33
    44import java.io.PrintWriter;
     5import java.util.Objects;
    56
    67/**
     
    1718public class OsmWriterFactory {
    1819
    19     public static volatile OsmWriterFactory theFactory;
     20    private static volatile OsmWriterFactory theFactory;
     21
     22    /**
     23     * Creates new {@code OsmWriter}.
     24     * @param out print writer
     25     * @param osmConform if {@code true}, prevents modification attributes to be written to the common part
     26     * @param version OSM API version (0.6)
     27     * @return new {@code OsmWriter}
     28     */
    2029    public static OsmWriter createOsmWriter(PrintWriter out, boolean osmConform, String version) {
    2130        // pre-set factory with this default implementation; can still be overwritten
     
    2837    }
    2938
     39    /**
     40     * Sets the default factory.
     41     * @param factory new default factory
     42     * @since 11851
     43     */
     44    public static void setDefaultFactory(OsmWriterFactory factory) {
     45        theFactory = Objects.requireNonNull(factory);
     46    }
     47
     48    /**
     49     * Creates new {@code OsmWriter}.
     50     * @param out print writer
     51     * @param osmConform if {@code true}, prevents modification attributes to be written to the common part
     52     * @param version OSM API version (0.6)
     53     * @return new {@code OsmWriter}
     54     */
    3055    protected OsmWriter createOsmWriterImpl(PrintWriter out, boolean osmConform, String version) {
    3156        return new OsmWriter(out, osmConform, version);
Note: See TracChangeset for help on using the changeset viewer.