Skip to content

Commit

Permalink
fix: Check Tag equality using String#equalsIgnoreCase
Browse files Browse the repository at this point in the history
  • Loading branch information
4drian3d committed May 16, 2023
1 parent f92df0f commit 47f17eb
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions api/src/main/java/io/github/miniplaceholders/api/Tags.java
Expand Up @@ -15,7 +15,7 @@
import net.kyori.adventure.text.minimessage.tag.resolver.TagResolver;

final class Tags {
private Tags(){}
private Tags() {}

static Relational relational(@NotNull final String name, @NotNull final RelationalPlaceholder relationalPlaceholder){
return new Tags.Relational(name, relationalPlaceholder);
Expand All @@ -35,7 +35,7 @@ static final class Relational {
}

TagResolver of(@NotNull final Audience audience, @NotNull final Audience otherAudience){
return new TagResolver(){
return new TagResolver() {
@Override
public @Nullable Tag resolve(@NotNull String name, @NotNull ArgumentQueue arguments,
@NotNull Context ctx) throws ParsingException {
Expand All @@ -53,10 +53,10 @@ public boolean has(@NotNull String name) {
}

@Override
public boolean equals(Object o){
if(o == this) return true;
if(!(o instanceof Relational)) return false;
return ((Relational)o).key.equals(this.key);
public boolean equals(final Object o) {
if (o == this) return true;
if (!(o instanceof final Relational that)) return false;
return that.key.equalsIgnoreCase(this.key);
}

@Override
Expand Down Expand Up @@ -93,10 +93,10 @@ public boolean has(@NotNull String name) {
}

@Override
public boolean equals(Object o){
if(o == this) return true;
if(!(o instanceof Single)) return false;
return ((Single)o).key.equals(this.key);
public boolean equals(final Object o) {
if (o == this) return true;
if (!(o instanceof final Single that)) return false;
return that.key.equalsIgnoreCase(this.key);
}

@Override
Expand Down

0 comments on commit 47f17eb

Please sign in to comment.