Skip to content

Commit

Permalink
ensure JDK 8 compatibility
Browse files Browse the repository at this point in the history
Signed-off-by: Ceki Gulcu <[email protected]>
  • Loading branch information
ceki committed Nov 27, 2023
1 parent 14a71d0 commit 189af50
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@

import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.nio.file.FileSystems;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.Arrays;
Expand Down Expand Up @@ -318,7 +319,7 @@ void withJoran() throws JoranException, IOException {

StatusPrinter.print(loggerContext);

Path configFilePath = Path.of(ClassicTestConstants.OUTPUT_DIR_PREFIX+"json/test-" + diff + ".json");
Path configFilePath = FileSystems.getDefault().getPath(ClassicTestConstants.OUTPUT_DIR_PREFIX+"json/test-" + diff + ".json");
List<String> lines = Files.readAllLines(configFilePath);
int count = 4;
assertEquals(count, lines.size());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.InvalidClassException;
import java.io.ObjectInputFilter;
import java.io.ObjectInputStream;
import java.io.ObjectStreamClass;
import java.util.ArrayList;
Expand Down Expand Up @@ -44,7 +43,6 @@ public class HardenedObjectInputStream extends ObjectInputStream {

public HardenedObjectInputStream(InputStream in, String[] whitelist) throws IOException {
super(in);
this.initObjectFilter();
this.whitelistedClassNames = new ArrayList<String>();
if (whitelist != null) {
for (int i = 0; i < whitelist.length; i++) {
Expand All @@ -53,11 +51,7 @@ public HardenedObjectInputStream(InputStream in, String[] whitelist) throws IOEx
}
}

private void initObjectFilter() {
this.setObjectInputFilter(ObjectInputFilter.Config.createFilter(
"maxarray=" + ARRAY_LIMIT + ";maxdepth=" + DEPTH_LIMIT + ";"
));
}

public HardenedObjectInputStream(InputStream in, List<String> whitelist) throws IOException {
super(in);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@
*/
package ch.qos.logback.core.util;

import java.lang.module.ModuleDescriptor;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Optional;

/**
Expand Down
9 changes: 1 addition & 8 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -381,8 +381,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<<<<<<< HEAD


<executions>
<execution>
<id>default-compile</id>
Expand Down Expand Up @@ -410,12 +409,6 @@
</configuration>
</execution>
</executions>
=======

<configuration>
<release>${jdk.version}</release>
</configuration>
>>>>>>> 9a1fc44f8 (add support for Virtual threads)
</plugin>

<plugin>
Expand Down

0 comments on commit 189af50

Please sign in to comment.