Skip to content

Commit

Permalink
KAA-1279: Fixed about 200 warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
sashadidukh committed Sep 30, 2016
1 parent 3da8493 commit 8f455fa
Show file tree
Hide file tree
Showing 42 changed files with 385 additions and 288 deletions.
Expand Up @@ -104,20 +104,21 @@ public void editFields(AbstractSchemaDto other) {
}

@Override
public boolean equals(Object o) {
if (this == o) {
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!(o instanceof AbstractSchemaDto)) {
if (!(obj instanceof AbstractSchemaDto)) {
return false;
}

AbstractSchemaDto that = (AbstractSchemaDto) o;
AbstractSchemaDto that = (AbstractSchemaDto) obj;

if (version != that.version) {
return false;
}
if (applicationId != null ? !applicationId.equals(that.applicationId) : that.applicationId != null) {
if (applicationId != null ? !applicationId.equals(that.applicationId) :
that.applicationId != null) {
return false;
}
if (schema != null ? !schema.equals(that.schema) : that.schema != null) {
Expand Down
Expand Up @@ -202,29 +202,31 @@ public void setVersion(Long version) {
}

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

AbstractStructureDto that = (AbstractStructureDto) o;
AbstractStructureDto that = (AbstractStructureDto) obj;

if (lastModifyTime != that.lastModifyTime) {
return false;
}
if (sequenceNumber != that.sequenceNumber) {
return false;
}
if (applicationId != null ? !applicationId.equals(that.applicationId) : that.applicationId != null) {
if (applicationId != null ? !applicationId.equals(that.applicationId) :
that.applicationId != null) {
return false;
}
if (body != null ? !body.equals(that.body) : that.body != null) {
return false;
}
if (endpointGroupId != null ? !endpointGroupId.equals(that.endpointGroupId) : that.endpointGroupId != null) {
if (endpointGroupId != null ? !endpointGroupId.equals(that.endpointGroupId) :
that.endpointGroupId != null) {
return false;
}
if (status != that.status) {
Expand All @@ -247,15 +249,15 @@ public int hashCode() {

@Override
public String toString() {
return "AbstractStructureDto{" +
"id='" + id + '\'' +
", applicationId='" + applicationId + '\'' +
", endpointGroupId='" + endpointGroupId + '\'' +
", sequenceNumber=" + sequenceNumber +
", lastModifyTime=" + lastModifyTime +
", status=" + status +
", version=" + version +
'}';
return "AbstractStructureDto{"
+ "id='" + id + '\''
+ ", applicationId='" + applicationId + '\''
+ ", endpointGroupId='" + endpointGroupId + '\''
+ ", sequenceNumber=" + sequenceNumber
+ ", lastModifyTime=" + lastModifyTime
+ ", status=" + status
+ ", version=" + version
+ '}';
}

public int incrementSeqNum() {
Expand Down
Expand Up @@ -80,20 +80,21 @@ public void setCredentialsServiceName(String credentialsServiceName) {
}

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

ApplicationDto that = (ApplicationDto) o;
ApplicationDto that = (ApplicationDto) obj;

if (sequenceNumber != that.sequenceNumber) {
return false;
}
if (applicationToken != null ? !applicationToken.equals(that.applicationToken) : that.applicationToken != null) {
if (applicationToken != null ? !applicationToken.equals(that.applicationToken) :
that.applicationToken != null) {
return false;
}
if (tenantId != null ? !tenantId.equals(that.tenantId) : that.tenantId != null) {
Expand All @@ -117,7 +118,13 @@ public int hashCode() {

@Override
public String toString() {
return "ApplicationDto{" + "id='" + id + '\'' + ", applicationToken='" + applicationToken + '\'' + ", name='" + name + '\''
+ ", sequenceNumber=" + sequenceNumber + ", tenantId='" + tenantId + ", credentialsServiceName='" + credentialsServiceName + '\'' + '}';
return "ApplicationDto{"
+ "id='" + id + '\''
+ ", applicationToken='" + applicationToken
+ '\'' + ", name='" + name + '\''
+ ", sequenceNumber=" + sequenceNumber
+ ", tenantId='" + tenantId
+ ", credentialsServiceName='" + credentialsServiceName + '\''
+ '}';
}
}
Expand Up @@ -43,19 +43,21 @@ public void setChangeNotificationDto(ChangeNotificationDto changeNotificationDto
}

@Override
public boolean equals(Object o) {
if (this == o) {
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!(o instanceof ChangeConfigurationNotification)) {
if (!(obj instanceof ChangeConfigurationNotification)) {
return false;
}
ChangeConfigurationNotification that = (ChangeConfigurationNotification) o;
ChangeConfigurationNotification that = (ChangeConfigurationNotification) obj;

if (configurationDto != null ? !configurationDto.equals(that.configurationDto) : that.configurationDto != null) {
if (configurationDto != null ? !configurationDto.equals(that.configurationDto) :
that.configurationDto != null) {
return false;
}
if (changeNotificationDto != null ? !changeNotificationDto.equals(that.changeNotificationDto) : that.changeNotificationDto != null) {
if (changeNotificationDto != null ? !changeNotificationDto.equals(that.changeNotificationDto) :
that.changeNotificationDto != null) {
return false;
}

Expand All @@ -71,9 +73,9 @@ public int hashCode() {

@Override
public String toString() {
return "ChangeConfigurationNotification{" +
"configurationDto=" + configurationDto +
", changeNotificationDto=" + changeNotificationDto +
'}';
return "ChangeConfigurationNotification{"
+ "configurationDto=" + configurationDto
+ ", changeNotificationDto=" + changeNotificationDto
+ '}';
}
}
Expand Up @@ -88,26 +88,29 @@ public void setTopicId(String topicId) {
}

@Override
public boolean equals(Object o) {
if (this == o) {
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!(o instanceof ChangeDto)) {
if (!(obj instanceof ChangeDto)) {
return false;
}

ChangeDto changeDto = (ChangeDto) o;
ChangeDto changeDto = (ChangeDto) obj;

if (cfVersion != changeDto.cfVersion) {
return false;
}
if (configurationId != null ? !configurationId.equals(changeDto.configurationId) : changeDto.configurationId != null) {
if (configurationId != null ? !configurationId.equals(changeDto.configurationId) :
changeDto.configurationId != null) {
return false;
}
if (endpointGroupId != null ? !endpointGroupId.equals(changeDto.endpointGroupId) : changeDto.endpointGroupId != null) {
if (endpointGroupId != null ? !endpointGroupId.equals(changeDto.endpointGroupId) :
changeDto.endpointGroupId != null) {
return false;
}
if (profileFilterId != null ? !profileFilterId.equals(changeDto.profileFilterId) : changeDto.profileFilterId != null) {
if (profileFilterId != null ? !profileFilterId.equals(changeDto.profileFilterId) :
changeDto.profileFilterId != null) {
return false;
}
if (topicId != null ? !topicId.equals(changeDto.topicId) : changeDto.topicId != null) {
Expand All @@ -133,14 +136,14 @@ public int hashCode() {

@Override
public String toString() {
return "ChangeDto{" +
"id=" + id +
"type=" + type +
", endpointGroupId='" + endpointGroupId + '\'' +
", profileFilterId='" + profileFilterId + '\'' +
", configurationId='" + configurationId + '\'' +
", cfVersion=" + cfVersion +
", topicId='" + topicId + '\'' +
'}';
return "ChangeDto{"
+ "id=" + id
+ "type=" + type
+ ", endpointGroupId='" + endpointGroupId + '\''
+ ", profileFilterId='" + profileFilterId + '\''
+ ", configurationId='" + configurationId + '\''
+ ", cfVersion=" + cfVersion
+ ", topicId='" + topicId + '\''
+ '}';
}
}
Expand Up @@ -43,18 +43,20 @@ public void setChangeNotificationDto(ChangeNotificationDto changeNotificationDto
}

@Override
public boolean equals(Object o) {
if (this == o) {
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!(o instanceof ChangeProfileFilterNotification)) {
if (!(obj instanceof ChangeProfileFilterNotification)) {
return false;
}
ChangeProfileFilterNotification that = (ChangeProfileFilterNotification) o;
if (changeNotificationDto != null ? !changeNotificationDto.equals(that.changeNotificationDto) : that.changeNotificationDto != null) {
ChangeProfileFilterNotification that = (ChangeProfileFilterNotification) obj;
if (changeNotificationDto != null ? !changeNotificationDto.equals(that.changeNotificationDto) :
that.changeNotificationDto != null) {
return false;
}
if (profileFilterDto != null ? !profileFilterDto.equals(that.profileFilterDto) : that.profileFilterDto != null) {
if (profileFilterDto != null ? !profileFilterDto.equals(that.profileFilterDto) :
that.profileFilterDto != null) {
return false;
}

Expand All @@ -70,9 +72,9 @@ public int hashCode() {

@Override
public String toString() {
return "ChangeProfileNotification{" +
"profileFilterDto=" + profileFilterDto +
", changeNotificationDto=" + changeNotificationDto +
'}';
return "ChangeProfileNotification{"
+ "profileFilterDto=" + profileFilterDto
+ ", changeNotificationDto=" + changeNotificationDto
+ '}';
}
}
Expand Up @@ -29,6 +29,10 @@ public ConfigurationDto() {
super();
}

/**
* Instantiates a new ConfigurationDto.
* @param other the ConfigurationDto object
*/
public ConfigurationDto(ConfigurationDto other) {
super(other);
this.schemaId = other.schemaId;
Expand Down Expand Up @@ -61,23 +65,24 @@ public void setSchemaVersion(int schemaVersion) {
}

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

ConfigurationDto that = (ConfigurationDto) o;
ConfigurationDto that = (ConfigurationDto) obj;

if (schemaId != null ? !schemaId.equals(that.schemaId) : that.schemaId != null) {
return false;
}
return protocolSchema != null ? protocolSchema.equals(that.protocolSchema) : that.protocolSchema == null;
return protocolSchema != null ? protocolSchema.equals(that.protocolSchema) :
that.protocolSchema == null;

}

Expand All @@ -91,9 +96,9 @@ public int hashCode() {

@Override
public String toString() {
return "ConfigurationDto{" +
"schemaId='" + schemaId + '\'' +
", protocolSchema='" + protocolSchema + '\'' +
'}';
return "ConfigurationDto{"
+ "schemaId='" + schemaId + '\''
+ ", protocolSchema='" + protocolSchema + '\''
+ '}';
}
}
Expand Up @@ -25,22 +25,26 @@
import java.util.List;
import java.util.Map;

public class ConfigurationRecordDto extends StructureRecordDto<ConfigurationDto> implements Serializable, Comparable<ConfigurationRecordDto> {
public class ConfigurationRecordDto extends StructureRecordDto<ConfigurationDto>
implements Serializable, Comparable<ConfigurationRecordDto> {

private static final long serialVersionUID = 5838762122987694212L;

public ConfigurationRecordDto() {
super();
}

public ConfigurationRecordDto(ConfigurationDto activeConfiguration, ConfigurationDto inactiveConfiguration) {
public ConfigurationRecordDto(
ConfigurationDto activeConfiguration, ConfigurationDto inactiveConfiguration) {
super(activeConfiguration, inactiveConfiguration);
}

public static List<ConfigurationRecordDto> convertToConfigurationRecords(Collection<ConfigurationDto> configurations) {
public static List<ConfigurationRecordDto> convertToConfigurationRecords(
Collection<ConfigurationDto> configurations) {
Map<String, ConfigurationRecordDto> configurationRecordsMap = new HashMap<>();
for (ConfigurationDto configuration : configurations) {
ConfigurationRecordDto configurationRecord = configurationRecordsMap.get(configuration.getSchemaId());
ConfigurationRecordDto configurationRecord = configurationRecordsMap
.get(configuration.getSchemaId());
if (configurationRecord == null) {
configurationRecord = new ConfigurationRecordDto();
configurationRecordsMap.put(configuration.getSchemaId(), configurationRecord);
Expand All @@ -56,22 +60,24 @@ public static List<ConfigurationRecordDto> convertToConfigurationRecords(Collect

@JsonIgnore
public int getSchemaVersion() {
return activeStructureDto != null ? activeStructureDto.getSchemaVersion() : inactiveStructureDto.getSchemaVersion();
return activeStructureDto != null ? activeStructureDto.getSchemaVersion() :
inactiveStructureDto.getSchemaVersion();
}

@JsonIgnore
public String getSchemaId() {
return activeStructureDto != null ? activeStructureDto.getSchemaId() : inactiveStructureDto.getSchemaId();
return activeStructureDto != null ? activeStructureDto.getSchemaId() :
inactiveStructureDto.getSchemaId();
}

@Override
public int compareTo(ConfigurationRecordDto o) {
return this.getSchemaVersion() - o.getSchemaVersion();
public int compareTo(ConfigurationRecordDto configurationRecordDto) {
return this.getSchemaVersion() - configurationRecordDto.getSchemaVersion();
}

@Override
public boolean equals(Object o) {
return super.equals(o);
public boolean equals(Object obj) {
return super.equals(obj);
}

@Override
Expand Down

0 comments on commit 8f455fa

Please sign in to comment.