Skip to content

Commit 78794cc

Browse files
germanosinCopilot
andauthored
Apply suggestions from code review
Co-authored-by: Copilot <[email protected]>
1 parent 4a0d729 commit 78794cc

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

api/src/main/java/io/kafbat/ui/service/index/LuceneTopicsIndex.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ private Directory build(List<InternalTopic> topics) {
6767
for (InternalTopic topic : topics) {
6868
Document doc = new Document();
6969

70-
7170
doc.add(new StringField(FIELD_NAME_RAW, topic.getName(), Field.Store.YES));
7271
doc.add(new IndexedTextField(FIELD_NAME, topic.getName(), Field.Store.YES));
7372
doc.add(new IntPoint(FIELD_PARTITIONS, topic.getPartitionCount()));

api/src/main/java/io/kafbat/ui/service/index/lucene/NameDistanceScoringFunction.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,16 @@ public DoubleValuesSource rewrite(IndexSearcher searcher) {
8888

8989
@Override
9090
public int hashCode() {
91-
return 0;
91+
return java.util.Objects.hash(fieldName, prefixes);
9292
}
9393

9494
@Override
9595
public boolean equals(Object obj) {
96-
return false;
96+
if (this == obj) return true;
97+
if (obj == null || getClass() != obj.getClass()) return false;
98+
NameDistanceScoringFunction that = (NameDistanceScoringFunction) obj;
99+
return java.util.Objects.equals(fieldName, that.fieldName) &&
100+
java.util.Objects.equals(prefixes, that.prefixes);
97101
}
98102

99103
@Override

api/src/test/java/io/kafbat/ui/service/index/lucene/LuceneTopicsIndexTest.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,4 @@ public static Stream<Arguments> providerOrdered() {
108108
);
109109
}
110110

111-
112-
113111
}

0 commit comments

Comments
 (0)