| Index: chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetArticle.java
|
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetArticle.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetArticle.java
|
| index 7fb037243e4133847d51008b3c1b771c26403b64..007ef8e04036bff03314ea5a127ac417172c8a73 100644
|
| --- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetArticle.java
|
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetArticle.java
|
| @@ -18,8 +18,8 @@ public class SnippetArticle implements NewTabPageItem {
|
| /** The category of this article. */
|
| public final int mCategory;
|
|
|
| - /** The unique identifier for this article. */
|
| - public final String mId;
|
| + /** The identifier for this article within the category - not necessarily unique globally. */
|
| + public final String mWithinCategoryId;
|
|
|
| /** The title of this article. */
|
| public final String mTitle;
|
| @@ -64,11 +64,11 @@ public class SnippetArticle implements NewTabPageItem {
|
| /**
|
| * Creates a SnippetArticleListItem object that will hold the data.
|
| */
|
| - public SnippetArticle(int category, String id, String title, String publisher,
|
| + public SnippetArticle(int category, String withinCategoryId, String title, String publisher,
|
| String previewText, String url, String ampUrl, long timestamp, float score,
|
| int position, @ContentSuggestionsCardLayoutEnum int cardLayout) {
|
| mCategory = category;
|
| - mId = id;
|
| + mWithinCategoryId = withinCategoryId;
|
| mTitle = title;
|
| mPublisher = publisher;
|
| mPreviewText = previewText;
|
| @@ -83,12 +83,13 @@ public class SnippetArticle implements NewTabPageItem {
|
| @Override
|
| public boolean equals(Object other) {
|
| if (!(other instanceof SnippetArticle)) return false;
|
| - return mId.equals(((SnippetArticle) other).mId);
|
| + SnippetArticle rhs = (SnippetArticle) other;
|
| + return mCategory == rhs.mCategory && mWithinCategoryId.equals(rhs.mWithinCategoryId);
|
| }
|
|
|
| @Override
|
| public int hashCode() {
|
| - return mId.hashCode();
|
| + return mCategory ^ mWithinCategoryId.hashCode();
|
| }
|
|
|
| @Override
|
|
|