RadiusNetworks / android-ibeacon-service

An Android library providing APIs to interact with iBeacons
http://developer.radiusnetworks.com/ibeacon/android/index.html
681 stars 244 forks source link

Region equals() method bug #12

Closed rwozniak closed 10 years ago

rwozniak commented 10 years ago

In the method of class Region:

        public boolean equals(Object other) {
                 if (other instanceof Region) {
                        return ((Region)other).uniqueId == this.uniqueId;                         
                 }
                 return false;
        }

uniqueIds (which are Strings) are compared using '==' instead of .equals(). This will cause problems in collections (eg. removing from Map).

davidgyoung commented 10 years ago

Great catch, thanks! Fixed in e18f35ad056f544d9fc25cde1dfb78520180ceb4 and binary release 0.7.2