diff --git a/common/unsafe/src/test/java/org/apache/spark/unsafe/types/UTF8StringSuite.java b/common/unsafe/src/test/java/org/apache/spark/unsafe/types/UTF8StringSuite.java index 773461bcc9c3..ea79c28151ed 100644 --- a/common/unsafe/src/test/java/org/apache/spark/unsafe/types/UTF8StringSuite.java +++ b/common/unsafe/src/test/java/org/apache/spark/unsafe/types/UTF8StringSuite.java @@ -63,6 +63,9 @@ public void basicTest() { checkBasic("hello", 5); // 5 * 1 byte chars checkBasic("大 千 世 界", 7); checkBasic("︽﹋%", 3); // 3 * 3 bytes chars + // checkstyle.off: AvoidEscapedUnicodeCharacters + checkBasic("\uD83E\uDD19", 1); // 4 bytes char + // checkstyle.on: AvoidEscapedUnicodeCharacters } @Test diff --git a/core/src/test/java/org/apache/spark/util/collection/unsafe/sort/UnsafeExternalSorterSuite.java b/core/src/test/java/org/apache/spark/util/collection/unsafe/sort/UnsafeExternalSorterSuite.java index 12497c7f92ed..17c4d7e5b988 100644 --- a/core/src/test/java/org/apache/spark/util/collection/unsafe/sort/UnsafeExternalSorterSuite.java +++ b/core/src/test/java/org/apache/spark/util/collection/unsafe/sort/UnsafeExternalSorterSuite.java @@ -480,18 +480,17 @@ public void testOOMDuringSpill() throws Exception { memoryManager.markconsequentOOM(2); try { insertNumber(sorter, 1024); - fail("expected OutOfMmoryError but " + - "it seems operation surprisingly succeeded"); + fail("expected OutOfMmoryError but it seems operation surprisingly succeeded"); } // We expect an OutOfMemoryError here, anything else // (i.e the original NPE is a failure) catch (OutOfMemoryError oom){ String oomStackTrace = Utils.exceptionString(oom); - assertThat("expected OutOfMemoryError in " + - "org.apache.spark.util.collection.unsafe.sort.UnsafeInMemorySorter.reset", - oomStackTrace, - Matchers.containsString("org.apache.spark.util.collection." + - "unsafe.sort.UnsafeInMemorySorter.reset")); + assertThat("expected OutOfMemoryError in " + + "org.apache.spark.util.collection.unsafe.sort.UnsafeInMemorySorter.reset", + oomStackTrace, + Matchers.containsString( + "org.apache.spark.util.collection.unsafe.sort.UnsafeInMemorySorter.reset")); } } } diff --git a/core/src/test/java/org/apache/spark/util/collection/unsafe/sort/UnsafeInMemorySorterSuite.java b/core/src/test/java/org/apache/spark/util/collection/unsafe/sort/UnsafeInMemorySorterSuite.java index 359426d82932..c14553232851 100644 --- a/core/src/test/java/org/apache/spark/util/collection/unsafe/sort/UnsafeInMemorySorterSuite.java +++ b/core/src/test/java/org/apache/spark/util/collection/unsafe/sort/UnsafeInMemorySorterSuite.java @@ -174,14 +174,12 @@ public int compare( } }; UnsafeInMemorySorter sorter = new UnsafeInMemorySorter(consumer, memoryManager, - recordComparator, prefixComparator, - 100, shouldUseRadixSort()); + recordComparator, prefixComparator, 100, shouldUseRadixSort()); testMemoryManager.markExecutionAsOutOfMemoryOnce(); try { sorter.reset(); - fail("expected OutOfMmoryError " + - "but it seems operation surprisingly succeeded"); + fail("expected OutOfMmoryError but it seems operation surprisingly succeeded"); } catch (OutOfMemoryError oom) { // as expected }