Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ private static <T> Predicate<? super T> getPredicate(

return (value) -> set.contains(indexValueForEntity(getter, value));
} else {
HashSet<Comparable> set = new HashSet<>(values.size());
HashSet<Comparable<?>> set = new HashSet<>(values.size());
for (Object key : values) {
set.add(asKey(key));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ interface Accessor {

Object get(Object instance) throws ReflectiveOperationException;

Class getType();
Class<?> getType();
}

private class FieldAccessor implements Accessor {
Expand All @@ -141,7 +141,7 @@ public Object get(Object instance) throws ReflectiveOperationException {
}

@Override
public Class getType() {
public Class<?> getType() {
return field.getType();
}
}
Expand All @@ -160,7 +160,7 @@ public Object get(Object instance) throws ReflectiveOperationException {
}

@Override
public Class getType() {
public Class<?> getType() {
return method.getReturnType();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,9 @@ public void setUp() throws IOException {
when(taskContext.taskMemoryManager()).thenReturn(taskMemoryManager);
}

private UnsafeShuffleWriter createWriter(boolean transferToEnabled) {
private UnsafeShuffleWriter<Object, Object> createWriter(boolean transferToEnabled) {
conf.set("spark.file.transferTo", String.valueOf(transferToEnabled));
return new UnsafeShuffleWriter(
return new UnsafeShuffleWriter<>(
blockManager,
taskMemoryManager,
new SerializedShuffleHandle<>(0, 1, shuffleDep),
Expand Down Expand Up @@ -533,7 +533,7 @@ public void testPeakMemoryUsed() throws Exception {
final long numRecordsPerPage = pageSizeBytes / recordLengthBytes;
taskMemoryManager = spy(taskMemoryManager);
when(taskMemoryManager.pageSizeBytes()).thenReturn(pageSizeBytes);
final UnsafeShuffleWriter writer = new UnsafeShuffleWriter(
final UnsafeShuffleWriter<Object, Object> writer = new UnsafeShuffleWriter<>(
blockManager,
taskMemoryManager,
new SerializedShuffleHandle<>(0, 1, shuffleDep),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import javax.servlet.http.{HttpServletRequest, HttpServletRequestWrapper, HttpSe
import scala.collection.JavaConverters._
import scala.concurrent.duration._

import com.gargoylesoftware.htmlunit.BrowserVersion
import com.google.common.io.{ByteStreams, Files}
import org.apache.commons.io.{FileUtils, IOUtils}
import org.apache.hadoop.fs.{FileStatus, FileSystem, Path}
Expand Down Expand Up @@ -365,8 +364,7 @@ class HistoryServerSuite extends SparkFunSuite with BeforeAndAfter with Matchers
contextHandler.addServlet(holder, "/")
server.attachHandler(contextHandler)

implicit val webDriver: WebDriver =
new HtmlUnitDriver(BrowserVersion.INTERNET_EXPLORER_11, true)
implicit val webDriver: WebDriver = new HtmlUnitDriver(true)

try {
val url = s"http://localhost:$port"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class KeyLockSuite extends SparkFunSuite with TimeLimits {
@volatile var e: Throwable = null
val threads = (0 until numThreads).map { i =>
new Thread() {
override def run(): Unit = try {
override def run(): Unit = {
latch.await(foreverMs, TimeUnit.MILLISECONDS)
keyLock.withLock(keys(i)) {
var cur = numThreadsHoldingLock.get()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,8 @@ class ExecutorClassLoaderSuite
assert(e.getMessage.contains("ThisIsAClassName"))
// RemoteClassLoaderError must not be LinkageError nor ClassNotFoundException. Otherwise,
// JVM will cache it and doesn't retry to load a class.
assert(!e.isInstanceOf[LinkageError] && !e.isInstanceOf[ClassNotFoundException])
assert(!(classOf[LinkageError].isAssignableFrom(e.getClass)))
assert(!(classOf[ClassNotFoundException].isAssignableFrom(e.getClass)))
} finally {
rpcEnv.shutdown()
rpcEnv.awaitTermination()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -680,12 +680,12 @@ class TreeNodeSuite extends SparkFunSuite with SQLHelper {
}

test("clone") {
def assertDifferentInstance(before: AnyRef, after: AnyRef): Unit = {
def assertDifferentInstance[T <: TreeNode[T]](before: TreeNode[T], after: TreeNode[T]): Unit = {
assert(before.ne(after) && before == after)
before.asInstanceOf[TreeNode[_]].children.zip(
after.asInstanceOf[TreeNode[_]].children).foreach {
case (beforeChild: AnyRef, afterChild: AnyRef) =>
assertDifferentInstance(beforeChild, afterChild)
before.children.zip(after.children).foreach { case (beforeChild, afterChild) =>
assertDifferentInstance(
beforeChild.asInstanceOf[TreeNode[T]],
afterChild.asInstanceOf[TreeNode[T]])
}
}

Expand Down