Skip to content

Commit

Permalink
Fix NeedBraces
Browse files Browse the repository at this point in the history
  • Loading branch information
Kirill380 committed Sep 27, 2016
1 parent f864c0a commit 58729e8
Show file tree
Hide file tree
Showing 9 changed files with 128 additions and 60 deletions.
Expand Up @@ -45,8 +45,9 @@ public class TopicListHashCalculator {
* @return the integer
*/
public static Integer calculateTopicListHash(List<Topic> topics) {
if (topics == null)
if (topics == null) {
return NULL_LIST_HASH;
}

int result = EMPTRY_LIST_HASH;
if (!topics.isEmpty()) {
Expand Down
Expand Up @@ -122,7 +122,11 @@ private static JsonNode injectUuidsFromJsonNodes(JsonNode json, Schema schema) {
.filter(f -> !f.name().equals(UUID_FIELD))
.forEach(f -> injectUuidsFromJsonNodes(json.get(f.name()), f.schema()));

boolean addressable = schema.getFields().stream().filter(f -> f.name().equals(UUID_FIELD)).findFirst().isPresent();
boolean addressable = schema.getFields().stream()
.filter(f -> f.name().equals(UUID_FIELD))
.findFirst()
.isPresent();

if (addressable) {
((ObjectNode) json).put(UUID_FIELD, (Integer) null);
}
Expand Down Expand Up @@ -151,8 +155,10 @@ public static void removeUuids(JsonNode json) {
}

for (JsonNode node : json) {
if (node.isContainerNode())
if (node.isContainerNode()) {
removeUuids(node);
}
}
}

}
Expand Up @@ -203,45 +203,61 @@ public int hashCode() {

@Override
public boolean equals(Object obj) {
if (this == obj)
if (this == obj) {
return true;
if (obj == null)
}
if (obj == null) {
return false;
if (getClass() != obj.getClass())
}
if (getClass() != obj.getClass()) {
return false;
}
CTLSchema other = (CTLSchema) obj;
if (body == null) {
if (other.body != null)
if (other.body != null) {
return false;
} else if (!body.equals(other.body))
}
} else if (!body.equals(other.body)) {
return false;
if (createdTime != other.createdTime)
}
if (createdTime != other.createdTime) {
return false;
}
if (createdUsername == null) {
if (other.createdUsername != null)
if (other.createdUsername != null) {
return false;
} else if (!createdUsername.equals(other.createdUsername))
}
} else if (!createdUsername.equals(other.createdUsername)) {
return false;
}
if (defaultRecord == null) {
if (other.defaultRecord != null)
if (other.defaultRecord != null) {
return false;
} else if (!defaultRecord.equals(other.defaultRecord))
}
} else if (!defaultRecord.equals(other.defaultRecord)) {
return false;
}
if (dependencySet == null) {
if (other.dependencySet != null)
if (other.dependencySet != null) {
return false;
} else if (!dependencySet.equals(other.dependencySet))
}
} else if (!dependencySet.equals(other.dependencySet)) {
return false;
}
if (metaInfo == null) {
if (other.metaInfo != null)
if (other.metaInfo != null) {
return false;
} else if (!metaInfo.equals(other.metaInfo))
}
} else if (!metaInfo.equals(other.metaInfo)) {
return false;
}
if (version == null) {
if (other.version != null)
if (other.version != null) {
return false;
} else if (!version.equals(other.version))
}
} else if (!version.equals(other.version)) {
return false;
}
return true;
}

Expand Down
Expand Up @@ -152,28 +152,37 @@ public int hashCode() {

@Override
public boolean equals(Object obj) {
if (this == obj)
if (this == obj) {
return true;
if (obj == null)
}
if (obj == null) {
return false;
if (getClass() != obj.getClass())
}
if (getClass() != obj.getClass()) {
return false;
}
CTLSchemaMetaInfo other = (CTLSchemaMetaInfo) obj;
if (application == null) {
if (other.application != null)
if (other.application != null) {
return false;
} else if (!application.equals(other.application))
}
} else if (!application.equals(other.application)) {
return false;
}
if (fqn == null) {
if (other.fqn != null)
if (other.fqn != null) {
return false;
} else if (!fqn.equals(other.fqn))
}
} else if (!fqn.equals(other.fqn)) {
return false;
}
if (tenant == null) {
if (other.tenant != null)
if (other.tenant != null) {
return false;
} else if (!tenant.equals(other.tenant))
}
} else if (!tenant.equals(other.tenant)) {
return false;
}
return true;
}

Expand Down
Expand Up @@ -204,11 +204,14 @@ private void setBackreference(List<EventClassFamilyVersion> ecfvList) {
ecfvList.forEach(ecfv -> ecfv.getRecords().forEach(ec -> ec.setEcfv(ecfv)));
}


