Skip to content

Commit

Permalink
Update to Java 21
Browse files Browse the repository at this point in the history
  • Loading branch information
dfuchss committed Oct 31, 2023
1 parent dcaa88d commit a744198
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
FROM maven:3-eclipse-temurin-17 as builder
FROM maven:3-eclipse-temurin-21 AS builder

WORKDIR /usr/src/bot
COPY src src
COPY pom.xml pom.xml
RUN mvn clean package

FROM eclipse-temurin:17-alpine
FROM eclipse-temurin:21-alpine

ENV RUN_IN_DOCKER true
ENV DISCORD_TOKEN MY_TOKEN
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.fuchss</groupId>
<artifactId>maven-parent</artifactId>
<version>0.11.0</version>
<version>0.21.0</version>
</parent>

<artifactId>deltabot</artifactId>
Expand Down
6 changes: 3 additions & 3 deletions src/main/kotlin/org/fuchss/deltabot/cognitive/Requests.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package org.fuchss.deltabot.cognitive
import java.io.DataOutputStream
import java.io.InputStream
import java.net.HttpURLConnection
import java.net.URL
import java.net.URI
import java.nio.charset.Charset
import java.nio.charset.StandardCharsets

Expand All @@ -17,7 +17,7 @@ fun get(
url: String,
timeoutInMS: Int? = null
): String {
val endpoint = URL(url)
val endpoint = URI(url).toURL()
val urlConnection: HttpURLConnection = endpoint.openConnection() as HttpURLConnection
if (timeoutInMS != null) {
urlConnection.connectTimeout = timeoutInMS
Expand Down Expand Up @@ -54,7 +54,7 @@ fun post(
contentType: String,
postData: ByteArray
): String {
val endpoint = URL(url)
val endpoint = URI(url).toURL()
val urlConnection: HttpURLConnection = endpoint.openConnection() as HttpURLConnection
urlConnection.requestMethod = "POST"
urlConnection.useCaches = false
Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/org/fuchss/deltabot/db/dto/UserDTO.kt
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class UserDTO {
session: Session?,
user: User
) {
readableName = "${user.name}#${user.discriminator}"
readableName = "${user.name}#${user.id}"
session?.persist(this)
}

Expand Down

0 comments on commit a744198

Please sign in to comment.