Skip to content

Commit c03a4dd

Browse files
committed
Fix inspection issues
1 parent 9139e4c commit c03a4dd

File tree

29 files changed

+81
-107
lines changed

29 files changed

+81
-107
lines changed

BotCommands-core/src/main/java/io/github/freya022/botcommands/api/BCInfo.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ public class BCInfo {
2424
public static final String COMMIT_HASH;
2525
public static final String BUILD_JDA_VERSION;
2626

27-
@SuppressWarnings("ConstantConditions")
2827
public static final String VERSION;
2928

3029
static {

BotCommands-core/src/main/java/io/github/freya022/botcommands/api/localization/providers/LocalizationMapProviders.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public LocalizationMap cycleProvidersWithParents(String baseName, Locale locale)
6464
return bundle;
6565
}
6666
} catch (Exception e) {
67-
LOGGER.error("An error occurred while getting a bundle '{}' with locale '{}' with provider '{}'", baseName, locale, provider.getClass().getName());
67+
LOGGER.warn("An error occurred while getting a bundle w/ parents '{}' with locale '{}' with provider '{}'", baseName, locale, provider.getClass().getName(), e);
6868
}
6969
}
7070

@@ -94,7 +94,7 @@ public LocalizationMap cycleProviders(String baseName, Locale locale) {
9494
return bundle;
9595
}
9696
} catch (Exception e) {
97-
LOGGER.error("An error occurred while getting a bundle '{}' with locale '{}' with provider '{}'", baseName, locale, provider.getClass().getName());
97+
LOGGER.warn("An error occurred while getting a bundle '{}' with locale '{}' with provider '{}'", baseName, locale, provider.getClass().getName(), e);
9898
}
9999
}
100100

BotCommands-core/src/main/java/io/github/freya022/botcommands/api/utils/EmojiUtils.java

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,25 +11,25 @@
1111
import java.util.NoSuchElementException;
1212

