Ignore:
Timestamp:
2014-10-18T23:07:52+02:00 (10 years ago)
Author:
donvip
Message:

[josm_plugins] fix Java 7 / unused code warnings

Location:
applications/editors/josm/plugins/wikipedia/src/org/wikipedia
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/wikipedia/src/org/wikipedia/WikipediaAddNamesAction.java

    r30629 r30737  
    3131    public void actionPerformed(ActionEvent e) {
    3232        final WikipediaApp.WikipediaLangArticle wp = WikipediaApp.WikipediaLangArticle.parseTag("wikipedia", getWikipediaValue());
    33         List<String[]> tags = new ArrayList<String[]>();
     33        List<String[]> tags = new ArrayList<>();
    3434        for (WikipediaApp.WikipediaLangArticle i : WikipediaApp.getInterwikiArticles(wp.lang, wp.article)) {
    3535            if (useWikipediaLangArticle(i)) {
  • applications/editors/josm/plugins/wikipedia/src/org/wikipedia/WikipediaApp.java

    r30448 r30737  
    5454            NodeList nodes = (NodeList) xpathPlacemark.evaluate(doc, XPathConstants.NODESET);
    5555            // construct WikipediaEntry for each XML element
    56             List<WikipediaEntry> entries = new ArrayList<WikipediaEntry>(nodes.getLength());
     56            List<WikipediaEntry> entries = new ArrayList<>(nodes.getLength());
    5757            for (int i = 0; i < nodes.getLength(); i++) {
    5858                final String[] coord = xpathCoord.evaluate(nodes.item(i)).split(",");
     
    7979            System.out.println("Wikipedia: GET " + url);
    8080            final Scanner scanner = new Scanner(new URL(url).openStream(), "UTF-8").useDelimiter("\n");
    81             final List<WikipediaEntry> entries = new ArrayList<WikipediaEntry>();
     81            final List<WikipediaEntry> entries = new ArrayList<>();
    8282            while (scanner.hasNext()) {
    8383                final String article = scanner.next().trim().replace("_", " ");
     
    9292    static List<WikipediaEntry> getEntriesFromClipboard(final String wikipediaLang) {
    9393        final List<String> clipboardLines = Arrays.asList(Utils.getClipboardContent().split("[\\n\\r]+"));
    94         return new ArrayList<WikipediaEntry>(Utils.transform(clipboardLines, new Function<String, WikipediaEntry>() {
     94        return new ArrayList<>(Utils.transform(clipboardLines, new Function<String, WikipediaEntry>() {
    9595
    9696            @Override
     
    102102
    103103    static void updateWIWOSMStatus(String wikipediaLang, Collection<WikipediaEntry> entries) {
    104         Collection<String> articleNames = new ArrayList<String>();
     104        Collection<String> articleNames = new ArrayList<>();
    105105        for (WikipediaEntry i : entries) {
    106106            articleNames.add(i.wikipediaArticle);
    107107        }
    108         Map<String, Boolean> status = new HashMap<String, Boolean>();
     108        Map<String, Boolean> status = new HashMap<>();
    109109        if (!articleNames.isEmpty()) {
    110110            final String url = "https://tools.wmflabs.org/wiwosm/osmjson/getGeoJSON.php?action=check"
     
    162162    static Collection<WikipediaLangArticle> getInterwikiArticles(String wikipediaLang, String article) {
    163163        try {
    164             Collection<WikipediaLangArticle> r = new ArrayList<WikipediaLangArticle>();
     164            Collection<WikipediaLangArticle> r = new ArrayList<>();
    165165            final String url = "https://" + wikipediaLang + ".wikipedia.org/w/api.php" +
    166166                    "?action=query" +
  • applications/editors/josm/plugins/wikipedia/src/org/wikipedia/WikipediaToggleDialog.java

    r30532 r30737  
    5959    String titleContext = null;
    6060    final StringProperty wikipediaLang = new StringProperty("wikipedia.lang", LanguageInfo.getJOSMLocaleCode().substring(0, 2));
    61     final Set<String> articles = new HashSet<String>();
     61    final Set<String> articles = new HashSet<>();
    6262    final DefaultListModel<WikipediaEntry> model = new DefaultListModel<>();
    6363    final JList<WikipediaEntry> list = new JList<WikipediaEntry>(model) {
Note: See TracChangeset for help on using the changeset viewer.