From 277077cd978b708f6cdcf9132154342d17978c55 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Fri, 22 Apr 2016 16:41:31 +0300 Subject: fix tag equality --- src/main/java/com/juick/Tag.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/main/java/com/juick/Tag.java b/src/main/java/com/juick/Tag.java index 3cee3358..119aad99 100644 --- a/src/main/java/com/juick/Tag.java +++ b/src/main/java/com/juick/Tag.java @@ -17,11 +17,13 @@ */ package com.juick; +import java.util.Objects; + /** * * @author Ugnich Anton */ -public class Tag implements Comparable { +public class Tag { public String Name = null; public int TID = 0; @@ -29,7 +31,11 @@ public class Tag implements Comparable { public int UsageCnt = 0; @Override - public int compareTo(Tag o) { - return this.Name.compareTo(o.Name); + public boolean equals(Object o) { + boolean equal = false; + if (o != null && o instanceof Tag) { + equal = Objects.equals(Name, ((Tag) o).Name); + } + return equal; } } -- cgit v1.2.3