From 4dae5219cf334cbcda1f727808715b759539c720 Mon Sep 17 00:00:00 2001 From: rfscholte Date: Sun, 18 Apr 2021 20:58:31 +0200 Subject: [PATCH] [JXR-158] StringEntry shouldn't be Comparable --- .../apache/maven/jxr/util/StringEntry.java | 21 +++---------------- 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/maven-jxr/src/main/java/org/apache/maven/jxr/util/StringEntry.java b/maven-jxr/src/main/java/org/apache/maven/jxr/util/StringEntry.java index 85b99770..41de66d8 100644 --- a/maven-jxr/src/main/java/org/apache/maven/jxr/util/StringEntry.java +++ b/maven-jxr/src/main/java/org/apache/maven/jxr/util/StringEntry.java @@ -23,13 +23,11 @@ * A StringEntry represents a value found by the tokenizer. The index is where * this StringEntry was found in the source string */ -public class StringEntry - implements Comparable +public final class StringEntry { + private final String value; - private String value = null; - - private int index = 0; + private final int index; /** * Constructor for the StringEntry object @@ -60,18 +58,5 @@ public String toString() { return this.value; } - - /** - * Compare two objects for equality. - */ - @Override - public int compareTo( StringEntry se ) - { - //right now only sort by the index. - - return Integer.compare( se.getIndex(), this.getIndex() ); - - } - }