From 8c2eba6d483c9f23911b1308b6ad9e091384c706 Mon Sep 17 00:00:00 2001 From: Selim Eser <2211482@stud.hs-mannheim.de> Date: Sun, 9 Jun 2024 20:17:02 +0200 Subject: [PATCH] Fixed some problems --- src/main/java/de/hs_mannheim/domain/System.java | 7 ++----- src/main/java/de/hs_mannheim/facade/Application.java | 1 - 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/main/java/de/hs_mannheim/domain/System.java b/src/main/java/de/hs_mannheim/domain/System.java index 37e298a..3b47d0f 100644 --- a/src/main/java/de/hs_mannheim/domain/System.java +++ b/src/main/java/de/hs_mannheim/domain/System.java @@ -1,7 +1,6 @@ package de.hs_mannheim.domain; import java.io.BufferedReader; -import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.net.URI; @@ -9,10 +8,8 @@ import java.net.http.HttpClient; import java.net.http.HttpRequest; import java.net.http.HttpResponse; import java.net.http.HttpResponse.BodyHandlers; -import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.HashSet; -import java.util.List; import java.util.TreeSet; import org.json.JSONObject; @@ -149,7 +146,7 @@ public class System { .GET() .build(); - HttpResponse get_response = http_client.send(get_request, BodyHandlers.ofString()); + HttpResponse get_response = http_client.send(get_request, BodyHandlers.ofString()); JSONObject json = new JSONObject(((String)get_response.body()).substring(0,((String) get_response.body()).length())); weather = json.getJSONArray("weather").getJSONObject(0).getString("description"); @@ -205,7 +202,7 @@ public class System { .GET() .build(); - HttpResponse get_response = http_client.send(get_request, BodyHandlers.ofString()); + HttpResponse get_response = http_client.send(get_request, BodyHandlers.ofString()); JSONObject json = new JSONObject(((String)get_response.body()).substring(0,((String) get_response.body()).length())); weather_day_1 = json.getJSONArray("list").getJSONObject(11).getJSONArray("weather").getJSONObject(0).getString("description"); diff --git a/src/main/java/de/hs_mannheim/facade/Application.java b/src/main/java/de/hs_mannheim/facade/Application.java index 8a87955..597ce20 100644 --- a/src/main/java/de/hs_mannheim/facade/Application.java +++ b/src/main/java/de/hs_mannheim/facade/Application.java @@ -1,7 +1,6 @@ package de.hs_mannheim.facade; import java.util.ArrayList; -import java.util.TreeSet; import de.hs_mannheim.domain.System;