Skip to content

Commit

Permalink
Deprecate StringKeyAnalyzer.StringKeyAnalyzer() in favor of
Browse files Browse the repository at this point in the history
StringKeyAnalyzer.INSTANCE
  • Loading branch information
garydgregory committed Jun 23, 2024
1 parent 6c609f0 commit c30df24
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/changes/changes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
<action type="fix" dev="ggregory" due-to="Gary Gregory">Deprecate AbstractEmptyIterator.add(E) without replacement.</action>
<action type="fix" dev="ggregory" due-to="Gary Gregory">Add missing Javadocs.</action>
<action type="fix" dev="ggregory" due-to="Gary Gregory">PatriciaTrie constructor reuse the stateless singleton StringKeyAnalyzer.INSTANCE.</action>
<action type="fix" dev="ggregory" due-to="Gary Gregory">Deprecate StringKeyAnalyzer.StringKeyAnalyzer() in favor of StringKeyAnalyzer.INSTANCE.</action>
<!-- ADD -->
<!-- UPDATE -->
</release>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@

/**
* An {@link KeyAnalyzer} for {@link String}s.
*
* <p>
* This class is stateless.
* </p>
* @since 4.0
*/
public class StringKeyAnalyzer extends KeyAnalyzer<String> {
Expand All @@ -41,6 +43,16 @@ private static int mask(final int bit) {
return MSB >>> bit;
}

/**
* Constructs a new instance.
*
* @deprecated Use {@link #INSTANCE}.
*/
@Deprecated
public StringKeyAnalyzer() {
// empty
}

@Override
public int bitIndex(final String key, final int offsetInBits, final int lengthInBits,
final String other, final int otherOffsetInBits, final int otherLengthInBits) {
Expand Down

0 comments on commit c30df24

Please sign in to comment.