Skip to content

Commit c492ac6

Browse files
authored
Merge pull request scala#5370 from SethTisue/java-unchecked-warnings
sbt build: fix "unchecked" warnings when compiling Java code
2 parents 5e91aa5 + e280e17 commit c492ac6

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

build.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ lazy val commonSettings = clearSourceAndResourceDirectories ++ publishSettings +
133133
// we always assume that Java classes are standalone and do not have any dependency
134134
// on Scala classes
135135
compileOrder := CompileOrder.JavaThenScala,
136-
javacOptions in Compile ++= Seq("-g", "-source", "1.8", "-target", "1.8"),
136+
javacOptions in Compile ++= Seq("-g", "-source", "1.8", "-target", "1.8", "-Xlint:unchecked"),
137137
// we don't want any unmanaged jars; as a reminder: unmanaged jar is a jar stored
138138
// directly on the file system and it's not resolved through Ivy
139139
// Ant's build stored unmanaged jars in `lib/` directory

test/junit/scala/runtime/LambdaDeserializerTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ private <A, B> A reconstitute(A f1, java.util.HashMap<String, MethodHandle> cach
136136
}
137137
}
138138

139+
@SuppressWarnings("unchecked")
139140
private <A> A deserizalizeLambdaCreatingAllowedMap(A f1, HashMap<String, MethodHandle> cache, MethodHandles.Lookup lookup) {
140141
SerializedLambda serialized = writeReplace(f1);
141142
HashMap<String, MethodHandle> allowed = createAllowedMap(lookup, serialized);

test/junit/scala/tools/testing/ClearAfterClass.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ private static void closeIfClosable(Object o) {
4545
}
4646
}
4747

48+
@SuppressWarnings("unchecked")
4849
public <T> T cached(String key, scala.Function0<T> t) {
4950
Map<String, Object> perClassCache = cache.get(getClass());
5051
return (T) perClassCache.computeIfAbsent(key, s -> t.apply());

0 commit comments

Comments
 (0)