First batch of errorprone fixes. #3061

This commit is contained in:
Mark H. Wood
2020-11-24 10:55:08 -05:00
parent 96742fe558
commit 65f04fcec9
29 changed files with 134 additions and 161 deletions

View File

@@ -24,7 +24,6 @@ import javax.persistence.Table;
import javax.persistence.Transient;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.logging.log4j.Logger;
import org.dspace.content.comparator.NameAscendingComparator;
import org.dspace.content.factory.ContentServiceFactory;
import org.dspace.content.service.CommunityService;
@@ -42,18 +41,12 @@ import org.hibernate.proxy.HibernateProxyHelper;
* <code>update</code> is called.
*
* @author Robert Tansley
* @version $Revision$
*/
@Entity
@Table(name = "community")
@Cacheable
@org.hibernate.annotations.Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE, include = "non-lazy")
public class Community extends DSpaceObject implements DSpaceObjectLegacySupport {
/**
* log4j category
*/
private static final Logger log = org.apache.logging.log4j.LogManager.getLogger(Community.class);
@Column(name = "community_id", insertable = false, updatable = false)
private Integer legacyId;
@@ -215,7 +208,7 @@ public class Community extends DSpaceObject implements DSpaceObjectLegacySupport
*/
@Override
public boolean equals(Object other) {
if (other == null) {
if (!(other instanceof Community)) {
return false;
}
Class<?> objClass = HibernateProxyHelper.getClassWithoutInitializingProxy(other);
@@ -223,11 +216,7 @@ public class Community extends DSpaceObject implements DSpaceObjectLegacySupport
return false;
}
final Community otherCommunity = (Community) other;
if (!this.getID().equals(otherCommunity.getID())) {
return false;
}
return true;
return this.getID().equals(otherCommunity.getID());
}
@Override