From e98c0a4f98c72c90b429e803bc1967e0056ba541 Mon Sep 17 00:00:00 2001 From: ThatGamerBlue Date: Mon, 25 May 2020 17:32:40 +0100 Subject: sort files using last modified as long, preventing downcasting errors (#376) --- pf4j/src/test/java/org/pf4j/AbstractExtensionFinderTest.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'pf4j/src/test') diff --git a/pf4j/src/test/java/org/pf4j/AbstractExtensionFinderTest.java b/pf4j/src/test/java/org/pf4j/AbstractExtensionFinderTest.java index bcf1535..e841189 100644 --- a/pf4j/src/test/java/org/pf4j/AbstractExtensionFinderTest.java +++ b/pf4j/src/test/java/org/pf4j/AbstractExtensionFinderTest.java @@ -18,6 +18,7 @@ package org.pf4j; import com.google.common.collect.ImmutableList; import com.google.common.io.ByteStreams; import com.google.testing.compile.Compilation; +import java.util.Comparator; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -238,7 +239,7 @@ public class AbstractExtensionFinderTest { public Map> loadClasses(List classes) throws IOException { // Sort generated ".class" by lastModified field - classes.sort((c1, c2) -> (int) (c1.getLastModified() - c2.getLastModified())); + classes.sort(Comparator.comparingLong(JavaFileObject::getLastModified)); // Load classes Map> loadedClasses = new HashMap<>(classes.size()); -- cgit v1.2.3