@Override
public boolean validateEventClassFamilyFqns(String eventClassFamilyId, List<String> fqns) {
Set<String> storedFQNs = getFqnSetForECF(eventClassFamilyId);
for (String fqn : fqns) {
if (storedFQNs.contains(fqn)) return false;
if (storedFQNs.contains(fqn)) {
return false;
}
}
return true;
}
Expand Down Expand Up @@ -278,7 +281,9 @@ public boolean isValidECFListInSdkProfile(List<AefMapInfoDto> aefList) {
.findFirst();
if (optEcfv.isPresent()) {
for (EventClass ec : optEcfv.get().getRecords()) {
if (!ecList.add(ec)) return false;
if (!ecList.add(ec)) {
return false;
}
}
}
}
Expand All @@ -291,7 +296,8 @@ public Set<String> getFqnSetForECF(String ecfId) {
LOG.debug("Get fqn list for event class family by id [{}] ", ecfId);
Set<String> storedFQNs = new HashSet<>();
EventClassFamily ecf = eventClassFamilyDao.findById(ecfId);
ecf.getSchemas().forEach(ecfv -> ecfv.getRecords().forEach(ec -> storedFQNs.add(ec.getFqn())));
ecf.getSchemas()
.forEach(ecfv -> ecfv.getRecords().forEach(ec -> storedFQNs.add(ec.getFqn())));
return storedFQNs;
} else {
throw new IncorrectParameterException("Incorrect event class family id: " + ecfId);
Expand Down
Expand Up @@ -67,13 +67,21 @@ public void setMail(String mail) {

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}

UserProfileUpdateDto that = (UserProfileUpdateDto) o;

if (!firstName.equals(that.firstName)) return false;
if (!lastName.equals(that.lastName)) return false;
if (!firstName.equals(that.firstName)) {
return false;
}
if (!lastName.equals(that.lastName)) {
return false;
}
return mail.equals(that.mail);

}
Expand All @@ -88,10 +96,11 @@ public int hashCode() {

@Override
public String toString() {
return "UserProfileUpdateDto{" +
"firstName='" + firstName + '\'' +
", lastName='" + lastName + '\'' +
", mail='" + mail + '\'' +
'}';
final StringBuilder sb = new StringBuilder("UserProfileUpdateDto{");
sb.append("firstName='").append(firstName).append('\'');
sb.append(", lastName='").append(lastName).append('\'');
sb.append(", mail='").append(mail).append('\'');
sb.append('}');
return sb.toString();
}
}
Expand Up @@ -120,37 +120,48 @@ public int hashCode() {

@Override
public boolean equals(Object obj) {
if (this == obj)
if (this == obj) {
return true;
if (obj == null)
}
if (obj == null) {
return false;
if (getClass() != obj.getClass())
}
if (getClass() != obj.getClass()) {
return false;
}
CTLSchemaDto other = (CTLSchemaDto) obj;

if (id == null) {
if (other.id != null)
if (other.id != null) {
return false;
} else if (!id.equals(other.id))
}
} else if (!id.equals(other.id)) {
return false;
}

if (dependencySet == null) {
if (other.dependencySet != null)
if (other.dependencySet != null) {
return false;
} else if (!dependencySet.equals(other.dependencySet))
}
} else if (!dependencySet.equals(other.dependencySet)) {
return false;
}

if (metaInfo == null) {
if (other.metaInfo != null)
if (other.metaInfo != null) {
return false;
} else if (!metaInfo.equals(other.metaInfo))
}
} else if (!metaInfo.equals(other.metaInfo)) {
return false;
}

if (version == null) {
if (other.version != null)
if (other.version != null) {
return false;
} else if (!version.equals(other.version))
}
} else if (!version.equals(other.version)) {
return false;
}

return true;
}
Expand Down
Expand Up @@ -117,28 +117,37 @@ public int hashCode() {

@Override
public boolean equals(Object obj) {
if (this == obj)
if (this == obj) {
return true;
if (obj == null)
}
if (obj == null) {
return false;
if (getClass() != obj.getClass())
}
if (getClass() != obj.getClass()) {
return false;
}
CTLSchemaMetaInfoDto other = (CTLSchemaMetaInfoDto) obj;
if (applicationId == null) {
if (other.applicationId != null)
if (other.applicationId != null) {
return false;
} else if (!applicationId.equals(other.applicationId))
}
} else if (!applicationId.equals(other.applicationId)) {
return false;
}
if (fqn == null) {
if (other.fqn != null)
if (other.fqn != null) {
return false;
} else if (!fqn.equals(other.fqn))
}
} else if (!fqn.equals(other.fqn)) {
return false;
}
if (tenantId == null) {
if (other.tenantId != null)
if (other.tenantId != null) {
return false;
} else if (!tenantId.equals(other.tenantId))
}
} else if (!tenantId.equals(other.tenantId)) {
return false;
}
return true;
}

Expand Down
Expand Up @@ -19,6 +19,7 @@
import java.io.Serializable;

public final class EventClassFamilyVersion implements Serializable {

/**
*
*/
Expand Down

0 comments on commit 58729e8

Please sign in to comment.