Skip to content

Commit

Permalink
Fix deprecations
Browse files Browse the repository at this point in the history
  • Loading branch information
Rakambda committed Jun 5, 2023
1 parent cd855d4 commit 639078a
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 5 deletions.
4 changes: 4 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ java {
targetCompatibility = JavaVersion.VERSION_20
}

tasks.withType<JavaCompile>(){
options.compilerArgs.addAll(listOf("-Xlint:deprecation"))
}

springBoot {
val className: String by project

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public static Supplier<Modal> builder(String codeLink){
.build();

return Modal.create(COMPONENT_ID, "Anilist register")
.addActionRows(ActionRow.of(code))
.addComponents(ActionRow.of(code))
.build();
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public static Supplier<Modal> builder(){
.build();

return Modal.create(COMPONENT_ID, "Time reaction create")
.addActionRows(
.addComponents(
ActionRow.of(episode),
ActionRow.of(link),
ActionRow.of(body)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import org.jetbrains.annotations.Nullable;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URL;
import static java.util.Objects.nonNull;

Expand All @@ -19,7 +20,7 @@ public URL deserialize(@NotNull JsonParser jsonParser, @NotNull DeserializationC
try{
var value = jsonParser.getValueAsString();
if(nonNull(value) && !value.isBlank() && !value.equals(".")){
return new URL(value);
return URI.create(value).toURL();
}
}
catch(MalformedURLException e){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.time.Instant;
import java.util.Collection;
import java.util.Date;
import java.util.List;
import java.util.Objects;

Expand All @@ -36,6 +36,6 @@ public void triggerTask(@PathVariable("taskId") String taskId){
.filter(t -> Objects.equals(t.getId(), taskId))
.findFirst()
.orElseThrow(() -> new IllegalArgumentException("Invalid task id"));
taskScheduler.schedule(task, new Date());
taskScheduler.schedule(task, Instant.now());
}
}

0 comments on commit 639078a

Please sign in to comment.