Skip to content

Commit

Permalink
Rebase Checkstyle code cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tiihott committed Nov 11, 2024
1 parent d83af23 commit d7550fa
Show file tree
Hide file tree
Showing 16 changed files with 63 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@

public interface CategoryTable {

void create();
public abstract void create();

}
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,15 @@ public void create() {
*/
@Override
public boolean equals(final Object object) {
if (this == object)
if (this == object) {
return true;
if (object == null)
}
if (object == null) {
return false;
if (object.getClass() != this.getClass())
}
if (object.getClass() != this.getClass()) {
return false;
}
final CategoryTableImpl cast = (CategoryTableImpl) object;
return this.originTable.equals(cast.originTable) && this.ctx == cast.ctx && // equal only if same instance of DSLContext
this.bloomTermId == cast.bloomTermId && this.tableFilters.equals(cast.tableFilters);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,15 @@ public List<Table<?>> tables() {
*/
@Override
public boolean equals(final Object object) {
if (this == object)
if (this == object) {
return true;
if (object == null)
}
if (object == null) {
return false;
if (object.getClass() != this.getClass())
}
if (object.getClass() != this.getClass()) {
return false;
}
final ConditionMatchBloomDBTables cast = (ConditionMatchBloomDBTables) object;
return this.condition.equals(cast.condition) && this.ctx == cast.ctx;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,5 @@

public interface DatabaseTables {

List<Table<?>> tables();
public abstract List<Table<?>> tables();
}
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,12 @@ public List<String> tokens() {

@Override
public boolean equals(final Object object) {
if (this == object)
if (this == object) {
return true;
if (object == null || getClass() != object.getClass())
}
if (object == null || getClass() != object.getClass()) {
return false;
}
final RegexExtractedValue cast = (RegexExtractedValue) object;
return value.equals(cast.value) && pattern.equals(cast.pattern);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,12 @@ public byte[] bytes() {

@Override
public boolean equals(final Object object) {
if (this == object)
if (this == object) {
return true;
if (object == null || getClass() != object.getClass())
}
if (object == null || getClass() != object.getClass()) {
return false;
}
final SearchTermBloomFilter cast = (SearchTermBloomFilter) object;
return expected.equals(cast.expected) && fpp.equals(cast.fpp) && stringTokens.equals(cast.stringTokens);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,12 @@ public Result<Record> toResult() {
*/
@Override
public boolean equals(final Object object) {
if (this == object)
if (this == object) {
return true;
if (object == null || getClass() != object.getClass())
}
if (object == null || getClass() != object.getClass()) {
return false;
}
final TableFilterTypesFromMetadata cast = (TableFilterTypesFromMetadata) object;
return ctx == cast.ctx && Objects.equals(table, cast.table) && Objects
.equals(expectedField, cast.expectedField) && Objects.equals(fppField, cast.fppField) && Objects
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,12 @@ public Batch asBatch() {
*/
@Override
public boolean equals(final Object object) {
if (this == object)
if (this == object) {
return true;
if (object == null || getClass() != object.getClass())
}
if (object == null || getClass() != object.getClass()) {
return false;
}
final TableFilters cast = (TableFilters) object;
return bloomTermId == cast.bloomTermId && recordsInMetadata.equals(cast.recordsInMetadata) && ctx == cast.ctx
&& table.equals(cast.table) && thisTable.equals(cast.thisTable) && searchTerm.equals(cast.searchTerm);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,5 @@

public interface TableRecords {

Result<Record> toResult();
public abstract Result<Record> toResult();
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,5 @@

public interface Tokenizable<T> {

List<T> tokens();
public abstract List<T> tokens();
}
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,12 @@ public List<Token> tokens() {

@Override
public boolean equals(final Object object) {
if (this == object)
if (this == object) {
return true;
if (object == null || object.getClass() != this.getClass())
}
if (object == null || object.getClass() != this.getClass()) {
return false;
}
final TokenizedValue cast = (TokenizedValue) object;
return value.equals(cast.value);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,12 @@ public List<String> tokens() {

@Override
public boolean equals(final Object object) {
if (this == object)
if (this == object) {
return true;
if (object == null || object.getClass() != this.getClass())
}
if (object == null || object.getClass() != this.getClass()) {
return false;
}
final TokensAsStrings cast = (TokensAsStrings) object;
return origin.equals(cast.origin);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@

public interface BloomQueryCondition {

boolean isBloomSearchCondition();
public abstract boolean isBloomSearchCondition();

Set<Table<?>> requiredTables();
public abstract Set<Table<?>> requiredTables();
}
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,12 @@ public Condition condition() {

@Override
public boolean equals(final Object object) {
if (this == object)
if (this == object) {
return true;
if (object == null || getClass() != object.getClass())
}
if (object == null || getClass() != object.getClass()) {
return false;
}
final CategoryTableCondition cast = (CategoryTableCondition) object;
return comparedTo.equals(cast.comparedTo) && bloomTermCondition.equals(cast.bloomTermCondition)
&& typeIdCondition.equals(cast.typeIdCondition) && categoryTable.equals(cast.categoryTable);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,12 @@ public Condition condition() {

@Override
public boolean equals(final Object object) {
if (this == object)
if (this == object) {
return true;
if (object == null || object.getClass() != this.getClass())
}
if (object == null || object.getClass() != this.getClass()) {
return false;
}
final RegexLikeCondition cast = (RegexLikeCondition) object;
return valueField.equals(cast.valueField) && comparedToField.equals(cast.comparedToField);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@

import org.w3c.dom.Element;

import java.util.Objects;

public final class ValidElement {

private final Element element;
Expand Down Expand Up @@ -88,16 +90,24 @@ public String operation() {

@Override
public boolean equals(final Object object) {
if (this == object)
if (this == object) {
return true;
if (object == null)
}
if (object == null) {
return false;
if (object.getClass() != this.getClass())
}
if (object.getClass() != this.getClass()) {
return false;
}
final ValidElement cast = (ValidElement) object;
boolean equalName = this.element.getTagName().equals(cast.element.getTagName());
boolean equalOperation = this.element.getAttribute("operation").equals(cast.element.getAttribute("operation"));
boolean equalValue = this.element.getAttribute("value").equals(cast.element.getAttribute("value"));
return equalName && equalOperation && equalValue;
}

@Override
public int hashCode() {
return Objects.hash(element.getTagName(), element.getAttribute("operation"), element.getAttribute("value"));
}
}

0 comments on commit d7550fa

Please sign in to comment.