From e9811c372a376debf0dbf7afb4b8ee69281a3fa0 Mon Sep 17 00:00:00 2001 From: YuCheng Hu Date: Wed, 30 Apr 2025 14:12:00 -0400 Subject: [PATCH 1/2] update config for IJ --- .idea/checkstyle-idea.xml | 2 +- .idea/compiler.xml | 17 +--- .idea/dataSources.xml | 17 ---- .idea/encodings.xml | 22 ------ .idea/inspectionProfiles/Project_Default.xml | 7 -- .idea/jarRepositories.xml | 81 +------------------- .idea/jpa.xml | 7 -- .idea/prettier.xml | 6 -- 8 files changed, 5 insertions(+), 154 deletions(-) delete mode 100644 .idea/dataSources.xml delete mode 100644 .idea/inspectionProfiles/Project_Default.xml delete mode 100644 .idea/jpa.xml delete mode 100644 .idea/prettier.xml diff --git a/.idea/checkstyle-idea.xml b/.idea/checkstyle-idea.xml index b767a3113c..87234f98cb 100644 --- a/.idea/checkstyle-idea.xml +++ b/.idea/checkstyle-idea.xml @@ -1,7 +1,7 @@ - 10.14.2 + 10.23.0 JavaOnly true diff --git a/.idea/dataSources.xml b/.idea/dataSources.xml deleted file mode 100644 index b9687fac26..0000000000 --- a/.idea/dataSources.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - postgresql - true - org.postgresql.Driver - jdbc:postgresql://nas1120:5433/postgres - - - - - - $ProjectFileDir$ - - - \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml index 612addbb27..e2602f3cfc 100644 --- a/.idea/encodings.xml +++ b/.idea/encodings.xml @@ -7,14 +7,8 @@ - - - - - - @@ -31,10 +25,6 @@ - - - - @@ -47,8 +37,6 @@ - - @@ -67,8 +55,6 @@ - - @@ -93,10 +79,6 @@ - - - - @@ -110,10 +92,6 @@ - - - - diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml deleted file mode 100644 index 9c69411050..0000000000 --- a/.idea/inspectionProfiles/Project_Default.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml index da3c1d5f51..54c93d6811 100644 --- a/.idea/jarRepositories.xml +++ b/.idea/jarRepositories.xml @@ -1,105 +1,30 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/jpa.xml b/.idea/jpa.xml deleted file mode 100644 index 898e07a675..0000000000 --- a/.idea/jpa.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - \ No newline at end of file diff --git a/.idea/prettier.xml b/.idea/prettier.xml deleted file mode 100644 index b0c1c68fbb..0000000000 --- a/.idea/prettier.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - \ No newline at end of file -- 2.43.0 From c6a8551a8c1245dd72ea5b0fb89e2021a7b83716 Mon Sep 17 00:00:00 2001 From: YuCheng Hu Date: Wed, 30 Apr 2025 14:18:30 -0400 Subject: [PATCH 2/2] Update pom.xml file for part of main project --- .idea/compiler.xml | 1 + .idea/encodings.xml | 2 ++ pom.xml | 1 + xstream/pom.xml | 4 ++-- xstream/src/test/java/com/baeldung/rce/AppUnitTest.java | 5 +++-- 5 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.idea/compiler.xml b/.idea/compiler.xml index c5cdf5038d..7d6d2ebcd2 100644 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -40,6 +40,7 @@ + diff --git a/.idea/encodings.xml b/.idea/encodings.xml index e2602f3cfc..f8feab6f94 100644 --- a/.idea/encodings.xml +++ b/.idea/encodings.xml @@ -96,5 +96,7 @@ + + \ No newline at end of file diff --git a/pom.xml b/pom.xml index d721685dae..e2d58f5205 100644 --- a/pom.xml +++ b/pom.xml @@ -56,6 +56,7 @@ toolkits xml xml-2 + xstream diff --git a/xstream/pom.xml b/xstream/pom.xml index 6f25e67e12..8f14d1c833 100644 --- a/xstream/pom.xml +++ b/xstream/pom.xml @@ -10,9 +10,9 @@ An Introduction To XStream - com.baeldung + com.ossez parent-modules - 1.0.0-SNAPSHOT + 0.0.2-SNAPSHOT diff --git a/xstream/src/test/java/com/baeldung/rce/AppUnitTest.java b/xstream/src/test/java/com/baeldung/rce/AppUnitTest.java index 3b541ae099..19d9b60463 100644 --- a/xstream/src/test/java/com/baeldung/rce/AppUnitTest.java +++ b/xstream/src/test/java/com/baeldung/rce/AppUnitTest.java @@ -9,6 +9,7 @@ import java.io.InputStream; import java.io.OutputStream; import java.net.HttpURLConnection; import java.net.SocketException; +import java.net.URI; import java.net.URL; import static org.junit.Assert.assertTrue; @@ -43,9 +44,9 @@ public final class AppUnitTest { * side-effect that is difficult to observe. */ @Test(expected = SocketException.class) - public void givenAppIsVulneable_whenExecuteRemoteCodeWhichThrowsException_thenThrowsException() throws IOException { + public void givenAppIsVulneable_whenExecuteRemoteCodeWhichThrowsException_thenThrowsException() throws Exception { // POST the attack.xml to the application's /persons endpoint - final URL url = new URL("http://localhost:" + app.port() + "/persons"); + final URL url = new URI("http://localhost:" + app.port() + "/persons").toURL(); final HttpURLConnection connection = (HttpURLConnection) url.openConnection(); connection.setRequestMethod("POST"); connection.setDoOutput(true); -- 2.43.0