Changeset 19335 in osm for applications/editors


Ignore:
Timestamp:
2010-01-09T15:03:13+01:00 (15 years ago)
Author:
jttt
Message:

Added multipolygon tests, fixed some warnings

Location:
applications/editors/josm/plugins/validator
Files:
1 added
11 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/validator/.settings/org.eclipse.jdt.ui.prefs

    r10662 r19335  
    1 #Sun Sep 07 16:57:55 CEST 2008
     1#Fri Jan 08 08:06:27 CET 2010
    22eclipse.preferences.version=1
     3editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
    34formatter_profile=_JOSM
    45formatter_settings_version=11
     6sp_cleanup.add_default_serial_version_id=true
     7sp_cleanup.add_generated_serial_version_id=false
     8sp_cleanup.add_missing_annotations=true
     9sp_cleanup.add_missing_deprecated_annotations=true
     10sp_cleanup.add_missing_methods=false
     11sp_cleanup.add_missing_nls_tags=false
     12sp_cleanup.add_missing_override_annotations=false
     13sp_cleanup.add_serial_version_id=false
     14sp_cleanup.always_use_blocks=true
     15sp_cleanup.always_use_parentheses_in_expressions=false
     16sp_cleanup.always_use_this_for_non_static_field_access=false
     17sp_cleanup.always_use_this_for_non_static_method_access=false
     18sp_cleanup.convert_to_enhanced_for_loop=false
     19sp_cleanup.correct_indentation=false
     20sp_cleanup.format_source_code=false
     21sp_cleanup.format_source_code_changes_only=false
     22sp_cleanup.make_local_variable_final=false
     23sp_cleanup.make_parameters_final=false
     24sp_cleanup.make_private_fields_final=true
     25sp_cleanup.make_type_abstract_if_missing_method=false
     26sp_cleanup.make_variable_declarations_final=false
     27sp_cleanup.never_use_blocks=false
     28sp_cleanup.never_use_parentheses_in_expressions=true
     29sp_cleanup.on_save_use_additional_actions=true
     30sp_cleanup.organize_imports=true
     31sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
     32sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
     33sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
     34sp_cleanup.qualify_static_member_accesses_with_declaring_class=false
     35sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
     36sp_cleanup.remove_private_constructors=true
     37sp_cleanup.remove_trailing_whitespaces=true
     38sp_cleanup.remove_trailing_whitespaces_all=true
     39sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
     40sp_cleanup.remove_unnecessary_casts=true
     41sp_cleanup.remove_unnecessary_nls_tags=false
     42sp_cleanup.remove_unused_imports=false
     43sp_cleanup.remove_unused_local_variables=false
     44sp_cleanup.remove_unused_private_fields=true
     45sp_cleanup.remove_unused_private_members=false
     46sp_cleanup.remove_unused_private_methods=true
     47sp_cleanup.remove_unused_private_types=true
     48sp_cleanup.sort_members=false
     49sp_cleanup.sort_members_all=false
     50sp_cleanup.use_blocks=false
     51sp_cleanup.use_blocks_only_for_return_and_throw=false
     52sp_cleanup.use_parentheses_in_expressions=false
     53sp_cleanup.use_this_for_non_static_field_access=false
     54sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true
     55sp_cleanup.use_this_for_non_static_method_access=false
     56sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true
  • applications/editors/josm/plugins/validator/build.xml

    r19304 r19335  
    2727        -->
    2828        <property name="commit.message" value="Update to JOSM 2748" />
    29         <property name="plugin.main.version" value="2748" />
     29        <property name="plugin.main.version" value="2788" />
    3030
    3131
  • applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/GridLayer.java

    r18593 r19335  
    138138     * Visitor that highlights all cells the selected primitives go through
    139139     */
    140     class HighlightCellVisitor extends AbstractVisitor
     140    static class HighlightCellVisitor extends AbstractVisitor
    141141    {
    142142        /** The MapView */
  • applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/OSMValidatorPlugin.java

    r19224 r19335  
    3939import org.openstreetmap.josm.plugins.validator.tests.DuplicateWay;
    4040import org.openstreetmap.josm.plugins.validator.tests.DuplicatedWayNodes;
     41import org.openstreetmap.josm.plugins.validator.tests.MultipolygonTest;
    4142import org.openstreetmap.josm.plugins.validator.tests.NameMismatch;
    4243import org.openstreetmap.josm.plugins.validator.tests.NodesWithSameName;
     
    8081    /**
    8182     * All available tests
    82      * TODO: is there any way to find out automagically all available tests?
     83     * TODO: is there any way to find out automatically all available tests?
    8384     */
    8485    @SuppressWarnings("unchecked")
     
    99100            DuplicateWay.class, // ID 1401 .. 1499
    100101            NameMismatch.class, // ID  1501 ..  1599
     102            MultipolygonTest.class, // ID  1601 ..  1699
    101103    };
    102104
     
    134136                }
    135137            } catch (final FileNotFoundException e) {
     138                // Ignore
    136139            } catch (final IOException e) {
    137140                e.printStackTrace();
     
    157160
    158161    private ValidateUploadHook uploadHook;
    159    
     162
    160163    @Override
    161164    public void mapFrameInitialized(MapFrame oldFrame, MapFrame newFrame) {
     
    166169            if (Main.pref.hasKey(PreferenceEditor.PREF_DEBUG + ".grid"))
    167170                Main.main.addLayer(new GridLayer(tr("Grid")));
    168             MapView.addLayerChangeListener(this);           
     171            MapView.addLayerChangeListener(this);
    169172        } else
    170173                MapView.removeLayerChangeListener(this);
     
    273276            } catch (InvocationTargetException ite) {
    274277                ite.getCause().printStackTrace();
    275                 JOptionPane.showMessageDialog(Main.parent, 
     278                JOptionPane.showMessageDialog(Main.parent,
    276279                                tr("Error initializing test {0}:\n {1}", test.getClass()
    277280                        .getSimpleName(), ite.getCause().getMessage()),
     
    280283            } catch (Exception e) {
    281284                e.printStackTrace();
    282                 JOptionPane.showMessageDialog(Main.parent, 
     285                JOptionPane.showMessageDialog(Main.parent,
    283286                                tr("Error initializing test {0}:\n {1}", test.getClass()
    284287                        .getSimpleName(), e),
  • applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/Test.java

    r18928 r19335  
    33import static org.openstreetmap.josm.tools.I18n.tr;
    44
     5import java.awt.GridBagConstraints;
    56import java.util.ArrayList;
    67import java.util.Collection;
     
    3233{
    3334    /** Name of the test */
    34     protected String name;
     35    protected final String name;
    3536
    3637    /** Description of the test */
    37     protected String description;
     38    protected final String description;
    3839
    3940    /** Whether this test is enabled. Enabled by default */
     
    7778    public Test(String name)
    7879    {
    79         this.name = name;
     80        this(name, null);
    8081    }
    8182
     
    162163
    163164        GBC a = GBC.eol();
    164         a.anchor = GBC.EAST;
     165        a.anchor = GridBagConstraints.EAST;
    165166        checkBeforeUpload = new JCheckBox();
    166167        checkBeforeUpload.setSelected(testBeforeUpload);
  • applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/ValidatorDialog.java

    r19226 r19335  
    438438        if (!Main.pref.getBoolean(PreferenceEditor.PREF_FILTER_BY_SELECTION, false))
    439439            return;
    440         if (newSelection == null || newSelection.size() == 0)
     440        if (newSelection.isEmpty())
    441441            tree.setFilter(null);
    442442        HashSet<OsmPrimitive> filter = new HashSet<OsmPrimitive>(newSelection);
  • applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/tests/CrossingWays.java

    r18344 r19335  
    166166     * @author frsantos
    167167     */
    168     private class ExtendedSegment
     168    private static class ExtendedSegment
    169169    {
    170170        public Node n1, n2;
  • applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/tests/DuplicateWay.java

    r18092 r19335  
    2828{
    2929
    30     private class WayPair {
     30    private static class WayPair {
    3131        public List<LatLon> coor;
    3232        public Map<String, String> keys;
  • applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/tests/TagChecker.java

    r19229 r19335  
    886886        protected static int TAG_CHECK_INFO   = 1270;
    887887
    888         private class CheckerElement {
     888        private static class CheckerElement {
    889889            public Object tag;
    890890            public Object value;
  • applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/tests/UnconnectedWays.java

    r18848 r19335  
    226226//            return !w.containsNode(n)
    227227//            && line.ptSegDist(n.getEastNorth().east(), n.getEastNorth().north()) < dist;
    228             if (w == null)
     228            if (w == null) {
    229229                Main.debug("way null");
     230                return false;
     231            }
    230232            if (w.containsNode(n))
    231233                return false;
  • applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/util/Entities.java

    r13497 r19335  
    341341        if (firstAmp < 0)
    342342            return str;
    343         String res = new String(str.substring(0, firstAmp));
     343        String res = str.substring(0, firstAmp);
    344344        int len = str.length();
    345345        for (int i = firstAmp; i < len; i++) {
Note: See TracChangeset for help on using the changeset viewer.