1313
/**
14-
* Utility class to resolve alias emojis into unicode, and getting an {@link UnicodeEmoji} out of them.
14+
* Utility class to resolve alias emojis into Unicode, and getting an {@link UnicodeEmoji} out of them.
1515
*/
1616
@NullMarked
1717
public class EmojiUtils {
1818
private static final int REGIONAL_INDICATOR_A_CODEPOINT = 127462;
1919
private static final int REGIONAL_INDICATOR_Z_CODEPOINT = 127487;
2020

2121
/**
22-
* Returns the unicode emoji from a Discord alias (e.g. {@code :joy:}).
22+
* Returns the Unicode emoji from a Discord alias (e.g. {@code :joy:}).
2323
*
2424
* <p><b>Note:</b> The input string is case-sensitive!
2525
*
26-
* <p>This will return itself if the input is a valid unicode emoji.
26+
* <p>This will return itself if the input is a valid Unicode emoji.
2727
*
28-
* @param input An emoji alias or unicode
28+
* @param input An emoji alias or Unicode
2929
*
30-
* @return The unicode string of this emoji
30+
* @return The Unicode string of this emoji
3131
*
32-
* @throws NoSuchElementException if no emoji alias or unicode matches
32+
* @throws NoSuchElementException if no emoji alias or Unicode matches
3333
* @see #resolveJDAEmoji(String)
3434
*/
3535
public static String resolveEmoji(String input) {
@@ -39,15 +39,15 @@ public static String resolveEmoji(String input) {
3939
}
4040

4141
/**
42-
* Returns the unicode emoji from a Discord alias (e.g. {@code :joy:}), or {@code null} if unresolvable.
42+
* Returns the Unicode emoji from a Discord alias (e.g. {@code :joy:}), or {@code null} if unresolvable.
4343
*
4444
* <p><b>Note:</b> The input string is case-sensitive!
4545
*
46-
* <p>This will return itself if the input is a valid unicode emoji.
46+
* <p>This will return itself if the input is a valid Unicode emoji.
4747
*
48-
* @param input An emoji alias or unicode
48+
* @param input An emoji alias or Unicode
4949
*
50-
* @return The unicode string of this emoji, {@code null} if unresolvable
50+
* @return The Unicode string of this emoji, {@code null} if unresolvable
5151
*
5252
* @see #resolveJDAEmojiOrNull(String)
5353
*/
@@ -85,13 +85,13 @@ private static String removeColonFromAlias(final String alias) {
8585
*
8686
* <p><b>Note:</b> The input string is case-sensitive!
8787
*
88-
* <p>This will return itself if the input is a valid unicode emoji.
88+
* <p>This will return itself if the input is a valid Unicode emoji.
8989
*
90-
* @param input An emoji alias or unicode
90+
* @param input An emoji alias or Unicode
9191
*
9292
* @return The {@link UnicodeEmoji} of this emoji
9393
*
94-
* @throws NoSuchElementException if no emoji alias or unicode matches
94+
* @throws NoSuchElementException if no emoji alias or Unicode matches
9595
* @see #resolveEmoji(String)
9696
*/
9797
public static UnicodeEmoji resolveJDAEmoji(String input) {
@@ -103,9 +103,9 @@ public static UnicodeEmoji resolveJDAEmoji(String input) {
103103
*
104104
* <p><b>Note:</b> The input string is case-sensitive!
105105
*
106-
* <p>This will return itself if the input is a valid unicode emoji.
106+
* <p>This will return itself if the input is a valid Unicode emoji.
107107
*
108-
* @param input An emoji alias or unicode
108+
* @param input An emoji alias or Unicode
109109
*
110110
* @return The {@link UnicodeEmoji} of this emoji
111111
*

BotCommands-core/src/main/kotlin/io/github/freya022/botcommands/api/commands/annotations/Cooldown.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import java.time.temporal.ChronoUnit
2626
* alongside [RateLimiter.createDefaultProxied][RateLimiter.Companion.createDefaultProxied].
2727
*
2828
* ### Cooldown cancellation
29-
* The cooldown can be cancelled inside the command with [CancellableRateLimit.cancelRateLimit] on your event.
29+
* The cooldown can be canceled inside the command with [CancellableRateLimit.cancelRateLimit] on your event.
3030
*
3131
* @see RateLimit @RateLimit
3232
*

BotCommands-core/src/main/kotlin/io/github/freya022/botcommands/api/commands/annotations/RateLimit.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ annotation class Refill(
9292
* alongside [RateLimiter.Companion.createDefaultProxied].
9393
*
9494
* ### Rate limit cancellation
95-
* The rate limit can be cancelled inside the command with [CancellableRateLimit.cancelRateLimit] on your event.
95+
* The rate limit can be canceled inside the command with [CancellableRateLimit.cancelRateLimit] on your event.
9696
*
9797
* ### Example
9898
* ```java

BotCommands-core/src/main/kotlin/io/github/freya022/botcommands/api/commands/builder/CommandBuilder.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ interface CommandBuilder : INamedCommand, IDeclarationSiteHolderBuilder {
4545
* **Note:** This won't apply if you are a [bot owner][BotOwners.isOwner].
4646
*
4747
* ### Rate limit cancellation
48-
* The rate limit can be cancelled inside the command with [CancellableRateLimit.cancelRateLimit] on your event.
48+
* The rate limit can be canceled inside the command with [CancellableRateLimit.cancelRateLimit] on your event.
4949
*
5050
* ### Example
5151
*
@@ -94,7 +94,7 @@ interface CommandBuilder : INamedCommand, IDeclarationSiteHolderBuilder {
9494
* This cooldown cannot be referenced anywhere else as it is not registered.
9595
*
9696
* ### Cooldown cancellation
97-
* The cooldown can be cancelled inside the command with [CancellableRateLimit.cancelRateLimit] on your event.
97+
* The cooldown can be canceled inside the command with [CancellableRateLimit.cancelRateLimit] on your event.
9898
*
9999
* @param duration The duration before the cooldown expires
100100
* @param scope The scope of the cooldown

BotCommands-core/src/main/kotlin/io/github/freya022/botcommands/api/commands/ratelimit/declaration/RateLimitManager.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ abstract class RateLimitManager internal constructor() {
6565
* **Note:** The cooldown won't apply if you are a [bot owner][BotOwners.isOwner].
6666
*
6767
* ### Cooldown cancellation
68-
* The cooldown can be cancelled inside the command with [CancellableRateLimit.cancelRateLimit] on your event.
68+
* The cooldown can be canceled inside the command with [CancellableRateLimit.cancelRateLimit] on your event.
6969
*
7070
* @param group The name of the underlying rate limiter
7171
* @param scope The scope of the cooldown
@@ -96,7 +96,7 @@ abstract class RateLimitManager internal constructor() {
9696
* **Note:** The cooldown won't apply if you are a [bot owner][BotOwners.isOwner].
9797
*
9898
* ### Cooldown cancellation
99-
* The cooldown can be cancelled inside the command with [CancellableRateLimit.cancelRateLimit] on your event.
99+
* The cooldown can be canceled inside the command with [CancellableRateLimit.cancelRateLimit] on your event.
100100
*
101101
* @param group The name of the underlying rate limiter
102102
* @param scope The scope of the cooldown

BotCommands-core/src/main/kotlin/io/github/freya022/botcommands/api/components/builder/button/ButtonFactory.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class ButtonFactory internal constructor(
3535
}
3636

3737
/**
38-
* Creates a new button factory with the provided emoji alias / emoji unicode.
38+
* Creates a new button factory with the provided emoji alias / emoji Unicode.
3939
*
4040
* ### Example
4141
* ```kt

BotCommands-core/src/main/kotlin/io/github/freya022/botcommands/api/components/utils/ButtonContent.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ data class ButtonContent(val style: ButtonStyle, val label: String?, val emoji:
8888
}
8989

9090
/**
91-
* Constructs a [ButtonContent] with an unicode emoji,
91+
* Constructs a [ButtonContent] with a Unicode emoji,
9292
* see [Emoji.fromUnicode] for accepted formats.
9393
*/
9494
@JvmStatic

BotCommands-core/src/main/kotlin/io/github/freya022/botcommands/api/core/reflect/ParameterType.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,7 @@ class ParameterType private constructor(val type: KType) {
2525

2626
other as ParameterType
2727

28-
if (type != other.type) return false
29-
30-
return true
28+
return type == other.type
3129
}
3230

3331
override fun hashCode(): Int {

0 commit comments

Comments
 (0)