Skip to content

Commit cb6f9d2

Browse files
committed
Renaming run to runRoutine to avoid confusion with Runnable
1 parent 607c342 commit cb6f9d2

File tree

4 files changed

+11
-10
lines changed

4 files changed

+11
-10
lines changed

application/src/main/java/org/togetherjava/tjbot/commands/Routine.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,16 @@
1212
* to {@link Features}.
1313
* <p>
1414
* <p>
15-
* After registration, the system will automatically start and execute {@link #run(JDA)} on the
16-
* schedule defined by {@link #createSchedule()}.
15+
* After registration, the system will automatically start and execute {@link #runRoutine(JDA)} on
16+
* the schedule defined by {@link #createSchedule()}.
1717
*/
1818
public interface Routine extends Feature {
1919
/**
20-
* Triggered by the core system on the schedule defined by
20+
* Triggered by the core system on the schedule defined by {@link #createSchedule()}.
2121
*
2222
* @param jda the JDA instance the bot is operating with
2323
*/
24-
void run(@NotNull JDA jda);
24+
void runRoutine(@NotNull JDA jda);
2525

2626
/**
2727
* Retrieves the schedule of this routine. Called by the core system once during the startup in

application/src/main/java/org/togetherjava/tjbot/commands/moderation/temp/TemporaryModerationRoutine.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public TemporaryModerationRoutine(@NotNull JDA jda,
5353
}
5454

5555
@Override
56-
public void run(@NotNull JDA jda) {
56+
public void runRoutine(@NotNull JDA jda) {
5757
checkExpiredActions();
5858
}
5959

application/src/main/java/org/togetherjava/tjbot/commands/system/BotCore.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,12 @@ public BotCore(@NotNull JDA jda, @NotNull Database database) {
9191
.forEach(routine -> {
9292
Routine.Schedule schedule = routine.createSchedule();
9393
switch (schedule.mode()) {
94-
case FIXED_RATE -> ROUTINE_SERVICE.scheduleAtFixedRate(() -> routine.run(jda),
95-
schedule.initialDuration(), schedule.duration(), schedule.unit());
94+
case FIXED_RATE -> ROUTINE_SERVICE.scheduleAtFixedRate(
95+
() -> routine.runRoutine(jda), schedule.initialDuration(),
96+
schedule.duration(), schedule.unit());
9697
case FIXED_DELAY -> ROUTINE_SERVICE.scheduleWithFixedDelay(
97-
() -> routine.run(jda), schedule.initialDuration(), schedule.duration(),
98-
schedule.unit());
98+
() -> routine.runRoutine(jda), schedule.initialDuration(),
99+
schedule.duration(), schedule.unit());
99100
default -> throw new AssertionError("Unsupported schedule mode");
100101
}
101102
});

application/src/main/java/org/togetherjava/tjbot/routines/ModAuditLogRoutine.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ private static boolean isSnowflakeAfter(@NotNull ISnowflake snowflake,
204204
}
205205

206206
@Override
207-
public void run(@NotNull JDA jda) {
207+
public void runRoutine(@NotNull JDA jda) {
208208
checkAuditLogsRoutine(jda);
209209
}
210210

0 commit comments

Comments
 (0)