Skip to content

Commit d4b3a5a

Browse files
committed
Remove commons-lang3 dependency that causes random classloading issues
No time to figure out the cause of the issue for the sake of a Pair class. Use scala.Tuple2 instead.
1 parent 291b0f3 commit d4b3a5a

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/main/java/sbt_inc/SbtIncrementalCompiler.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
import java.util.jar.Manifest;
1818
import java.util.stream.Collectors;
1919
import java.util.stream.Stream;
20-
import org.apache.commons.lang3.tuple.Pair;
2120
import org.apache.maven.artifact.Artifact;
2221
import org.apache.maven.plugin.logging.Log;
2322
import sbt.internal.inc.*;
@@ -27,6 +26,7 @@
2726
import sbt.io.IO;
2827
import sbt.util.Logger;
2928
import scala.Option;
29+
import scala.Tuple2;
3030
import scala_maven.MavenArtifactResolver;
3131
import util.FileUtils;
3232
import xsbti.PathBasedFile;
@@ -194,9 +194,9 @@ private String compilerBridgeArtifactId(String scalaVersion) {
194194
}
195195
}
196196

197-
private static List<Pair<File, String>> computeZipEntries(List<Path> paths, Path rootDir) {
197+
private static List<Tuple2<File, String>> computeZipEntries(List<Path> paths, Path rootDir) {
198198
int rootDirLength = rootDir.toString().length();
199-
Stream<Pair<File, String>> stream =
199+
Stream<Tuple2<File, String>> stream =
200200
paths.stream()
201201
.map(
202202
path -> {
@@ -205,7 +205,7 @@ private static List<Pair<File, String>> computeZipEntries(List<Path> paths, Path
205205
if (Files.isDirectory(path)) {
206206
zipPath = zipPath + "/";
207207
}
208-
return Pair.of(path.toFile(), zipPath);
208+
return new Tuple2(path.toFile(), zipPath);
209209
});
210210
return stream.collect(Collectors.toList());
211211
}
@@ -313,18 +313,18 @@ private File getCompiledBridgeJar(ScalaInstance scalaInstance, Log mavenLogger)
313313
manifest.read(is);
314314
}
315315

316-
List<Pair<File, String>> scalaCompiledClasses =
316+
List<Tuple2<File, String>> scalaCompiledClasses =
317317
computeZipEntries(FileUtils.listDirectoryContent(classesDir, file -> true), classesDir);
318-
List<Pair<File, String>> resources =
318+
List<Tuple2<File, String>> resources =
319319
computeZipEntries(bridgeSourcesNonScalaFiles, sourcesDir);
320-
List<Pair<File, String>> allZipEntries = new ArrayList<>();
320+
List<Tuple2<File, String>> allZipEntries = new ArrayList<>();
321321
allZipEntries.addAll(scalaCompiledClasses);
322322
allZipEntries.addAll(resources);
323323

324324
IO.jar(
325325
IterableHasAsScala(
326326
allZipEntries.stream()
327-
.map(x -> scala.Tuple2.apply(x.getLeft(), x.getRight()))
327+
.map(x -> scala.Tuple2.apply(x._1, x._2))
328328
.collect(Collectors.toList()))
329329
.asScala(),
330330
cachedCompiledBridgeJar,

0 commit comments

Comments
 (0)