aboutsummaryrefslogtreecommitdiff
path: root/extras
diff options
context:
space:
mode:
authorDongjoon Hyun <dongjoon@apache.org>2016-03-09 10:31:26 +0000
committerSean Owen <sowen@cloudera.com>2016-03-09 10:31:26 +0000
commitc3689bc24e03a9471cd6e8169da61963c4528252 (patch)
tree5d1ee90afa2087ede8e4dbc4dd666d699578c230 /extras
parentcbff2803ef117d7cffe6f05fc1bbd395a1e9c587 (diff)
downloadspark-c3689bc24e03a9471cd6e8169da61963c4528252.tar.gz
spark-c3689bc24e03a9471cd6e8169da61963c4528252.tar.bz2
spark-c3689bc24e03a9471cd6e8169da61963c4528252.zip
[SPARK-13702][CORE][SQL][MLLIB] Use diamond operator for generic instance creation in Java code.
## What changes were proposed in this pull request? In order to make `docs/examples` (and other related code) more simple/readable/user-friendly, this PR replaces existing codes like the followings by using `diamond` operator. ``` - final ArrayList<Product2<Object, Object>> dataToWrite = - new ArrayList<Product2<Object, Object>>(); + final ArrayList<Product2<Object, Object>> dataToWrite = new ArrayList<>(); ``` Java 7 or higher supports **diamond** operator which replaces the type arguments required to invoke the constructor of a generic class with an empty set of type parameters (<>). Currently, Spark Java code use mixed usage of this. ## How was this patch tested? Manual. Pass the existing tests. Author: Dongjoon Hyun <dongjoon@apache.org> Closes #11541 from dongjoon-hyun/SPARK-13702.
Diffstat (limited to 'extras')
-rw-r--r--extras/kinesis-asl/src/main/java/org/apache/spark/examples/streaming/JavaKinesisWordCountASL.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/extras/kinesis-asl/src/main/java/org/apache/spark/examples/streaming/JavaKinesisWordCountASL.java b/extras/kinesis-asl/src/main/java/org/apache/spark/examples/streaming/JavaKinesisWordCountASL.java
index 64e044aa8e..5dc825dfdc 100644
--- a/extras/kinesis-asl/src/main/java/org/apache/spark/examples/streaming/JavaKinesisWordCountASL.java
+++ b/extras/kinesis-asl/src/main/java/org/apache/spark/examples/streaming/JavaKinesisWordCountASL.java
@@ -136,7 +136,7 @@ public final class JavaKinesisWordCountASL { // needs to be public for access fr
JavaStreamingContext jssc = new JavaStreamingContext(sparkConfig, batchInterval);
// Create the Kinesis DStreams
- List<JavaDStream<byte[]>> streamsList = new ArrayList<JavaDStream<byte[]>>(numStreams);
+ List<JavaDStream<byte[]>> streamsList = new ArrayList<>(numStreams);
for (int i = 0; i < numStreams; i++) {
streamsList.add(
KinesisUtils.createStream(jssc, kinesisAppName, streamName, endpointUrl, regionName,