Changeset 30532 in osm for applications/editors/josm


Ignore:
Timestamp:
2014-07-14T04:18:06+02:00 (10 years ago)
Author:
donvip
Message:

[josm_plugins] fix compilation warnings

Location:
applications/editors/josm/plugins
Files:
7 added
137 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/DirectDownload/src/org/openstreetmap/josm/plugins/directdownload/DownloadDataGui.java

    r29776 r30532  
    128128            return handler.getResult();
    129129        } catch (java.net.MalformedURLException e) {
     130            Main.error(e);
    130131            JOptionPane.showMessageDialog(null, tr("Invalid URL {0}", urlString));
    131132        } catch (java.io.IOException e) {
     133            Main.error(e);
    132134            JOptionPane.showMessageDialog(null, tr("Error fetching URL {0}", urlString));
    133135        } catch (SAXException e) {
     136            Main.error(e);
    134137            JOptionPane.showMessageDialog(null, tr("Error parsing data from URL {0}", urlString));
    135         } catch(ParserConfigurationException pce) {
     138        } catch (ParserConfigurationException e) {
     139            Main.error(e);
    136140            JOptionPane.showMessageDialog(null, tr("Error parsing data from URL {0}", urlString));
    137141        }
  • applications/editors/josm/plugins/DirectUpload/src/org/openstreetmap/josm/plugins/DirectUpload/UploadDataGui.java

    r30260 r30532  
    9595    private HistoryComboBox descriptionField;
    9696    private HistoryComboBox tagsField;
    97     private JComboBox visibilityCombo;
     97    private JComboBox<String> visibilityCombo;
    9898
    9999    // Constants used when generating upload request
     
    130130        visibilityLabel.setToolTipText(tr("Defines the visibility of your trace for other OSM users."));
    131131       
    132         visibilityCombo = new JComboBox();
     132        visibilityCombo = new JComboBox<>();
    133133        visibilityCombo.setEditable(false);
    134134        for(visibility v : visibility.values()) {
  • applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/gui/ElevationProfileDialog.java

    r30381 r30532  
    6363    private final JLabel totalTimeLabel;
    6464    private final JLabel distLabel;
    65     private final JComboBox trackCombo;
     65    private final JComboBox<IElevationProfile> trackCombo;
    6666    private final JButton zoomButton;
    6767
     
    170170        zoomButton.setEnabled(false);
    171171
    172         trackCombo = new JComboBox(new TrackModel());
     172        trackCombo = new JComboBox<>(new TrackModel());
    173173        trackCombo.setPreferredSize(new Dimension(200, 24)); // HACK!
    174174        trackCombo.setEnabled(false); // we have no model on startup
     
    254254     * that the model has changed.
    255255     */
    256     @SuppressWarnings("unchecked") // TODO: Can be removed in Java 1.7
    257256    private void updateView() {
    258257        if (model == null) {
     
    410409    }
    411410
    412     @SuppressWarnings("rawtypes") // TODO: Can be removed in Java 1.7
    413     class TrackModel implements ComboBoxModel {
     411    class TrackModel implements ComboBoxModel<IElevationProfile> {
    414412        private Collection<ListDataListener> listeners;
    415413
     
    445443
    446444        @Override
    447         public Object getSelectedItem() {
     445        public IElevationProfile getSelectedItem() {
    448446            if (model == null) return null;
    449447
     
    460458            }
    461459        }
    462 
    463460    }
    464461}
  • applications/editors/josm/plugins/FastDraw/src/org/openstreetmap/josm/plugins/fastdraw/FastDrawConfigDialog.java

    r29453 r30532  
    4444//            tr("Autosimplify and save"),tr("Simplify and wait"),tr("Simplify and save"),
    4545//            tr("Save as is")});
    46         JComboBox combo1=new JComboBox(new String[]{tr("Autosimplify"),
     46        JComboBox<String> combo1=new JComboBox<>(new String[]{tr("Autosimplify"),
    4747            tr("Simplify with initial epsilon"),tr("Save as is")});
    4848        JCheckBox snapCb=new JCheckBox(tr("Snap to nodes"));
  • applications/editors/josm/plugins/HouseNumberTaggingTool/src/org/openstreetmap/josm/plugins/housenumbertool/TagDialog.java

    r30172 r30532  
    8989   private JCheckBox housenumberEnabled;
    9090   private JSlider housenumberChangeSequence;
    91    private JComboBox building;
     91   private JComboBox<String> building;
    9292   private JRadioButton streetRadio;
    9393   private JRadioButton placeRadio;
     
    139139
    140140      Arrays.sort(buildingStrings);
    141       building = new JComboBox(buildingStrings);
     141      building = new JComboBox<>(buildingStrings);
    142142      building.setSelectedItem(dto.getBuilding());
    143143      building.setMaximumRowCount(50);
  • applications/editors/josm/plugins/ImportImagePlugin/src/org/openstreetmap/josm/plugins/ImportImagePlugin/LayerPropertiesDialog.java

    r29854 r30532  
    6666    private JTextField searchField = null;
    6767    private JScrollPane crsListScrollPane = null;
    68     private JList crsJList = null;
     68    private JList<String> crsJList = null;
    6969    private JButton useDefaultCRSButton = null;
    7070    private JButton applySelectedCRSButton = null;
     
    406406     * @return javax.swing.JList   
    407407     */
    408     private JList getCrsJList() {
     408    private JList<String> getCrsJList() {
    409409        if (crsJList == null) {
    410             crsJList = new JList(supportedCRS);
     410            crsJList = new JList<>(supportedCRS);
    411411            crsJList.addListSelectionListener(new ListSelectionHandler());
    412412        }
  • applications/editors/josm/plugins/OsmInspectorPlugin/.settings/org.eclipse.jdt.core.prefs

    r30416 r30532  
    11eclipse.preferences.version=1
     2org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled
     3org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
     4org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
     5org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
     6org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
     7org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
    28org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
    39org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
    410org.eclipse.jdt.core.compiler.compliance=1.7
     11org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
    512org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
     13org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
     14org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
     15org.eclipse.jdt.core.compiler.problem.deadCode=warning
     16org.eclipse.jdt.core.compiler.problem.deprecation=warning
     17org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
     18org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
     19org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
     20org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
    621org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
     22org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
     23org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
     24org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
     25org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
     26org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
     27org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
     28org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
     29org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
     30org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
     31org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
     32org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
     33org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
     34org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
     35org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
     36org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
     37org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
     38org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
     39org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
     40org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
     41org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
     42org.eclipse.jdt.core.compiler.problem.missingSerialVersion=ignore
     43org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
     44org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
     45org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
     46org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
     47org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning
     48org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
     49org.eclipse.jdt.core.compiler.problem.nullReference=warning
     50org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
     51org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
     52org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
     53org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
     54org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
     55org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
     56org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore
     57org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
     58org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
     59org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
     60org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
     61org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
     62org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
     63org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
     64org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
     65org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
     66org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
     67org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
     68org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled
     69org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
     70org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
     71org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
     72org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
     73org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning
     74org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
     75org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
     76org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
     77org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore
     78org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
     79org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
     80org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
     81org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
     82org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
     83org.eclipse.jdt.core.compiler.problem.unusedImport=warning
     84org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
     85org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
     86org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=warning
     87org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
     88org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
     89org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
     90org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
     91org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
     92org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
     93org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
     94org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
    795org.eclipse.jdt.core.compiler.source=1.7
  • applications/editors/josm/plugins/OsmInspectorPlugin/src/org/openstreetmap/josm/plugins/osminspector/gui/OsmInspectorDialog.java

    r29547 r30532  
    1313import javax.swing.DefaultListModel;
    1414import javax.swing.JList;
    15 import javax.swing.JScrollBar;
    1615import javax.swing.JScrollPane;
    1716import javax.swing.ListSelectionModel;
    1817import javax.swing.ScrollPaneConstants;
    19 import javax.swing.ScrollPaneLayout;
    2018import javax.swing.event.ListSelectionEvent;
    2119import javax.swing.event.ListSelectionListener;
     
    3836
    3937        private OsmInspectorLayer layer;
    40         private JList bugsList;
     38        private JList<String> bugsList;
    4139        private OsmInspectorNextAction actNext;
    4240        private OsmInspectorPrevAction actPrev;
    43         private DefaultListModel model;
     41        private DefaultListModel<String> model;
    4442
    4543        private OsmInspectorBugInfoDialog bugInfoDialog;
    46         /**
    47          *
    48          */
    49         private static final long serialVersionUID = 5465011236663660394L;
    50 
    5144       
    5245        public void updateNextPrevAction(OsmInspectorLayer l) {
     
    6154                Main.map.addToggleDialog(this, true);
    6255
    63                 model = new DefaultListModel();
     56                model = new DefaultListModel<>();
    6457                refreshModel();
    65                 bugsList = new JList(model);
     58                bugsList = new JList<>(model);
    6659                bugsList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    6760                bugsList.setLayoutOrientation(JList.VERTICAL_WRAP);
     
    125118                                KeyEvent.VK_K, Shortcut.CTRL_SHIFT);
    126119                Main.registerActionShortcut(actNext, snext);
    127 
    128120        }
    129121
     
    135127                        }
    136128                }
    137 
    138129        }
    139130
     
    168159        public void hideNotify() {
    169160                if (dialogsPanel != null) {
    170                         // TODO Auto-generated method stub
    171161                        super.hideNotify();
    172162                }
     
    176166                        ListSelectionListener {
    177167
    178                 /**
    179                  *
    180                  */
    181                 private static final long serialVersionUID = 123266015594117296L;
    182168                private OsmInspectorLayer layer;
    183169
     
    203189                @Override
    204190                public void valueChanged(ListSelectionEvent arg0) {
    205                         // TODO Auto-generated method stub
    206 
    207191                }
    208192        }
     
    218202                        ListSelectionListener {
    219203
    220                 /**
    221          *
    222          */
    223                 private static final long serialVersionUID = 1L;
    224204                private OsmInspectorLayer layer;
    225205
     
    227207                        super("prev");
    228208                        layer = (OsmInspectorLayer) inspector;
    229 
    230209                }
    231210
     
    246225                @Override
    247226                public void valueChanged(ListSelectionEvent e) {
    248                         // TODO Auto-generated method stub
    249 
    250227                }
    251228        }
     
    253230        @Override
    254231        public void mouseClicked(MouseEvent e) {
    255                 // TODO Auto-generated method stub
    256 
    257232        }
    258233
    259234        @Override
    260235        public void mouseEntered(MouseEvent e) {
    261                 // TODO Auto-generated method stub
    262 
    263236        }
    264237
    265238        @Override
    266239        public void mouseExited(MouseEvent e) {
    267                 // TODO Auto-generated method stub
    268 
    269240        }
    270241
    271242        @Override
    272243        public void mousePressed(MouseEvent e) {
    273                 // TODO Auto-generated method stub
    274 
    275244        }
    276245
    277246        @Override
    278247        public void mouseReleased(MouseEvent e) {
    279                 // TODO Auto-generated method stub
    280 
    281248        }
    282249
     
    288255                        refreshBugList();
    289256                }
    290 
    291257        }
    292258
    293259        private void refreshBugList() {
    294260                bugsList.clearSelection();
    295                 bugsList = new JList(model);
    296 
     261                bugsList = new JList<>(model);
    297262        }
    298263
     
    317282               
    318283        }
    319 
    320284}
  • applications/editors/josm/plugins/addrinterpolation/src/org/openstreetmap/josm/plugins/AddrInterpolation/AddrInterpolationDialog.java

    r30067 r30532  
    9393    private boolean interpolationMethodSet = false;
    9494
    95 
    9695    // NOTE: The following 2 arrays must match in number of elements and position
    9796    // Tag values for map (Except that 'Numeric' is replaced by actual # on map)
     
    9998    String[] addrInterpolationStrings = { tr("Odd"), tr("Even"), tr("All"), tr("Alphabetic"), tr("Numeric") }; // Translatable names for display
    10099    private final int NumericIndex = 4;
    101     private JComboBox addrInterpolationList = null;
     100    private JComboBox<String> addrInterpolationList = null;
    102101
    103102    // NOTE: The following 2 arrays must match in number of elements and position
    104103    String[] addrInclusionTags = { "actual", "estimate", "potential" }; // Tag values for map
    105104    String[] addrInclusionStrings = { tr("Actual"), tr("Estimate"), tr("Potential") }; // Translatable names for display
    106     private JComboBox addrInclusionList = null;
    107 
    108 
     105    private JComboBox<String> addrInclusionList = null;
    109106
    110107    // For tracking edit changes as group for undo
     
    121118
    122119        ShowDialog(editControlsPane, name);
    123 
    124     }
    125 
    126 
     120    }
    127121
    128122    private void ShowDialog(JPanel editControlsPane, String name) {
     
    160154    }
    161155
    162 
    163 
    164156    // Create edit control items and return JPanel on which they reside
    165157    private JPanel CreateEditControls() {
     
    172164
    173165        editControlsPane.setBorder(BorderFactory.createEmptyBorder(15,15,15,15));
    174 
    175166
    176167        String streetName = selectedStreet.get("name");
     
    204195
    205196        JLabel numberingLabel = new JLabel(tr("Numbering Scheme:"));
    206         addrInterpolationList = new JComboBox(addrInterpolationStrings);
     197        addrInterpolationList = new JComboBox<>(addrInterpolationStrings);
    207198
    208199        JLabel incrementLabel = new JLabel(tr("Increment:"));
     
    217208
    218209        JLabel inclusionLabel = new JLabel(tr("Accuracy:"));
    219         addrInclusionList = new JComboBox(addrInclusionStrings);
     210        addrInclusionList = new JComboBox<>(addrInclusionStrings);
    220211        addrInclusionList.setSelectedIndex(lastAccuracyIndex);
    221212
     
    239230        }
    240231
    241 
    242 
    243232        JPanel optionPanel = CreateOptionalFields();
    244233        c.gridx = 0;
     
    248237
    249238        editControlsPane.add(optionPanel, c);
    250 
    251239
    252240        KeyAdapter enterProcessor = new KeyAdapter() {
     
    257245                        dialog.dispose();
    258246                    }
    259 
    260247                }
    261248            }
     
    267254        addrInterpolationList.addKeyListener(enterProcessor);
    268255        incrementTextField.addKeyListener(enterProcessor);
    269 
    270256
    271257        // Watch when Interpolation Method combo box is selected so that
     
    282268        });
    283269
    284 
    285270        // Watch when Interpolation Method combo box is changed so that
    286271        // Numeric increment box can be enabled or disabled.
     
    292277        });
    293278
    294 
    295279        editControlsPane.add(cbConvertToHouseNumbers, c);
    296 
    297 
    298280
    299281        if (houseNumberNodes.size() > 0) {
     
    305287        editControlsPane.add(new UrlLabel("http://wiki.openstreetmap.org/wiki/JOSM/Plugins/AddrInterpolation",
    306288                tr("More information about this feature"),2), c);
    307 
    308289
    309290        c.gridx = 0;
     
    332313    }
    333314
    334 
    335 
    336315    // Call after both starting and ending housenumbers have been entered - usually when
    337316    // combo box gets focus.
     
    368347                }
    369348            }
    370 
    371 
    372349        } else {
    373350            // Test for possible alpha
     
    392369            // Did not detect alpha
    393370            return false;
    394 
    395         }
    396        
     371        }
    397372        return true;
    398 
    399     }
    400 
    401 
     373    }
    402374
    403375    // Set Interpolation Method combo box to method specified by 'currentMethod' (an OSM key value)
     
    423395    }
    424396
    425 
    426397    // Set Inclusion Method combo box to method specified by 'currentMethod' (an OSM key value)
    427398    private void SelectInclusion(String currentMethod) {
     
    435406        }
    436407        addrInclusionList.setSelectedIndex(currentIndex);
    437 
    438     }
    439 
    440 
     408    }
    441409
    442410    // Create optional control fields in a group box
     
    485453        AddEditControlRows(optionalTextLabels, optionalEditFields,  editControlsPane);
    486454
    487 
    488 
    489455        JPanel optionPanel = new JPanel(new BorderLayout());
    490456        Border groupBox = BorderFactory.createEtchedBorder();
     
    498464    }
    499465
    500 
    501 
    502466    // Populate dialog for any possible existing settings if editing an existing Address interpolation way
    503467    private void GetExistingMapKeys() {
    504 
    505468
    506469        // Check all nodes for optional addressing data
     
    538501            CheckNodeForAddressTags(firstNode);
    539502            CheckNodeForAddressTags(lastNode);
    540 
    541         }
    542 
    543 
    544 
    545     }
    546 
     503        }
     504    }
    547505
    548506    // Check for any existing address data.   If found,
     
    571529            lastFullAddress = value;
    572530        }
    573 
    574     }
    575 
    576 
     531    }
    577532
    578533    // Look for a possible 'associatedStreet' type of relation for selected street
     
    609564                        }
    610565                    }
    611 
    612                 }
    613             }
    614 
     566                }
     567            }
    615568        }
    616569
    617570        return "";
    618571    }
    619 
    620572
    621573    // We can proceed only if there is both a named way (the 'street') and
     
    668620                }
    669621            }
    670 
    671622        }
    672623
     
    697648        }
    698649
    699 
    700650        return isValid;
    701651    }
    702 
    703652
    704653    /**
     
    728677    }
    729678
    730 
    731 
    732679    public void actionPerformed(ActionEvent e) {
    733680        if ("ok".equals(e.getActionCommand())) {
     
    735682                dialog.dispose();
    736683            }
    737 
    738684        } else  if ("cancel".equals(e.getActionCommand())) {
    739685            dialog.dispose();
    740 
    741         }
    742     }
    743 
    744 
     686        }
     687    }
    745688
    746689    // For Alpha interpolation, return base string
     
    757700    }
    758701
    759 
    760702    private char LastChar(String strValue) {
    761703        if (strValue.length() > 0) {
     
    767709    }
    768710
    769 
    770711    // Test for valid positive long int
    771     private boolean isLong( String input )
    772     {
     712    private boolean isLong( String input ) {
    773713        try
    774714        {
     
    791731        return p.matcher(s).matches();
    792732    }
    793 
    794733
    795734    private void InterpolateAlphaSection(int startNodeIndex, int endNodeIndex, String endValueString,
     
    828767                LatLon newHouseNumberPosition = lastHouseNode.getCoor().interpolate(toNode.getCoor(), proportion);
    829768
    830 
    831 
    832769                Node newHouseNumberNode = new Node(newHouseNumberPosition);
    833770                currentChar++;
     
    850787            }
    851788        }
    852 
    853 
    854     }
    855 
     789    }
    856790
    857791    private void CreateAlphaInterpolation(String startValueString, String endValueString) {
     
    889823        // End nodes do not actually contain housenumber value yet (command has not executed), so use user-entered value
    890824        InterpolateAlphaSection(startIndex, addrInterpolationWay.getNodesCount()-1, endValueString, startingChar, endingChar);
    891 
    892     }
    893 
     825    }
    894826
    895827    private double CalculateSegmentLengths(int startNodeIndex, int endNodeIndex, double segmentLengths[]) {
     
    905837        }
    906838        return totalLength;
    907 
    908     }
    909 
     839    }
    910840
    911841    private void InterpolateNumericSection(int startNodeIndex, int endNodeIndex,
     
    913843            long increment) {
    914844
    915 
    916845        int nSegments  =endNodeIndex - startNodeIndex;
    917846
     
    920849        // Total length of address interpolation way section
    921850        double totalLength= CalculateSegmentLengths(startNodeIndex, endNodeIndex, segmentLengths);
    922 
    923851
    924852        int nHouses = (int)((endingAddr - startingAddr) / increment) -1;
     
    956884                lastHouseNode = newHouseNumberNode;
    957885
    958 
    959886                segmentLengths[currentSegment] -= distanceNeeded; // Track amount used
    960887                nHouses -- ;
    961888            }
    962889        }
    963 
    964 
    965     }
    966 
     890    }
    967891
    968892    private void CreateNumericInterpolation(String startValueString, String endValueString, long increment) {
     
    970894        long startingAddr = Long.parseLong( startValueString );
    971895        long endingAddr = Long.parseLong( endValueString );
    972 
    973896
    974897        // Search for possible anchors from the 2nd node to 2nd from last, interpolating between each anchor
     
    1000923    }
    1001924
    1002 
    1003925    // Called if user has checked "Convert to House Numbers" checkbox.
    1004926    private void ConvertWayToHousenumbers(String selectedMethod, String startValueString, String endValueString,
     
    1011933
    1012934            CreateAlphaInterpolation(startValueString, endValueString);
    1013 
    1014935
    1015936        } else {
     
    1021942            }
    1022943            CreateNumericInterpolation(startValueString, endValueString, increment);
    1023 
    1024         }
    1025 
     944        }
    1026945
    1027946        RemoveAddressInterpolationWay();
    1028947
    1029948    }
    1030 
    1031949
    1032950    private void RemoveAddressInterpolationWay() {
     
    1044962
    1045963        addrInterpolationWay = null;
    1046 
    1047     }
    1048 
    1049 
     964    }
    1050965
    1051966    private boolean ValidateAndSave() {
     
    1084999            } else if (selectedMethod.equals("all")) {
    10851000
    1086             }else if (selectedMethod.equals("alphabetic")) {
     1001            } else if (selectedMethod.equals("alphabetic")) {
    10871002                errorMessage = ValidateAlphaAddress(startValueString, endValueString);
    10881003
    1089             }else if (selectedMethod.equals("Numeric")) {
     1004            } else if (selectedMethod.equals("Numeric")) {
    10901005
    10911006                if (!ValidNumericIncrementString(incrementString, startAddr, endAddr)) {
    10921007                    errorMessage = tr("Expected valid number for increment");
    10931008                }
    1094 
    10951009            }
    10961010            if (!errorMessage.equals("")) {
     
    11251039                currentDataSet.clearSelection(lastNode);  // Workaround for JOSM Bug #3838
    11261040            }
    1127 
    11281041
    11291042            String interpolationTagValue = selectedMethod;
     
    11511064        }
    11521065
    1153 
    1154 
    11551066        if (streetRelationButton.isSelected()) {
    11561067
     
    11671078            }
    11681079        }
    1169 
    11701080
    11711081        // For all nodes, add to relation and
     
    11991109    }
    12001110
    1201 
    12021111    private boolean ValidNumericIncrementString(String incrementString, long startingAddr, long endingAddr) {
    12031112
     
    12151124        return true;
    12161125    }
    1217 
    1218 
    12191126
    12201127    // Create Associated Street relation, add street, and add to list of commands to perform
     
    12281135    }
    12291136
    1230 
    1231 
    12321137    // Read from dialog text box, removing leading and trailing spaces
    12331138    // Return the string, or null for a zero length string
     
    12431148    }
    12441149
    1245 
    12461150    // Test if relation contains specified member
    12471151    //   If not already present, it is added
     
    12631167        }
    12641168    }
    1265 
    1266 
    12671169
    12681170    // Check alphabetic style address
     
    13161218                errorMessage = tr("Starting address letter must be less than ending address letter");
    13171219            }
    1318 
    13191220        }
    13201221
    13211222        return errorMessage;
    13221223    }
    1323 
    1324 
    13251224
    13261225    // Convert string addresses to numeric, with error check
     
    13531252    }
    13541253
    1355 
    1356 
    13571254    private String GetInterpolationMethod() {
    13581255        int selectedIndex = addrInterpolationList.getSelectedIndex();
    13591256        return addrInterpolationTags[selectedIndex];
    13601257    }
    1361 
    13621258
    13631259    private String GetInclusionMethod() {
     
    13661262        return addrInclusionTags[selectedIndex];
    13671263    }
    1368 
    1369 
    1370 
    1371 
    1372 
    1373 
    1374 
    13751264}
    1376 
    1377 
  • applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastreInterface.java

    r29801 r30532  
    414414            communeList[i + 1] = listOfCommunes.elementAt(i).substring(listOfCommunes.elementAt(i).indexOf(">")+1);
    415415        }
    416         JComboBox inputCommuneList = new JComboBox(communeList);
     416        JComboBox<String> inputCommuneList = new JComboBox<>(communeList);
    417417        p.add(inputCommuneList, GBC.eol().fill(GBC.HORIZONTAL).insets(10, 0, 0, 0));
    418418        JOptionPane pane = new JOptionPane(p, JOptionPane.INFORMATION_MESSAGE, JOptionPane.OK_CANCEL_OPTION, null) {
     
    432432    private int selectFeuilleDialog() {
    433433        JPanel p = new JPanel(new GridBagLayout());
    434         Vector<String> ImageNames = new Vector<String>();
     434        Vector<String> imageNames = new Vector<String>();
    435435        for (PlanImage src : listOfFeuilles) {
    436             ImageNames.add(src.name);
    437         }
    438         JComboBox inputFeuilleList = new JComboBox(ImageNames);
     436            imageNames.add(src.name);
     437        }
     438        JComboBox<String> inputFeuilleList = new JComboBox<>(imageNames);
    439439        p.add(inputFeuilleList, GBC.eol().fill(GBC.HORIZONTAL).insets(10, 0, 0, 0));
    440440        JOptionPane pane = new JOptionPane(p, JOptionPane.INFORMATION_MESSAGE, JOptionPane.OK_CANCEL_OPTION, null);
  • applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastrePreferenceSetting.java

    r30481 r30532  
    3737    private JCheckBox drawBoundaries = new JCheckBox(tr("Draw boundaries of downloaded data."));
    3838
    39     private JComboBox imageInterpolationMethod = new JComboBox();
     39    private JComboBox<String> imageInterpolationMethod = new JComboBox<>();
    4040
    4141    private JCheckBox disableImageCropping = new JCheckBox(tr("Disable image cropping during georeferencing."));
     
    9595    static final String DEFAULT_GRAB_MULTIPLIER = Scale.SQUARE_100M.value;
    9696
     97    /**
     98     * Constructs a new {@code CadastrePreferenceSetting}.
     99     */
    97100    public CadastrePreferenceSetting() {
    98101        super("cadastrewms.gif", I18n.tr("French cadastre WMS"),
     
    104107        );
    105108    }
    106 
    107109
    108110    public void addGui(final PreferenceTabbedPane gui) {
  • applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CheckSourceUploadHook.java

    r23190 r30532  
    3232public class CheckSourceUploadHook implements UploadHook
    3333{
    34     /** Serializable ID */
    35     private static final long serialVersionUID = -1;
    3634
    3735    /**
     
    8280            JTextField tf = new JTextField(CadastrePlugin.source);
    8381            p.add(tf, GBC.eol());
    84             JList l = new JList(sel.toArray());
     82            JList<OsmPrimitive> l = new JList<>(sel.toArray(new OsmPrimitive[0]));
    8583            l.setCellRenderer(renderer);
    8684            l.setVisibleRowCount(l.getModel().getSize() < 6 ? l.getModel().getSize() : 10);
     
    9189                Main.main.undoRedo.add(new ChangePropertyCommand(sel, "source", tf.getText()));
    9290        }
    93 
    9491    }
    9592}
    96 
  • applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionNewLocation.java

    r28887 r30532  
    6969                + "Use the syntax and punctuation known by www.cadastre.gouv.fr .</html>"));
    7070        JLabel labelDepartement =  new JLabel(tr("Departement"));
    71         final JComboBox inputDepartement = new JComboBox();
     71        final JComboBox<String> inputDepartement = new JComboBox<>();
    7272        for (int i=1; i<departements.length; i+=2) {
    7373            inputDepartement.addItem(departements[i]);
  • applications/editors/josm/plugins/colorscheme/src/at/dallermassl/josm/plugin/colorscheme/ColorSchemePreference.java

    r29854 r30532  
    3939    private static final String PREF_KEY_SCHEMES_NAMES = PREF_KEY_SCHEMES_PREFIX + "names";
    4040    public static final String PREF_KEY_COLOR_PREFIX = "color.";
    41     private JList schemesList;
    42     private DefaultListModel listModel;
     41    private JList<String> schemesList;
     42    private DefaultListModel<String> listModel;
    4343    private List<String>colorKeys;
    4444    private ColorPreference colorPreference;
     
    5050    }
    5151
    52 
    53     /* (non-Javadoc)
    54      * @see org.openstreetmap.josm.gui.preferences.PreferenceSetting#addGui(org.openstreetmap.josm.gui.preferences.PreferenceDialog)
    55      */
    5652    @Override
    5753    public void addGui(final PreferenceTabbedPane gui) {
     
    6258        colorKeys = new ArrayList<String>(colorMap.keySet());
    6359        Collections.sort(colorKeys);
    64         listModel = new DefaultListModel();
    65         schemesList = new JList(listModel);
     60        listModel = new DefaultListModel<>();
     61        schemesList = new JList<>(listModel);
    6662        String schemes = Main.pref.get(PREF_KEY_SCHEMES_NAMES);
    6763        StringTokenizer st = new StringTokenizer(schemes, ";");
  • applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/Preferences.java

    r27863 r30532  
    22
    33
     4import java.awt.event.ActionEvent;
     5import java.awt.event.ActionListener;
     6
     7import javax.swing.DefaultComboBoxModel;
     8import javax.swing.GroupLayout;
     9import javax.swing.JCheckBox;
     10import javax.swing.JComboBox;
     11import javax.swing.JLabel;
    412import javax.swing.JPanel;
     13import javax.swing.JTextField;
     14import javax.swing.event.ChangeEvent;
     15import javax.swing.event.ChangeListener;
    516
    617import org.openstreetmap.josm.Main;
     
    7081    private void initComponents() {
    7182
    72         mainPanel = new javax.swing.JPanel();
    73         addNewTagCheckBox = new javax.swing.JCheckBox();
    74         addNewTagKeyField = new javax.swing.JTextField();
    75         jLabel1 = new javax.swing.JLabel();
    76         addNewTagValueField = new javax.swing.JTextField();
    77         jLabel2 = new javax.swing.JLabel();
    78         optimizeComboBox = new javax.swing.JComboBox();
    79         buildingCheckBox = new javax.swing.JCheckBox();
     83        mainPanel = new JPanel();
     84        addNewTagCheckBox = new JCheckBox();
     85        addNewTagKeyField = new JTextField();
     86        jLabel1 = new JLabel();
     87        addNewTagValueField = new JTextField();
     88        jLabel2 = new JLabel();
     89        optimizeComboBox = new JComboBox<>();
     90        buildingCheckBox = new JCheckBox();
    8091
    8192        thisPanel.setLayout(new java.awt.GridLayout(1, 0));
    8293
    8394        addNewTagCheckBox.setText("Novým primitivám přidávat tag:");
    84         addNewTagCheckBox.addChangeListener(new javax.swing.event.ChangeListener() {
    85             public void stateChanged(javax.swing.event.ChangeEvent evt) {
     95        addNewTagCheckBox.addChangeListener(new ChangeListener() {
     96            public void stateChanged(ChangeEvent evt) {
    8697                addNewTagChanged(evt);
    8798            }
    8899        });
    89         addNewTagCheckBox.addActionListener(new java.awt.event.ActionListener() {
    90             public void actionPerformed(java.awt.event.ActionEvent evt) {
     100        addNewTagCheckBox.addActionListener(new ActionListener() {
     101            public void actionPerformed(ActionEvent evt) {
    91102                addNewTagCheckBoxActionPerformed(evt);
    92103            }
     
    103114        jLabel2.setText("Optimalizovat algoritmus přiřazování:");
    104115
    105         optimizeComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "pro rychlejší odezvu", "menší spotřebu paměti" }));
     116        optimizeComboBox.setModel(new DefaultComboBoxModel<>(new String[] { "pro rychlejší odezvu", "menší spotřebu paměti" }));
    106117        optimizeComboBox.setSelectedIndex(1);
    107118        optimizeComboBox.setEnabled(false);
    108119
    109120        buildingCheckBox.setText("Nově polygonům přidávat tag \"building=yes\"");
    110         buildingCheckBox.addChangeListener(new javax.swing.event.ChangeListener() {
    111             public void stateChanged(javax.swing.event.ChangeEvent evt) {
     121        buildingCheckBox.addChangeListener(new ChangeListener() {
     122            public void stateChanged(ChangeEvent evt) {
    112123                buildingCheckBoxaddNewTagChanged(evt);
    113124            }
     
    119130        });
    120131
    121         javax.swing.GroupLayout mainPanelLayout = new javax.swing.GroupLayout(mainPanel);
     132        javax.swing.GroupLayout mainPanelLayout = new GroupLayout(mainPanel);
    122133        mainPanel.setLayout(mainPanelLayout);
    123134        mainPanelLayout.setHorizontalGroup(
     
    213224    private javax.swing.JLabel jLabel2;
    214225    private javax.swing.JPanel mainPanel;
    215     private javax.swing.JComboBox optimizeComboBox;
     226    private javax.swing.JComboBox<String> optimizeComboBox;
    216227    // End of variables declaration//GEN-END:variables
    217228
  • applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/addressdatabase/ElementWithHouses.java

    r23190 r30532  
    5757        return houses;
    5858    }
    59 
    60 
    61 
    6259}
  • applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/gui/ConflictResolver.java

    r29854 r30532  
    8787        candLabel = new javax.swing.JLabel();
    8888        mainZoomButton = new javax.swing.JButton();
    89         mainField = new javax.swing.JComboBox();
    90         candField = new javax.swing.JComboBox();
     89        mainField = new javax.swing.JComboBox<>();
     90        candField = new javax.swing.JComboBox<>();
    9191        candPickButton = new javax.swing.JButton();
    9292        mainPickButton = new javax.swing.JButton();
     
    123123        });
    124124
    125         mainField.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
     125        mainField.setModel(new javax.swing.DefaultComboBoxModel<Object>(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
    126126        mainField.setRenderer(new UniversalListRenderer());
    127127
    128         candField.setModel(new javax.swing.DefaultComboBoxModel(new String[] { " " }));
     128        candField.setModel(new javax.swing.DefaultComboBoxModel<Object>(new String[] { " " }));
    129129        candField.setRenderer(new UniversalListRenderer());
    130130
     
    236236                    r.unOverwrite(prim, r.translate(prim));
    237237
    238                 ComboBoxModel model = candField.getModel();
     238                ComboBoxModel<Object> model = candField.getModel();
    239239                for (int i = 0; i < model.getSize(); i++) {
    240240                    AddressElement elem = (AddressElement) model.getElementAt(i);
     
    253253                    r.unOverwrite(r.translate(elem), elem);
    254254
    255                 ComboBoxModel model = candField.getModel();
     255                ComboBoxModel<Object> model = candField.getModel();
    256256                for (int i = 0; i < model.getSize(); i++) {
    257257                    OsmPrimitive prim = (OsmPrimitive) model.getElementAt(i);
     
    279279
    280280    // Variables declaration - do not modify//GEN-BEGIN:variables
    281     private javax.swing.JComboBox candField;
     281    private javax.swing.JComboBox<Object> candField;
    282282    private javax.swing.JLabel candLabel;
    283283    private javax.swing.JButton candPickButton;
    284284    private javax.swing.JButton candZoomButton;
    285     private javax.swing.JComboBox mainField;
     285    private javax.swing.JComboBox<Object> mainField;
    286286    private javax.swing.JLabel mainLabel;
    287287    private javax.swing.JPanel mainPanel;
     
    325325
    326326    private ConflictsModel conflictModel = new ConflictsModel();
    327     private class ConflictsModel implements ComboBoxModel {
     327    private class ConflictsModel implements ComboBoxModel<Object> {
    328328
    329329        ArrayList<AddressElement> elements = new ArrayList<AddressElement>();
     
    473473            conflPrims.addAll(Reasoner.getInstance().getCandidates(selElem));
    474474            Collections.sort(conflPrims, PrimUtils.comparator);
    475             candField.setModel(new CandidatesModel<OsmPrimitive>(conflPrims));
     475            candField.setModel(new CandidatesModel<Object>(conflPrims));
    476476
    477477        } else if (selected instanceof OsmPrimitive) {
     
    480480            conflElems.addAll(Reasoner.getInstance().getCandidates(selElem));
    481481            Collections.sort(conflElems);
    482             candField.setModel(new CandidatesModel<AddressElement>(conflElems));
     482            candField.setModel(new CandidatesModel<Object>(conflElems));
    483483
    484484        } else {
    485             candField.setModel(new DefaultComboBoxModel());
     485            candField.setModel(new DefaultComboBoxModel<>());
    486486            candZoomButton.setEnabled(false);
    487487            reassignButton.setEnabled(false);
     
    512512    }
    513513
    514     private class CandidatesModel<E> implements ComboBoxModel {
     514    private class CandidatesModel<E> implements ComboBoxModel<E> {
    515515
    516516        Set<ListDataListener> listeners = new HashSet<ListDataListener>();
     
    540540            } else
    541541                reassignButton.setEnabled(false);
    542 
    543 
    544542        }
    545543
     
    552550        }
    553551
    554         public Object getElementAt(int index) {
     552        public E getElementAt(int index) {
    555553            if (index < primitives.size())
    556554                return primitives.get(index);
  • applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/gui/FactoryDialog.java

    r30346 r30532  
    121121
    122122        for (int i=0; i<houseModel.getSize(); i++)
    123             if (houseModel.getHouseAt(i) == house) {
     123            if (houseModel.getElementAt(i) == house) {
    124124                houseList.setSelectedIndex(i);
    125125                houseList.ensureIndexIsVisible(i);
     
    159159        index++; // Initial kick to do at least one move.
    160160        House current;
    161         while ( (current = houseModel.getHouseAt(index)) != null
     161        while ( (current = houseModel.getElementAt(index)) != null
    162162             && Reasoner.getInstance().translate(current) != null)
    163163            index++;
     
    262262        mainPanel = new javax.swing.JPanel();
    263263        jScrollPane1 = new javax.swing.JScrollPane();
    264         houseList = new javax.swing.JList();
     264        houseList = new javax.swing.JList<>();
    265265        keepOddityCheckBox = new javax.swing.JCheckBox();
    266266        relocateButton = new javax.swing.JButton();
    267         streetComboBox = new javax.swing.JComboBox();
     267        streetComboBox = new javax.swing.JComboBox<>();
    268268
    269269        setLayout(new java.awt.GridLayout(1, 0));
    270 
    271         houseList.setModel(new javax.swing.AbstractListModel() {
     270/*
     271        houseList.setModel(new javax.swing.AbstractListModel<String>() {
    272272            String[] strings = { " " };
    273273            @Override
    274274            public int getSize() { return strings.length; }
    275275            @Override
    276             public Object getElementAt(int i) { return strings[i]; }
    277         });
     276            public String getElementAt(int i) { return strings[i]; }
     277        });*/
    278278        houseList.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
    279279        houseList.setEnabled(false);
     
    349349
    350350    // Variables declaration - do not modify//GEN-BEGIN:variables
    351     private javax.swing.JList houseList;
     351    private javax.swing.JList<House> houseList;
    352352    private javax.swing.JScrollPane jScrollPane1;
    353353    private javax.swing.JCheckBox keepOddityCheckBox;
    354354    private javax.swing.JPanel mainPanel;
    355355    private javax.swing.JButton relocateButton;
    356     private javax.swing.JComboBox streetComboBox;
     356    private javax.swing.JComboBox<ElementWithHouses> streetComboBox;
    357357    // End of variables declaration//GEN-END:variables
    358358
     
    370370    private class StreetListRenderer extends DefaultListCellRenderer {
    371371        @Override
    372         public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
     372        public Component getListCellRendererComponent(JList<?> list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
    373373            Component c = super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
    374374
     
    398398
    399399        @Override
    400         public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
     400        public Component getListCellRendererComponent(JList<?> list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
    401401            Component c = super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
    402402
     
    467467//==============================================================================
    468468
    469     private class StreetListModel extends HalfCookedComboBoxModel {
     469    private class StreetListModel extends HalfCookedComboBoxModel<ElementWithHouses> {
    470470
    471471        private ElementWithHouses selected = null;
     
    499499
    500500        @Override
    501         public Object getElementAt(int index) {
     501        public ElementWithHouses getElementAt(int index) {
    502502            if (parent == null) return null;
    503503
     
    528528//==============================================================================
    529529
    530     private class HouseListModel extends HalfCookedListModel
     530    private class HouseListModel extends HalfCookedListModel<House>
    531531                                 implements ReasonerListener {
    532532
     
    544544        }
    545545
    546         public House getHouseAt(int index) {
     546        @Override
     547        public House getElementAt(int index) {
    547548            if (streetComboBox.getSelectedItem() == null) return null;
    548549            ElementWithHouses selected
     
    555556
    556557        @Override
    557         public Object getElementAt(int index) {
    558             return getHouseAt(index);
    559         }
    560 
    561         @Override
    562558        public void primitiveChanged(OsmPrimitive prim) {}
    563559        @Override
  • applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/gui/LocationSelector.java

    r29854 r30532  
    6666        initLocationHints();
    6767
    68         DefaultComboBoxModel regions = new DefaultComboBoxModel(Database.getInstance().regions.toArray());
     68        DefaultComboBoxModel<Region> regions = new DefaultComboBoxModel<>(Database.getInstance().regions.toArray(new Region[0]));
    6969        regionHlIndex = reshuffleListItems(regions, hlRegions);
    7070        oblastComboBox.setModel(regions);
     
    173173    * beginning, return number of moved items.
    174174    */
    175 
    176     private int reshuffleListItems(DefaultComboBoxModel list, final ArrayList<AddressElement> hlList) {
     175    private <E> int reshuffleListItems(DefaultComboBoxModel<E> list, final ArrayList<AddressElement> hlList) {
    177176        int curHlIndex = 0;
    178177
    179178        for (int i = 0; i < list.getSize(); i++)
    180179            for (int j = 0; j < hlList.size(); j++) {
    181                 Object t = list.getElementAt(i);
     180                E t = list.getElementAt(i);
    182181                if (t == hlList.get(j)) {
    183182                    list.removeElementAt(i);
     
    199198
    200199        mainPanel = new javax.swing.JPanel();
    201         oblastComboBox = new javax.swing.JComboBox();
    202         suburbComboBox = new javax.swing.JComboBox();
    203         vitociComboBox = new javax.swing.JComboBox();
     200        oblastComboBox = new javax.swing.JComboBox<>();
     201        suburbComboBox = new javax.swing.JComboBox<>();
     202        vitociComboBox = new javax.swing.JComboBox<>();
    204203        obecLabel = new javax.swing.JLabel();
    205204        castObceLabel = new javax.swing.JLabel();
     
    298297        if (oblast == null) return;
    299298
    300         DefaultComboBoxModel vitocis = new DefaultComboBoxModel(oblast.getViToCis().toArray());
     299        DefaultComboBoxModel<ViToCi> vitocis = new DefaultComboBoxModel<>(oblast.getViToCis().toArray(new ViToCi[0]));
    301300        vitociHlIndex = reshuffleListItems(vitocis, hlViToCis);
    302301        vitociComboBox.setModel(vitocis);
     
    312311
    313312        if (obec.getSuburbs().size() > 0) {
    314             Object[] suburbs = new Object[obec.getSuburbs().size() + 1];
     313            ElementWithStreets[] suburbs = new ElementWithStreets[obec.getSuburbs().size() + 1];
    315314            for (int i=0; i<obec.getSuburbs().size(); i++)
    316315                suburbs[i] = obec.getSuburbs().get(i);
    317316            suburbs[obec.getSuburbs().size()] = obec;
    318             DefaultComboBoxModel suburbsList = new DefaultComboBoxModel(suburbs);
     317            DefaultComboBoxModel<ElementWithStreets> suburbsList = new DefaultComboBoxModel<>(suburbs);
    319318            suburbHlIndex = reshuffleListItems(suburbsList, hlSuburbs);
    320319            suburbComboBox.setModel(suburbsList);
    321320            suburbComboBox.setSelectedItem(suburbsList.getElementAt(0));
    322321        } else
    323             suburbComboBox.setModel(new DefaultComboBoxModel());
     322            suburbComboBox.setModel(new DefaultComboBoxModel<ElementWithStreets>());
    324323
    325324        suburbComboBox.setEnabled(suburbComboBox.getModel().getSize() > 1);
     
    353352    private javax.swing.JPanel mainPanel;
    354353    private javax.swing.JLabel obecLabel;
    355     private javax.swing.JComboBox oblastComboBox;
     354    private javax.swing.JComboBox<Region> oblastComboBox;
    356355    private javax.swing.JLabel oblastLabel;
    357     private javax.swing.JComboBox suburbComboBox;
    358     private javax.swing.JComboBox vitociComboBox;
     356    private javax.swing.JComboBox<ElementWithStreets> suburbComboBox;
     357    private javax.swing.JComboBox<ViToCi> vitociComboBox;
    359358    // End of variables declaration//GEN-END:variables
    360359
     
    362361        @Override
    363362        public Component getListCellRendererComponent(
    364                     JList list, Object value, int index,
     363                    JList<?> list, Object value, int index,
    365364                    boolean isSelected, boolean cellHasFocus) {
    366365
     
    383382    private class SuburbRenderer extends AddressElementRenderer {
    384383        @Override
    385         public Component getListCellRendererComponent(JList list, Object value,
     384        public Component getListCellRendererComponent(JList<?> list, Object value,
    386385                          int index, boolean isSelected, boolean cellHasFocus) {
    387386            Component c = super.getListCellRendererComponent(list, value,
  • applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/gui/PointManipulatorDialog.java

    r29727 r30532  
    197197        changeLocationButton = new javax.swing.JButton();
    198198        jScrollPane1 = new javax.swing.JScrollPane();
    199         proposalList = new javax.swing.JList();
    200         matchesComboBox = new javax.swing.JComboBox();
     199        proposalList = new javax.swing.JList<>();
     200        matchesComboBox = new javax.swing.JComboBox<>();
    201201        jLabel6 = new javax.swing.JLabel();
    202202        statusLabel = new javax.swing.JLabel();
     
    236236        jScrollPane1.setViewportView(proposalList);
    237237
    238         matchesComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "" }));
     238        //matchesComboBox.setModel(new javax.swing.DefaultComboBoxModel<String>(new String[] { "" }));
    239239        matchesComboBox.addItemListener(new java.awt.event.ItemListener() {
    240240            public void itemStateChanged(java.awt.event.ItemEvent evt) {
     
    307307    private void proposalListKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_proposalListKeyReleased
    308308        if (evt.getKeyCode() == KeyEvent.VK_DELETE) {
    309             for (Object o : proposalList.getSelectedValues())
     309            for (Object o : proposalList.getSelectedValuesList())
    310310                proposalContainer.removeProposal((Proposal) o);
    311311        }
     
    341341    private javax.swing.JTextField locationEdit;
    342342    private javax.swing.JPanel mainPanel;
    343     private javax.swing.JComboBox matchesComboBox;
    344     private javax.swing.JList proposalList;
     343    private javax.swing.JComboBox<AddressElement> matchesComboBox;
     344    private javax.swing.JList<Proposal> proposalList;
    345345    private javax.swing.JLabel statusLabel;
    346346    // End of variables declaration//GEN-END:variables
     
    349349     * Container for all Houses, which match the given 'alternatenumber'.
    350350     */
    351     private class MatchesComboBoxModel extends HalfCookedComboBoxModel {
     351    private class MatchesComboBoxModel extends HalfCookedComboBoxModel<AddressElement> {
    352352
    353353        private List<AddressElement> matches = null;
     
    379379        }
    380380
    381         public Object getElementAt(int index) {
     381        public AddressElement getElementAt(int index) {
    382382            if (matches == null) return null;
    383383            if (index >= matches.size()) return null;
  • applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/gui/databaseeditors/StreetEditor.java

    r29854 r30532  
    3737
    3838        nameField.setText(street.getName());
    39         houseList.setModel(new DefaultComboBoxModel(street.getHouses().toArray()));
     39        houseList.setModel(new DefaultComboBoxModel<>(street.getHouses().toArray(new House[0])));
    4040        houseList.setCellRenderer(new UniversalListRenderer());
    4141
     
    7272        jLabel3 = new javax.swing.JLabel();
    7373        jScrollPane1 = new javax.swing.JScrollPane();
    74         houseList = new javax.swing.JList();
     74        houseList = new javax.swing.JList<>();
    7575        parentEditButton = new javax.swing.JButton();
    7676        houseEditButton = new javax.swing.JButton();
     
    163163        assert selectedHouse != null;
    164164        if (EditorFactory.editHouse(selectedHouse))
    165             houseList.setModel(new DefaultComboBoxModel(street.getHouses().toArray()));
     165            houseList.setModel(new DefaultComboBoxModel<>(street.getHouses().toArray(new House[0])));
    166166    }//GEN-LAST:event_houseEditButtonActionPerformed
    167167
     
    175175    // Variables declaration - do not modify//GEN-BEGIN:variables
    176176    private javax.swing.JButton houseEditButton;
    177     private javax.swing.JList houseList;
     177    private javax.swing.JList<House> houseList;
    178178    private javax.swing.JLabel jLabel1;
    179179    private javax.swing.JLabel jLabel2;
  • applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/gui/databaseeditors/SuburbEditor.java

    r29854 r30532  
    3939        parentEditButton.setEnabled(EditorFactory.isEditable(parent));
    4040
    41         houseList.setModel(new DefaultComboBoxModel(suburb.getHouses().toArray()));
     41        houseList.setModel(new DefaultComboBoxModel<>(suburb.getHouses().toArray(new House[0])));
    4242        houseList.setCellRenderer(new UniversalListRenderer());
    4343
     
    4646        houseListChanged(null);
    4747
    48         streetList.setModel(new DefaultComboBoxModel(suburb.getStreets().toArray()));
     48        streetList.setModel(new DefaultComboBoxModel<>(suburb.getStreets().toArray(new Street[0])));
    4949        streetList.setCellRenderer(new UniversalListRenderer());
    5050
     
    8181        jLabel3 = new javax.swing.JLabel();
    8282        jScrollPane1 = new javax.swing.JScrollPane();
    83         houseList = new javax.swing.JList();
     83        houseList = new javax.swing.JList<>();
    8484        parentEditButton = new javax.swing.JButton();
    8585        houseEditButton = new javax.swing.JButton();
    8686        jScrollPane2 = new javax.swing.JScrollPane();
    87         streetList = new javax.swing.JList();
     87        streetList = new javax.swing.JList<>();
    8888        streetEditButton = new javax.swing.JButton();
    8989        jLabel4 = new javax.swing.JLabel();
     
    212212        assert selectedHouse != null;
    213213        if (EditorFactory.editHouse(selectedHouse))
    214             houseList.setModel(new DefaultComboBoxModel(suburb.getHouses().toArray()));
     214            houseList.setModel(new DefaultComboBoxModel<>(suburb.getHouses().toArray(new House[0])));
    215215}//GEN-LAST:event_houseEditButtonActionPerformed
    216216
     
    223223        assert selectedStreet != null;
    224224        if (EditorFactory.editStreet(selectedStreet))
    225             streetList.setModel(new DefaultComboBoxModel(suburb.getStreets().toArray()));
     225            streetList.setModel(new DefaultComboBoxModel<>(suburb.getStreets().toArray(new Street[0])));
    226226    }//GEN-LAST:event_streetEditButtonActionPerformed
    227227
     
    229229    // Variables declaration - do not modify//GEN-BEGIN:variables
    230230    private javax.swing.JButton houseEditButton;
    231     private javax.swing.JList houseList;
     231    private javax.swing.JList<House> houseList;
    232232    private javax.swing.JLabel jLabel1;
    233233    private javax.swing.JLabel jLabel2;
     
    242242    private javax.swing.JTextField parentField;
    243243    private javax.swing.JButton streetEditButton;
    244     private javax.swing.JList streetList;
     244    private javax.swing.JList<Street> streetList;
    245245    // End of variables declaration//GEN-END:variables
    246246
  • applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/gui/utils/HalfCookedComboBoxModel.java

    r15585 r30532  
    1616 * @author Radomír Černoch, radomir.cernoch@gmail.com
    1717 */
    18 public abstract class HalfCookedComboBoxModel implements ComboBoxModel {
     18public abstract class HalfCookedComboBoxModel<E> implements ComboBoxModel<E> {
    1919
    2020    List<ListDataListener> listeners = new ArrayList<ListDataListener>();
    2121
     22    @Override
    2223    public void addListDataListener(ListDataListener l) {
    2324        listeners.add(l);
    2425    }
    2526
     27    @Override
    2628    public void removeListDataListener(ListDataListener l) {
    2729        listeners.remove(l);
  • applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/gui/utils/HalfCookedListModel.java

    r15585 r30532  
    1616 * @author Radomír Černoch, radomir.cernoch@gmail.com
    1717 */
    18 public abstract class HalfCookedListModel implements ListModel {
     18public abstract class HalfCookedListModel<E> implements ListModel<E> {
    1919
    2020    List<ListDataListener> listeners = new ArrayList<ListDataListener>();
    2121
     22    @Override
    2223    public void addListDataListener(ListDataListener l) {
    2324        listeners.add(l);
    2425    }
    2526
     27    @Override
    2628    public void removeListDataListener(ListDataListener l) {
    2729        listeners.remove(l);
  • applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/proposal/ProposalContainer.java

    r15584 r30532  
    2323 * @see Proposal
    2424 */
    25 public class ProposalContainer implements ListModel, Comparable<ProposalContainer> {
    26 
     25public class ProposalContainer implements ListModel<Proposal>, Comparable<ProposalContainer> {
    2726
    2827    /**
     
    6564     * The list of proposals to be applied to encapsulated primitive.
    6665     */
    67     protected List<Proposal> proposals
    68             = new ArrayList<Proposal>();
     66    protected List<Proposal> proposals = new ArrayList<Proposal>();
    6967
    7068    /**
     
    184182    }
    185183
     184    @Override
    186185    public int getSize() {
    187186        return proposals.size();
    188187    }
    189188
    190     public Object getElementAt(int index) {
     189    @Override
     190    public Proposal getElementAt(int index) {
    191191        return proposals.get(index);
    192192    }
    193193
     194    @Override
    194195    public void addListDataListener(ListDataListener l) {
    195196        listeners.add(l);
    196197    }
    197198
     199    @Override
    198200    public void removeListDataListener(ListDataListener l) {
    199201        listeners.remove(l);
    200202    }
    201203
     204    @Override
    202205    public int compareTo(ProposalContainer o) {
    203206        return PrimUtils.comparator.compare(this.target, o.target);
    204207    }
    205 
    206208}
  • applications/editors/josm/plugins/editgpx/src/org/openstreetmap/josm/plugins/editgpx/GPXLayerImportAction.java

    r28204 r30532  
    3737class GPXLayerImportAction extends AbstractAction {
    3838
    39 
    40     private static final long serialVersionUID = 5794897888911798168L;
    4139    private EditGpxData data;
    4240    public Object importing = new Object(); //used for synchronization
     
    5452    public void activateImport() {
    5553        Box panel = Box.createVerticalBox();
    56         DefaultListModel dModel= new DefaultListModel();
     54        DefaultListModel<GpxLayer> dModel = new DefaultListModel<>();
    5755
    58         final JList layerList = new JList(dModel);
     56        final JList<GpxLayer> layerList = new JList<>(dModel);
    5957        Collection<Layer> data = Main.map.mapView.getAllLayers();
    6058        int layerCnt = 0;
     
    6260        for (Layer l : data){
    6361            if(l instanceof GpxLayer){
    64                 dModel.addElement(l);
     62                dModel.addElement((GpxLayer) l);
    6563                layerCnt++;
    6664            }
     
    6967            layerList.setSelectionInterval(0, layerCnt-1);
    7068            layerList.setCellRenderer(new DefaultListCellRenderer(){
    71                 @Override public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
     69                @Override public Component getListCellRendererComponent(JList<?> list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
    7270                    Layer layer = (Layer)value;
    7371                    JLabel label = (JLabel)super.getListCellRendererComponent(list,
     
    104102            }
    105103            synchronized(importing) {
    106                 for (Object o : layerList.getSelectedValues()) {
    107                     GpxLayer gpx = (GpxLayer )o;
     104                for (GpxLayer gpx : layerList.getSelectedValuesList()) {
    108105                    this.data.load(gpx.data);
    109106                }
  • applications/editors/josm/plugins/globalsat/src/org/kaintoch/gps/globalsat/dg100/Response.java

    r29854 r30532  
    1212 *
    1313 */
    14 public class Response
     14public class Response<E>
    1515{
    1616    final static public byte typeFileInfo = (byte)0xBB;
     
    2323    private int nextIdx = 0;
    2424    private Dg100Config config = null;
    25     private List data = new ArrayList(100);
     25    private List<E> data = new ArrayList<>(100);
    2626    private long id = 0;
    2727
     
    3535     * @param resp
    3636     */
    37     static public Response parseResponse(byte resp[], int len)
     37    static public Response<?> parseResponse(byte resp[], int len)
    3838    {
    3939        ByteBuffer buf = ByteBuffer.wrap(resp);
    4040        byte respType = buf.get(4);
    41         Response response = new Response(respType);
    4241        buf.position(5);
    4342        if (respType == typeFileInfo) // file info
    4443        {
     44            Response<FileInfoRec> response = new Response<>(respType);
    4545            int cntInfoCur = buf.getShort();
    4646            int nextIdx = buf.getShort();
     
    5252                response.addRec(fileInfoRec);
    5353            }
     54            return response;
    5455        }
    5556        else if (respType == typeGpsRec) // gps recs
    5657        {
     58            Response<GpsRec> response = new Response<>(respType);
    5759            int recType = 2;
    5860            // read part 1
     
    8587                recType = gpsRec.getDg100TypeOfNextRec();
    8688            }
     89            return response;
    8790        }
    8891        else if (respType == typeConfig) // config
    8992        {
     93            Response<?> response = new Response<>(respType);
    9094            Dg100Config config = new Dg100Config(buf);
    9195            response.config = config;
     96            return response;
    9297        }
    9398        else if (respType == typeId) // id
    9499        {
     100            Response<?> response = new Response<>(respType);
    95101            response.id = 0;
    96102            for (int ii = 0 ; ii < 8 ; ++ii)
     
    99105                response.id = response.id * 10 + digit;
    100106            }
     107            return response;
    101108        }
    102109        else
    103110        {
     111            return new Response<>(respType);
    104112        }
    105         return response;
    106113    }
    107114
    108     private void addRec(Object obj)
     115    private void addRec(E obj)
    109116    {
    110117        data.add(obj);
    111118    }
    112119
    113     public List getRecs()
     120    public List<E> getRecs()
    114121    {
    115122        return data;
  • applications/editors/josm/plugins/globalsat/src/org/openstreetmap/josm/plugins/globalsat/GlobalsatConfigDialog.java

    r29854 r30532  
    55
    66import static org.openstreetmap.josm.tools.I18n.tr;
    7 import gnu.io.CommPortIdentifier;
    87
    98import java.awt.Dimension;
     
    1312import java.awt.event.ActionListener;
    1413import java.awt.event.KeyEvent;
    15 import java.util.LinkedList;
    16 import java.util.List;
    1714
    1815import javax.swing.BoxLayout;
    1916import javax.swing.ButtonGroup;
    2017import javax.swing.JCheckBox;
    21 import javax.swing.JComboBox;
    2218import javax.swing.JLabel;
    2319import javax.swing.JOptionPane;
     
    2824import org.kaintoch.gps.globalsat.dg100.Dg100Config;
    2925import org.openstreetmap.josm.Main;
    30 
    3126
    3227/**
     
    5550    }
    5651
    57 
    58 
    59     // the JOptionPane that contains this dialog. required for the closeDialog() method.
    60     private JOptionPane optionPane;
    61     private JCheckBox delete;
    62     private JComboBox portCombo;
    6352    private JRadioButton formatPosOnly = new JRadioButton(tr("Position only"));
    6453    private JRadioButton formatPosTDS = new JRadioButton(tr("Position, Time, Date, Speed"));
     
    7968    private JTextField cMeters = new IntegerTextField();
    8069
    81     private JLabel memUsage = new JLabel();
    82 
    8370    private JCheckBox disableLogDist, disableLogSpeed;
    8471    private JTextField minLogDist, minLogSpeed;
    8572
    86     private List<CommPortIdentifier> ports = new LinkedList<CommPortIdentifier>();
    87 
    8873    private Dg100Config conf;
    89 
    9074
    9175    public GlobalsatConfigDialog(Dg100Config config) {
     
    326310
    327311    /**
    328      * Has to be called after this dialog has been added to a JOptionPane.
    329      * @param optionPane
    330      */
    331     public void setOptionPane(JOptionPane optionPane) {
    332         this.optionPane = optionPane;
    333     }
    334 
    335     /**
    336312     * Get the selected configuration.
    337313     */
  • applications/editors/josm/plugins/globalsat/src/org/openstreetmap/josm/plugins/globalsat/GlobalsatDg100.java

    r26509 r30532  
    5050
    5151    /** delete file: A0 A2 00 02 BC 01 00 BD B0 B3 */
    52     private static byte dg100CmdSwitch2Nmea[] =
     52    /*private static byte dg100CmdSwitch2Nmea[] =
    5353    { (byte) 0xA0, (byte) 0xA2, (byte) 0x00, (byte) 0x18, (byte) 0x81,
    5454      (byte) 0x02, (byte) 0x01, (byte) 0x01, (byte) 0x00, (byte) 0x01,
     
    5858      (byte) 0x00, (byte) 0x25, (byte) 0x80, (byte) 0x00, (byte) 0x00,
    5959      (byte) 0xB0, (byte) 0xB3
    60     };
     60    };*/
    6161    /** delete file: A0 A2 00 02 BC 01 00 BD B0 B3 */
    62     private static byte dg100CmdEnterGMouse[] =
     62    /*private static byte dg100CmdEnterGMouse[] =
    6363    { (byte) 0xA0, (byte) 0xA2, (byte) 0x00, (byte) 0x02, (byte) 0xBC
    6464      , (byte) 0x01, (byte) 0x00, (byte) 0xBD, (byte) 0xB0, (byte) 0xB3
    65     };
     65    };*/
    6666    /** delete file: A0 A2 00 03 BA FF FF 02 B8 B0 B3 */
    6767    private static byte dg100CmdDelFile[] =
     
    104104    };
    105105    /** read config: A0 A2 00 01 BF 00 BF B0 B3 */
    106     private static byte dg100CmdGetId[] =
     106    /*private static byte dg100CmdGetId[] =
    107107    { (byte) 0xA0, (byte) 0xA2, (byte) 0x00, (byte) 0x01, (byte) 0xBF
    108       , (byte) 0x00, (byte) 0xBF, (byte) 0xB0, (byte) 0xB3 };
     108      , (byte) 0x00, (byte) 0xBF, (byte) 0xB0, (byte) 0xB3 };*/
    109109    /** read config: A0 A2 00 01 BF 00 BF B0 B3 */
    110     private static byte dg100CmdSetId[] =
     110    /*private static byte dg100CmdSetId[] =
    111111    { (byte) 0xA0, (byte) 0xA2, (byte) 0x00, (byte) 0x09, (byte) 0xC0
    112112      , (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00
    113113      , (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00
    114       , (byte) 0x00, (byte) 0xC0, (byte) 0xB0, (byte) 0xB3};
     114      , (byte) 0x00, (byte) 0xC0, (byte) 0xB0, (byte) 0xB3};*/
    115115
    116116    private byte[] response = new byte[65536];
     
    187187        }
    188188        try{
    189             Response response = sendCmdDelFiles();
     189            sendCmdDelFiles();
    190190        }catch(Exception e){
    191191            throw new ConnectionException(e);
     
    220220        try{
    221221            do{
    222                 Response response = sendCmdGetFileInfo(nextIdx);
     222                Response<FileInfoRec> response = sendCmdGetFileInfo(nextIdx);
    223223                nextIdx = response.getNextIdx();
    224224                result.addAll(response.getRecs());
     
    232232    public List<GpsRec> readGpsRecList(List<FileInfoRec> fileInfoList) throws ConnectionException
    233233    {
    234         int cnt = 0;
    235234        List<GpsRec> result = new ArrayList<GpsRec>(200);
    236235
    237236        try{
    238237            for(FileInfoRec fileInfoRec:fileInfoList){
    239                 cnt++;
    240                 Response response = sendCmdGetGpsRecs(fileInfoRec.getIdx());
     238                Response<GpsRec> response = sendCmdGetGpsRecs(fileInfoRec.getIdx());
    241239                result.addAll(response.getRecs());
    242240            }
     
    247245    }
    248246
    249     private Response sendCmdDelFiles() throws IOException, UnsupportedCommOperationException
     247    private Response<?> sendCmdDelFiles() throws IOException, UnsupportedCommOperationException
    250248    {
    251249        System.out.println("deleting data...");
     
    254252    }
    255253
    256     private Response sendCmdGetFileInfo(int idx) throws IOException, UnsupportedCommOperationException
     254    @SuppressWarnings("unchecked")
     255    private Response<FileInfoRec> sendCmdGetFileInfo(int idx) throws IOException, UnsupportedCommOperationException
    257256    {
    258257        byte[] src = dg100CmdGetFileInfo;
     
    262261        updateCheckSum(buf);
    263262        int len = sendCmd(src, response, -1);
    264         return Response.parseResponse(response, len);
    265     }
    266 
    267     private Response sendCmdGetConfig() throws IOException, UnsupportedCommOperationException
     263        return (Response<FileInfoRec>) Response.parseResponse(response, len);
     264    }
     265
     266    private Response<?> sendCmdGetConfig() throws IOException, UnsupportedCommOperationException
    268267    {
    269268        byte[] src = dg100CmdGetConfig;
     
    277276                connect();
    278277            }
    279             Response response = sendCmdGetConfig();
    280             return response.getConfig();
     278            return sendCmdGetConfig().getConfig();
    281279        }catch(Exception e){
    282280            throw new ConnectionException(e);
    283281        }
    284282    }
    285 
    286283
    287284    private void sendCmdSetConfig(Dg100Config config) throws IOException, UnsupportedCommOperationException
     
    310307    }
    311308
    312     private Response sendCmdGetGpsRecs(int idx) throws IOException, UnsupportedCommOperationException
     309    @SuppressWarnings("unchecked")
     310    private Response<GpsRec> sendCmdGetGpsRecs(int idx) throws IOException, UnsupportedCommOperationException
    313311    {
    314312        byte[] src = dg100CmdGetGpsRecs;
     
    318316        updateCheckSum(buf);
    319317        int len = sendCmd(src, response, 2074);
    320         return Response.parseResponse(response, len);
     318        return (Response<GpsRec>) Response.parseResponse(response, len);
    321319    }
    322320
  • applications/editors/josm/plugins/globalsat/src/org/openstreetmap/josm/plugins/globalsat/GlobalsatImportDialog.java

    r29854 r30532  
    1010import java.awt.event.ActionListener;
    1111import java.util.Enumeration;
    12 import java.util.LinkedList;
    13 import java.util.List;
    1412
    1513import javax.swing.JButton;
     
    3331public class GlobalsatImportDialog extends JPanel {
    3432
    35     // the JOptionPane that contains this dialog. required for the closeDialog() method.
    36     private JOptionPane optionPane;
    3733    private JCheckBox delete;
    38     private JComboBox portCombo;
    39     private List<CommPortIdentifier> ports = new LinkedList<CommPortIdentifier>();
     34    private JComboBox<CommPortIdentifier> portCombo;
    4035
    4136    public GlobalsatImportDialog() {
     
    4540        setLayout(new GridBagLayout());
    4641
    47         portCombo = new JComboBox();
    48         portCombo.setRenderer(new ListCellRenderer(){
    49                 public java.awt.Component getListCellRendererComponent(JList list, Object o, int x, boolean a, boolean b){
    50                     String value = ((CommPortIdentifier)o).getName();
     42        portCombo = new JComboBox<>();
     43        portCombo.setRenderer(new ListCellRenderer<CommPortIdentifier>(){
     44                public java.awt.Component getListCellRendererComponent(JList<? extends CommPortIdentifier> list, CommPortIdentifier o, int x, boolean a, boolean b){
     45                    String value = o.getName();
    5146                    if(value == null){
    5247                        value = "null";
     
    10398                        JOptionPane pane = new JOptionPane(dialog, JOptionPane.PLAIN_MESSAGE, JOptionPane.OK_CANCEL_OPTION);
    10499                        JDialog dlg = pane.createDialog(Main.parent, tr("Configure Device"));
    105                         dialog.setOptionPane(pane);
    106100                        dlg.setVisible(true);
    107101                        if(((Integer)pane.getValue()) == JOptionPane.OK_OPTION){
     
    140134        portCombo.removeAllItems();
    141135
    142         Enumeration e = CommPortIdentifier.getPortIdentifiers();
     136        Enumeration<?> e = CommPortIdentifier.getPortIdentifiers();
    143137        for(e = CommPortIdentifier.getPortIdentifiers(); e.hasMoreElements(); ){
    144138            CommPortIdentifier port = (CommPortIdentifier)e.nextElement();
     
    163157        return (CommPortIdentifier)portCombo.getSelectedItem();
    164158    }
    165     /**
    166      * Has to be called after this dialog has been added to a JOptionPane.
    167      * @param optionPane
    168      */
    169     public void setOptionPane(JOptionPane optionPane) {
    170         this.optionPane = optionPane;
    171     }
    172159}
  • applications/editors/josm/plugins/globalsat/src/org/openstreetmap/josm/plugins/globalsat/GlobalsatPlugin.java

    r27852 r30532  
    77import java.awt.event.KeyEvent;
    88import java.io.IOException;
    9 import java.util.Enumeration;
    109
    1110import javax.swing.JDialog;
     
    8685    }
    8786
    88 
    8987    GlobalsatImportAction importAction;
    9088    public GlobalsatPlugin(PluginInformation info) {
     
    9290        boolean error = false;
    9391        try{
    94             Enumeration e = CommPortIdentifier.getPortIdentifiers();
     92            CommPortIdentifier.getPortIdentifiers();
    9593        }catch(java.lang.UnsatisfiedLinkError e){
    9694            error = true;
     
    114112            JOptionPane pane = new JOptionPane(dialog, JOptionPane.PLAIN_MESSAGE, JOptionPane.OK_CANCEL_OPTION);
    115113            JDialog dlg = pane.createDialog(Main.parent, tr("Import"));
    116             dialog.setOptionPane(pane);
    117114            dlg.setVisible(true);
    118115            if(((Integer)pane.getValue()) == JOptionPane.OK_OPTION){
  • applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/plugin/dialogs/GraphViewDialog.java

    r29854 r30532  
    5252    private final LinkedHashMap<String, ColorScheme> availableColorSchemes;
    5353
    54 
    5554    private final GraphViewPreferences preferences;
    5655    private final GraphViewPlugin plugin;
    5756
    58     private final JComboBox rulesetComboBox;
    59     private final JComboBox bookmarkComboBox;
    60     private final JComboBox colorSchemeComboBox;
     57    private final JComboBox<String> rulesetComboBox;
     58    private final JComboBox<String> bookmarkComboBox;
     59    private final JComboBox<String> colorSchemeComboBox;
    6160
    6261    /**
     
    111110            selectionPanel.add(rulesetLabel);
    112111
    113             rulesetComboBox = new JComboBox();
     112            rulesetComboBox = new JComboBox<>();
    114113            rulesetComboBox.addActionListener(rulesetActionListener);
    115114            gbcComboBox.gridy = 0;
     
    125124            selectionPanel.add(bookmarkLabel);
    126125
    127             bookmarkComboBox = new JComboBox();
     126            bookmarkComboBox = new JComboBox<>();
    128127            bookmarkComboBox.addActionListener(bookmarkActionListener);
    129128            gbcComboBox.gridy = 1;
     
    139138            selectionPanel.add(colorSchemeLabel);
    140139
    141             colorSchemeComboBox = new JComboBox();
     140            colorSchemeComboBox = new JComboBox<>();
    142141            for (String colorSchemeName : availableColorSchemes.keySet()) {
    143142                colorSchemeComboBox.addItem(colorSchemeName);
     
    285284
    286285        bookmarkComboBox.addActionListener(bookmarkActionListener);
    287 
    288286    }
    289 
    290287}
  • applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/plugin/dialogs/GraphViewPreferenceEditor.java

    r27863 r30532  
    5757    private JButton selectRulesetFolderButton;
    5858
    59     private JComboBox bookmarkComboBox;
     59    private JComboBox<String> bookmarkComboBox;
    6060    private JButton editBookmarkButton;
    6161    private JButton deleteBookmarkButton;
     
    174174        vehiclePanel.setLayout(new BoxLayout(vehiclePanel, BoxLayout.Y_AXIS));
    175175
    176         bookmarkComboBox = new JComboBox();
     176        bookmarkComboBox = new JComboBox<>();
    177177        vehiclePanel.add(bookmarkComboBox);
    178178
  • applications/editors/josm/plugins/imageryadjust/src/imageryadjust/ImageryAdjustMapMode.java

    r29609 r30532  
    165165
    166166        @Override
    167         public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected,
     167        public Component getListCellRendererComponent(JList<?> list, Object value, int index, boolean isSelected,
    168168                boolean cellHasFocus) {
    169169            Layer layer = (Layer) value;
     
    186186        if (adjustableLayers.size()==0) return null;
    187187        if (adjustableLayers.size()==1) return adjustableLayers.get(0);
    188         JComboBox layerList = new JComboBox();
     188        JComboBox<Layer> layerList = new JComboBox<>();
    189189        layerList.setRenderer(new LayerListCellRenderer());
    190         layerList.setModel(new DefaultComboBoxModel(adjustableLayers.toArray()));
     190        layerList.setModel(new DefaultComboBoxModel<Layer>(adjustableLayers.toArray(new Layer[0])));
    191191        layerList.setSelectedIndex(0);
    192192
  • applications/editors/josm/plugins/imagerycache/.settings/org.eclipse.jdt.core.prefs

    r30416 r30532  
    11eclipse.preferences.version=1
     2org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled
     3org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
     4org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
     5org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
     6org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
     7org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
    28org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
    39org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
    410org.eclipse.jdt.core.compiler.compliance=1.7
     11org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
    512org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
     13org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
     14org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
     15org.eclipse.jdt.core.compiler.problem.deadCode=warning
     16org.eclipse.jdt.core.compiler.problem.deprecation=warning
     17org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
     18org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
     19org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
     20org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
    621org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
     22org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
     23org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
     24org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
     25org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
     26org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
     27org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
     28org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
     29org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
     30org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
     31org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
     32org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
     33org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
     34org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
     35org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
     36org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
     37org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
     38org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
     39org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
     40org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
     41org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
     42org.eclipse.jdt.core.compiler.problem.missingSerialVersion=ignore
     43org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
     44org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
     45org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
     46org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
     47org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning
     48org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
     49org.eclipse.jdt.core.compiler.problem.nullReference=warning
     50org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
     51org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
     52org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
     53org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
     54org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
     55org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
     56org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore
     57org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
     58org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
     59org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
     60org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
     61org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
     62org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
     63org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
     64org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
     65org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
     66org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
     67org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
     68org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled
     69org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
     70org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
     71org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
     72org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
     73org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning
     74org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
     75org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
     76org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
     77org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore
     78org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
     79org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
     80org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
     81org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
     82org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
     83org.eclipse.jdt.core.compiler.problem.unusedImport=warning
     84org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
     85org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
     86org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=warning
     87org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
     88org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
     89org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
     90org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
     91org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
     92org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
     93org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
     94org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
    795org.eclipse.jdt.core.compiler.source=1.7
  • applications/editors/josm/plugins/imagerycache/src/org/mapdb/AsyncWriteEngine.java

    r29484 r30532  
    4949    protected Throwable writerFailedException = null;
    5050
    51 
    52     protected final LongConcurrentHashMap<Fun.Tuple2<Object,Serializer>> items = new LongConcurrentHashMap<Fun.Tuple2<Object, Serializer>>();
     51    protected final LongConcurrentHashMap<Fun.Tuple2<Object,Serializer<Object>>> items = new LongConcurrentHashMap<>();
    5352
    5453    protected final Thread newRecidsThread = new Thread("MapDB prealloc #"+threadNum){
     
    7372
    7473                for(;;){
    75                     LongMap.LongMapIterator<Fun.Tuple2<Object,Serializer>> iter = items.longMapIterator();
     74                    LongMap.LongMapIterator<Fun.Tuple2<Object,Serializer<Object>>> iter = items.longMapIterator();
    7675
    7776                    if(!iter.moveToNext()){
     
    8786                                    while(iter.moveToNext()){
    8887                                        long recid = iter.key();
    89                                         Fun.Tuple2<Object,Serializer> value = iter.value();
     88                                        Fun.Tuple2<Object,Serializer<Object>> value = iter.value();
    9089                                        if(value.a==DELETED){
    9190                                            AsyncWriteEngine.super.delete(recid, value.b);
     
    107106                        Utils.lock(writeLocks,recid);
    108107                        try{
    109                             Fun.Tuple2<Object,Serializer> value = iter.value();
     108                            Fun.Tuple2<Object,Serializer<Object>> value = iter.value();
    110109                            if(value.a==DELETED){
    111110                                AsyncWriteEngine.super.delete(recid, value.b);
     
    165164    }
    166165
     166    @SuppressWarnings("unchecked")
    167167    @Override
    168168    public <A> A get(long recid, Serializer<A> serializer) {
     
    172172            try{
    173173                checkState();
    174                 Fun.Tuple2<Object,Serializer> item = items.get(recid);
     174                Fun.Tuple2<Object,Serializer<Object>> item = items.get(recid);
    175175                if(item!=null){
    176176                    if(item.a == DELETED) return null;
     
    187187    }
    188188
     189    @SuppressWarnings({ "rawtypes", "unchecked" })
    189190    @Override
    190191    public <A> void update(long recid, A value, Serializer<A> serializer) {
     
    206207    }
    207208
     209    @SuppressWarnings({ "unchecked", "rawtypes" })
    208210    @Override
    209211    public <A> boolean compareAndSwap(long recid, A expectedOldValue, A newValue, Serializer<A> serializer) {
     
    212214        try{
    213215            checkState();
    214             Fun.Tuple2<Object, Serializer> existing = items.get(recid);
     216            Fun.Tuple2<Object, Serializer<Object>> existing = items.get(recid);
    215217            A oldValue = existing!=null? (A) existing.a : super.get(recid, serializer);
    216218            if(oldValue == expectedOldValue || (oldValue!=null && oldValue.equals(expectedOldValue))){
     
    226228    }
    227229
     230    @SuppressWarnings("unchecked")
    228231    @Override
    229232    public <A> void delete(long recid, Serializer<A> serializer) {
     
    245248            shutdownCondition.await();
    246249
    247 
    248250            super.close();
    249251        } catch (InterruptedException e) {
     
    251253        }
    252254    }
    253 
    254 
    255255
    256256    protected WeakReference<Engine> parentEngineWeakRef = null;
     
    302302        }
    303303    }
    304 
    305304}
  • applications/editors/josm/plugins/imagerycache/src/org/mapdb/BTreeKeySerializer.java

    r29484 r30532  
    1818    static final class BasicKeySerializer extends BTreeKeySerializer<Object> {
    1919
    20         protected final Serializer defaultSerializer;
     20        protected final Serializer<Object> defaultSerializer;
    2121
    22         BasicKeySerializer(Serializer defaultSerializer) {
     22        BasicKeySerializer(Serializer<Object> defaultSerializer) {
    2323            this.defaultSerializer = defaultSerializer;
    2424        }
  • applications/editors/josm/plugins/imagerycache/src/org/mapdb/BTreeMap.java

    r29484 r30532  
    275275    }
    276276
    277 
    278277    protected final Serializer<BNode> nodeSerializer = new Serializer<BNode>() {
    279278        @Override
     
    298297                    }
    299298                }
    300 
    301             }
    302 
     299            }
    303300
    304301            final boolean left = value.keys()[0] == null;
    305302            final boolean right = value.keys()[value.keys().length-1] == null;
    306 
    307303
    308304            final int header;
     
    334330            }
    335331
    336 
    337 
    338332            out.write(header);
    339333            out.write(value.keys().length);
     
    346340                    Utils.packLong(out, child);
    347341            }
    348 
    349 
    350342
    351343            keySerializer.serialize(out,left?1:0,
  • applications/editors/josm/plugins/imagerycache/src/org/mapdb/Bind.java

    r29363 r30532  
    44import java.util.Map;
    55import java.util.NavigableSet;
    6 import java.util.Set;
    76import java.util.concurrent.ConcurrentMap;
    87
     
    2120            public Iterator<K1> iterator() {
    2221                //use range query to get all values
     22                @SuppressWarnings("unchecked")
    2323                final Iterator<Fun.Tuple2<K2,K1>> iter =
    24                     ((NavigableSet)secondaryKeys) //cast is workaround for generics
     24                    secondaryKeys
    2525                        .subSet(
    26                                 Fun.t2(secondaryKey,null), //NULL represents lower bound, everything is larger than null
    27                                 Fun.t2(secondaryKey,Fun.HI) // HI is upper bound everything is smaller then HI
     26                                Fun.t2(secondaryKey,(K1)null), //NULL represents lower bound, everything is larger than null
     27                                Fun.t2(secondaryKey,(K1)Fun.HI) // HI is upper bound everything is smaller then HI
    2828                        ).iterator();
    2929
     
    5959    }
    6060
    61     public static void size(MapWithModificationListener map, final Atomic.Long size){
     61    public static <K,V> void size(MapWithModificationListener<K, V> map, final Atomic.Long size){
    6262        //set initial value first if necessary
    6363        if(size.get() == 0 && map.isEmpty())
    6464            size.set(map.size()); //TODO long overflow?
    6565
    66         map.addModificationListener(new MapListener() {
     66        map.addModificationListener(new MapListener<K, V>() {
    6767            @Override
    6868            public void update(Object key, Object oldVal, Object newVal) {
  • applications/editors/josm/plugins/imagerycache/src/org/mapdb/CacheLRU.java

    r29484 r30532  
    7878            Utils.lock(locks,recid);
    7979            Engine engine = getWrappedEngine();
    80             LongMap cache2 = checkClosed(cache);
     80            LongMap<Object> cache2 = checkClosed(cache);
    8181            Object oldValue = cache.get(recid);
    8282            if(oldValue == expectedOldValue || oldValue.equals(expectedOldValue)){
     
    9494        }
    9595    }
    96 
    9796
    9897    @SuppressWarnings("rawtypes")
  • applications/editors/josm/plugins/imagerycache/src/org/mapdb/EngineWrapper.java

    r29484 r30532  
    1414 *  limitations under the License.
    1515 */
    16 
    1716package org.mapdb;
    18 
    1917
    2018import java.io.IOError;
     
    2624import java.util.concurrent.ConcurrentLinkedQueue;
    2725
    28 
    2926/**
    3027 * EngineWrapper adapter. It implements all methods on Engine interface.
     
    293290    }
    294291
    295 
    296292    /**
    297293     * check if Record Instances were not modified while in cache.
    298294     * Usuful to diagnose strange problems with Instance Cache.
    299295     */
    300     public static class ImmutabilityCheckEngine extends EngineWrapper{
    301 
    302         protected static class Item {
    303             final Serializer serializer;
    304             final Object item;
     296    public static class ImmutabilityCheckEngine extends EngineWrapper {
     297
     298        protected static class Item<E> {
     299            final Serializer<E> serializer;
     300            final E item;
    305301            final int oldChecksum;
    306302
    307             public Item(Serializer serializer, Object item) {
     303            public Item(Serializer<E> serializer, E item) {
    308304                if(item==null || serializer==null) throw new AssertionError("null");
    309305                this.serializer = serializer;
     
    313309            }
    314310
    315             private int checksum(){
     311            private int checksum() {
    316312                try {
    317313                    DataOutput2 out = new DataOutput2();
     
    324320            }
    325321
    326             void check(){
     322            void check() {
    327323                int newChecksum = checksum();
    328324                if(oldChecksum!=newChecksum) throw new AssertionError("Record instance was modified: \n  "+item+"\n  "+serializer);
     
    330326        }
    331327
    332         protected LongConcurrentHashMap<Item> items = new LongConcurrentHashMap<Item>();
     328        protected LongConcurrentHashMap<Item<?>> items = new LongConcurrentHashMap<>();
    333329
    334330        protected ImmutabilityCheckEngine(Engine engine) {
     
    338334        @Override
    339335        public <A> A get(long recid, Serializer<A> serializer) {
    340             Item item = items.get(recid);
     336            Item<?> item = items.get(recid);
    341337            if(item!=null) item.check();
    342338            A ret = super.get(recid, serializer);
    343             if(ret!=null) items.put(recid, new Item(serializer,ret));
     339            if(ret!=null) items.put(recid, new Item<A>(serializer,ret));
    344340            return ret;
    345341        }
     
    348344        public <A> long put(A value, Serializer<A> serializer) {
    349345            long ret =  super.put(value, serializer);
    350             if(value!=null) items.put(ret, new Item(serializer,value));
     346            if(value!=null) items.put(ret, new Item<A>(serializer,value));
    351347            return ret;
    352348        }
     
    354350        @Override
    355351        public <A> void update(long recid, A value, Serializer<A> serializer) {
    356             Item item = items.get(recid);
     352            Item<?> item = items.get(recid);
    357353            if(item!=null) item.check();
    358354            super.update(recid, value, serializer);
    359             if(value!=null) items.put(recid, new Item(serializer,value));
    360         }
    361 
     355            if(value!=null) items.put(recid, new Item<A>(serializer,value));
     356        }
     357
     358        @SuppressWarnings({ "unchecked", "rawtypes" })
    362359        @Override
    363360        public <A> boolean compareAndSwap(long recid, A expectedOldValue, A newValue, Serializer<A> serializer) {
    364             Item item = items.get(recid);
     361            Item<?> item = items.get(recid);
    365362            if(item!=null) item.check();
    366363            boolean ret = super.compareAndSwap(recid, expectedOldValue, newValue, serializer);
     
    372369        public void close() {
    373370            super.close();
    374             for(Iterator<Item> iter = items.valuesIterator(); iter.hasNext();){
     371            for(Iterator<Item<?>> iter = items.valuesIterator(); iter.hasNext();){
    375372                iter.next().check();
    376373            }
     
    378375        }
    379376    }
    380    
    381377   
    382378    /** Engine wrapper with all methods synchronized on global lock, useful to diagnose concurrency issues.*/
     
    442438        }
    443439    }
    444 
    445440}
  • applications/editors/josm/plugins/imagerycache/src/org/mapdb/Queues.java

    r29484 r30532  
    4040            }
    4141
     42            @SuppressWarnings("unchecked")
    4243            @Override
    4344            public Node<E> deserialize(DataInput in, int available) throws IOException {
     
    7172        protected static final class Node<E>{
    7273
     74            @SuppressWarnings({ "unchecked", "rawtypes" })
    7375            protected static final Node EMPTY = new Node(0L, null);
    7476
     
    302304    }
    303305
     306    @SuppressWarnings("unchecked")
    304307    static <E> Stack<E> getStack(Engine engine, Serializer<Serializer> serializerSerializer, long rootRecid){
    305308        StackRoot root = engine.get(rootRecid, new StackRootSerializer(serializerSerializer));
     
    323326        }
    324327
     328        @SuppressWarnings("unchecked")
    325329        @Override
    326330        public boolean add(E item){
     
    337341        }
    338342
     343        @SuppressWarnings("unchecked")
    339344        @Override
    340345        public E poll(){
     
    416421    }
    417422
     423    @SuppressWarnings("unchecked")
    418424    static <E> long createQueue(Engine engine, Serializer<Serializer> serializerSerializer, Serializer<E> serializer){
    419425        long headerRecid = engine.put(0L, Serializer.LONG_SERIALIZER);
     
    426432    }
    427433
    428 
     434    @SuppressWarnings("unchecked")
    429435    static <E> Queue<E> getQueue(Engine engine, Serializer<Serializer> serializerSerializer, long rootRecid){
    430436        QueueRoot root = engine.get(rootRecid, new QueueRootSerializer(serializerSerializer));
     
    439445        protected final long size;
    440446
     447        @SuppressWarnings("unchecked")
    441448        public CircularQueue(Engine engine, Serializer serializer, long headRecid, long headInsertRecid, long size) {
    442449            super(engine, serializer, headRecid);
     
    445452        }
    446453
     454        @SuppressWarnings("unchecked")
    447455        @Override
    448456        public boolean add(Object o) {
     
    545553    }
    546554
     555    @SuppressWarnings({ "rawtypes", "unchecked" })
    547556    static <E> long createCircularQueue(Engine engine, Serializer<Serializer> serializerSerializer, Serializer<E> serializer, long size){
    548557        if(size<2) throw new IllegalArgumentException();
  • applications/editors/josm/plugins/imagerycache/src/org/mapdb/SerializerBase.java

    r29484 r30532  
    354354        /** classes bellow need object stack, so initialize it if not alredy initialized*/
    355355        if (objectStack == null) {
    356             objectStack = new FastArrayList();
     356            objectStack = new FastArrayList<>();
    357357            objectStack.add(obj);
    358358        }
     
    10651065
    10661066        if (objectStack == null)
    1067             objectStack = new FastArrayList();
     1067            objectStack = new FastArrayList<>();
    10681068        int oldObjectStackSize = objectStack.size();
    10691069
     
    11121112                break;
    11131113            case SERIALIZER_COMPRESSION_WRAPPER:
    1114                 ret = CompressLZF.CompressionWrapper((Serializer) deserialize(is, objectStack));
     1114                ret = CompressLZF.CompressionWrapper((Serializer<?>) deserialize(is, objectStack));
    11151115                break;
    11161116            default:
  • applications/editors/josm/plugins/imagerycache/src/org/mapdb/SerializerPojo.java

    r29363 r30532  
    542542    static{
    543543        try{
    544             Class clazz = Class.forName("sun.reflect.ReflectionFactory");
     544            Class<?> clazz = Class.forName("sun.reflect.ReflectionFactory");
    545545            if(clazz!=null){
    546546                Method getReflectionFactory = clazz.getMethod("getReflectionFactory");
     
    582582     *   If non of these works we fallback into usual reflection which requires an no-arg constructor
    583583     */
    584     @SuppressWarnings("restriction")
     584    @SuppressWarnings({ "restriction", "unchecked" })
    585585        protected <T> T createInstanceSkippinkConstructor(Class<T> clazz)
    586586            throws NoSuchMethodException, InvocationTargetException, IllegalAccessException, InstantiationException {
  • applications/editors/josm/plugins/imagerycache/src/org/mapdb/SnapshotEngine.java

    r29484 r30532  
    3636    protected final ReentrantReadWriteLock snapshotsLock = new ReentrantReadWriteLock();
    3737
     38    @SuppressWarnings("unchecked")
    3839    @Override
    3940    public <A> long put(A value, Serializer<A> serializer) {
     
    5051    }
    5152
     53    @SuppressWarnings("unchecked")
    5254    @Override
    5355    public <A> boolean compareAndSwap(long recid, A expectedOldValue, A newValue, Serializer<A> serializer) {
     
    6668    }
    6769
     70    @SuppressWarnings("unchecked")
    6871    @Override
    6972    public <A> void update(long recid, A value, Serializer<A> serializer) {
     
    8588    }
    8689
     90    @SuppressWarnings("unchecked")
    8791    @Override
    8892    public  <A> void delete(long recid, Serializer<A> serializer) {
     
    130134
    131135
     136        @SuppressWarnings("unchecked")
    132137        @Override
    133138        public <A> A get(long recid, Serializer<A> serializer) {
  • applications/editors/josm/plugins/imagerycache/src/org/mapdb/TxMaker.java

    r29363 r30532  
    1111public class TxMaker {
    1212
     13    @SuppressWarnings("unchecked")
    1314    protected static final Fun.Tuple2<Object, Serializer> DELETED = new Fun.Tuple2(null, Serializer.STRING_SERIALIZER);
    1415
     
    6263        protected Set<Long> newItems = new LinkedHashSet<Long>();
    6364
    64 
    6565        protected TxEngine(Engine engine) {
    6666            super(engine);
     
    7979        }
    8080
     81        @SuppressWarnings("unchecked")
    8182        @Override
    8283        public <A> A get(long recid, Serializer<A> serializer) {
     
    9394        }
    9495
     96        @SuppressWarnings({ "rawtypes", "unchecked" })
    9597        @Override
    9698        public <A> void update(long recid, A value, Serializer<A> serializer) {
     
    128130        }
    129131
     132        @SuppressWarnings({ "unchecked", "rawtypes" })
    130133        @Override
    131134        public void commit() {
     
    144147                engine.commit();
    145148            }
    146 
    147149        }
    148150
     
    163165                newItems = null;
    164166            }
    165 
    166167        }
    167168
     
    171172        }
    172173    }
    173 
    174 
    175174}
  • applications/editors/josm/plugins/junctionchecking/src/org/openstreetmap/josm/plugins/JunctionChecker/junctionchecking/JunctionChecker.java

    r25501 r30532  
    122122         */
    123123        private ArrayList<HashSet<Channel>> checkJunctionCandidates(ArrayList<HashSet<Channel>> junctioncandidates){
    124                 ArrayList<HashSet<Channel>> junctions = (ArrayList<HashSet<Channel>>) junctioncandidates.clone();
     124                @SuppressWarnings("unchecked")
     125        ArrayList<HashSet<Channel>> junctions = (ArrayList<HashSet<Channel>>) junctioncandidates.clone();
    125126                for (int i = 0; i < junctioncandidates.size(); i++) {
    126127                        for (int j = 0; j < junctioncandidates.size(); j++) {
  • applications/editors/josm/plugins/lakewalker/src/org/openstreetmap/josm/plugins/lakewalker/StringEnumConfigurer.java

    r23190 r30532  
    4444    protected String[] validValues;
    4545    protected String[] transValues;
    46     protected JComboBox box;
     46    protected JComboBox<String> box;
    4747    protected Box panel;
    4848    protected String tooltipText = "";
     
    6868            panel = Box.createHorizontalBox();
    6969            panel.add(new JLabel(name));
    70             box = new JComboBox(transValues);
     70            box = new JComboBox<>(transValues);
    7171            box.setToolTipText(tooltipText);
    7272            box.setMaximumSize(new Dimension(box.getMaximumSize().width,box.getPreferredSize().height));
  • applications/editors/josm/plugins/mapdust/.classpath

    r30416 r30532  
    44        <classpathentry including="conf/|images/" kind="src" path=""/>
    55        <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
    6         <classpathentry kind="lib" path="lib/gson-1.5.jar"/>
    76        <classpathentry combineaccessrules="false" kind="src" path="/JOSM"/>
     7        <classpathentry kind="lib" path="lib/gson-2.2.4.jar"/>
    88        <classpathentry kind="output" path="build/classes"/>
    99</classpath>
  • applications/editors/josm/plugins/mapdust/.settings/org.eclipse.jdt.core.prefs

    r30416 r30532  
    11eclipse.preferences.version=1
     2org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled
     3org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
     4org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
     5org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
     6org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
     7org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
    28org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
    39org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
     
    713org.eclipse.jdt.core.compiler.debug.localVariable=generate
    814org.eclipse.jdt.core.compiler.debug.sourceFile=generate
     15org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
    916org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
     17org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
     18org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
     19org.eclipse.jdt.core.compiler.problem.deadCode=warning
     20org.eclipse.jdt.core.compiler.problem.deprecation=warning
     21org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
     22org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
     23org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
     24org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
    1025org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
     26org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
     27org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
     28org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
     29org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
     30org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
     31org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
     32org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
     33org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
     34org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
     35org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
     36org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
     37org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
     38org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
     39org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
     40org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
     41org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
     42org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
     43org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
     44org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
     45org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
     46org.eclipse.jdt.core.compiler.problem.missingSerialVersion=ignore
     47org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
     48org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
     49org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
     50org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
     51org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning
     52org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
     53org.eclipse.jdt.core.compiler.problem.nullReference=warning
     54org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
     55org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
     56org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
     57org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
     58org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
     59org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
     60org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore
     61org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
     62org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
     63org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
     64org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
     65org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
     66org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
     67org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
     68org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
     69org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
     70org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
     71org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
     72org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled
     73org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
     74org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
     75org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
     76org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
     77org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning
     78org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
     79org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
     80org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
     81org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore
     82org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
     83org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
     84org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
     85org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
     86org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
     87org.eclipse.jdt.core.compiler.problem.unusedImport=warning
     88org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
     89org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
     90org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=warning
     91org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
     92org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
     93org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
     94org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
     95org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
     96org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
     97org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
     98org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
    1199org.eclipse.jdt.core.compiler.source=1.7
  • applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/MapdustActionUploaderException.java

    r25591 r30532  
    3636 */
    3737public class MapdustActionUploaderException extends Exception {
    38 
    39     /** Serial version UID */
    40     private static final long serialVersionUID = -6128820229665805478L;
    4138
    4239    /**
  • applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/adapter/DisplayMenu.java

    r25591 r30532  
    3131import java.awt.event.MouseAdapter;
    3232import java.awt.event.MouseEvent;
     33
    3334import javax.swing.JList;
    3435import javax.swing.JPopupMenu;
     36
     37import org.openstreetmap.josm.plugins.mapdust.service.value.MapdustBug;
    3538
    3639
     
    4851
    4952    /** The list of bugs */
    50     private JList listBugs;
     53    private JList<MapdustBug> listBugs;
    5154
    5255    /**
     
    6164     * @param menu The <code>JPopupMenu</code> object
    6265     */
    63     public DisplayMenu(JList listBugs, JPopupMenu menu) {
     66    public DisplayMenu(JList<MapdustBug> listBugs, JPopupMenu menu) {
    6467        this.listBugs = listBugs;
    6568        this.menu = menu;
  • applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/adapter/WindowClose.java

    r25591 r30532  
    4545 */
    4646public class WindowClose extends WindowAdapter {
    47 
    48     /** Serial version UID */
    4947
    5048    /** A <code>AbstractDialog</code> object */
  • applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/execute/ExecuteActionList.java

    r25591 r30532  
    5555public class ExecuteActionList extends MapdustExecuteAction implements
    5656        MapdustUpdateObservable {
    57 
    58     /** Serial version UID */
    59     private static final long serialVersionUID = -7487830542214611774L;
    6057
    6158    /** List of MapdustRefreshObserver objects */
  • applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/execute/ExecuteCloseBug.java

    r25828 r30532  
    6464public class ExecuteCloseBug extends MapdustExecuteAction implements
    6565        MapdustBugObservable, MapdustActionObservable {
    66 
    67     /** Serial version UID */
    68     private static final long serialVersionUID = 3468827127588061014L;
    6966
    7067    /** The list of Mapdust bug observers */
  • applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/execute/MapdustExecuteAction.java

    r25828 r30532  
    4444 */
    4545public abstract class MapdustExecuteAction extends AbstractAction {
    46 
    47     /** Serial version UID */
    48     private static final long serialVersionUID = 4318259806647818543L;
    4946
    5047    /** The abstract dialog object */
  • applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/dialog/CreateBugDialog.java

    r25828 r30532  
    2828package org.openstreetmap.josm.plugins.mapdust.gui.component.dialog;
    2929
    30 
    3130import java.awt.Color;
    3231import java.awt.Font;
     
    3433import java.awt.Point;
    3534import java.awt.Rectangle;
     35
    3636import javax.swing.JButton;
    3737import javax.swing.JComboBox;
     
    4141import javax.swing.JTextField;
    4242import javax.swing.WindowConstants;
     43
    4344import org.openstreetmap.josm.Main;
    4445import org.openstreetmap.josm.plugins.mapdust.MapdustPlugin;
     
    4950import org.openstreetmap.josm.plugins.mapdust.gui.component.renderer.ComboBoxRenderer;
    5051import org.openstreetmap.josm.plugins.mapdust.gui.component.util.ComponentUtil;
     52import org.openstreetmap.josm.plugins.mapdust.service.value.BugType;
    5153import org.openstreetmap.josm.tools.ImageProvider;
    52 
    5354
    5455/**
     
    7172
    7273    /** The combo-box for the bug types */
    73     private JComboBox cbbType;
     74    private JComboBox<BugType> cbbType;
    7475
    7576    /** The nickname label */
     
    248249     * @return the cbbType
    249250     */
    250     public JComboBox getCbbType() {
     251    public JComboBox<BugType> getCbbType() {
    251252        return cbbType;
    252253    }
  • applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/model/ActionListModel.java

    r25591 r30532  
    4040 * @version $Revision$
    4141 */
    42 public class ActionListModel extends AbstractListModel {
     42public class ActionListModel extends AbstractListModel<MapdustAction> {
    4343
    4444    /** The serial version UID */
     
    7373     */
    7474    @Override
    75     public Object getElementAt(int index) {
     75    public MapdustAction getElementAt(int index) {
    7676        if (index >= 0 && index < list.size()) {
    7777            return list.get(index);
     
    8989        return (list != null ? list.size() : 0);
    9090    }
    91 
    9291}
  • applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/model/BugsListModel.java

    r25591 r30532  
    2828package org.openstreetmap.josm.plugins.mapdust.gui.component.model;
    2929
    30 
    3130import java.util.List;
    3231import javax.swing.AbstractListModel;
    3332import org.openstreetmap.josm.plugins.mapdust.service.value.MapdustBug;
    34 
    3533
    3634/**
     
    4038 *
    4139 */
    42 public class BugsListModel extends AbstractListModel {
     40public class BugsListModel extends AbstractListModel<MapdustBug> {
    4341
    4442    /** The serial version UID */
     
    7169     */
    7270    @Override
    73     public Object getElementAt(int index) {
     71    public MapdustBug getElementAt(int index) {
    7472        if (index >= 0 && index < bugs.size()) {
    7573            return bugs.get(index);
     
    9492        this.fireContentsChanged(this, 0, bugs.size() - 1);
    9593    }
    96 
    9794}
  • applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/model/CommentListModel.java

    r25591 r30532  
    4040 *
    4141 */
    42 public class CommentListModel implements ListModel {
     42public class CommentListModel implements ListModel<MapdustComment> {
    4343
    4444    /** The list of <code>MapdustBug</code> objects */
     
    6868     */
    6969    @Override
    70     public Object getElementAt(int index) {
     70    public MapdustComment getElementAt(int index) {
    7171        if (index > 0 && index < comments.length) {
    7272            return comments[index];
  • applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/model/TypesListModel.java

    r27874 r30532  
    2828package org.openstreetmap.josm.plugins.mapdust.gui.component.model;
    2929
    30 
    3130import javax.swing.AbstractListModel;
    3231import javax.swing.ComboBoxModel;
    3332import org.openstreetmap.josm.plugins.mapdust.service.value.BugType;
    34 
    3533
    3634/**
     
    4038 * @version $Revision$
    4139 */
    42 public class TypesListModel extends AbstractListModel implements ComboBoxModel {
     40public class TypesListModel extends AbstractListModel<BugType> implements ComboBoxModel<BugType> {
    4341
    4442    /** The serial version UID */
     
    6563     */
    6664    @Override
    67     public Object getElementAt(int index) {
     65    public BugType getElementAt(int index) {
    6866        return types[index];
    6967    }
  • applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/panel/MapdustActionPanel.java

    r25591 r30532  
    2828package org.openstreetmap.josm.plugins.mapdust.gui.component.panel;
    2929
     30import static org.openstreetmap.josm.tools.I18n.tr;
    3031
    31 import static org.openstreetmap.josm.tools.I18n.tr;
    3232import java.awt.BorderLayout;
    3333import java.util.List;
     34
    3435import javax.swing.AbstractAction;
    3536import javax.swing.JList;
     
    3738import javax.swing.JScrollPane;
    3839import javax.swing.JToggleButton;
     40
    3941import org.openstreetmap.josm.plugins.mapdust.MapdustPlugin;
    4042import org.openstreetmap.josm.plugins.mapdust.gui.action.execute.ExecuteActionList;
     
    4244import org.openstreetmap.josm.plugins.mapdust.gui.component.util.ComponentUtil;
    4345import org.openstreetmap.josm.plugins.mapdust.gui.value.MapdustAction;
    44 
    4546
    4647/**
     
    5253public class MapdustActionPanel extends JPanel {
    5354
    54     /** The serial version UID */
    55     private static final long serialVersionUID = -6648507056357610823L;
    56 
    5755    /** The scroll pane */
    5856    private JScrollPane cmpActionList;
    5957
    6058    /** The JList containing the MapDust action objects */
    61     private JList actionJList;
     59    private JList<MapdustAction> actionJList;
    6260
    6361    /** The list of <code>MapdustAction</code> objects */
     
    113111        cmpActionList.getViewport().setView(actionJList);
    114112        cmpActionList.invalidate();
    115 
    116113    }
    117114
     
    133130        this.actionList = actionList;
    134131    }
    135 
    136132}
  • applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/panel/MapdustBugListPanel.java

    r25839 r30532  
    7979
    8080    /** The list of bugs */
    81     private JList mapdustBugsJList;
     81    private JList<MapdustBug> mapdustBugsJList;
    8282
    8383    /** The scroll pane for the <code>MapdustBug</code>s */
     
    163163            String text = " No bugs in the current view for the selected";
    164164            text += " filters!";
    165             JList textJList = new JList(new String[] { text });
     165            JList<String> textJList = new JList<>(new String[] { text });
    166166            textJList.setBorder(new LineBorder(Color.black, 1, false));
    167167            textJList.setCellRenderer(new BugListCellRenderer());
     
    192192            String text = " No bugs in the current view for the selected";
    193193            text += " filters!";
    194             JList textJList = new JList(new String[] { text });
     194            JList<String> textJList = new JList<>(new String[] { text });
    195195            textJList.setBorder(new LineBorder(Color.black, 1, false));
    196196            textJList.setCellRenderer(new BugListCellRenderer());
     
    198198        } else {
    199199            if (mapdustBugsJList == null) {
    200                 mapdustBugsJList = ComponentUtil.createJList(mapdustBugsList,
    201                         menu);
     200                mapdustBugsJList = ComponentUtil.createJList(mapdustBugsList, menu);
    202201                mapdustBugsJList.addListSelectionListener(this);
    203202                DisplayMenu adapter = new DisplayMenu(mapdustBugsJList, menu);
     
    349348     * @return the listBugs
    350349     */
    351     public JList getMapdustBugsJList() {
     350    public JList<MapdustBug> getMapdustBugsJList() {
    352351        return mapdustBugsJList;
    353352    }
  • applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/renderer/ActionListCellRenderer.java

    r25591 r30532  
    2828package org.openstreetmap.josm.plugins.mapdust.gui.component.renderer;
    2929
    30 
    3130import java.awt.Component;
    3231import java.awt.Font;
     
    3938import org.openstreetmap.josm.tools.ImageProvider;
    4039
    41 
    4240/**
    4341 * Cell renderer for the <code>MapdustAction</code> objects.
     
    4745 */
    4846public class ActionListCellRenderer extends DefaultListCellRenderer {
    49 
    50     /** The serial version UID */
    51     private static final long serialVersionUID = 7552949107018269769L;
    5247
    5348    /**
     
    6156     */
    6257    @Override
    63     public Component getListCellRendererComponent(JList list, Object value,
     58    public Component getListCellRendererComponent(JList<?> list, Object value,
    6459            int index, boolean isSelected, boolean hasFocus) {
    6560        JLabel label = (JLabel) super.getListCellRendererComponent(list, value,
  • applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/renderer/BugListCellRenderer.java

    r25591 r30532  
    6161     */
    6262    @Override
    63     public Component getListCellRendererComponent(JList list, Object value,
     63    public Component getListCellRendererComponent(JList<?> list, Object value,
    6464            int index, boolean isSelected, boolean hasFocus) {
    6565        JLabel label =(JLabel) super.getListCellRendererComponent(list, value,
  • applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/renderer/ComboBoxRenderer.java

    r27874 r30532  
    2828package org.openstreetmap.josm.plugins.mapdust.gui.component.renderer;
    2929
    30 
    3130import java.awt.Component;
    3231import java.awt.Font;
     
    3938import org.openstreetmap.josm.tools.ImageProvider;
    4039
    41 
    4240/**
    4341 * Cell renderer for the <code>MapdustBug</code> types.
     
    4543 * @author Bea
    4644 */
    47 public class ComboBoxRenderer implements ListCellRenderer {
     45public class ComboBoxRenderer implements ListCellRenderer<BugType> {
    4846
    4947    /** The default renderer */
     
    6159     */
    6260    @Override
    63     public Component getListCellRendererComponent(JList list, Object value,
     61    public Component getListCellRendererComponent(JList<? extends BugType> list, BugType type,
    6462            int index, boolean isSelected, boolean cellHasFocus) {
    6563        JLabel label = (JLabel) defaultRenderer.getListCellRendererComponent(
    66                 list, value, index, isSelected, cellHasFocus);
    67         if (value instanceof BugType) {
    68             BugType type = (BugType) value;
    69             String iconPath = "bugs/normal/open_" + type.getKey() + ".png";
    70             String text = type.getValue();
    71             ImageIcon icon = ImageProvider.get(iconPath);
    72             label.setIcon(icon);
    73             label.setText(text);
    74             label.setFont( new Font("Times New Roman", Font.BOLD, 12));
    75         }
     64                list, type, index, isSelected, cellHasFocus);
     65        String iconPath = "bugs/normal/open_" + type.getKey() + ".png";
     66        String text = type.getValue();
     67        ImageIcon icon = ImageProvider.get(iconPath);
     68        label.setIcon(icon);
     69        label.setText(text);
     70        label.setFont( new Font("Times New Roman", Font.BOLD, 12));
    7671        return label;
    7772    }
    78 
    7973}
  • applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/util/ComponentUtil.java

    r25828 r30532  
    3030
    3131import static org.openstreetmap.josm.tools.I18n.tr;
     32
    3233import java.awt.Color;
    3334import java.awt.Component;
     
    3536import java.awt.Rectangle;
    3637import java.util.List;
     38
    3739import javax.swing.AbstractAction;
    3840import javax.swing.Action;
     
    5254import javax.swing.SwingConstants;
    5355import javax.swing.border.LineBorder;
     56
    5457import org.openstreetmap.josm.plugins.mapdust.gui.component.model.ActionListModel;
    5558import org.openstreetmap.josm.plugins.mapdust.gui.component.model.BugsListModel;
     
    5861import org.openstreetmap.josm.plugins.mapdust.gui.component.renderer.BugListCellRenderer;
    5962import org.openstreetmap.josm.plugins.mapdust.gui.value.MapdustAction;
     63import org.openstreetmap.josm.plugins.mapdust.service.value.BugType;
    6064import org.openstreetmap.josm.plugins.mapdust.service.value.MapdustBug;
    6165import org.openstreetmap.josm.tools.ImageProvider;
     
    211215     * @return A <code>JScrollPane</code> object
    212216     */
    213     public static JScrollPane createJScrollPane(JList list) {
     217    public static JScrollPane createJScrollPane(JList<?> list) {
    214218        JScrollPane jScrollPane = new JScrollPane();
    215219        jScrollPane.setViewportView(list);
     
    224228     * @return A <code>JList</code> object
    225229     */
    226     public static JList createJList(List<MapdustAction> list) {
    227         final JList jList = new JList(new ActionListModel(list));
     230    public static JList<MapdustAction> createJList(List<MapdustAction> list) {
     231        final JList<MapdustAction> jList = new JList<>(new ActionListModel(list));
    228232        jList.setBorder(new LineBorder(Color.black, 1, false));
    229233        jList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
     
    240244     * @return A <code>JList</code>
    241245     */
    242     public static JList createJList(List<MapdustBug> bugsList,
    243             final JPopupMenu menu) {
    244         final JList jList = new JList(new BugsListModel(bugsList));
     246    public static JList<MapdustBug> createJList(List<MapdustBug> bugsList, final JPopupMenu menu) {
     247        final JList<MapdustBug> jList = new JList<>(new BugsListModel(bugsList));
    245248        jList.setBorder(new LineBorder(Color.black, 1, false));
    246249        jList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
     
    296299     * @return A <code>JComboBox</code> object
    297300     */
    298     public static JComboBox createJComboBox(Rectangle bounds,
    299             ListCellRenderer renderer, Color backgroundColor) {
    300         JComboBox jComboBox = new JComboBox(new TypesListModel());
     301    public static JComboBox<BugType> createJComboBox(Rectangle bounds,
     302            ListCellRenderer<BugType> renderer, Color backgroundColor) {
     303        JComboBox<BugType> jComboBox = new JComboBox<>(new TypesListModel());
    301304        jComboBox.setSelectedIndex(0);
    302305        jComboBox.setBackground(backgroundColor);
  • applications/editors/josm/plugins/measurement/src/org/openstreetmap/josm/plugins/measurement/MeasurementLayer.java

    r30353 r30532  
    4141import org.openstreetmap.josm.tools.ImageProvider;
    4242
    43 
    4443/**
    4544 * This is a layer that draws a grid
     
    206205    }
    207206
    208 
    209207    private class GPXLayerImportAction extends AbstractAction {
    210208
     
    212210     * The data model for the list component.
    213211     */
    214     private DefaultListModel model = new DefaultListModel();
     212    private DefaultListModel<GpxLayer> model = new DefaultListModel<>();
    215213
    216214    /**
     
    224222    public void actionPerformed(ActionEvent e) {
    225223        Box panel = Box.createVerticalBox();
    226         final JList layerList = new JList(model);
     224        final JList<GpxLayer> layerList = new JList<>(model);
    227225        Collection<Layer> data = Main.map.mapView.getAllLayers();
    228226        Layer lastLayer = null;
     
    231229        for (Layer l : data){
    232230                if(l instanceof GpxLayer){
    233                     model.addElement(l);
     231                    model.addElement((GpxLayer) l);
    234232                    lastLayer = l;
    235233                    layerCnt++;
     
    242240
    243241                layerList.setCellRenderer(new DefaultListCellRenderer(){
    244                         @Override public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
     242                        @Override public Component getListCellRendererComponent(JList<?> list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
    245243                            Layer layer = (Layer)value;
    246244                            JLabel label = (JLabel)super.getListCellRendererComponent(list,
     
    293291        }
    294292    }
    295 
    296293}
  • applications/editors/josm/plugins/merge-overlap/src/mergeoverlap/MyCombinePrimitiveResolverDialog.java

    r30034 r30532  
    953953            getActionMap().put("selectPreviousColumnCell", selectPreviousColumnCellAction);
    954954
    955             setRowHeight((int)new JComboBox().getPreferredSize().getHeight());
     955            setRowHeight((int)new JComboBox<Object>().getPreferredSize().getHeight());
    956956        }
    957957
     
    13761376            ((MultiValueCellEditor)getColumnModel().getColumn(2).getCellEditor()).addNavigationListeners(this);
    13771377
    1378             setRowHeight((int)new JComboBox().getPreferredSize().getHeight());
     1378            setRowHeight((int)new JComboBox<Object>().getPreferredSize().getHeight());
    13791379        }
    13801380
  • applications/editors/josm/plugins/mirrored_download/src/mirrored_download/MirroredDownloadAction.java

    r30162 r30532  
    117117    static class MirroredDownloadDialog extends DownloadDialog {
    118118
    119         protected JComboBox/*<String>*/ overpassType;
     119        protected JComboBox<String> overpassType;
    120120        protected HistoryComboBox overpassQuery;
    121121        private static MirroredDownloadDialog instance;
     
    137137        @Override
    138138        protected void buildMainPanelAboveDownloadSelections(JPanel pnl) {
    139             overpassType = new JComboBox/*<String>*/(new String[]{"*", "node", "way", "relation"});
     139            overpassType = new JComboBox<>(new String[]{"*", "node", "way", "relation"});
    140140            pnl.add(new JLabel(tr("Object type: ")), GBC.std().insets(5, 5, 5, 5));
    141141            pnl.add(overpassType, GBC.eol().fill(GridBagConstraints.HORIZONTAL));
  • applications/editors/josm/plugins/mirrored_download/src/mirrored_download/UrlSelectionDialog.java

    r30495 r30532  
    3131  private JDialog jDialog = null;
    3232  private JTabbedPane tabbedPane = null;
    33   private JComboBox cbSelectUrl = null;
     33  private JComboBox<String> cbSelectUrl = null;
    3434  private JCheckBox cbAddMeta = null;
    3535
     
    6060    contentPane.add(label);
    6161
    62     cbSelectUrl = new JComboBox();
     62    cbSelectUrl = new JComboBox<>();
    6363    cbSelectUrl.setEditable(true);
    6464
  • applications/editors/josm/plugins/namemanager/src/org/openstreetmap/josm/plugins/namemanager/dialog/NameManagerDialog.java

    r25594 r30532  
    7777    private List<Way> waysInsideSelectedArea;
    7878    private JTabbedPane tabPanel;
    79     private JComboBox country;
     79    private JComboBox<String> country;
    8080    private JLabel labelLevel1;
    8181    private JTextField level1;
     
    138138        buildings.setSelected(false);
    139139        JLabel labelCountry = new JLabel("  " + tr(COUNTRY));
    140         country = new JComboBox();
     140        country = new JComboBox<>();
    141141        labelLevel1 = new JLabel("  level1");
    142142        level1 = new JTextField();
  • applications/editors/josm/plugins/nearclick/.project

    r29853 r30532  
    1111                        </arguments>
    1212                </buildCommand>
    13                 <buildCommand>
    14                         <name>org.eclipse.pde.ManifestBuilder</name>
    15                         <arguments>
    16                         </arguments>
    17                 </buildCommand>
    18                 <buildCommand>
    19                         <name>org.eclipse.pde.SchemaBuilder</name>
    20                         <arguments>
    21                         </arguments>
    22                 </buildCommand>
    2313        </buildSpec>
    2414        <natures>
    2515                <nature>org.eclipse.jdt.core.javanature</nature>
    26                 <nature>org.eclipse.pde.PluginNature</nature>
    2716        </natures>
    2817</projectDescription>
  • applications/editors/josm/plugins/opendata/.settings/org.eclipse.jdt.core.prefs

    r30416 r30532  
    11eclipse.preferences.version=1
     2org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled
     3org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
     4org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
     5org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
     6org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
     7org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
    28org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
    39org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
     
    1824org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
    1925org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
     26org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
    2027org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
    2128org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
     
    3138org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
    3239org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
     40org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
    3341org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
     42org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
    3443org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
    3544org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
     
    4049org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
    4150org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
     51org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning
     52org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
    4253org.eclipse.jdt.core.compiler.problem.nullReference=warning
     54org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
     55org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
    4356org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
    4457org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
    4558org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
    4659org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
    47 org.eclipse.jdt.core.compiler.problem.rawTypeReference=ignore
     60org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore
     61org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
     62org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
    4863org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
    49 org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
     64org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=warning
    5065org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning
    5166org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
     
    5570org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
    5671org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
     72org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled
    5773org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
    5874org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
    5975org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
    60 org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=ignore
     76org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
     77org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning
    6178org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
    6279org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
     
    7794org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
    7895org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
     96org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
    7997org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
    8098org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
  • applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/datasets/WayCombiner.java

    r30340 r30532  
    5656
    5757        // remove duplicates, preserving order
    58         ways = new LinkedHashSet<Way>(ways);
     58        ways = new LinkedHashSet<>(ways);
    5959
    6060        // try to build a new way which includes all the combined
     
    7171        TagCollection wayTags = TagCollection.unionOfAllPrimitives(ways);
    7272
    73         List<Way> reversedWays = new LinkedList<Way>();
    74         List<Way> unreversedWays = new LinkedList<Way>();
     73        List<Way> reversedWays = new LinkedList<>();
     74        List<Way> unreversedWays = new LinkedList<>();
    7575        for (Way w: ways) {
    7676            if ((path.indexOf(w.getNode(0)) + 1) == path.lastIndexOf(w.getNode(1))) {
     
    9999            // if there are still reversed ways with direction-dependent tags, reverse their tags
    100100            if (!reversedWays.isEmpty()) {
    101                 List<Way> unreversedTagWays = new ArrayList<Way>(ways);
     101                List<Way> unreversedTagWays = new ArrayList<>(ways);
    102102                unreversedTagWays.removeAll(reversedWays);
    103103                ReverseWayTagCorrector reverseWayTagCorrector = new ReverseWayTagCorrector();
    104                 List<Way> reversedTagWays = new ArrayList<Way>();
     104                List<Way> reversedTagWays = new ArrayList<>();
    105105                Collection<Command> changePropertyCommands =  null;
    106106                for (Way w : reversedWays) {
     
    149149        }
    150150
    151         LinkedList<Way> deletedWays = new LinkedList<Way>(ways);
     151        LinkedList<Way> deletedWays = new LinkedList<>(ways);
    152152        deletedWays.remove(targetWay);
    153153
  • applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/gui/ModulePreference.java

    r30340 r30532  
    219219            return false;
    220220        if (model.isActiveModulesChanged()) {
    221             LinkedList<String> l = new LinkedList<String>(model.getSelectedModuleNames());
     221            LinkedList<String> l = new LinkedList<>(model.getSelectedModuleNames());
    222222            Collections.sort(l);
    223223            Main.pref.putCollection(PREF_MODULES, l);
     
    446446    static private class ModuleConfigurationSitesPanel extends JPanel {
    447447
    448         private DefaultListModel model;
     448        private DefaultListModel<String> model;
    449449
    450450        protected void build() {
    451451            setLayout(new GridBagLayout());
    452452            add(new JLabel(tr("Add Open Data Module description URL.")), GBC.eol());
    453             model = new DefaultListModel();
     453            model = new DefaultListModel<>();
    454454            for (String s : OdPreferenceSetting.getModuleSites()) {
    455455                model.addElement(s);
    456456            }
    457             final JList list = new JList(model);
     457            final JList<String> list = new JList<>(model);
    458458            add(new JScrollPane(list), GBC.std().fill());
    459459            JPanel buttons = new JPanel(new GridBagLayout());
     
    519519        public List<String> getUpdateSites() {
    520520            if (model.getSize() == 0) return Collections.emptyList();
    521             List<String> ret = new ArrayList<String>(model.getSize());
     521            List<String> ret = new ArrayList<>(model.getSize());
    522522            for (int i=0; i< model.getSize();i++){
    523                 ret.add((String)model.get(i));
     523                ret.add(model.get(i));
    524524            }
    525525            return ret;
  • applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/gui/ModulePreferencesModel.java

    r30340 r30532  
    2020import org.openstreetmap.josm.plugins.opendata.core.modules.ModuleInformation;
    2121
    22 /**
    23  * TODO
    24  *
    25  */
    2622public class ModulePreferencesModel extends Observable implements OdConstants {
    27     private final ArrayList<ModuleInformation> availableModules = new ArrayList<ModuleInformation>();
    28     private final ArrayList<ModuleInformation> displayedModules = new ArrayList<ModuleInformation>();
    29     private final HashMap<ModuleInformation, Boolean> selectedModulesMap = new HashMap<ModuleInformation, Boolean>();
    30     private Set<String> pendingDownloads = new HashSet<String>();
     23    private final ArrayList<ModuleInformation> availableModules = new ArrayList<>();
     24    private final ArrayList<ModuleInformation> displayedModules = new ArrayList<>();
     25    private final HashMap<ModuleInformation, Boolean> selectedModulesMap = new HashMap<>();
     26    private Set<String> pendingDownloads = new HashSet<>();
    3127    private String filterExpression;
    3228    private final Set<String> currentActiveModules;
     
    3733   
    3834    public ModulePreferencesModel() {
    39         currentActiveModules = new HashSet<String>();
     35        currentActiveModules = new HashSet<>();
    4036        currentActiveModules.addAll(getModules(currentActiveModules));
    4137    }
     
    6662        sort();
    6763        filterDisplayedModules(filterExpression);
    68         Set<String> activeModules = new HashSet<String>();
     64        Set<String> activeModules = new HashSet<>();
    6965        activeModules.addAll(getModules(activeModules));
    7066        for (ModuleInformation pi: availableModules) {
     
    10197        sort();
    10298        filterDisplayedModules(filterExpression);
    103         Set<String> activeModules = new HashSet<String>();
     99        Set<String> activeModules = new HashSet<>();
    104100        activeModules.addAll(getModules(activeModules));
    105101        for (ModuleInformation pi: availableModules) {
     
    120116     */
    121117    public List<ModuleInformation> getSelectedModules() {
    122         List<ModuleInformation> ret = new LinkedList<ModuleInformation>();
     118        List<ModuleInformation> ret = new LinkedList<>();
    123119        for (ModuleInformation pi: availableModules) {
    124120            if (selectedModulesMap.get(pi) == null) {
     
    138134     */
    139135    public Set<String> getSelectedModuleNames() {
    140         Set<String> ret = new HashSet<String>();
     136        Set<String> ret = new HashSet<>();
    141137        for (ModuleInformation pi: getSelectedModules()) {
    142138            ret.add(pi.name);
     
    177173     */
    178174    public List<ModuleInformation> getModulesScheduledForUpdateOrDownload() {
    179         List<ModuleInformation> ret = new ArrayList<ModuleInformation>();
     175        List<ModuleInformation> ret = new ArrayList<>();
    180176        for (String module: pendingDownloads) {
    181177            ModuleInformation pi = getModuleInformation(module);
  • applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/NeptuneReader.java

    r30340 r30532  
    7676        public static final String OSM_FERRY = "ferry";
    7777
    78         private static final List<URL> schemas = new ArrayList<URL>();
     78        private static final List<URL> schemas = new ArrayList<>();
    7979        static {
    8080                schemas.add(NeptuneReader.class.getResource(NEPTUNE_XSD));
     
    8383        private ChouettePTNetworkType root;
    8484       
    85         private final Map<String, OsmPrimitive> tridentObjects = new HashMap<String, OsmPrimitive>();
     85        private final Map<String, OsmPrimitive> tridentObjects = new HashMap<>();
    8686       
    8787        public static final boolean acceptsXmlNeptuneFile(File file) {
     
    133133                JAXBContext jc = JAXBContext.newInstance(packageName, NeptuneReader.class.getClassLoader());
    134134                Unmarshaller u = jc.createUnmarshaller();
    135                 JAXBElement<T> doc = (JAXBElement<T>)u.unmarshal(inputStream);
     135                @SuppressWarnings("unchecked")
     136        JAXBElement<T> doc = (JAXBElement<T>)u.unmarshal(inputStream);
    136137                return doc.getValue();
    137138        }
  • applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/NetworkReader.java

    r30340 r30532  
    4545     * File readers
    4646     */
    47     public static final Map<String, Class<? extends AbstractReader>> FILE_READERS = new HashMap<String, Class<? extends AbstractReader>>();
     47    public static final Map<String, Class<? extends AbstractReader>> FILE_READERS = new HashMap<>();
    4848    static {
    4949        FILE_READERS.put(CSV_EXT, CsvReader.class);
     
    5858    }
    5959   
    60     public static final Map<String, Class<? extends AbstractReader>> FILE_AND_ARCHIVE_READERS = new HashMap<String, Class<? extends AbstractReader>>(FILE_READERS);
     60    public static final Map<String, Class<? extends AbstractReader>> FILE_AND_ARCHIVE_READERS = new HashMap<>(FILE_READERS);
    6161    static {
    6262        FILE_AND_ARCHIVE_READERS.put(ZIP_EXT, ZipReader.class);
  • applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/ProjectionChooser.java

    r30340 r30532  
    1818import org.openstreetmap.josm.tools.GBC;
    1919
    20 @SuppressWarnings("serial")
    2120public class ProjectionChooser extends ExtendedDialog {
    2221
     
    2928     * Combobox with all projections available
    3029     */
    31     private final JComboBox projectionCombo = new JComboBox(ProjectionPreference.getProjectionChoices().toArray());
     30    private final JComboBox<ProjectionChoice> projectionCombo = new JComboBox<>(
     31            ProjectionPreference.getProjectionChoices().toArray(new ProjectionChoice[0]));
    3232
    3333        public ProjectionChooser(Component parent) {
  • applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/archive/ArchiveReader.java

    r30340 r30532  
    5959       
    6060        final File temp = OdUtils.createTempDir();
    61         final List<File> candidates = new ArrayList<File>();
     61        final List<File> candidates = new ArrayList<>();
    6262       
    6363        try {
     
    7070           
    7171            if (promptUser && candidates.size() > 1) {
    72                 DialogPrompter<CandidateChooser> prompt = new DialogPrompter() {
     72                DialogPrompter<CandidateChooser> prompt = new DialogPrompter<CandidateChooser>() {
    7373                    @Override
    7474                    protected CandidateChooser buildDialog() {
  • applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/archive/CandidateChooser.java

    r30340 r30532  
    2727    private final JPanel projPanel = new JPanel(new GridBagLayout());
    2828
    29     //private final Map<JCheckBox, File> checkBoxes = new HashMap<JCheckBox, File>();
    30     private final JComboBox fileCombo;
     29    private final JComboBox<File> fileCombo;
    3130
    3231        public CandidateChooser(Component parent, List<File> candidates) {
     
    3736
    3837                @Override
    39                 public Component getListCellRendererComponent(JList list, Object value,
     38                public Component getListCellRendererComponent(JList<?> list, Object value,
    4039                                int index, boolean isSelected, boolean cellHasFocus) {
    4140                        super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
     
    4948        protected CandidateChooser(Component parent, String title, String[] buttonTexts, List<File> candidates) {
    5049                super(parent, title, buttonTexts);
    51                 this.fileCombo = new JComboBox(candidates.toArray());
     50                this.fileCombo = new JComboBox<>(candidates.toArray(new File[0]));
    5251                this.fileCombo.setRenderer(new Renderer());
    5352                addGui(candidates);
  • applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/geographic/AbstractMapInfoReader.java

    r30340 r30532  
    7575       
    7676        protected void parseColumns(String[] words) {
    77                 columns = new ArrayList<String>();
     77                columns = new ArrayList<>();
    7878                numcolumns = Integer.parseInt(words[1]);
    7979        }
  • applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/geographic/DefaultShpHandler.java

    r30340 r30532  
    3838
    3939        private static final List<Pair<org.opengis.referencing.datum.Ellipsoid, Ellipsoid>>
    40                 ellipsoids = new ArrayList<Pair<org.opengis.referencing.datum.Ellipsoid, Ellipsoid>>();
     40                ellipsoids = new ArrayList<>();
    4141        static {
    4242                ellipsoids.add(new Pair<org.opengis.referencing.datum.Ellipsoid, Ellipsoid>(DefaultEllipsoid.GRS80, Ellipsoid.GRS80));
     
    4444        }
    4545       
    46         protected static final Double get(ParameterValueGroup values, ParameterDescriptor desc) {
     46        protected static final Double get(ParameterValueGroup values, ParameterDescriptor<?> desc) {
    4747                return (Double) values.parameter(desc.getName().getCode()).getValue();
    4848        }
     
    6464                        return CRS.findMathTransform(getCrsFor(sourceCRS.getName().getCode()), targetCRS, lenient);
    6565                } else if (sourceCRS instanceof AbstractDerivedCRS && sourceCRS.getName().getCode().equalsIgnoreCase("Lambert_Conformal_Conic")) {
    66                         List<MathTransform> result = new ArrayList<MathTransform>();
     66                        List<MathTransform> result = new ArrayList<>();
    6767                        AbstractDerivedCRS crs = (AbstractDerivedCRS) sourceCRS;
    6868                        MathTransform transform = crs.getConversionFromBase().getMathTransform();
  • applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/geographic/GeographicReader.java

    r30340 r30532  
    7272
    7373        public GeographicReader(GeographicHandler handler, GeographicHandler[] defaultHandlers) {
    74                 this.nodes = new HashMap<LatLon, Node>();
     74                this.nodes = new HashMap<>();
    7575                this.handler = handler;
    7676                this.defaultHandlers = defaultHandlers;
     
    256256                       
    257257                        if (findSimiliarCrs) {
    258                                 List<CoordinateReferenceSystem> candidates = new ArrayList<CoordinateReferenceSystem>();
     258                                List<CoordinateReferenceSystem> candidates = new ArrayList<>();
    259259                               
    260260                                // Find matching CRS with Bursa Wolf parameters in EPSG database
  • applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/geographic/GmlReader.java

    r30340 r30532  
    144144       
    145145        private void parseFeatureMember(Component parent) throws XMLStreamException, GeoCrsException, FactoryException, UserCancelException, GeoMathTransformException, MismatchedDimensionException, TransformException {
    146                 List<OsmPrimitive> list = new ArrayList<OsmPrimitive>();
     146                List<OsmPrimitive> list = new ArrayList<>();
    147147                Way way = null;
    148148                Node node = null;
    149                 Map<String, String> tags = new HashMap<String, String>();
     149                Map<String, String> tags = new HashMap<>();
    150150                while (parser.hasNext()) {
    151151            int event = parser.next();
  • applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/geographic/KmlReader.java

    r30340 r30532  
    4545
    4646    private XMLStreamReader parser;
    47     private Map<LatLon, Node> nodes = new HashMap<LatLon, Node>();
     47    private Map<LatLon, Node> nodes = new HashMap<>();
    4848   
    4949    public KmlReader(XMLStreamReader parser) {
  • applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/geographic/ShpReader.java

    r30508 r30532  
    99import java.io.IOException;
    1010import java.io.InputStream;
     11import java.io.Serializable;
    1112import java.nio.charset.Charset;
    1213import java.nio.charset.IllegalCharsetNameException;
     
    5657
    5758        private final ShpHandler handler;
    58         private final Set<OsmPrimitive> featurePrimitives = new HashSet<OsmPrimitive>();
     59        private final Set<OsmPrimitive> featurePrimitives = new HashSet<>();
    5960       
    6061        public ShpReader(ShpHandler handler) {
     
    174175                try {
    175176                        if (file != null) {
    176                         Map params = new HashMap();
     177                        Map<String, Serializable> params = new HashMap<>();
    177178                        Charset charset = null;
    178179                        params.put(ShapefileDataStoreFactory.URLP.key, file.toURI().toURL());
     
    194195                        if (charset != null) {
    195196                            Main.info("Using charset "+charset);
    196                             params.put(ShapefileDataStoreFactory.DBFCHARSET.key, charset);
     197                            params.put(ShapefileDataStoreFactory.DBFCHARSET.key, charset.name());
    197198                        }
    198                                 DataStore dataStore = new ShapefileDataStoreFactory().createDataStore(params);//FIXME
     199                                DataStore dataStore = new ShapefileDataStoreFactory().createDataStore(params);
    199200                                if (dataStore == null) {
    200201                                        throw new IOException(tr("Unable to find a data store for file {0}", file.getName()));
  • applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/tabular/OdsReader.java

    r30340 r30532  
    6565                        }
    6666
    67                         List<String> result = new ArrayList<String>();
     67                        List<String> result = new ArrayList<>();
    6868                        boolean allFieldsBlank = true;
    6969                        for (TableTableCell cell : row.getAllCells()) {
  • applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/tabular/SpreadSheetReader.java

    r30340 r30532  
    9797                System.out.println("Header: "+Arrays.toString(header));
    9898               
    99                 Map<ProjectionPatterns, List<CoordinateColumns>> projColumns = new HashMap<ProjectionPatterns, List<CoordinateColumns>>();
     99                Map<ProjectionPatterns, List<CoordinateColumns>> projColumns = new HashMap<>();
    100100               
    101101                for (int i = 0; i<header.length; i++) {
     
    103103                            List<CoordinateColumns> columns = projColumns.get(pp);
    104104                            if (columns == null) {
    105                                 projColumns.put(pp, columns = new ArrayList<CoordinateColumns>());
     105                                projColumns.put(pp, columns = new ArrayList<>());
    106106                            }
    107107                                CoordinateColumns col = columns.isEmpty() ? null : columns.get(columns.size()-1);
     
    116116                }
    117117
    118                 final List<CoordinateColumns> columns = new ArrayList<CoordinateColumns>();
     118                final List<CoordinateColumns> columns = new ArrayList<>();
    119119               
    120120                for (ProjectionPatterns pp : projColumns.keySet()) {
     
    180180                        }
    181181                       
    182             final Map<CoordinateColumns, EastNorth> ens = new HashMap<CoordinateColumns, EastNorth>();
    183                         final Map<CoordinateColumns, Node> nodes = new HashMap<CoordinateColumns, Node>();
     182            final Map<CoordinateColumns, EastNorth> ens = new HashMap<>();
     183                        final Map<CoordinateColumns, Node> nodes = new HashMap<>();
    184184                        for (CoordinateColumns c : columns) {
    185185                            nodes.put(c, new Node());
  • applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/tabular/XlsReader.java

    r30340 r30532  
    5656                        Row row = sheet.getRow(rowIndex++);
    5757                        if (row != null) {
    58                                 List<String> result = new ArrayList<String>();
     58                                List<String> result = new ArrayList<>();
    5959                                for (Cell cell : row) {
    6060                            switch (cell.getCellType()) {
  • applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/layers/OdDataLayer.java

    r30340 r30532  
    124124        @Override
    125125        public Action[] getMenuEntries() {
    126                 List<Action> result = new ArrayList<Action>();
     126                List<Action> result = new ArrayList<>();
    127127                for (Action entry : super.getMenuEntries()) {
    128128                        result.add(entry);
  • applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/layers/OdDiffLayer.java

    r30340 r30532  
    3131                super(name);
    3232                this.dataLayer = dataLayer;
    33                 this.differentPrimitives = new ArrayList<Pair<OsmPrimitive,OsmPrimitive>>();
    34                 this.onlyInTlsPrimitives = new ArrayList<OsmPrimitive>();
    35                 this.onlyInOsmPrimitives = new ArrayList<OsmPrimitive>();
     33                this.differentPrimitives = new ArrayList<>();
     34                this.onlyInTlsPrimitives = new ArrayList<>();
     35                this.onlyInOsmPrimitives = new ArrayList<>();
    3636                initDiff(dataLayer.data, dataLayer.osmLayer.data);
    3737        }
     
    4444                                        onlyInTlsPrimitives.add(p1);
    4545                                } else if (!dataLayer.handler.equals(p1, p2)) {
    46                                         differentPrimitives.add(new Pair<OsmPrimitive, OsmPrimitive>(p1, p2));
     46                                        differentPrimitives.add(new Pair<>(p1, p2));
    4747                                }
    4848                        }
  • applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/layers/OdOsmDataLayer.java

    r30340 r30532  
    4141                                                        if (nodes != null) {
    4242                                                                for (Node n : nodes) {
    43                                                                         List<OsmPrimitive> refferingAllowedWays = new ArrayList<OsmPrimitive>();
     43                                                                        List<OsmPrimitive> refferingAllowedWays = new ArrayList<>();
    4444                                                                        for (OsmPrimitive referrer : n.getReferrers()) {
    4545                                                                                if (referrer instanceof Way && !dataLayer.handler.isForbidden(referrer)) {
  • applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/licenses/License.java

    r30340 r30532  
    1717        public static final LOOL LOOL = new LOOL();
    1818       
    19         private final Map<String, URL> urls = new HashMap<String, URL>();
    20         private final Map<String, URL> summaryURLs = new HashMap<String, URL>();
     19        private final Map<String, URL> urls = new HashMap<>();
     20        private final Map<String, URL> summaryURLs = new HashMap<>();
    2121       
    2222        private Icon icon;
  • applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/modules/AbstractModule.java

    r30340 r30532  
    1919public abstract class AbstractModule implements Module, OdConstants {
    2020
    21         protected final List<Class<? extends AbstractDataSetHandler>> handlers = new ArrayList<Class <? extends AbstractDataSetHandler>>();
     21        protected final List<Class<? extends AbstractDataSetHandler>> handlers = new ArrayList<>();
    2222
    23         private final List<AbstractDataSetHandler> instanciatedHandlers = new ArrayList<AbstractDataSetHandler>();
     23        private final List<AbstractDataSetHandler> instanciatedHandlers = new ArrayList<>();
    2424
    2525        protected final ModuleInformation info;
     
    4646        @Override
    4747        public SourceProvider getMapPaintStyleSourceProvider() {
    48                 final List<SourceEntry> sources = new ArrayList<SourceEntry>();
     48                final List<SourceEntry> sources = new ArrayList<>();
    4949                for (AbstractDataSetHandler handler : getInstanciatedHandlers()) {
    5050                        ExtendedSourceEntry src;
     
    8383        @Override
    8484        public SourceProvider getPresetSourceProvider() {
    85                 final List<SourceEntry> sources = new ArrayList<SourceEntry>();
     85                final List<SourceEntry> sources = new ArrayList<>();
    8686                for (AbstractDataSetHandler handler : getInstanciatedHandlers()) {
    8787                        if (handler != null && handler.getTaggingPreset() != null) {
     
    9999        @Override
    100100        public final List<AbstractDataSetHandler> getNewlyInstanciatedHandlers() {
    101                 List<AbstractDataSetHandler> result = new ArrayList<AbstractDataSetHandler>();
     101                List<AbstractDataSetHandler> result = new ArrayList<>();
    102102                for (Class<? extends AbstractDataSetHandler> handlerClass : handlers) {
    103103                        if (handlerClass != null) {
  • applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/modules/ModuleDownloadTask.java

    r30436 r30532  
    3232 */
    3333public class ModuleDownloadTask extends PleaseWaitRunnable{
    34     private final Collection<ModuleInformation> toUpdate = new LinkedList<ModuleInformation>();
    35     private final Collection<ModuleInformation> failed = new LinkedList<ModuleInformation>();
    36     private final Collection<ModuleInformation> downloaded = new LinkedList<ModuleInformation>();
     34    private final Collection<ModuleInformation> toUpdate = new LinkedList<>();
     35    private final Collection<ModuleInformation> failed = new LinkedList<>();
     36    private final Collection<ModuleInformation> downloaded = new LinkedList<>();
    3737    //private Exception lastException;
    3838    private boolean canceled;
  • applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/modules/ModuleHandler.java

    r30340 r30532  
    6161     * All installed and loaded modules (resp. their main classes)
    6262     */
    63     public final static Collection<Module> moduleList = new LinkedList<Module>();
     63    public final static Collection<Module> moduleList = new LinkedList<>();
    6464
    6565    /**
    6666     * Add here all ClassLoader whose resource should be searched.
    6767     */
    68     private static final List<ClassLoader> sources = new LinkedList<ClassLoader>();
     68    private static final List<ClassLoader> sources = new LinkedList<>();
    6969
    7070    static {
     
    198198    public static ClassLoader createClassLoader(Collection<ModuleInformation> modules) {
    199199        // iterate all modules and collect all libraries of all modules:
    200         List<URL> allModuleLibraries = new LinkedList<URL>();
     200        List<URL> allModuleLibraries = new LinkedList<>();
    201201        File moduleDir = OdPlugin.getInstance().getModulesDirectory();
    202202        for (ModuleInformation info : modules) {
     
    269269            monitor.beginTask(tr("Loading modules ..."));
    270270            monitor.subTask(tr("Checking module preconditions..."));
    271             List<ModuleInformation> toLoad = new LinkedList<ModuleInformation>();
     271            List<ModuleInformation> toLoad = new LinkedList<>();
    272272            for (ModuleInformation pi: modules) {
    273273                if (checkLoadPreconditions(parent, modules, pi)) {
     
    316316                return null;
    317317            }
    318             HashMap<String, ModuleInformation> ret = new HashMap<String, ModuleInformation>();
     318            HashMap<String, ModuleInformation> ret = new HashMap<>();
    319319            for (ModuleInformation pi: task.getAvailableModules()) {
    320320                ret.put(pi.name, pi);
     
    358358     */
    359359    public static List<ModuleInformation> buildListOfModulesToLoad(Component parent) {
    360         Set<String> modules = new HashSet<String>();
     360        Set<String> modules = new HashSet<>();
    361361        modules.addAll(Main.pref.getCollection(PREF_MODULES,  new LinkedList<String>()));
    362362        if (System.getProperty("josm."+PREF_MODULES) != null) {
     
    364364        }
    365365        Map<String, ModuleInformation> infos = loadLocallyAvailableModuleInformation(null);
    366         List<ModuleInformation> ret = new LinkedList<ModuleInformation>();
     366        List<ModuleInformation> ret = new LinkedList<>();
    367367        for (Iterator<String> it = modules.iterator(); it.hasNext();) {
    368368            String module = it.next();
     
    448448            // filter modules which actually have to be updated
    449449            //
    450             Collection<ModuleInformation> modulesToUpdate = new ArrayList<ModuleInformation>();
     450            Collection<ModuleInformation> modulesToUpdate = new ArrayList<>();
    451451            for(ModuleInformation pi: modules) {
    452452                if (pi.isUpdateRequired()) {
  • applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/modules/ModuleInformation.java

    r30340 r30532  
    4646    public String iconPath;
    4747    public ImageIcon icon;
    48     public List<URL> libraries = new LinkedList<URL>();
    49     public final Map<String, String> attr = new TreeMap<String, String>();
     48    public List<URL> libraries = new LinkedList<>();
     49    public final Map<String, String> attr = new TreeMap<>();
    5050
    5151    /**
     
    245245     * @return the loaded class
    246246     */
     247    @SuppressWarnings("unchecked")
    247248    public Class<? extends Module> loadClass(ClassLoader classLoader) throws ModuleException {
    248249        if (className == null)
     
    265266    public static Collection<String> getModuleLocations() {
    266267        Collection<String> locations = Main.pref.getAllPossiblePreferenceDirs();
    267         Collection<String> all = new ArrayList<String>(locations.size());
     268        Collection<String> all = new ArrayList<>(locations.size());
    268269        for (String s : locations) {
    269270            all.add(s+"plugins/opendata/modules");
  • applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/modules/ModuleListParser.java

    r30340 r30532  
    5858     */
    5959    public List<ModuleInformation> parse(InputStream in) throws ModuleListParseException{
    60         List<ModuleInformation> ret = new LinkedList<ModuleInformation>();
     60        List<ModuleInformation> ret = new LinkedList<>();
    6161        BufferedReader r = null;
    6262        try {
  • applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/modules/ReadLocalModuleInformationTask.java

    r30436 r30532  
    1818import org.openstreetmap.josm.io.OsmTransferException;
    1919import org.openstreetmap.josm.tools.ImageProvider;
    20 import org.openstreetmap.josm.tools.Utils;
    2120import org.xml.sax.SAXException;
    2221
     
    4140    public ReadLocalModuleInformationTask() {
    4241        super(tr("Reading local module information.."), false);
    43         availableModules = new HashMap<String, ModuleInformation>();
     42        availableModules = new HashMap<>();
    4443    }
    4544
    4645    public ReadLocalModuleInformationTask(ProgressMonitor monitor) {
    4746        super(tr("Reading local module information.."),monitor, false);
    48         availableModules = new HashMap<String, ModuleInformation>();
     47        availableModules = new HashMap<>();
    4948    }
    5049
     
    225224     */
    226225    public List<ModuleInformation> getAvailableModules() {
    227         return new ArrayList<ModuleInformation>(availableModules.values());
     226        return new ArrayList<>(availableModules.values());
    228227    }
    229228
  • applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/modules/ReadRemoteModuleInformationTask.java

    r30436 r30532  
    5353            this.sites = Collections.emptySet();
    5454        }
    55         availableModules = new LinkedList<ModuleInformation>();
     55        availableModules = new LinkedList<>();
    5656
    5757    }
     
    297297
    298298        // collect old cache files and remove if no longer in use
    299         List<File> siteCacheFiles = new LinkedList<File>();
     299        List<File> siteCacheFiles = new LinkedList<>();
    300300        for (String location : ModuleInformation.getModuleLocations()) {
    301301            File [] f = new File(location).listFiles(
  • applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/util/NamesFrUtils.java

    r30340 r30532  
    3131       
    3232        private static Map<String, String> initDictionary() {
    33                 Map<String, String> result = new HashMap<String, String>();
     33                Map<String, String> result = new HashMap<>();
    3434                try {
    3535                        BufferedReader reader = new BufferedReader(new InputStreamReader(
  • applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/util/OdUtils.java

    r30340 r30532  
    2929   
    3030        public static final String[] stripQuotesAndExtraChars(String[] split, String sep) {
    31                 List<String> result = new ArrayList<String>();
     31                List<String> result = new ArrayList<>();
    3232                boolean append = false;
    3333                for (int i = 0; i<split.length; i++) {
  • applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/gui/OsbBugListCellRenderer.java

    r25474 r30532  
    4141import org.openstreetmap.josm.plugins.osb.OsbPlugin;
    4242
    43 public class OsbBugListCellRenderer implements ListCellRenderer {
     43public class OsbBugListCellRenderer implements ListCellRenderer<OsbListItem> {
    4444
    4545    private Color background = Color.WHITE;
    4646    private Color altBackground = new Color(250, 250, 220);
    4747
    48     public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected,
     48    public Component getListCellRendererComponent(JList<? extends OsbListItem> list, OsbListItem item, int index, boolean isSelected,
    4949            boolean cellHasFocus) {
    5050
     
    6464        }
    6565
    66         OsbListItem item = (OsbListItem) value;
    6766        Node n = item.getNode();
    6867        Icon icon = null;
     
    8685        return label;
    8786    }
    88 
    8987}
  • applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/gui/OsbDialog.java

    r30004 r30532  
    9393    private static final long serialVersionUID = 1L;
    9494    private JPanel bugListPanel, queuePanel;
    95     private DefaultListModel bugListModel;
    96     private JList bugList;
    97     private JList queueList;
     95    private DefaultListModel<OsbListItem> bugListModel;
     96    private JList<OsbListItem> bugList;
     97    private JList<OsbAction> queueList;
    9898    private OsbPlugin osbPlugin;
    9999    private boolean fireSelectionChanged = true;
     
    120120        add(bugListPanel, BorderLayout.CENTER);
    121121
    122         bugListModel = new DefaultListModel();
    123         bugList = new JList(bugListModel);
     122        bugListModel = new DefaultListModel<>();
     123        bugList = new JList<>(bugListModel);
    124124        bugList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    125125        bugList.addListSelectionListener(this);
     
    180180        queuePanel = new JPanel(new BorderLayout());
    181181        queuePanel.setName(tr("Queue"));
    182         queueList = new JList(getActionQueue());
     182        queueList = new JList<>(getActionQueue());
    183183        queueList.setCellRenderer(new OsbQueueListCellRenderer());
    184184        queuePanel.add(new JScrollPane(queueList), BorderLayout.CENTER);
     
    241241    public synchronized void update(final DataSet dataset) {
    242242        // create a new list model
    243         bugListModel = new DefaultListModel();
     243        bugListModel = new DefaultListModel<>();
    244244        List<Node> sortedList = new ArrayList<Node>(dataset.getNodes());
    245245        Collections.sort(sortedList, new BugComparator());
     
    253253
    254254    public void valueChanged(ListSelectionEvent e) {
    255         if (bugList.getSelectedValues().length == 0) {
     255        if (bugList.getSelectedValuesList().isEmpty()) {
    256256            addComment.setEnabled(false);
    257257            closeIssue.setEnabled(false);
     
    260260
    261261        List<OsmPrimitive> selected = new ArrayList<OsmPrimitive>();
    262         for (Object listItem : bugList.getSelectedValues()) {
     262        for (Object listItem : bugList.getSelectedValuesList()) {
    263263            Node node = ((OsbListItem) listItem).getNode();
    264264            selected.add(node);
  • applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/gui/OsbQueueListCellRenderer.java

    r30004 r30532  
    4343import org.openstreetmap.josm.plugins.osb.gui.action.OsbAction;
    4444
    45 public class OsbQueueListCellRenderer implements ListCellRenderer {
     45public class OsbQueueListCellRenderer implements ListCellRenderer<OsbAction> {
    4646
    4747    private Color background = Color.WHITE;
    4848    private Color altBackground = new Color(250, 250, 220);
    4949
    50     public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected,
     50    @Override
     51    public Component getListCellRendererComponent(JList<? extends OsbAction> list, OsbAction action, int index, boolean isSelected,
    5152            boolean cellHasFocus) {
    5253
     
    6263        }
    6364
    64         OsbAction action = (OsbAction) value;
    6565        Icon icon = null;
    6666        if(action instanceof AddCommentAction) {
  • applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/gui/action/ActionQueue.java

    r22684 r30532  
    55import javax.swing.AbstractListModel;
    66
    7 public class ActionQueue extends AbstractListModel {
     7public class ActionQueue extends AbstractListModel<OsbAction> {
    88
    99    private LinkedList<OsbAction> queue = new LinkedList<OsbAction>();
     
    2525    }
    2626
    27     public boolean remove(Object o) {
     27    public boolean remove(OsbAction o) {
    2828        int index = queue.indexOf(o);
    2929        if(index >= 0) {
     
    5252    }
    5353
    54     public Object getElementAt(int index) {
     54    @Override
     55    public OsbAction getElementAt(int index) {
    5556        return queue.get(index);
    5657    }
    5758
     59    @Override
    5860    public int getSize() {
    5961        return queue.size();
  • applications/editors/josm/plugins/pdfimport/src/pdfimport/LoadPdfDialog.java

    r29803 r30532  
    120120         * Combobox with all projections available
    121121         */
    122         private JComboBox projectionCombo;
     122        private JComboBox<ProjectionChoice> projectionCombo;
    123123        private JButton projectionPreferencesButton;
    124124        private JTextField minXField;
     
    247247                c.gridheight = 1;c.gridwidth = 1;c.weightx =1; c.weighty = 1; c.fill = GridBagConstraints.BOTH;
    248248
    249                 this.projectionCombo = new JComboBox();
     249                this.projectionCombo = new JComboBox<>();
    250250                for (ProjectionChoice p: ProjectionPreference.getProjectionChoices()) {
    251251                        this.projectionCombo.addItem(p);
  • applications/editors/josm/plugins/photo_geotagging/src/org/openstreetmap/josm/plugins/photo_geotagging/GeotaggingAction.java

    r30462 r30532  
    1212import java.io.IOException;
    1313import java.nio.file.Files;
    14 import java.nio.file.Path;
    15 import java.nio.file.Paths;
    1614import java.text.DecimalFormat;
    1715import java.util.ArrayList;
     
    7775        cont.add(new JLabel(tr("Write position information into the exif header of the following files:")), GBC.eol());
    7876
    79         DefaultListModel listModel = new DefaultListModel();
     77        DefaultListModel<String> listModel = new DefaultListModel<>();
    8078        DecimalFormat dFormatter = new DecimalFormat("###0.000000");
    8179        for (ImageEntry e : images) {
     
    8482        }
    8583
    86         JList entryList = new JList(listModel);
     84        JList<String> entryList = new JList<>(listModel);
    8785
    8886        JScrollPane scroll = new JScrollPane(entryList);
     
    10199
    102100        final String[] mTimeModeArray = {"----", tr("to gps time"), tr("to previous value (unchanged mtime)")};
    103         final JComboBox mTimeMode = new JComboBox(mTimeModeArray);
     101        final JComboBox<String> mTimeMode = new JComboBox<>(mTimeModeArray);
    104102        {
    105103            String mTimeModePref = Main.pref.get(MTIME_MODE, null);
  • applications/editors/josm/plugins/public_transport/src/public_transport/GTFSImporterDialog.java

    r29854 r30532  
    2828  private JDialog jDialog = null;
    2929  private JTabbedPane tabbedPane = null;
    30   private JComboBox cbStoptype = null;
     30  private JComboBox<TransText> cbStoptype = null;
    3131  private JList tracksList = null;
    3232  private JTextField tfGPSTimeStart = null;
     
    6868    contentPane.add(label);
    6969
    70     cbStoptype = new JComboBox();
     70    cbStoptype = new JComboBox<>();
    7171    cbStoptype.setEditable(false);
    7272    for(String type : stoptypes)
     
    481481  public static double parseTime(String s)
    482482  {
    483     double result = 0;
    484483    if ((s.charAt(2) != ':') || (s.charAt(2) != ':')
    485484     || (s.length() < 8))
  • applications/editors/josm/plugins/public_transport/src/public_transport/RoutePatternAction.java

    r29859 r30532  
    398398  private static JDialog jDialog = null;
    399399  private static JTabbedPane tabbedPane = null;
    400   private static DefaultListModel relsListModel = null;
     400  private static DefaultListModel<RouteReference> relsListModel = null;
    401401  private static TagTableModel requiredTagsData = null;
    402402  private static CustomCellEditorTable requiredTagsTable = null;
     
    410410  private static StoplistTableModel stoplistData = null;
    411411  private static JTable stoplistTable = null;
    412   private static JList relsList = null;
     412  private static JList<RouteReference> relsList = null;
    413413  private static JCheckBox cbRight = null;
    414414  private static JCheckBox cbLeft = null;
     
    418418  private static Vector< RelationMember > markedWays = new Vector< RelationMember >();
    419419  private static Vector< RelationMember > markedNodes = new Vector< RelationMember >();
    420 
    421   private static Relation copy = null;
    422420
    423421  public RoutePatternAction() {
     
    470468      contentPane.add(headline);
    471469
    472       relsListModel = new DefaultListModel();
    473       relsList = new JList(relsListModel);
     470      relsListModel = new DefaultListModel<>();
     471      relsList = new JList<>(relsListModel);
    474472      JScrollPane rpListSP = new JScrollPane(relsList);
    475473      String[] data = {"1", "2", "3", "4", "5", "6"};
     
    584582      rowContent.add("route");
    585583      requiredTagsData.addRow(rowContent);
    586       JComboBox comboBox = new JComboBox();
     584      JComboBox<String> comboBox = new JComboBox<>();
    587585      comboBox.addItem("route");
    588586      requiredTagsTable.setCellEditor(0, 1, new DefaultCellEditor(comboBox));
     
    592590      rowContent.add(1, "bus");
    593591      requiredTagsData.addRow(rowContent);
    594       /*JComboBox*/ comboBox = new JComboBox();
     592      /*JComboBox*/ comboBox = new JComboBox<>();
    595593      comboBox.addItem("bus");
    596594      comboBox.addItem("trolleybus");
     
    743741      itineraryTable.setModel(itineraryData);
    744742      /*JScrollPane*/ tableSP = new JScrollPane(itineraryTable);
    745       /*JComboBox*/ comboBox = new JComboBox();
     743      /*JComboBox*/ comboBox = new JComboBox<>();
    746744      comboBox.addItem("");
    747745      comboBox.addItem("forward");
     
    867865      stoplistTable.setModel(stoplistData);
    868866      /*JScrollPane*/ tableSP = new JScrollPane(stoplistTable);
    869       /*JComboBox*/ comboBox = new JComboBox();
     867      /*JComboBox*/ comboBox = new JComboBox<>();
    870868      comboBox.addItem("");
    871869      comboBox.addItem("forward_stop");
     
    11091107      Vector< RelationMember > itemsToReflect = new Vector< RelationMember >();
    11101108      Vector< RelationMember > otherItems = new Vector< RelationMember >();
    1111       int insPos = itineraryTable.getSelectedRow();
    11121109
    11131110      // Temp
    11141111      Node firstNode = null;
    1115       Node lastNode = null;
     1112      //Node lastNode = null;
    11161113
    11171114      for (int i = 0; i < currentRoute.getMembersCount(); ++i)
     
    11361133              firstNode = item.getWay().getNode(0);
    11371134          }
    1138           lastNode = item.getWay().getNode(item.getWay().getNodesCount() - 1);
     1135          //lastNode = item.getWay().getNode(item.getWay().getNodesCount() - 1);
    11391136        }
    11401137        else if (item.isNode())
  • applications/editors/josm/plugins/public_transport/src/public_transport/StopImporterAction.java

    r30358 r30532  
    3838{
    3939  private static StopImporterDialog dialog = null;
    40   private static DefaultListModel tracksListModel = null;
     40  private static DefaultListModel<TrackReference> tracksListModel = null;
    4141  private static GpxData data = null;
    4242  private static TrackReference currentTrack = null;
     
    6262  }
    6363
    64   public DefaultListModel getTracksListModel()
     64  public DefaultListModel<TrackReference> getTracksListModel()
    6565  {
    6666    if (tracksListModel == null)
    67       tracksListModel = new DefaultListModel();
     67      tracksListModel = new DefaultListModel<>();
    6868    return tracksListModel;
    6969  }
  • applications/editors/josm/plugins/public_transport/src/public_transport/StopImporterDialog.java

    r29859 r30532  
    3333  private JDialog jDialog = null;
    3434  private JTabbedPane tabbedPane = null;
    35   private JComboBox cbStoptype = null;
    36   private JList tracksList = null;
     35  private JComboBox<TransText> cbStoptype = null;
     36  private JList<TrackReference> tracksList = null;
    3737  private JTextField tfGPSTimeStart = null;
    3838  private JTextField tfStopwatchStart = null;
     
    8080    contentPane.add(label);
    8181
    82     DefaultListModel tracksListModel = controller.getTracksListModel();
    83     tracksList = new JList(tracksListModel);
     82    DefaultListModel<TrackReference> tracksListModel = controller.getTracksListModel();
     83    tracksList = new JList<>(tracksListModel);
    8484    JScrollPane rpListSP = new JScrollPane(tracksList);
    8585    String[] data = {"1", "2", "3", "4", "5", "6"};
     
    114114    contentPane.add(label);
    115115
    116     cbStoptype = new JComboBox();
     116    cbStoptype = new JComboBox<>();
    117117    cbStoptype.setEditable(false);
    118118    for(String type : stoptypes)
     
    640640  {
    641641    stoplistTable.setModel(model);
    642     JComboBox comboBox = new JComboBox();
     642    JComboBox<TransText> comboBox = new JComboBox<>();
    643643    comboBox.addItem(new TransText(null));
    644644    comboBox.addItem(new TransText(marktr("yes")));
     
    661661  {
    662662    waypointTable.setModel(model);
    663     JComboBox comboBox = new JComboBox();
     663    JComboBox<TransText> comboBox = new JComboBox<>();
    664664    comboBox.addItem(new TransText(null));
    665665    comboBox.addItem(new TransText(marktr("yes")));
  • applications/editors/josm/plugins/reltoolbox/src/relcontext/RelContextDialog.java

    r30145 r30532  
    137137
    138138        final MouseListener relationMouseAdapter = new ChosenRelationMouseAdapter();
    139         final JComboBox roleBox = new JComboBox();
     139        final JComboBox<String> roleBox = new JComboBox<>();
    140140        roleBoxModel = new RoleComboBoxModel(roleBox);
    141141        roleBox.setModel(roleBoxModel);
     
    620620            setEnabled(newRelation != null);
    621621        }
    622         }
     622    }
    623623       
    624     private class RoleComboBoxModel extends AbstractListModel implements ComboBoxModel {
     624    private class RoleComboBoxModel extends AbstractListModel<String> implements ComboBoxModel<String> {
    625625        private List<String> roles = new ArrayList<String>();
    626626        private int selectedIndex = -1;
    627         private JComboBox combobox;
     627        private JComboBox<String> combobox;
    628628        private String membersRole;
    629629        private final String EMPTY_ROLE = tr("<empty>");
    630630        private final String ANOTHER_ROLE = tr("another...");
    631631
    632         public RoleComboBoxModel( JComboBox combobox ) {
     632        public RoleComboBoxModel( JComboBox<String> combobox ) {
    633633            super();
    634634            this.combobox = combobox;
     
    708708        }
    709709
    710         public Object getElementAt( int index ) {
     710        public String getElementAt( int index ) {
    711711            return getRole(index);
    712712        }
  • applications/editors/josm/plugins/reltoolbox/src/relcontext/actions/FindRelationAction.java

    r28857 r30532  
    3737        panel.add(searchField, BorderLayout.NORTH);
    3838        final FindRelationListModel relationsData = new FindRelationListModel();
    39         final JList relationsList = new JList(relationsData);
     39        final JList<Relation> relationsList = new JList<>(relationsData);
    4040        relationsList.setSelectionModel(relationsData.getSelectionModel());
    4141        relationsList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
     
    167167     * I admit, some of it was copypasted from {@link org.openstreetmap.josm.gui.dialogs.RelationListDialog.RelationListModel}.
    168168     */
    169     protected class FindRelationListModel extends AbstractListModel {
     169    protected class FindRelationListModel extends AbstractListModel<Relation> {
    170170        private final ArrayList<Relation> relations = new ArrayList<Relation>();
    171171        private DefaultListSelectionModel selectionModel;
     
    184184        }
    185185
    186         public Relation getRelation( int idx ) {
    187             return relations.get(idx);
    188         }
    189 
     186        @Override
    190187        public int getSize() {
    191188            return relations.size();
    192189        }
    193190
    194         public Object getElementAt( int index ) {
    195             return getRelation(index);
     191        @Override
     192        public Relation getElementAt( int index ) {
     193            return relations.get(index);
    196194        }
    197195
    198196        public void setRelations(Collection<Relation> relations) {
    199197            int selectedIndex = selectionModel.getMinSelectionIndex();
    200             Relation sel =  selectedIndex < 0 ? null : getRelation(selectedIndex);
     198            Relation sel =  selectedIndex < 0 ? null : getElementAt(selectedIndex);
    201199           
    202200            this.relations.clear();
  • applications/editors/josm/plugins/roadsigns/src/org/openstreetmap/josm/plugins/roadsigns/RoadSignInputDialog.java

    r30034 r30532  
    545545                if (rowIndex == -1 || colIndex == -1)
    546546                    return null;
    547                 int realColumnIndex = convertColumnIndexToModel(colIndex);
     547                //int realColumnIndex = convertColumnIndexToModel(colIndex);
    548548                return (String) getValueAt(rowIndex, colIndex);
    549549            }
     
    623623                    List<String> values = new ArrayList<String>();
    624624                    List<String> conditions = new ArrayList<String>();
    625                     String ident;
     625                    //String ident;
    626626                    public TagEvaluater(Tag t) {
    627627                        key = t.key.evaluate(env);
    628628                        default_value = t.value.evaluate(env);
    629                         ident = t.ident;
     629                        //ident = t.ident;
    630630                    }
    631631
     
    858858
    859859        private List<PresetMetaData> presetsData;
    860         private JComboBox selectionBox;
     860        private JComboBox<PresetMetaData> selectionBox;
    861861        JRadioButton rbAll, rbUseful;
    862862
     
    865865            presetsData = RoadSignsPlugin.getAvailablePresetsMetaData();
    866866
    867             selectionBox = new JComboBox(presetsData.toArray());
     867            selectionBox = new JComboBox<>(presetsData.toArray(new PresetMetaData[0]));
    868868            String code = Main.pref.get("plugin.roadsigns.preset.selection", null);
    869869            if (code != null) {
  • applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/gui/RoutingDialog.java

    r30361 r30532  
    5252public class RoutingDialog extends ToggleDialog {
    5353
    54     private final DefaultListModel model;
    55     private JList jList = null;
     54    private final DefaultListModel<String> model;
     55    private JList<String> jList = null;
    5656    private JScrollPane jScrollPane = null;
    5757
     
    6464        super(tr("Routing"), "routing", tr("Open a list of routing nodes"),
    6565                Shortcut.registerShortcut("subwindow:routing", tr("Toggle: {0}", tr("Routing")), KeyEvent.VK_R, Shortcut.ALT_CTRL_SHIFT), 150);
    66         model = new DefaultListModel();
     66        model = new DefaultListModel<>();
    6767        createLayout(getJScrollPane(), false, null);
    6868    }
     
    8888     * @return javax.swing.JList
    8989     */
    90     private JList getJList() {
     90    private JList<String> getJList() {
    9191        if (jList == null) {
    92             jList = new JList();
     92            jList = new JList<>();
    9393            jList.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
    9494            jList.setModel(model);
  • applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/gui/RoutingPreferenceDialog.java

    r30361 r30532  
    110110                JPanel p = new JPanel(new GridBagLayout());
    111111                p.add(new JLabel(tr("Weight")), GBC.std().insets(0, 0, 5, 0));
    112                 JComboBox key = new JComboBox();
     112                JComboBox<String> key = new JComboBox<>();
    113113                for (OsmWayTypes pk : OsmWayTypes.values())
    114114                    key.addItem(pk.getTag());
  • applications/editors/josm/plugins/smed/src/panels/PanelLights.java

    r29894 r30532  
    1818        public JLabel categoryLabel;
    1919
    20         public JComboBox landCatBox;
     20        public JComboBox<String> landCatBox;
    2121        public EnumMap<Cat, Integer> landCats = new EnumMap<Cat, Integer>(Cat.class);
    2222        private ActionListener alLandCatBox = new ActionListener() {
     
    3131                }
    3232        };
    33         public JComboBox trafficCatBox;
     33        public JComboBox<String> trafficCatBox;
    3434        public EnumMap<Cat, Integer> trafficCats = new EnumMap<Cat, Integer>(Cat.class);
    3535        private ActionListener alTrafficCatBox = new ActionListener() {
     
    4444                }
    4545        };
    46         public JComboBox warningCatBox;
     46        public JComboBox<String> warningCatBox;
    4747        public EnumMap<Cat, Integer> warningCats = new EnumMap<Cat, Integer>(Cat.class);
    4848        private ActionListener alWarningCatBox = new ActionListener() {
     
    5757                }
    5858        };
    59         public JComboBox platformCatBox;
     59        public JComboBox<String> platformCatBox;
    6060        public EnumMap<Cat, Integer> platformCats = new EnumMap<Cat, Integer>(Cat.class);
    6161        private ActionListener alPlatformCatBox = new ActionListener() {
     
    7070                }
    7171        };
    72         public JComboBox pilotCatBox;
     72        public JComboBox<String> pilotCatBox;
    7373        public EnumMap<Cat, Integer> pilotCats = new EnumMap<Cat, Integer>(Cat.class);
    7474        private ActionListener alPilotCatBox = new ActionListener() {
     
    8383                }
    8484        };
    85         public JComboBox rescueCatBox;
     85        public JComboBox<String> rescueCatBox;
    8686        public EnumMap<Cat, Integer> rescueCats = new EnumMap<Cat, Integer>(Cat.class);
    8787        private ActionListener alRescueCatBox = new ActionListener() {
     
    9696                }
    9797        };
    98         public JComboBox radioCatBox;
     98        public JComboBox<String> radioCatBox;
    9999        public EnumMap<Cat, Integer> radioCats = new EnumMap<Cat, Integer>(Cat.class);
    100100        private ActionListener alRadioCatBox = new ActionListener() {
     
    109109                }
    110110        };
    111         public JComboBox radarCatBox;
     111        public JComboBox<String> radarCatBox;
    112112        public EnumMap<Cat, Integer> radarCats = new EnumMap<Cat, Integer>(Cat.class);
    113113        private ActionListener alRadarCatBox = new ActionListener() {
     
    123123        };
    124124        public JLabel functionLabel;
    125         public JComboBox functionBox;
     125        public JComboBox<String> functionBox;
    126126        public EnumMap<Fnc, Integer> functions = new EnumMap<Fnc, Integer>(Fnc.class);
    127127        private ActionListener alfunctionBox = new ActionListener() {
     
    261261                functionLabel.setVisible(false);
    262262
    263                 functionBox = new JComboBox();
     263                functionBox = new JComboBox<>();
    264264                functionBox.setBounds(new Rectangle(5, 110, 160, 18));
    265265                add(functionBox);
     
    281281                categoryLabel.setVisible(false);
    282282
    283                 landCatBox = new JComboBox();
     283                landCatBox = new JComboBox<>();
    284284                landCatBox.setBounds(new Rectangle(5, 142, 160, 18));
    285285                add(landCatBox);
     
    308308                landCatBox.setVisible(false);
    309309
    310                 trafficCatBox = new JComboBox();
     310                trafficCatBox = new JComboBox<>();
    311311                trafficCatBox.setBounds(new Rectangle(5, 140, 160, 20));
    312312                add(trafficCatBox);
     
    325325                trafficCatBox.setVisible(false);
    326326
    327                 warningCatBox = new JComboBox();
     327                warningCatBox = new JComboBox<>();
    328328                warningCatBox.setBounds(new Rectangle(5, 140, 160, 20));
    329329                add(warningCatBox);
     
    347347                warningCatBox.setVisible(false);
    348348
    349                 platformCatBox = new JComboBox();
     349                platformCatBox = new JComboBox<>();
    350350                platformCatBox.setBounds(new Rectangle(5, 140, 160, 20));
    351351                add(platformCatBox);
     
    364364                platformCatBox.setVisible(false);
    365365
    366                 pilotCatBox = new JComboBox();
     366                pilotCatBox = new JComboBox<>();
    367367                pilotCatBox.setBounds(new Rectangle(5, 140, 160, 20));
    368368                add(pilotCatBox);
     
    374374                pilotCatBox.setVisible(false);
    375375
    376                 rescueCatBox = new JComboBox();
     376                rescueCatBox = new JComboBox<>();
    377377                rescueCatBox.setBounds(new Rectangle(5, 140, 160, 20));
    378378                add(rescueCatBox);
     
    391391                rescueCatBox.setVisible(false);
    392392
    393                 radioCatBox = new JComboBox();
     393                radioCatBox = new JComboBox<>();
    394394                radioCatBox.setBounds(new Rectangle(5, 140, 160, 20));
    395395                add(radioCatBox);
     
    429429                radioCatBox.setVisible(false);
    430430
    431                 radarCatBox = new JComboBox();
     431                radarCatBox = new JComboBox<>();
    432432                radarCatBox.setBounds(new Rectangle(5, 140, 160, 20));
    433433                add(radarCatBox);
  • applications/editors/josm/plugins/smed/src/panels/PanelLit.java

    r29894 r30532  
    3939        };
    4040        public JLabel visibilityLabel;
    41         public JComboBox visibilityBox;
     41        public JComboBox<String> visibilityBox;
    4242        public EnumMap<Vis, Integer> visibilities = new EnumMap<Vis, Integer>(Vis.class);
    4343        private ActionListener alVisibility = new ActionListener() {
     
    7979        };
    8080        public JLabel categoryLabel;
    81         public JComboBox categoryBox;
     81        public JComboBox<String> categoryBox;
    8282        public EnumMap<Lit, Integer> categories = new EnumMap<Lit, Integer>(Lit.class);
    8383        private ActionListener alCategory = new ActionListener() {
     
    115115        };
    116116        public JLabel exhibitionLabel;
    117         public JComboBox exhibitionBox;
     117        public JComboBox<String> exhibitionBox;
    118118        public EnumMap<Exh, Integer> exhibitions = new EnumMap<Exh, Integer>(Exh.class);
    119119        private ActionListener alExhibition = new ActionListener() {
     
    209209                categoryLabel.setBounds(new Rectangle(185, 0, 165, 20));
    210210                add(categoryLabel);
    211                 categoryBox = new JComboBox();
     211                categoryBox = new JComboBox<>();
    212212                categoryBox.setBounds(new Rectangle(185, 20, 165, 20));
    213213                add(categoryBox);
     
    235235                visibilityLabel.setBounds(new Rectangle(185, 40, 165, 20));
    236236                add(visibilityLabel);
    237                 visibilityBox = new JComboBox();
     237                visibilityBox = new JComboBox<>();
    238238                visibilityBox.setBounds(new Rectangle(185, 60, 165, 20));
    239239                add(visibilityBox);
     
    247247                exhibitionLabel.setBounds(new Rectangle(280, 80, 70, 20));
    248248                add(exhibitionLabel);
    249                 exhibitionBox = new JComboBox();
     249                exhibitionBox = new JComboBox<>();
    250250                exhibitionBox.setBounds(new Rectangle(280, 100, 70, 20));
    251251                add(exhibitionBox);
  • applications/editors/josm/plugins/smed/src/panels/PanelMore.java

    r29894 r30532  
    4444        };
    4545        public JLabel statusLabel;
    46         public JComboBox statusBox;
     46        public JComboBox<String> statusBox;
    4747        public EnumMap<Sts, Integer> statuses = new EnumMap<Sts, Integer>(Sts.class);
    4848        private ActionListener alStatus = new ActionListener() {
     
    5656        };
    5757        public JLabel constrLabel;
    58         public JComboBox constrBox;
     58        public JComboBox<String> constrBox;
    5959        public EnumMap<Cns, Integer> constructions = new EnumMap<Cns, Integer>(Cns.class);
    6060        private ActionListener alConstr = new ActionListener() {
     
    6868        };
    6969        public JLabel conLabel;
    70         public JComboBox conBox;
     70        public JComboBox<String> conBox;
    7171        public EnumMap<Con, Integer> conspicuities = new EnumMap<Con, Integer>(Con.class);
    7272        private ActionListener alCon = new ActionListener() {
     
    8080        };
    8181        public JLabel reflLabel;
    82         public JComboBox reflBox;
     82        public JComboBox<String> reflBox;
    8383        public EnumMap<Con, Integer> reflectivities = new EnumMap<Con, Integer>(Con.class);
    8484        private ActionListener alRefl = new ActionListener() {
     
    235235                statusLabel.setBounds(new Rectangle(250, 0, 100, 20));
    236236                add(statusLabel);
    237                 statusBox = new JComboBox();
     237                statusBox = new JComboBox<>();
    238238                statusBox.setBounds(new Rectangle(250, 20, 100, 20));
    239239                addStsItem("", Sts.UNKSTS);
     
    262262                constrLabel.setBounds(new Rectangle(250, 40, 100, 20));
    263263                add(constrLabel);
    264                 constrBox = new JComboBox();
     264                constrBox = new JComboBox<>();
    265265                constrBox.setBounds(new Rectangle(250, 60, 100, 20));
    266266                addCnsItem("", Cns.UNKCNS);
     
    280280                conLabel.setBounds(new Rectangle(250, 80, 100, 20));
    281281                add(conLabel);
    282                 conBox = new JComboBox();
     282                conBox = new JComboBox<>();
    283283                conBox.setBounds(new Rectangle(250, 100, 100, 20));
    284284                addConItem("", Con.UNKCON);
     
    291291                reflLabel.setBounds(new Rectangle(250, 120, 100, 20));
    292292                add(reflLabel);
    293                 reflBox = new JComboBox();
     293                reflBox = new JComboBox<>();
    294294                reflBox.setBounds(new Rectangle(250, 140, 100, 20));
    295295                addReflItem("", Con.UNKCON);
     
    361361                return button;
    362362        }
    363 
    364363}
  • applications/editors/josm/plugins/smed/src/panels/PanelRadar.java

    r29894 r30532  
    2828                }
    2929        };
    30         private JComboBox radioCatBox;
     30        private JComboBox<String> radioCatBox;
    3131        private EnumMap<Cat, Integer> radioCats = new EnumMap<Cat, Integer>(Cat.class);
    3232        private ActionListener alRadioCatBox = new ActionListener() {
     
    175175                add(aisButton);
    176176
    177                 radioCatBox = new JComboBox();
     177                radioCatBox = new JComboBox<>();
    178178                radioCatBox.setBounds(new Rectangle(210, 40, 150, 20));
    179179                add(radioCatBox);
  • applications/editors/josm/plugins/smed/src/panels/PanelSectors.java

    r29894 r30532  
    3636                }
    3737        };
    38         public JComboBox colourBox;
     38        public JComboBox<ImageIcon> colourBox;
    3939        public EnumMap<Col, ImageIcon> colours = new EnumMap<Col, ImageIcon>(Col.class);
    40         public JComboBox visibilityBox;
     40        public JComboBox<String> visibilityBox;
    4141        public EnumMap<Vis, String> visibilities = new EnumMap<Vis, String>(Vis.class);
    42         public JComboBox exhibitionBox;
     42        public JComboBox<String> exhibitionBox;
    4343        public EnumMap<Exh, String> exhibitions = new EnumMap<Exh, String>(Exh.class);
    4444
     
    7474
    7575                TableColumn colColumn = table.getColumnModel().getColumn(1);
    76                 colourBox = new JComboBox();
     76                colourBox = new JComboBox<>();
    7777                addColItem(new ImageIcon(getClass().getResource("/images/DelButton.png")), Col.UNKCOL);
    7878                addColItem(new ImageIcon(getClass().getResource("/images/WhiteButton.png")), Col.WHITE);
     
    8787               
    8888                TableColumn visColumn = table.getColumnModel().getColumn(12);
    89                 visibilityBox = new JComboBox();
     89                visibilityBox = new JComboBox<>();
    9090                addVisibItem("", Vis.UNKVIS);
    9191                addVisibItem(Messages.getString("Intensified"), Vis.INTEN);
     
    9595               
    9696                TableColumn exhColumn = table.getColumnModel().getColumn(13);
    97                 exhibitionBox = new JComboBox();
     97                exhibitionBox = new JComboBox<>();
    9898                addExhibItem("", Exh.UNKEXH);
    9999                addExhibItem(Messages.getString("24h"), Exh.H24);
  • applications/editors/josm/plugins/smed/src/panels/PanelSpec.java

    r30294 r30532  
    1717        private SmedAction dlg;
    1818        public JLabel categoryLabel;
    19         public JComboBox categoryBox;
     19        public JComboBox<String> categoryBox;
    2020        public EnumMap<Cat, Integer> categories = new EnumMap<Cat, Integer>(Cat.class);
    2121        private ActionListener alCategoryBox = new ActionListener() {
     
    2828                }
    2929        };
    30         public JComboBox mooringBox;
     30        public JComboBox<String> mooringBox;
    3131        public EnumMap<Cat, Integer> moorings = new EnumMap<Cat, Integer>(Cat.class);
    3232        private ActionListener alMooringBox = new ActionListener() {
     
    173173                categoryLabel.setBounds(new Rectangle(5, 125, 160, 18));
    174174                add(categoryLabel);
    175                 categoryBox = new JComboBox();
     175                categoryBox = new JComboBox<>();
    176176                categoryBox.setBounds(new Rectangle(5, 142, 160, 18));
    177177                add(categoryBox);
     
    196196                addCatItem(Messages.getString("FerryCross"), Cat.SPM_FRRY);
    197197                addCatItem(Messages.getString("Anchorage"), Cat.SPM_ANCH);
    198                 mooringBox = new JComboBox();
     198                mooringBox = new JComboBox<>();
    199199                mooringBox.setBounds(new Rectangle(5, 142, 160, 18));
    200200                add(mooringBox);
  • applications/editors/josm/plugins/tagging-preset-tester/src/org/openstreetmap/josm/plugins/taggingpresettester/TaggingCellRenderer.java

    r29725 r30532  
    1616
    1717final public class TaggingCellRenderer extends DefaultListCellRenderer {
    18     @Override public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
     18    @Override public Component getListCellRendererComponent(JList<?> list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
    1919        TaggingPreset a = null;
    2020        if (value instanceof TaggingPreset)
  • applications/editors/josm/plugins/tracer2/.classpath

    r30047 r30532  
    22<classpath>
    33        <classpathentry kind="src" path="src"/>
    4         <classpathentry kind="src" path="test/src"/>
    5         <!-- <classpathentry exported="true" kind="con" path="GROOVY_SUPPORT"/>
    6         <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
    7         <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
    8         <classpathentry kind="lib" path="/JOSM/dist/josm-custom.jar" sourcepath="/JOSM/src"/>
    9         <classpathentry kind="lib" path="/JOSM/test/build" sourcepath="/JOSM/test/functional"/>
    10         <classpathentry kind="lib" path="test/config"/>
    11         <classpathentry kind="output" path="build"/> -->
     4        <classpathentry combineaccessrules="false" kind="src" path="/JOSM"/>
     5        <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
     6        <classpathentry kind="output" path="bin"/>
    127</classpath>
  • applications/editors/josm/plugins/tracer2/src/org/openstreetmap/josm/plugins/tracer2/preferences/ServerParamDialog.java

    r30049 r30532  
    5656    private JTextField m_oDescription = new JTextField();
    5757    private JTextArea m_oUrl = new JTextArea(5,5);
    58     private JComboBox m_oTileSize;
    59     private JComboBox m_oResolution;
     58    private JComboBox<String> m_oTileSize;
     59    private JComboBox<String> m_oResolution;
    6060    //private JTextField m_oSkipBottom = new JTextField();
    61     private JComboBox m_oMode;
     61    private JComboBox<String> m_oMode;
    6262    private JTextField m_oThreshold = new JTextField();
    63     private JComboBox m_oPointsPerCircle;
     63    private JComboBox<String> m_oPointsPerCircle;
    6464    private JTextField m_oTag = new JTextField();
    6565    private JTextField m_oPreferredValues = new JTextField();
     
    112112    }
    113113   
    114     private void loadComboBox( JComboBox c, String strValue, String[] astrValues ) {
     114    private void loadComboBox( JComboBox<?> c, String strValue, String[] astrValues ) {
    115115        int pos = 0;
    116116        for ( String str: astrValues ) {
     
    123123    }
    124124   
    125     private String saveComboBox( JComboBox c, String[] astrValues ) {
     125    private String saveComboBox( JComboBox<?> c, String[] astrValues ) {
    126126        return astrValues[c.getSelectedIndex()];
    127127    }
     
    140140        setButtonIcons(new String[] { "ok.png", "cancel.png" });
    141141       
    142         m_oTileSize = new JComboBox(m_astrTileSize);
    143         m_oResolution = new JComboBox(m_astrResolution);
    144         m_oMode = new JComboBox(m_astrMode);
    145         m_oPointsPerCircle = new JComboBox(m_astrPointsPerCircle);
     142        m_oTileSize = new JComboBox<>(m_astrTileSize);
     143        m_oResolution = new JComboBox<>(m_astrResolution);
     144        m_oMode = new JComboBox<>(m_astrMode);
     145        m_oPointsPerCircle = new JComboBox<>(m_astrPointsPerCircle);
    146146       
    147147        load();
  • applications/editors/josm/plugins/tracer2/src/org/openstreetmap/josm/plugins/tracer2/preferences/ServerParamSelectDialog.java

    r30049 r30532  
    3434public class ServerParamSelectDialog extends JPanel {
    3535       
    36     /**
    37          *
    38          */
    39         private static final long serialVersionUID = 5655941545321036641L;
    40        
    41         private JComboBox m_oComboBox;
     36        private JComboBox<String> m_oComboBox;
    4237    List<ServerParam> m_listServerParam;
    4338    private boolean m_bShow = true;
     
    7469                i++;
    7570        }
    76         m_oComboBox = new JComboBox(astr);
     71        m_oComboBox = new JComboBox<>(astr);
    7772        m_oComboBox.setSelectedIndex(pos);
    7873       
  • applications/editors/josm/plugins/turnrestrictions/test/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionLegEditorTest.java

    r23192 r30532  
    1515import javax.swing.JPanel;
    1616import javax.swing.JScrollPane;
    17 import javax.swing.JTextArea;
    1817
    1918import org.openstreetmap.josm.data.coor.LatLon;
     
    3534public class TurnRestrictionLegEditorTest extends JFrame {
    3635   
    37     private JTextArea taTest;
    3836    private TurnRestrictionLegEditor editor;
    3937    private TurnRestrictionEditorModel model;
    40     private JList lstObjects;
    41     private DefaultListModel listModel;
     38    private JList<OsmPrimitive> lstObjects;
     39    private DefaultListModel<OsmPrimitive> listModel;
    4240    private DataSet dataSet;
    43    
    4441   
    4542    protected JPanel buildLegEditorPanel() {
     
    7673    protected JPanel buildObjectListPanel() {
    7774        JPanel pnl = new JPanel(new BorderLayout());
    78         listModel = new DefaultListModel();
    79         pnl.add(new JScrollPane(lstObjects = new JList(listModel)), BorderLayout.CENTER);
     75        listModel = new DefaultListModel<>();
     76        pnl.add(new JScrollPane(lstObjects = new JList<>(listModel)), BorderLayout.CENTER);
    8077        lstObjects.setCellRenderer(new OsmPrimitivRenderer());     
    8178       
  • applications/editors/josm/plugins/turnrestrictions/test/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/ViaListTest.java

    r23192 r30532  
    2121 *
    2222 */
    23 public class ViaListTest  extends JFrame{
     23public class ViaListTest extends JFrame {
    2424   
    25     private ViaList lstVias;
    2625    private TurnRestrictionEditorModel model;
    27     private JList lstJOSMSelection;
    28    
    2926   
    3027    protected void build() {
    3128        DataSet ds = new DataSet();
    32         OsmDataLayer layer =new OsmDataLayer(ds, "test",null);
     29        OsmDataLayer layer =new OsmDataLayer(ds, "test", null);
    3330        // mock a controler
    3431        NavigationControler controler = new NavigationControler() {
     
    5451       
    5552        DefaultListSelectionModel selectionModel = new DefaultListSelectionModel();
    56         c.add(lstVias = new ViaList(new ViaListModel(model, selectionModel), selectionModel), gc);
     53        c.add(new ViaList(new ViaListModel(model, selectionModel), selectionModel), gc);
    5754       
    5855        gc.gridx = 1;
    59         c.add(lstJOSMSelection = new JList(), gc);
     56        c.add(new JList<>(), gc);
    6057       
    6158        setSize(600,600);       
  • applications/editors/josm/plugins/utilsplugin2/src/edu/princeton/cs/algs4/EdgeWeightedDigraph.java

    r28116 r30532  
    2121 *  <i>Algorithms, 4th Edition</i> by Robert Sedgewick and Kevin Wayne.
    2222 */
    23 
    24 
    25 
    2623public class EdgeWeightedDigraph {
    2724    private final int V;
     
    3229     * Create an empty edge-weighted digraph with V vertices.
    3330     */
     31    @SuppressWarnings("unchecked")
    3432    public EdgeWeightedDigraph(int V) {
    3533        if (V < 0) throw new RuntimeException("Number of vertices must be nonnegative");
     
    102100    }
    103101
    104 
    105102   /**
    106103     * Add the edge e to this digraph.
     
    111108        E++;
    112109    }
    113 
    114110
    115111   /**
     
    144140    }
    145141
    146 
    147 
    148142   /**
    149143     * Return a string representation of this graph.
     
    162156        return s.toString();
    163157    }
    164 
    165     /**
    166      * Test client.
    167      */
    168 //    public static void main(String[] args) {
    169 //        In in = new In(args[0]);
    170 //        EdgeWeightedDigraph G = new EdgeWeightedDigraph(in);
    171 //        StdOut.println(G);
    172 //    }
    173 
    174158}
  • applications/editors/josm/plugins/utilsplugin2/src/edu/princeton/cs/algs4/IndexMinPQ.java

    r28116 r30532  
    1919    private Key[] keys;      // keys[i] = priority of i
    2020
     21    @SuppressWarnings("unchecked")
    2122    public IndexMinPQ(int NMAX) {
    2223        keys = (Key[]) new Comparable[NMAX + 1];    // make this of length NMAX??
     
    186187        }
    187188    }
    188 
    189 
    190 //    public static void main(String[] args) {
    191 //        // insert a bunch of strings
    192 //        String[] strings = { "it", "was", "the", "best", "of", "times", "it", "was", "the", "worst" };
    193 //
    194 //        IndexMinPQ<String> pq = new IndexMinPQ<String>(strings.length);
    195 //        for (int i = 0; i < strings.length; i++) {
    196 //            pq.insert(i, strings[i]);
    197 //        }
    198 //
    199 //        // delete and print each key
    200 //        while (!pq.isEmpty()) {
    201 //            int i = pq.delMin();
    202 //            StdOut.println(i + " " + strings[i]);
    203 //        }
    204 //        StdOut.println();
    205 //
    206 //        // reinsert the same strings
    207 //        for (int i = 0; i < strings.length; i++) {
    208 //            pq.insert(i, strings[i]);
    209 //        }
    210 //
    211 //        // print each key using the iterator
    212 //        for (int i : pq) {
    213 //            StdOut.println(i + " " + strings[i]);
    214 //        }
    215 //        while (!pq.isEmpty()) {
    216 //            pq.delMin();
    217 //        }
    218 //
    219 //    }
    220189}
  • applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/customurl/ChooseURLAction.java

    r29769 r30532  
    5454        }
    5555        final JLabel label1=new JLabel(tr("Please select one of custom URLs (configured in Preferences)"));
    56         final JList list1=new JList(names);
     56        final JList<String> list1=new JList<>(names);
    5757        final JTextField editField=new JTextField();
    5858        final JCheckBox check1=new JCheckBox(tr("Ask every time"));
  • applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/replacegeometry/ReplaceGeometryUtils.java

    r30177 r30532  
    88import java.util.Arrays;
    99import java.util.Collection;
     10import java.util.Collections;
    1011import java.util.HashMap;
    1112import java.util.HashSet;
     
    1314import java.util.List;
    1415import java.util.Map;
    15 import java.util.Set;
    1616
    1717import javax.swing.JOptionPane;
     
    2424import org.openstreetmap.josm.command.DeleteCommand;
    2525import org.openstreetmap.josm.command.MoveCommand;
     26import org.openstreetmap.josm.corrector.UserCancelException;
    2627import org.openstreetmap.josm.data.coor.LatLon;
    2728import org.openstreetmap.josm.data.osm.Node;
     
    2930import org.openstreetmap.josm.data.osm.Relation;
    3031import org.openstreetmap.josm.data.osm.RelationMember;
    31 import org.openstreetmap.josm.data.osm.RelationToChildReference;
    3232import org.openstreetmap.josm.data.osm.TagCollection;
    3333import org.openstreetmap.josm.data.osm.Way;
    3434import org.openstreetmap.josm.gui.DefaultNameFormatter;
     35import org.openstreetmap.josm.gui.Notification;
    3536import org.openstreetmap.josm.gui.conflict.tags.CombinePrimitiveResolverDialog;
    36 import org.openstreetmap.josm.gui.conflict.tags.TagConflictResolutionUtil;
    3737
    3838import edu.princeton.cs.algs4.AssignmentProblem;
    39 import org.openstreetmap.josm.gui.Notification;
    40 import static org.openstreetmap.josm.tools.I18n.tr;
    4139
    4240/**
     
    4543 */
    4644public final class ReplaceGeometryUtils {
    47     private static final String TITLE = tr("Replace Geometry");
    4845    /**
    4946     * Replace new or uploaded object with new object
     
    168165
    169166        // merge tags
    170         Collection<Command> tagResolutionCommands = getTagConflictResolutionCommands(subjectNode, referenceObject);
    171         if (tagResolutionCommands == null) {
     167        try {
     168            commands.addAll(getTagConflictResolutionCommands(subjectNode, referenceObject));
     169        } catch (UserCancelException e) {
    172170            // user canceled tag merge dialog
    173171            return null;
    174172        }
    175         commands.addAll(tagResolutionCommands);
    176173
    177174        // replace sacrificial node in way with node that is being upgraded
     
    254251               
    255252        // merge tags
    256         Collection<Command> tagResolutionCommands = getTagConflictResolutionCommands(referenceWay, subjectWay);
    257         if (tagResolutionCommands == null) {
     253        try {
     254            commands.addAll(getTagConflictResolutionCommands(referenceWay, subjectWay));
     255        } catch (UserCancelException e) {
    258256            // user canceled tag merge dialog
    259257            return null;
    260258        }
    261         commands.addAll(tagResolutionCommands);
    262259       
    263260        // Prepare a list of nodes that are not used anywhere except in the way
     
    452449     * @param source object tags are merged from
    453450     * @param target object tags are merged to
    454      * @return
    455      */
    456     protected static List<Command> getTagConflictResolutionCommands(OsmPrimitive source, OsmPrimitive target) {
    457         // determine if the same key in each object has different values
    458         boolean keysWithMultipleValues;
    459         Set<OsmPrimitive> set = new HashSet<OsmPrimitive>();
    460         set.add(source);
    461         set.add(target);
    462         TagCollection tagCol = TagCollection.unionOfAllPrimitives(set);
    463         Set<String> keys = tagCol.getKeysWithMultipleValues();
    464         keysWithMultipleValues = !keys.isEmpty();
    465            
     451     * @return The list of {@link Command commands} needed to apply resolution actions.
     452     * @throws UserCancelException If the user cancelled a dialog.
     453     */
     454    protected static List<Command> getTagConflictResolutionCommands(OsmPrimitive source, OsmPrimitive target) throws UserCancelException {
    466455        Collection<OsmPrimitive> primitives = Arrays.asList(source, target);
    467        
    468         Set<RelationToChildReference> relationToNodeReferences = RelationToChildReference.getRelationToChildReferences(primitives);
    469 
    470         // build the tag collection
    471         TagCollection tags = TagCollection.unionOfAllPrimitives(primitives);
    472         TagConflictResolutionUtil.combineTigerTags(tags);
    473         TagConflictResolutionUtil.normalizeTagCollectionBeforeEditing(tags, primitives);
    474         TagCollection tagsToEdit = new TagCollection(tags);
    475         TagConflictResolutionUtil.completeTagCollectionForEditing(tagsToEdit);
    476 
    477456        // launch a conflict resolution dialog, if necessary
    478         CombinePrimitiveResolverDialog dialog = CombinePrimitiveResolverDialog.getInstance();
    479         dialog.getTagConflictResolverModel().populate(tagsToEdit, tags.getKeysWithMultipleValues());
    480         dialog.getRelationMemberConflictResolverModel().populate(relationToNodeReferences);
    481         dialog.setTargetPrimitive(target);
    482         dialog.prepareDefaultDecisions();
    483 
    484         // conflict resolution is necessary if there are conflicts in the merged tags
    485         // or if both objects have relation memberships
    486         if (keysWithMultipleValues ||
    487                 (!RelationToChildReference.getRelationToChildReferences(source).isEmpty() &&
    488                  !RelationToChildReference.getRelationToChildReferences(target).isEmpty())) {
    489             dialog.setVisible(true);
    490             if (dialog.isCanceled()) {
    491                 return null;
    492             }
    493         }
    494         return dialog.buildResolutionCommands();
    495     }
    496 
     457        return CombinePrimitiveResolverDialog.launchIfNecessary(
     458                TagCollection.unionOfAllPrimitives(primitives), primitives, Collections.singleton(target));
     459    }
    497460   
    498461    /**
  • applications/editors/josm/plugins/waypoint_search/src/org/openstreetmap/josm/plugins/waypointSearch/SelectWaypointDialog.java

    r27467 r30532  
    1717import static org.openstreetmap.josm.tools.I18n.tr;
    1818
    19 
    2019public class SelectWaypointDialog extends ToggleDialog implements KeyListener, MouseListener {
    2120
    2221    private JTextField searchPattern = new JTextField(20);
    23     private DefaultListModel listModel = new DefaultListModel();
    24     private JList searchResult = new JList(listModel);
     22    private DefaultListModel<String> listModel = new DefaultListModel<>();
     23    private JList<String> searchResult = new JList<>(listModel);
    2524    private List<Marker> SearchResultObjectCache = new ArrayList<Marker>();
    2625    private boolean first_time_search = true;
    2726    private Engine engine = new Engine();
    28    
    2927   
    3028    public SelectWaypointDialog(String name, String iconName, String tooltip,
     
    3331        build();
    3432    }
    35    
    3633
    3734    protected void build() {
     
    6057        createLayout(panel, false, null);
    6158    }
    62 
    63    
    6459   
    6560    public void updateSearchResults(){
     
    7671        }
    7772    }
    78    
    7973
    8074    @Override
     
    8276        // TODO Auto-generated method stub
    8377    }
    84 
    8578
    8679    @Override
     
    9083    }
    9184
    92 
    9385    @Override
    9486    public void keyTyped(KeyEvent arg0) {
    9587        first_time_search = false;
    9688    }
    97 
    9889
    9990    @Override
     
    10899    }
    109100
    110 
    111101    @Override
    112102    public void mouseEntered(MouseEvent arg0) {
    113         // TODO Auto-generated method stub
    114        
    115103    }
    116 
    117104
    118105    @Override
    119106    public void mouseExited(MouseEvent arg0) {
    120         // TODO Auto-generated method stub
    121        
    122107    }
    123 
    124108
    125109    @Override
     
    128112            searchPattern.selectAll();
    129113        }
    130        
    131114    }
    132 
    133115
    134116    @Override
    135117    public void mouseReleased(MouseEvent arg0) {
    136         // TODO Auto-generated method stub
    137        
    138118    }
    139119}
  • applications/editors/josm/plugins/wikipedia/src/org/wikipedia/WikipediaToggleDialog.java

    r30100 r30532  
    6060    final StringProperty wikipediaLang = new StringProperty("wikipedia.lang", LanguageInfo.getJOSMLocaleCode().substring(0, 2));
    6161    final Set<String> articles = new HashSet<String>();
    62     final DefaultListModel model = new DefaultListModel();
    63     final JList list = new JList(model) {
     62    final DefaultListModel<WikipediaEntry> model = new DefaultListModel<>();
     63    final JList<WikipediaEntry> list = new JList<WikipediaEntry>(model) {
    6464
    6565        {
     
    8484
    8585                @Override
    86                 public JLabel getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
     86                public JLabel getListCellRendererComponent(JList<?> list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
    8787                    JLabel label = (JLabel) super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
    8888                    final WikipediaEntry entry = (WikipediaEntry) value;
Note: See TracChangeset for help on using the changeset viewer.