Ignore:
Timestamp:
2016-06-16T20:07:17+02:00 (8 years ago)
Author:
Don-vip
Message:

sonar - squid:S2386 - Mutable fields should not be "public static"

File:
1 edited

Legend:

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

    r10386 r10407  
    3434     * @since 4869
    3535     */
    36     public static final ArrayList<FileImporter> importers;
     36    private static final ArrayList<FileImporter> importers;
    3737
    3838    /**
     
    4040     * @since 4869
    4141     */
    42     public static final ArrayList<FileExporter> exporters;
     42    private static final ArrayList<FileExporter> exporters;
    4343
    4444    // add some file types only if the relevant classes are there.
     
    140140
    141141    /**
     142     * Adds a new file importer at the end of the global list. This importer will be evaluated after core ones.
     143     * @param importer new file importer
     144     * @since 10407
     145     */
     146    public static void addImporter(FileImporter importer) {
     147        if (importer != null) {
     148            importers.add(importer);
     149        }
     150    }
     151
     152    /**
     153     * Adds a new file importer at the beginning of the global list. This importer will be evaluated before core ones.
     154     * @param importer new file importer
     155     * @since 10407
     156     */
     157    public static void addImporterFirst(FileImporter importer) {
     158        if (importer != null) {
     159            importers.add(0, importer);
     160        }
     161    }
     162
     163    /**
     164     * Adds a new file exporter at the end of the global list. This exporter will be evaluated after core ones.
     165     * @param exporter new file exporter
     166     * @since 10407
     167     */
     168    public static void addExporter(FileExporter exporter) {
     169        if (exporter != null) {
     170            exporters.add(exporter);
     171        }
     172    }
     173
     174    /**
     175     * Adds a new file exporter at the beginning of the global list. This exporter will be evaluated before core ones.
     176     * @param exporter new file exporter
     177     * @since 10407
     178     */
     179    public static void addExporterFirst(FileExporter exporter) {
     180        if (exporter != null) {
     181            exporters.add(0, exporter);
     182        }
     183    }
     184
     185    /**
     186     * Returns the list of file importers.
     187     * @return unmodifiable list of file importers
     188     * @since 10407
     189     */
     190    public static List<FileImporter> getImporters() {
     191        return Collections.unmodifiableList(importers);
     192    }
     193
     194    /**
     195     * Returns the list of file exporters.
     196     * @return unmodifiable list of file exporters
     197     * @since 10407
     198     */
     199    public static List<FileExporter> getExporters() {
     200        return Collections.unmodifiableList(exporters);
     201    }
     202
     203    /**
    142204     * Updates the {@link AllFormatsImporter} that is contained in the importers list. If
    143205     * you do not use the importers variable directly, you don’t need to call this.
Note: See TracChangeset for help on using the changeset viewer.