diff options
author | Sean Owen <sowen@cloudera.com> | 2016-03-16 09:36:34 +0000 |
---|---|---|
committer | Sean Owen <sowen@cloudera.com> | 2016-03-16 09:36:34 +0000 |
commit | 3b461d9ecd633c4fd659998b99e700d76f58d18a (patch) | |
tree | 09e9923fc17bada794d01bc365f130039972a8b7 /common/sketch | |
parent | 05ab2948ab357fc07222bb3505df80b1886f7310 (diff) | |
download | spark-3b461d9ecd633c4fd659998b99e700d76f58d18a.tar.gz spark-3b461d9ecd633c4fd659998b99e700d76f58d18a.tar.bz2 spark-3b461d9ecd633c4fd659998b99e700d76f58d18a.zip |
[SPARK-13823][SPARK-13397][SPARK-13395][CORE] More warnings, StandardCharset follow up
## What changes were proposed in this pull request?
Follow up to https://github.com/apache/spark/pull/11657
- Also update `String.getBytes("UTF-8")` to use `StandardCharsets.UTF_8`
- And fix one last new Coverity warning that turned up (use of unguarded `wait()` replaced by simpler/more robust `java.util.concurrent` classes in tests)
- And while we're here cleaning up Coverity warnings, just fix about 15 more build warnings
## How was this patch tested?
Jenkins tests
Author: Sean Owen <sowen@cloudera.com>
Closes #11725 from srowen/SPARK-13823.2.
Diffstat (limited to 'common/sketch')
-rw-r--r-- | common/sketch/pom.xml | 24 | ||||
-rw-r--r-- | common/sketch/src/main/java/org/apache/spark/util/sketch/Utils.java | 8 |
2 files changed, 26 insertions, 6 deletions
diff --git a/common/sketch/pom.xml b/common/sketch/pom.xml index 442043cb51..8bc1f52798 100644 --- a/common/sketch/pom.xml +++ b/common/sketch/pom.xml @@ -45,5 +45,29 @@ <build> <outputDirectory>target/scala-${scala.binary.version}/classes</outputDirectory> <testOutputDirectory>target/scala-${scala.binary.version}/test-classes</testOutputDirectory> + <pluginManagement> + <plugins> + <plugin> + <groupId>net.alchim31.maven</groupId> + <artifactId>scala-maven-plugin</artifactId> + <configuration> + <javacArgs combine.children="append"> + <!-- This option is needed to suppress warnings from sun.misc.Unsafe usage --> + <javacArg>-XDignore.symbol.file</javacArg> + </javacArgs> + </configuration> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + <configuration> + <compilerArgs combine.children="append"> + <!-- This option is needed to suppress warnings from sun.misc.Unsafe usage --> + <arg>-XDignore.symbol.file</arg> + </compilerArgs> + </configuration> + </plugin> + </plugins> + </pluginManagement> </build> </project> diff --git a/common/sketch/src/main/java/org/apache/spark/util/sketch/Utils.java b/common/sketch/src/main/java/org/apache/spark/util/sketch/Utils.java index feb601d44f..81461f0300 100644 --- a/common/sketch/src/main/java/org/apache/spark/util/sketch/Utils.java +++ b/common/sketch/src/main/java/org/apache/spark/util/sketch/Utils.java @@ -17,15 +17,11 @@ package org.apache.spark.util.sketch; -import java.io.UnsupportedEncodingException; +import java.nio.charset.StandardCharsets; class Utils { public static byte[] getBytesFromUTF8String(String str) { - try { - return str.getBytes("utf-8"); - } catch (UnsupportedEncodingException e) { - throw new IllegalArgumentException("Only support utf-8 string", e); - } + return str.getBytes(StandardCharsets.UTF_8); } public static long integralToLong(Object i) { |