Changeset 9849 in josm


Ignore:
Timestamp:
2016-02-22T00:54:12+01:00 (6 years ago)
Author:
Don-vip
Message:

add more unit tests

Location:
trunk
Files:
2 added
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/conflict/tags/PasteTagsConflictResolverDialog.java

    r9847 r9849  
    4444
    4545public class PasteTagsConflictResolverDialog extends JDialog  implements PropertyChangeListener {
    46     private static final Map<OsmPrimitiveType, String> PANE_TITLES;
     46    static final Map<OsmPrimitiveType, String> PANE_TITLES;
    4747    static {
    4848        PANE_TITLES = new EnumMap<>(OsmPrimitiveType.class);
     
    5252    }
    5353
    54     private enum Mode {
     54    enum Mode {
    5555        RESOLVING_ONE_TAGCOLLECTION_ONLY,
    5656        RESOLVING_TYPED_TAGCOLLECTIONS
     
    356356    }
    357357
    358     private static final class StatisticsInfo {
     358    static final class StatisticsInfo {
    359359        public int numTags;
    360360        public final Map<OsmPrimitiveType, Integer> sourceInfo;
    361361        public final Map<OsmPrimitiveType, Integer> targetInfo;
    362362
    363         private StatisticsInfo() {
     363        StatisticsInfo() {
    364364            sourceInfo = new EnumMap<>(OsmPrimitiveType.class);
    365365            targetInfo = new EnumMap<>(OsmPrimitiveType.class);
     
    367367    }
    368368
    369     private static final class StatisticsTableModel extends DefaultTableModel {
     369    static final class StatisticsTableModel extends DefaultTableModel {
    370370        private static final String[] HEADERS = new String[] {tr("Paste ..."), tr("From ..."), tr("To ...") };
    371         private final transient List<StatisticsInfo> data;
    372 
    373         private StatisticsTableModel() {
    374             data = new ArrayList<>();
    375         }
     371        private final transient List<StatisticsInfo> data = new ArrayList<>();
    376372
    377373        @Override
     
    392388        @Override
    393389        public int getRowCount() {
    394             if (data == null) return 1;
    395             return data.size() + 1;
     390            return data == null ? 1 : data.size() + 1;
    396391        }
    397392
     
    406401    }
    407402
    408     private static class StatisticsInfoRenderer extends JLabel implements TableCellRenderer {
     403    static final class StatisticsInfoRenderer extends JLabel implements TableCellRenderer {
    409404        protected void reset() {
    410405            setIcon(null);
     
    478473    }
    479474
    480     private static final class StatisticsInfoTable extends JPanel {
    481 
    482         private StatisticsInfoTable(StatisticsTableModel model) {
     475    static final class StatisticsInfoTable extends JPanel {
     476
     477        StatisticsInfoTable(StatisticsTableModel model) {
    483478            JTable infoTable = new JTable(model,
    484479                    new TagTableColumnModelBuilder(new StatisticsInfoRenderer(), tr("Paste ..."), tr("From ..."), tr("To ...")).build());
Note: See TracChangeset for help on using the changeset viewer.