Skip to content

Commit 39224f1

Browse files
authored
version bumps, removed some warnings (#1272)
1 parent 28eb518 commit 39224f1

File tree

6 files changed

+13
-13
lines changed

6 files changed

+13
-13
lines changed

application/build.gradle

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ dependencies {
5151
implementation 'org.apache.logging.log4j:log4j-core:2.25.0'
5252
runtimeOnly 'org.apache.logging.log4j:log4j-slf4j2-impl:2.25.0'
5353

54-
implementation 'club.minnced:discord-webhooks:0.8.2'
54+
implementation 'club.minnced:discord-webhooks:0.8.4'
5555

5656
implementation "org.jooq:jooq:$jooqVersion"
5757

@@ -81,15 +81,16 @@ dependencies {
8181
implementation 'com.apptasticsoftware:rssreader:3.9.3'
8282

8383
testImplementation 'org.mockito:mockito-core:5.18.0'
84-
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.11.4'
85-
testImplementation 'org.junit.jupiter:junit-jupiter-params:5.11.0'
84+
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.13.2'
85+
testImplementation 'org.junit.jupiter:junit-jupiter-params:5.13.2'
8686
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
87-
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.11.1'
87+
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.13.2'
8888

8989
implementation "com.theokanning.openai-gpt3-java:api:$chatGPTVersion"
9090
implementation "com.theokanning.openai-gpt3-java:service:$chatGPTVersion"
9191
}
9292

9393
application {
9494
mainClass = 'org.togetherjava.tjbot.Application'
95+
applicationDefaultJvmArgs = ["--enable-native-access=ALL-UNNAMED"]
9596
}

application/src/main/java/org/togetherjava/tjbot/features/jshell/renderer/RendererUtils.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ private RendererUtils() {}
2323

2424
static String abortionCauseToString(JShellEvalAbortionCause abortionCause) {
2525
return switch (abortionCause) {
26-
case JShellEvalAbortionCause.TimeoutAbortionCause ignored -> "Allowed time exceeded.";
26+
case JShellEvalAbortionCause.TimeoutAbortionCause _ -> "Allowed time exceeded.";
2727
case JShellEvalAbortionCause.UnhandledExceptionAbortionCause(String exceptionClass, String exceptionMessage) ->
2828
"Uncaught exception:\n" + exceptionClass + ":" + exceptionMessage;
2929
case JShellEvalAbortionCause.CompileTimeErrorAbortionCause(List<String> errors) ->
3030
"The code doesn't compile:\n" + String.join("\n", errors);
31-
case JShellEvalAbortionCause.SyntaxErrorAbortionCause ignored ->
31+
case JShellEvalAbortionCause.SyntaxErrorAbortionCause _ ->
3232
"The code doesn't compile, there are syntax errors in this code.";
3333
};
3434
}

application/src/main/java/org/togetherjava/tjbot/features/moderation/scam/ScamDetector.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ private void analyzeUrl(String url, AnalyseResults results) {
8080
String host;
8181
try {
8282
host = URI.create(url).getHost();
83-
} catch (IllegalArgumentException e) {
83+
} catch (IllegalArgumentException _) {
8484
// Invalid urls are not scam
8585
return;
8686
}

application/src/main/java/org/togetherjava/tjbot/features/rss/RSSHandlerRoutine.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ private Optional<ZonedDateTime> getLastSavedDateFromDatabaseRecord(RssFeedRecord
214214
ZonedDateTime savedDate =
215215
getZonedDateTime(rssRecord.getLastDate(), dateFormatterPattern);
216216
return Optional.of(savedDate);
217-
} catch (DateTimeParseException e) {
217+
} catch (DateTimeParseException _) {
218218
return Optional.empty();
219219
}
220220
}
@@ -317,7 +317,7 @@ private static boolean isValidDateFormat(Item rssItem, RSSFeed feedConfig) {
317317
// that the format pattern defined in the config and the
318318
// feed's actual format differ.
319319
getZonedDateTime(firstRssFeedPubDate.get(), feedConfig.dateFormatterPattern());
320-
} catch (DateTimeParseException e) {
320+
} catch (DateTimeParseException _) {
321321
return false;
322322
}
323323
return true;

application/src/main/java/org/togetherjava/tjbot/features/tags/TagManageCommand.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ private static void sendSuccessMessage(IReplyCallback event, String id, String a
130130
private static OptionalLong parseMessageIdAndHandle(String messageId, IReplyCallback event) {
131131
try {
132132
return OptionalLong.of(Long.parseLong(messageId));
133-
} catch (NumberFormatException e) {
133+
} catch (NumberFormatException _) {
134134
event
135135
.reply("The given message id '%s' is invalid, expected a number."
136136
.formatted(messageId))
@@ -297,7 +297,7 @@ private Optional<String> getTagContent(Subcommand subcommand, String id) {
297297
if (Subcommand.SUBCOMMANDS_WITH_PREVIOUS_CONTENT.contains(subcommand)) {
298298
try {
299299
return tagSystem.getTag(id);
300-
} catch (NoSuchElementException e) {
300+
} catch (NoSuchElementException _) {
301301
// NOTE Rare race condition, for example if another thread deleted the tag in the
302302
// meantime
303303
logger.warn("Tried to retrieve content of tag '{}', but the content doesn't exist.",

build.gradle

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ sonarqube {
3131
}
3232

3333
// Install git hooks
34-
task installLocalGitHook(type: Copy) {
34+
tasks.register('installLocalGitHook', Copy) {
3535
from new File(rootProject.rootDir, 'scripts/pre-commit')
3636
into new File(rootProject.rootDir, '.git/hooks')
3737
fileMode 0775
@@ -97,5 +97,4 @@ subprojects {
9797
compileTestJava {
9898
options.encoding = "UTF-8"
9999
}
100-
101100
}

0 commit comments

Comments
 (0)