Changeset 31850 in osm for applications/editors/josm


Ignore:
Timestamp:
2015-12-22T19:02:20+01:00 (9 years ago)
Author:
simon04
Message:

JOSM/wikipedia: use Objects.equals

File:
1 edited

Legend:

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

    r31849 r31850  
    1717import java.util.List;
    1818import java.util.Map;
     19import java.util.Objects;
    1920import java.util.Scanner;
    2021import java.util.regex.Matcher;
     
    247248            if (this == o) return true;
    248249            if (o == null || getClass() != o.getClass()) return false;
    249 
    250             WikipediaLangArticle that = (WikipediaLangArticle) o;
    251 
    252             if (article != null ? !article.equals(that.article) : that.article != null) return false;
    253             if (lang != null ? !lang.equals(that.lang) : that.lang != null) return false;
    254 
    255             return true;
     250            final WikipediaLangArticle that = (WikipediaLangArticle) o;
     251            return Objects.equals(lang, that.lang) &&
     252                    Objects.equals(article, that.article);
     253        }
     254
     255        @Override
     256        public int hashCode() {
     257            return Objects.hash(lang, article);
    256258        }
    257259    }
Note: See TracChangeset for help on using the changeset viewer.