avro-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nielsbas...@apache.org
Subject [08/19] avro git commit: AVRO-2117: Cleanup Java - Explicit types replaced with <>
Date Fri, 29 Dec 2017 17:10:18 GMT
http://git-wip-us.apache.org/repos/asf/avro/blob/8bc49510/lang/java/ipc/src/test/java/org/apache/avro/TestSchema.java
----------------------------------------------------------------------
diff --git a/lang/java/ipc/src/test/java/org/apache/avro/TestSchema.java b/lang/java/ipc/src/test/java/org/apache/avro/TestSchema.java
index 15bb095..f814db9 100644
--- a/lang/java/ipc/src/test/java/org/apache/avro/TestSchema.java
+++ b/lang/java/ipc/src/test/java/org/apache/avro/TestSchema.java
@@ -156,10 +156,10 @@ public class TestSchema {
   public void testArray() throws Exception {
     String json = "{\"type\":\"array\", \"items\": \"long\"}";
     Schema schema = Schema.parse(json);
-    Collection<Long> array = new GenericData.Array<Long>(1, schema);
+    Collection<Long> array = new GenericData.Array<>(1, schema);
     array.add(1L);
     check(json, "[1]", array);
-    array = new ArrayList<Long>(1);
+    array = new ArrayList<>(1);
     array.add(1L);
     check(json, "[1]", array);
     checkParseError("{\"type\":\"array\"}");      // items required
@@ -167,7 +167,7 @@ public class TestSchema {
 
   @Test
   public void testMap() throws Exception {
-    HashMap<Utf8,Long> map = new HashMap<Utf8,Long>();
+    HashMap<Utf8,Long> map = new HashMap<>();
     map.put(new Utf8("a"), 1L);
     check("{\"type\":\"map\", \"values\":\"long\"}", "{\"a\":1}", map);
     checkParseError("{\"type\":\"map\"}");        // values required
@@ -233,7 +233,7 @@ public class TestSchema {
       +"[{\"name\":\"f\", \"type\": {\"type\":\"map\", \"values\":\"long\"}}]}";
     Schema schema = Schema.parse(json);
 
-    HashMap<Utf8,Long> map = new HashMap<Utf8,Long>();
+    HashMap<Utf8,Long> map = new HashMap<>();
     map.put(new Utf8("a"), 1L);
     GenericData.Record record = new GenericData.Record(schema);
     record.put("f", map);
@@ -291,13 +291,13 @@ public class TestSchema {
     for (int i = 1; i < 15; i++) {                // 15 is big enough to trigger
       // create a list of records, each with a single field whose type is a
       // union of all of the records.
-      List<Schema> recs = new ArrayList<Schema>();
+      List<Schema> recs = new ArrayList<>();
       for (int j = 0; j < i; j++)
         recs.add(Schema.createRecord(""+(char)('A'+j), null, null, false));
       for (Schema s : recs) {
         Schema union = Schema.createUnion(recs);
         Field f = new Field("x", union, null, null);
-        List<Field> fields = new ArrayList<Field>();
+        List<Field> fields = new ArrayList<>();
         fields.add(f);
         s.setFields(fields);
       }
@@ -392,7 +392,7 @@ public class TestSchema {
     checkUnionError(new Schema[] {Schema.createMap(Schema.create(Type.INT)),
         Schema.createMap(Schema.create(Type.INT))});
 
-    List<String> symbols = new ArrayList<String>();
+    List<String> symbols = new ArrayList<>();
     symbols.add("NOTHING");
 
     // succeed with two branches of the same named type, if different names
@@ -544,8 +544,8 @@ public class TestSchema {
     GenericData.Record record = new GenericData.Record(schema);
     try {
       checkBinary(schema, record,
-                  new GenericDatumWriter<Object>(),
-                  new GenericDatumReader<Object>());
+          new GenericDatumWriter<>(),
+          new GenericDatumReader<>());
     } catch (NullPointerException e) {
       assertEquals("null of string in field x of Test", e.getMessage());
     }
@@ -674,20 +674,20 @@ public class TestSchema {
                  GenericData.get().validate(schema, datum));
 
       checkBinary(schema, datum,
-                  new GenericDatumWriter<Object>(),
-                  new GenericDatumReader<Object>(), null);
+          new GenericDatumWriter<>(),
+          new GenericDatumReader<>(), null);
       reuse = checkBinary(schema, datum,
-          new GenericDatumWriter<Object>(),
-          new GenericDatumReader<Object>(), reuse);
+          new GenericDatumWriter<>(),
+          new GenericDatumReader<>(), reuse);
       checkDirectBinary(schema, datum,
-                  new GenericDatumWriter<Object>(),
-                  new GenericDatumReader<Object>());
+          new GenericDatumWriter<>(),
+          new GenericDatumReader<>());
       checkBlockingBinary(schema, datum,
-                  new GenericDatumWriter<Object>(),
-                  new GenericDatumReader<Object>());
+          new GenericDatumWriter<>(),
+          new GenericDatumReader<>());
       checkJson(schema, datum,
-                  new GenericDatumWriter<Object>(),
-                  new GenericDatumReader<Object>());
+          new GenericDatumWriter<>(),
+          new GenericDatumReader<>());
 
       // Check that we can generate the code for every schema we see.
       TestSpecificCompiler.assertCompiles(schema, false);
@@ -801,7 +801,7 @@ public class TestSchema {
                                 String json) throws Exception {
     ByteArrayOutputStream out = new ByteArrayOutputStream();
     Encoder encoder = EncoderFactory.get().jsonEncoder(schema, out);
-    DatumWriter<Object> writer = new GenericDatumWriter<Object>();
+    DatumWriter<Object> writer = new GenericDatumWriter<>();
     writer.setSchema(schema);
     writer.write(datum, encoder);
     encoder.flush();
@@ -810,7 +810,7 @@ public class TestSchema {
     String encoded = new String(data, "UTF-8");
     assertEquals("Encoded data does not match.", json, encoded);
 
-    DatumReader<Object> reader = new GenericDatumReader<Object>();
+    DatumReader<Object> reader = new GenericDatumReader<>();
     reader.setSchema(schema);
     Object decoded = reader.read(null, DecoderFactory.get()
         .jsonDecoder(schema, new ByteArrayInputStream(data)));
@@ -846,7 +846,7 @@ public class TestSchema {
     +"\"type\":"+schemaJson+", "
     +"\"default\":"+defaultJson+"}]}";
     Schema expected = Schema.parse(recordJson);
-    DatumReader<Object> in = new GenericDatumReader<Object>(ACTUAL, expected);
+    DatumReader<Object> in = new GenericDatumReader<>(ACTUAL, expected);
     GenericData.Record record = (GenericData.Record)
       in.read(null, DecoderFactory.get().binaryDecoder(
           new byte[0], null));
@@ -873,7 +873,7 @@ public class TestSchema {
     Schema expected =
       Schema.parse("{\"type\":\"record\", \"name\":\"Foo\", \"fields\":"+
                    "[{\"name\":\"f\", \"type\": \"string\"}]}");
-    DatumReader<Object> in = new GenericDatumReader<Object>(ACTUAL, expected);
+    DatumReader<Object> in = new GenericDatumReader<>(ACTUAL, expected);
     in.read(null, DecoderFactory.get().binaryDecoder(
         new ByteArrayInputStream(new byte[0]), null));
   }
@@ -885,7 +885,7 @@ public class TestSchema {
     Schema expected = Schema.parse
       ("{\"type\":\"enum\",\"name\":\"E\",\"symbols\":[\"Y\",\"Z\"]}");
     ByteArrayOutputStream out = new ByteArrayOutputStream();
-    DatumWriter<Object> writer = new GenericDatumWriter<Object>(actual);
+    DatumWriter<Object> writer = new GenericDatumWriter<>(actual);
     Encoder encoder = EncoderFactory.get().directBinaryEncoder(out, null);
     writer.write(new GenericData.EnumSymbol(actual, "Y"), encoder);
     writer.write(new GenericData.EnumSymbol(actual, "X"), encoder);
@@ -893,7 +893,7 @@ public class TestSchema {
     byte[] data = out.toByteArray();
     Decoder decoder = DecoderFactory.get().binaryDecoder(
         data, null);
-    DatumReader<String> in = new GenericDatumReader<String>(actual, expected);
+    DatumReader<String> in = new GenericDatumReader<>(actual, expected);
     assertEquals("Wrong value", new GenericData.EnumSymbol(expected, "Y"),
                  in.read(null, decoder));
     try {
@@ -933,8 +933,8 @@ public class TestSchema {
   }
 
   private static List<String> lockedArrayList() {
-    return new Schema.LockableArrayList<String>(Arrays.asList(new String[] {
-        "a", "b", "c" })).lock();
+    return new Schema.LockableArrayList<>(Arrays.asList(new String[]{
+        "a", "b", "c"})).lock();
   }
 
   @Test(expected=IllegalStateException.class)

http://git-wip-us.apache.org/repos/asf/avro/blob/8bc49510/lang/java/ipc/src/test/java/org/apache/avro/compiler/specific/TestSpecificCompiler.java
----------------------------------------------------------------------
diff --git a/lang/java/ipc/src/test/java/org/apache/avro/compiler/specific/TestSpecificCompiler.java b/lang/java/ipc/src/test/java/org/apache/avro/compiler/specific/TestSpecificCompiler.java
index 28aa998..ddcf9d5 100644
--- a/lang/java/ipc/src/test/java/org/apache/avro/compiler/specific/TestSpecificCompiler.java
+++ b/lang/java/ipc/src/test/java/org/apache/avro/compiler/specific/TestSpecificCompiler.java
@@ -725,7 +725,7 @@ public class TestSpecificCompiler {
       return;               // Nothing to compile!
     }
     File dstDir = AvroTestUtil.tempFile(TestSpecificCompiler.class, "realCompiler");
-    List<File> javaFiles = new ArrayList<File>();
+    List<File> javaFiles = new ArrayList<>();
     for (OutputFile o : outputs) {
       javaFiles.add(o.writeToDestination(null, dstDir));
     }

http://git-wip-us.apache.org/repos/asf/avro/blob/8bc49510/lang/java/ipc/src/test/java/org/apache/avro/generic/TestDeepCopy.java
----------------------------------------------------------------------
diff --git a/lang/java/ipc/src/test/java/org/apache/avro/generic/TestDeepCopy.java b/lang/java/ipc/src/test/java/org/apache/avro/generic/TestDeepCopy.java
index 3829391..17314cb 100644
--- a/lang/java/ipc/src/test/java/org/apache/avro/generic/TestDeepCopy.java
+++ b/lang/java/ipc/src/test/java/org/apache/avro/generic/TestDeepCopy.java
@@ -56,7 +56,7 @@ public class TestDeepCopy {
     interopBuilder.setLongField(64L);
 
     Map<java.lang.String,org.apache.avro.Foo> map =
-      new HashMap<java.lang.String,org.apache.avro.Foo>(1);
+      new HashMap<>(1);
     map.put("foo", Foo.newBuilder().setLabel("bar").build());
     interopBuilder.setMapField(map);
 
@@ -64,7 +64,7 @@ public class TestDeepCopy {
 
     Node.Builder rootBuilder = Node.newBuilder().setLabel("/");
     Node.Builder homeBuilder = Node.newBuilder().setLabel("home");
-    homeBuilder.setChildren(new ArrayList<Node>(0));
+    homeBuilder.setChildren(new ArrayList<>(0));
     rootBuilder.setChildren(Arrays.asList(new Node[] { homeBuilder.build() }));
     interopBuilder.setRecordField(rootBuilder.build());
 

http://git-wip-us.apache.org/repos/asf/avro/blob/8bc49510/lang/java/ipc/src/test/java/org/apache/avro/io/Perf.java
----------------------------------------------------------------------
diff --git a/lang/java/ipc/src/test/java/org/apache/avro/io/Perf.java b/lang/java/ipc/src/test/java/org/apache/avro/io/Perf.java
index 1f8a892..9c4d1c0 100644
--- a/lang/java/ipc/src/test/java/org/apache/avro/io/Perf.java
+++ b/lang/java/ipc/src/test/java/org/apache/avro/io/Perf.java
@@ -76,17 +76,17 @@ public class Perf {
     }
   }
 
-  private static final List<TestDescriptor> BASIC = new ArrayList<TestDescriptor>();
-  private static final List<TestDescriptor> RECORD = new ArrayList<TestDescriptor>();
-  private static final List<TestDescriptor> GENERIC = new ArrayList<TestDescriptor>();
-  private static final List<TestDescriptor> GENERIC_ONETIME = new ArrayList<TestDescriptor>();
-  private static final List<TestDescriptor> SPECIFIC = new ArrayList<TestDescriptor>();
-  private static final List<TestDescriptor> REFLECT = new ArrayList<TestDescriptor>();
+  private static final List<TestDescriptor> BASIC = new ArrayList<>();
+  private static final List<TestDescriptor> RECORD = new ArrayList<>();
+  private static final List<TestDescriptor> GENERIC = new ArrayList<>();
+  private static final List<TestDescriptor> GENERIC_ONETIME = new ArrayList<>();
+  private static final List<TestDescriptor> SPECIFIC = new ArrayList<>();
+  private static final List<TestDescriptor> REFLECT = new ArrayList<>();
   private static final LinkedHashMap<String, TestDescriptor> ALL_TESTS;
   private static final LinkedHashMap<String, List<TestDescriptor>> BATCHES;
   static {
-    ALL_TESTS = new LinkedHashMap<String, TestDescriptor>();
-    BATCHES = new LinkedHashMap<String, List<TestDescriptor>>();
+    ALL_TESTS = new LinkedHashMap<>();
+    BATCHES = new LinkedHashMap<>();
     BATCHES.put("-basic", BASIC);
     new TestDescriptor(IntTest.class, "-i").add(BASIC);
     new TestDescriptor(SmallLongTest.class, "-ls").add(BASIC);
@@ -156,7 +156,7 @@ public class Perf {
   }
 
   public static void main(String[] args) throws Exception {
-    List<Test> tests = new ArrayList<Test>();
+    List<Test> tests = new ArrayList<>();
     boolean writeTests = true;
     boolean readTests = true;
     for (String a : args) {
@@ -1119,7 +1119,7 @@ public class Perf {
       return reader;
     }
     protected GenericDatumReader<Object> newReader() {
-      return new GenericDatumReader<Object>(schema);
+      return new GenericDatumReader<>(schema);
     }
     @Override
     void genSourceData() {
@@ -1144,7 +1144,7 @@ public class Perf {
     }
     @Override
     void writeInternal(Encoder e) throws IOException {
-      GenericDatumWriter<Object> writer = new GenericDatumWriter<Object>(schema);
+      GenericDatumWriter<Object> writer = new GenericDatumWriter<>(schema);
       for (int i = 0; i < sourceData.length; i++) {
         GenericRecord rec = sourceData[i];
         writer.write(rec, e);
@@ -1278,7 +1278,7 @@ public class Perf {
     }
     @Override
     protected GenericDatumReader<Object> newReader() {
-      return new GenericDatumReader<Object>(schema, getReaderSchema());
+      return new GenericDatumReader<>(schema, getReaderSchema());
     }
     protected abstract Schema getReaderSchema();
   }
@@ -1367,10 +1367,10 @@ public class Perf {
       return writer;
     }
     protected SpecificDatumReader<T> newReader() {
-      return new SpecificDatumReader<T>(schema);
+      return new SpecificDatumReader<>(schema);
     }
     protected SpecificDatumWriter<T> newWriter() {
-      return new SpecificDatumWriter<T>(schema);
+      return new SpecificDatumWriter<>(schema);
     }
     @Override
     void genSourceData() {
@@ -1413,7 +1413,7 @@ public class Perf {
     @Override
     protected FooBarSpecificRecord genSingleRecord(Random r) {
       TypeEnum[] typeEnums = TypeEnum.values();
-      List<Integer> relatedIds = new ArrayList<Integer>(10);
+      List<Integer> relatedIds = new ArrayList<>(10);
       for (int i = 0; i < 10; i++) {
         relatedIds.add(r.nextInt());
       }
@@ -1440,8 +1440,8 @@ public class Perf {
     ReflectTest(String name, T sample, int factor) throws IOException {
       super(name, ReflectData.get().getSchema(sample.getClass()).toString(), factor);
       clazz = (Class<T>) sample.getClass();
-      reader = new ReflectDatumReader<T>(schema);
-      writer = new ReflectDatumWriter<T>(schema);
+      reader = new ReflectDatumReader<>(schema);
+      writer = new ReflectDatumWriter<>(schema);
     }
 
     @SuppressWarnings("unchecked")

http://git-wip-us.apache.org/repos/asf/avro/blob/8bc49510/lang/java/ipc/src/test/java/org/apache/avro/ipc/TestNettyServerWithCallbacks.java
----------------------------------------------------------------------
diff --git a/lang/java/ipc/src/test/java/org/apache/avro/ipc/TestNettyServerWithCallbacks.java b/lang/java/ipc/src/test/java/org/apache/avro/ipc/TestNettyServerWithCallbacks.java
index 6ed898a..c34bacf 100644
--- a/lang/java/ipc/src/test/java/org/apache/avro/ipc/TestNettyServerWithCallbacks.java
+++ b/lang/java/ipc/src/test/java/org/apache/avro/ipc/TestNettyServerWithCallbacks.java
@@ -54,7 +54,7 @@ public class TestNettyServerWithCallbacks {
   private static Simple.Callback simpleClient;
   private static final AtomicBoolean ackFlag = new AtomicBoolean(false);
   private static final AtomicReference<CountDownLatch> ackLatch =
-    new AtomicReference<CountDownLatch>(new CountDownLatch(1));
+    new AtomicReference<>(new CountDownLatch(1));
   private static Simple simpleService = new SimpleImpl(ackFlag);
 
   @BeforeClass
@@ -88,13 +88,13 @@ public class TestNettyServerWithCallbacks {
     Assert.assertEquals("Hello, how are you?", simpleClient.hello("how are you?"));
 
     // Test asynchronous RPC (future):
-    CallFuture<String> future1 = new CallFuture<String>();
+    CallFuture<String> future1 = new CallFuture<>();
     simpleClient.hello("World!", future1);
     Assert.assertEquals("Hello, World!", future1.get(2, TimeUnit.SECONDS));
     Assert.assertNull(future1.getError());
 
     // Test asynchronous RPC (callback):
-    final CallFuture<String> future2 = new CallFuture<String>();
+    final CallFuture<String> future2 = new CallFuture<>();
     simpleClient.hello("what's up?", new Callback<String>() {
       @Override
       public void handleResult(String result) {
@@ -121,13 +121,13 @@ public class TestNettyServerWithCallbacks {
     Assert.assertEquals(record, simpleClient.echo(record));
 
     // Test asynchronous RPC (future):
-    CallFuture<TestRecord> future1 = new CallFuture<TestRecord>();
+    CallFuture<TestRecord> future1 = new CallFuture<>();
     simpleClient.echo(record, future1);
     Assert.assertEquals(record, future1.get(2, TimeUnit.SECONDS));
     Assert.assertNull(future1.getError());
 
     // Test asynchronous RPC (callback):
-    final CallFuture<TestRecord> future2 = new CallFuture<TestRecord>();
+    final CallFuture<TestRecord> future2 = new CallFuture<>();
     simpleClient.echo(record, new Callback<TestRecord>() {
       @Override
       public void handleResult(TestRecord result) {
@@ -148,13 +148,13 @@ public class TestNettyServerWithCallbacks {
     Assert.assertEquals(8, simpleClient.add(2, 6));
 
     // Test asynchronous RPC (future):
-    CallFuture<Integer> future1 = new CallFuture<Integer>();
+    CallFuture<Integer> future1 = new CallFuture<>();
     simpleClient.add(8, 8, future1);
     Assert.assertEquals(new Integer(16), future1.get(2, TimeUnit.SECONDS));
     Assert.assertNull(future1.getError());
 
     // Test asynchronous RPC (callback):
-    final CallFuture<Integer> future2 = new CallFuture<Integer>();
+    final CallFuture<Integer> future2 = new CallFuture<>();
     simpleClient.add(512, 256, new Callback<Integer>() {
       @Override
       public void handleResult(Integer result) {
@@ -177,13 +177,13 @@ public class TestNettyServerWithCallbacks {
     Assert.assertEquals(byteBuffer, simpleClient.echoBytes(byteBuffer));
 
     // Test asynchronous RPC (future):
-    CallFuture<ByteBuffer> future1 = new CallFuture<ByteBuffer>();
+    CallFuture<ByteBuffer> future1 = new CallFuture<>();
     simpleClient.echoBytes(byteBuffer, future1);
     Assert.assertEquals(byteBuffer, future1.get(2, TimeUnit.SECONDS));
     Assert.assertNull(future1.getError());
 
     // Test asynchronous RPC (callback):
-    final CallFuture<ByteBuffer> future2 = new CallFuture<ByteBuffer>();
+    final CallFuture<ByteBuffer> future2 = new CallFuture<>();
     simpleClient.echoBytes(byteBuffer, new Callback<ByteBuffer>() {
       @Override
       public void handleResult(ByteBuffer result) {
@@ -212,7 +212,7 @@ public class TestNettyServerWithCallbacks {
     }
 
     // Test asynchronous RPC (future):
-    CallFuture<Void> future = new CallFuture<Void>();
+    CallFuture<Void> future = new CallFuture<>();
     simpleClient.error(future);
     try {
       future.get(2, TimeUnit.SECONDS);
@@ -228,7 +228,7 @@ public class TestNettyServerWithCallbacks {
 
     // Test asynchronous RPC (callback):
     final CountDownLatch latch = new CountDownLatch(1);
-    final AtomicReference<Throwable> errorRef = new AtomicReference<Throwable>();
+    final AtomicReference<Throwable> errorRef = new AtomicReference<>();
     simpleClient.error(new Callback<Void>() {
       @Override
       public void handleResult(Void result) {
@@ -278,7 +278,7 @@ public class TestNettyServerWithCallbacks {
         Assert.assertEquals(3, simpleClient2.add(1, 2));
 
         // Try again with callbacks:
-        CallFuture<Integer> addFuture = new CallFuture<Integer>();
+        CallFuture<Integer> addFuture = new CallFuture<>();
         simpleClient2.add(1, 2, addFuture);
         Assert.assertEquals(new Integer(3), addFuture.get());
 
@@ -305,7 +305,7 @@ public class TestNettyServerWithCallbacks {
         // is thrown:
         ioeCaught = false;
         try {
-          addFuture = new CallFuture<Integer>();
+          addFuture = new CallFuture<>();
           simpleClient2.add(1, 2, addFuture);
           addFuture.get();
           Assert.fail("Send after server close should have thrown Exception");
@@ -336,7 +336,7 @@ public class TestNettyServerWithCallbacks {
       int serverPort = server2.getPort();
       System.out.println("server2 port : " + serverPort);
 
-      CallFuture<Integer> addFuture = new CallFuture<Integer>();
+      CallFuture<Integer> addFuture = new CallFuture<>();
       Transceiver transceiver2 = new NettyTransceiver(new InetSocketAddress(
           serverPort), TestNettyServer.CONNECT_TIMEOUT_MILLIS);
       try {

http://git-wip-us.apache.org/repos/asf/avro/blob/8bc49510/lang/java/ipc/src/test/java/org/apache/avro/ipc/TestNettyTransceiverWhenServerStops.java
----------------------------------------------------------------------
diff --git a/lang/java/ipc/src/test/java/org/apache/avro/ipc/TestNettyTransceiverWhenServerStops.java b/lang/java/ipc/src/test/java/org/apache/avro/ipc/TestNettyTransceiverWhenServerStops.java
index b6a5c71..b602158 100644
--- a/lang/java/ipc/src/test/java/org/apache/avro/ipc/TestNettyTransceiverWhenServerStops.java
+++ b/lang/java/ipc/src/test/java/org/apache/avro/ipc/TestNettyTransceiverWhenServerStops.java
@@ -47,7 +47,7 @@ public class TestNettyTransceiverWhenServerStops {
     final AtomicInteger successes = new AtomicInteger();
     final AtomicInteger failures = new AtomicInteger();
     final AtomicBoolean quitOnFailure = new AtomicBoolean();
-    List<Thread> threads = new ArrayList<Thread>();
+    List<Thread> threads = new ArrayList<>();
 
     // Start a bunch of client threads that use the transceiver to send messages
     for (int i = 0; i < 100; i++) {

http://git-wip-us.apache.org/repos/asf/avro/blob/8bc49510/lang/java/ipc/src/test/java/org/apache/avro/ipc/TestSaslDigestMd5.java
----------------------------------------------------------------------
diff --git a/lang/java/ipc/src/test/java/org/apache/avro/ipc/TestSaslDigestMd5.java b/lang/java/ipc/src/test/java/org/apache/avro/ipc/TestSaslDigestMd5.java
index 34651eb..2c211c9 100644
--- a/lang/java/ipc/src/test/java/org/apache/avro/ipc/TestSaslDigestMd5.java
+++ b/lang/java/ipc/src/test/java/org/apache/avro/ipc/TestSaslDigestMd5.java
@@ -60,7 +60,7 @@ public class TestSaslDigestMd5 extends TestProtocolGeneric {
 
   private static final String DIGEST_MD5_MECHANISM = "DIGEST-MD5";
   private static final Map<String, String> DIGEST_MD5_PROPS =
-    new HashMap<String, String>();
+    new HashMap<>();
 
   static {
     DIGEST_MD5_PROPS.put(Sasl.QOP, "auth-int");

http://git-wip-us.apache.org/repos/asf/avro/blob/8bc49510/lang/java/ipc/src/test/java/org/apache/avro/ipc/stats/TestHistogram.java
----------------------------------------------------------------------
diff --git a/lang/java/ipc/src/test/java/org/apache/avro/ipc/stats/TestHistogram.java b/lang/java/ipc/src/test/java/org/apache/avro/ipc/stats/TestHistogram.java
index 9ab6eb7..bd9622b 100644
--- a/lang/java/ipc/src/test/java/org/apache/avro/ipc/stats/TestHistogram.java
+++ b/lang/java/ipc/src/test/java/org/apache/avro/ipc/stats/TestHistogram.java
@@ -35,10 +35,10 @@ public class TestHistogram {
 
   @Test
   public void testBasicOperation() {
-    Segmenter<String, Integer> s = new Histogram.TreeMapSegmenter<Integer>(
-        new TreeSet<Integer>(Arrays.asList(0, 1, 2, 4, 8, 16)));
+    Segmenter<String, Integer> s = new Histogram.TreeMapSegmenter<>(
+        new TreeSet<>(Arrays.asList(0, 1, 2, 4, 8, 16)));
 
-    Histogram<String, Integer> h = new Histogram<String, Integer>(s);
+    Histogram<String, Integer> h = new Histogram<>(s);
 
     for(int i = 0; i < 20; ++i) {
       h.add(i);
@@ -79,7 +79,7 @@ public class TestHistogram {
       }
     }
 
-    List<Entry<String>> entries = new ArrayList<Entry<String>>();
+    List<Entry<String>> entries = new ArrayList<>();
     for (Entry<String> entry : h.entries()) {
       entries.add(entry);
     }
@@ -97,10 +97,10 @@ public class TestHistogram {
 
   @Test(expected=Histogram.SegmenterException.class)
   public void testBadValue() {
-    Segmenter<String, Long> s = new Histogram.TreeMapSegmenter<Long>(
-        new TreeSet<Long>(Arrays.asList(0L, 1L, 2L, 4L, 8L, 16L)));
+    Segmenter<String, Long> s = new Histogram.TreeMapSegmenter<>(
+        new TreeSet<>(Arrays.asList(0L, 1L, 2L, 4L, 8L, 16L)));
 
-    Histogram<String, Long> h = new Histogram<String, Long>(s);
+    Histogram<String, Long> h = new Histogram<>(s);
     h.add(-1L);
   }
 
@@ -129,7 +129,7 @@ public class TestHistogram {
 
   @Test
   public void testFloatHistogram() {
-    FloatHistogram<String> h = new FloatHistogram<String>(new SingleBucketSegmenter());
+    FloatHistogram<String> h = new FloatHistogram<>(new SingleBucketSegmenter());
     h.add(12.0f);
     h.add(10.0f);
     h.add(20.0f);

http://git-wip-us.apache.org/repos/asf/avro/blob/8bc49510/lang/java/ipc/src/test/java/org/apache/avro/specific/TestSpecificBuilderTree.java
----------------------------------------------------------------------
diff --git a/lang/java/ipc/src/test/java/org/apache/avro/specific/TestSpecificBuilderTree.java b/lang/java/ipc/src/test/java/org/apache/avro/specific/TestSpecificBuilderTree.java
index 1a0a486..59c681c 100644
--- a/lang/java/ipc/src/test/java/org/apache/avro/specific/TestSpecificBuilderTree.java
+++ b/lang/java/ipc/src/test/java/org/apache/avro/specific/TestSpecificBuilderTree.java
@@ -60,7 +60,7 @@ public class TestSpecificBuilderTree {
       requestBuilder
         .getHttpRequestBuilder()
           .getURIBuilder()
-            .setParameters(new ArrayList<QueryParameter>());
+            .setParameters(new ArrayList<>());
     }
 
     requestBuilder

http://git-wip-us.apache.org/repos/asf/avro/blob/8bc49510/lang/java/ipc/src/test/java/org/apache/avro/specific/TestSpecificData.java
----------------------------------------------------------------------
diff --git a/lang/java/ipc/src/test/java/org/apache/avro/specific/TestSpecificData.java b/lang/java/ipc/src/test/java/org/apache/avro/specific/TestSpecificData.java
index 4518583..bc56a83 100644
--- a/lang/java/ipc/src/test/java/org/apache/avro/specific/TestSpecificData.java
+++ b/lang/java/ipc/src/test/java/org/apache/avro/specific/TestSpecificData.java
@@ -77,7 +77,7 @@ public class TestSpecificData {
   public void testSpecificWithinGeneric() throws Exception {
     // define a record with a field that's a generated TestRecord
     Schema schema = Schema.createRecord("Foo", "", "x.y.z", false);
-    List<Schema.Field> fields = new ArrayList<Schema.Field>();
+    List<Schema.Field> fields = new ArrayList<>();
     fields.add(new Schema.Field("f", TestRecord.SCHEMA$, "", null));
     schema.setFields(fields);
 
@@ -91,16 +91,16 @@ public class TestSpecificData {
 
     // test that this instance can be written & re-read
     TestSchema.checkBinary(schema, record,
-                           new SpecificDatumWriter<Object>(),
-                           new SpecificDatumReader<Object>());
+        new SpecificDatumWriter<>(),
+        new SpecificDatumReader<>());
 
     TestSchema.checkDirectBinary(schema, record,
-        new SpecificDatumWriter<Object>(),
-        new SpecificDatumReader<Object>());
+        new SpecificDatumWriter<>(),
+        new SpecificDatumReader<>());
 
     TestSchema.checkBlockingBinary(schema, record,
-        new SpecificDatumWriter<Object>(),
-        new SpecificDatumReader<Object>());
+        new SpecificDatumWriter<>(),
+        new SpecificDatumReader<>());
 }
 
   @Test public void testConvertGenericToSpecific() {
@@ -149,7 +149,7 @@ public class TestSpecificData {
     out.close();
 
     ObjectInputStream in =
-      new ObjectInputStream(new ByteArrayInputStream(bytes.toByteArray()));
+        new ObjectInputStream(new ByteArrayInputStream(bytes.toByteArray()));
     TestRecord after = (TestRecord)in.readObject();
 
     Assert.assertEquals(before, after);

http://git-wip-us.apache.org/repos/asf/avro/blob/8bc49510/lang/java/ipc/src/test/java/org/apache/avro/specific/TestSpecificDatumReader.java
----------------------------------------------------------------------
diff --git a/lang/java/ipc/src/test/java/org/apache/avro/specific/TestSpecificDatumReader.java b/lang/java/ipc/src/test/java/org/apache/avro/specific/TestSpecificDatumReader.java
index 5b6cca3..f2c6f42 100644
--- a/lang/java/ipc/src/test/java/org/apache/avro/specific/TestSpecificDatumReader.java
+++ b/lang/java/ipc/src/test/java/org/apache/avro/specific/TestSpecificDatumReader.java
@@ -41,7 +41,7 @@ public class TestSpecificDatumReader {
 
   public static byte[] serializeRecord(FooBarSpecificRecord fooBarSpecificRecord) throws IOException {
     SpecificDatumWriter<FooBarSpecificRecord> datumWriter =
-        new SpecificDatumWriter<FooBarSpecificRecord>(FooBarSpecificRecord.SCHEMA$);
+        new SpecificDatumWriter<>(FooBarSpecificRecord.SCHEMA$);
     ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
     Encoder encoder = EncoderFactory.get().binaryEncoder(byteArrayOutputStream, null);
     datumWriter.write(fooBarSpecificRecord, encoder);
@@ -51,7 +51,7 @@ public class TestSpecificDatumReader {
 
   public static byte[] serializeRecord(StringablesRecord stringablesRecord) throws IOException {
     SpecificDatumWriter<StringablesRecord> datumWriter =
-      new SpecificDatumWriter<StringablesRecord>(StringablesRecord.SCHEMA$);
+        new SpecificDatumWriter<>(StringablesRecord.SCHEMA$);
     ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
     Encoder encoder = EncoderFactory.get().binaryEncoder(byteArrayOutputStream, null);
     datumWriter.write(stringablesRecord, encoder);
@@ -71,7 +71,7 @@ public class TestSpecificDatumReader {
     byte[] recordBytes = serializeRecord(specificRecord);
 
     Decoder decoder = DecoderFactory.get().binaryDecoder(recordBytes, null);
-    SpecificDatumReader<FooBarSpecificRecord> specificDatumReader = new SpecificDatumReader<FooBarSpecificRecord>(FooBarSpecificRecord.SCHEMA$);
+    SpecificDatumReader<FooBarSpecificRecord> specificDatumReader = new SpecificDatumReader<>(FooBarSpecificRecord.SCHEMA$);
     FooBarSpecificRecord deserialized = new FooBarSpecificRecord();
     specificDatumReader.read(deserialized, decoder);
 
@@ -82,10 +82,10 @@ public class TestSpecificDatumReader {
   public void testStringables() throws IOException {
     StringablesRecord.Builder newBuilder = StringablesRecord.newBuilder();
     newBuilder.setValue(new BigDecimal("42.11"));
-    HashMap<String, BigDecimal> mapWithBigDecimalElements = new HashMap<String, BigDecimal>();
+    HashMap<String, BigDecimal> mapWithBigDecimalElements = new HashMap<>();
     mapWithBigDecimalElements.put("test", new BigDecimal("11.11"));
     newBuilder.setMapWithBigDecimalElements(mapWithBigDecimalElements);
-    HashMap<BigInteger, String> mapWithBigIntKeys = new HashMap<BigInteger, String>();
+    HashMap<BigInteger, String> mapWithBigIntKeys = new HashMap<>();
     mapWithBigIntKeys.put(BigInteger.ONE, "test");
     newBuilder.setMapWithBigIntKeys(mapWithBigIntKeys);
     StringablesRecord stringablesRecord = newBuilder.build();
@@ -94,7 +94,7 @@ public class TestSpecificDatumReader {
 
     Decoder decoder = DecoderFactory.get().binaryDecoder(recordBytes, null);
     SpecificDatumReader<StringablesRecord> specificDatumReader =
-      new SpecificDatumReader<StringablesRecord>(StringablesRecord.SCHEMA$);
+      new SpecificDatumReader<>(StringablesRecord.SCHEMA$);
     StringablesRecord deserialized = new StringablesRecord();
     specificDatumReader.read(deserialized, decoder);
 

http://git-wip-us.apache.org/repos/asf/avro/blob/8bc49510/lang/java/ipc/src/test/java/org/apache/avro/specific/TestSpecificDatumWriter.java
----------------------------------------------------------------------
diff --git a/lang/java/ipc/src/test/java/org/apache/avro/specific/TestSpecificDatumWriter.java b/lang/java/ipc/src/test/java/org/apache/avro/specific/TestSpecificDatumWriter.java
index d863891..172f735 100644
--- a/lang/java/ipc/src/test/java/org/apache/avro/specific/TestSpecificDatumWriter.java
+++ b/lang/java/ipc/src/test/java/org/apache/avro/specific/TestSpecificDatumWriter.java
@@ -32,7 +32,7 @@ import org.junit.Test;
 public class TestSpecificDatumWriter {
   @Test
   public void testResolveUnion() throws IOException {
-    final SpecificDatumWriter<TestRecordWithUnion> writer = new SpecificDatumWriter<TestRecordWithUnion>();
+    final SpecificDatumWriter<TestRecordWithUnion> writer = new SpecificDatumWriter<>();
     Schema schema = TestRecordWithUnion.SCHEMA$;
     ByteArrayOutputStream out = new ByteArrayOutputStream();
     JsonEncoder encoder = EncoderFactory.get().jsonEncoder(schema, out);

http://git-wip-us.apache.org/repos/asf/avro/blob/8bc49510/lang/java/ipc/src/test/java/org/apache/avro/specific/TestSpecificRecordBuilder.java
----------------------------------------------------------------------
diff --git a/lang/java/ipc/src/test/java/org/apache/avro/specific/TestSpecificRecordBuilder.java b/lang/java/ipc/src/test/java/org/apache/avro/specific/TestSpecificRecordBuilder.java
index bae1dda..b230017 100644
--- a/lang/java/ipc/src/test/java/org/apache/avro/specific/TestSpecificRecordBuilder.java
+++ b/lang/java/ipc/src/test/java/org/apache/avro/specific/TestSpecificRecordBuilder.java
@@ -192,8 +192,8 @@ public class TestSpecificRecordBuilder {
   @Test
   public void testBuilderPerformance() {
     int count = 1000000;
-    List<Person> friends = new ArrayList<Person>(0);
-    List<String> languages = new ArrayList<String>(Arrays.asList(new String[] { "English", "Java" }));
+    List<Person> friends = new ArrayList<>(0);
+    List<String> languages = new ArrayList<>(Arrays.asList(new String[]{"English", "Java"}));
     long startTimeNanos = System.nanoTime();
     for (int ii = 0; ii < count; ii++) {
       Person.newBuilder().setName("James Gosling").setYearOfBirth(1955).setCountry("US").setState("CA").setFriends(friends).
@@ -226,8 +226,8 @@ public class TestSpecificRecordBuilder {
   @SuppressWarnings("deprecation")
   public void testManualBuildPerformance() {
     int count = 1000000;
-    List<Person> friends = new ArrayList<Person>(0);
-    List<String> languages = new ArrayList<String>(Arrays.asList(new String[] { "English", "Java" }));
+    List<Person> friends = new ArrayList<>(0);
+    List<String> languages = new ArrayList<>(Arrays.asList(new String[]{"English", "Java"}));
     long startTimeNanos = System.nanoTime();
     for (int ii = 0; ii < count; ii++) {
       Person person = new Person();

http://git-wip-us.apache.org/repos/asf/avro/blob/8bc49510/lang/java/mapred/src/main/java/org/apache/avro/hadoop/file/HadoopCodecFactory.java
----------------------------------------------------------------------
diff --git a/lang/java/mapred/src/main/java/org/apache/avro/hadoop/file/HadoopCodecFactory.java b/lang/java/mapred/src/main/java/org/apache/avro/hadoop/file/HadoopCodecFactory.java
index 9927ef9..2a40154 100644
--- a/lang/java/mapred/src/main/java/org/apache/avro/hadoop/file/HadoopCodecFactory.java
+++ b/lang/java/mapred/src/main/java/org/apache/avro/hadoop/file/HadoopCodecFactory.java
@@ -39,7 +39,7 @@ import org.apache.avro.file.CodecFactory;
 public class HadoopCodecFactory {
 
   private static final Map<String, String> HADOOP_AVRO_NAME_MAP =
-      new HashMap<String, String>();
+      new HashMap<>();
 
   static {
     HADOOP_AVRO_NAME_MAP.put("org.apache.hadoop.io.compress.DeflateCodec", "deflate");

http://git-wip-us.apache.org/repos/asf/avro/blob/8bc49510/lang/java/mapred/src/main/java/org/apache/avro/hadoop/file/SortedKeyValueFile.java
----------------------------------------------------------------------
diff --git a/lang/java/mapred/src/main/java/org/apache/avro/hadoop/file/SortedKeyValueFile.java b/lang/java/mapred/src/main/java/org/apache/avro/hadoop/file/SortedKeyValueFile.java
index 6b07220..c656bf8 100644
--- a/lang/java/mapred/src/main/java/org/apache/avro/hadoop/file/SortedKeyValueFile.java
+++ b/lang/java/mapred/src/main/java/org/apache/avro/hadoop/file/SortedKeyValueFile.java
@@ -224,8 +224,8 @@ public class SortedKeyValueFile {
       DatumReader<GenericRecord> datumReader =
         model.createDatumReader(recordSchema);
       mDataFileReader =
-        new DataFileReader<GenericRecord>
-        (new FsInput(dataFilePath, options.getConfiguration()), datumReader);
+          new DataFileReader<>
+              (new FsInput(dataFilePath, options.getConfiguration()), datumReader);
 
     }
 
@@ -285,7 +285,7 @@ public class SortedKeyValueFile {
      * @return An iterator.
      */
     public Iterator<AvroKeyValue<K, V>> iterator() {
-      return new AvroKeyValue.Iterator<K, V>(mDataFileReader.iterator());
+      return new AvroKeyValue.Iterator<>(mDataFileReader.iterator());
     }
 
     /** {@inheritDoc} */
@@ -306,8 +306,8 @@ public class SortedKeyValueFile {
         Configuration conf, Path path, Schema keySchema) throws IOException {
       DatumReader<GenericRecord> datumReader = model.createDatumReader(
           AvroKeyValue.getSchema(keySchema, Schema.create(Schema.Type.LONG)));
-      DataFileReader<GenericRecord> fileReader = new DataFileReader<GenericRecord>(
-          new FsInput(path, conf), datumReader);
+      DataFileReader<GenericRecord> fileReader = new DataFileReader<>(
+        new FsInput(path, conf), datumReader);
 
       NavigableMap<K, Long> index;
       if (Schema.create(Schema.Type.STRING).equals(keySchema)) {
@@ -317,13 +317,13 @@ public class SortedKeyValueFile {
         // problem for primitive string types.  If, for example, you tried to use a record
         // type as the key, any string fields inside of it would not be compared correctly
         // against java.lang.Strings.
-        index = new TreeMap<K, Long>(new AvroCharSequenceComparator<K>());
+        index = new TreeMap<>(new AvroCharSequenceComparator<>());
       } else {
-        index = new TreeMap<K, Long>();
+        index = new TreeMap<>();
       }
       try {
         for (GenericRecord genericRecord : fileReader) {
-          AvroKeyValue<K, Long> indexRecord = new AvroKeyValue<K, Long>(genericRecord);
+          AvroKeyValue<K, Long> indexRecord = new AvroKeyValue<>(genericRecord);
           index.put(indexRecord.getKey(), indexRecord.getValue());
         }
       } finally {
@@ -567,7 +567,7 @@ public class SortedKeyValueFile {
       DatumWriter<GenericRecord> datumWriter =
         model.createDatumWriter(mRecordSchema);
       OutputStream dataOutputStream = fileSystem.create(dataFilePath);
-      mDataFileWriter = new DataFileWriter<GenericRecord>(datumWriter)
+      mDataFileWriter = new DataFileWriter<>(datumWriter)
           .setSyncInterval(1 << 20)  // Set the auto-sync interval sufficiently large, since
                                      // we will manually sync every mIndexInterval records.
           .setCodec(options.getCodec())
@@ -580,7 +580,7 @@ public class SortedKeyValueFile {
       DatumWriter<GenericRecord> indexWriter =
         model.createDatumWriter(mIndexSchema);
       OutputStream indexOutputStream = fileSystem.create(indexFilePath);
-      mIndexFileWriter = new DataFileWriter<GenericRecord>(indexWriter)
+      mIndexFileWriter = new DataFileWriter<>(indexWriter)
           .create(mIndexSchema, indexOutputStream);
     }
 
@@ -601,7 +601,7 @@ public class SortedKeyValueFile {
 
       // Construct the data record.
       AvroKeyValue<K, V> dataRecord
-          = new AvroKeyValue<K, V>(new GenericData.Record(mRecordSchema));
+          = new AvroKeyValue<>(new GenericData.Record(mRecordSchema));
       dataRecord.setKey(key);
       dataRecord.setValue(value);
 
@@ -613,7 +613,7 @@ public class SortedKeyValueFile {
 
         // Construct the record to put in the index.
         AvroKeyValue<K, Long> indexRecord
-            = new AvroKeyValue<K, Long>(new GenericData.Record(mIndexSchema));
+            = new AvroKeyValue<>(new GenericData.Record(mIndexSchema));
         indexRecord.setKey(key);
         indexRecord.setValue(position);
         mIndexFileWriter.append(indexRecord.get());

http://git-wip-us.apache.org/repos/asf/avro/blob/8bc49510/lang/java/mapred/src/main/java/org/apache/avro/hadoop/io/AvroDeserializer.java
----------------------------------------------------------------------
diff --git a/lang/java/mapred/src/main/java/org/apache/avro/hadoop/io/AvroDeserializer.java b/lang/java/mapred/src/main/java/org/apache/avro/hadoop/io/AvroDeserializer.java
index 7b6031d..79d5be5 100644
--- a/lang/java/mapred/src/main/java/org/apache/avro/hadoop/io/AvroDeserializer.java
+++ b/lang/java/mapred/src/main/java/org/apache/avro/hadoop/io/AvroDeserializer.java
@@ -68,8 +68,8 @@ public abstract class AvroDeserializer<T extends AvroWrapper<D>, D> implements D
                              ClassLoader classLoader) {
     mWriterSchema = writerSchema;
     mReaderSchema = null != readerSchema ? readerSchema : writerSchema;
-    mAvroDatumReader = new ReflectDatumReader<D>(mWriterSchema, mReaderSchema,
-                                                 new ReflectData(classLoader));
+    mAvroDatumReader = new ReflectDatumReader<>(mWriterSchema, mReaderSchema,
+                                                new ReflectData(classLoader));
   }
 
   /**

http://git-wip-us.apache.org/repos/asf/avro/blob/8bc49510/lang/java/mapred/src/main/java/org/apache/avro/hadoop/io/AvroKeyDeserializer.java
----------------------------------------------------------------------
diff --git a/lang/java/mapred/src/main/java/org/apache/avro/hadoop/io/AvroKeyDeserializer.java b/lang/java/mapred/src/main/java/org/apache/avro/hadoop/io/AvroKeyDeserializer.java
index dd36639..42e68df 100644
--- a/lang/java/mapred/src/main/java/org/apache/avro/hadoop/io/AvroKeyDeserializer.java
+++ b/lang/java/mapred/src/main/java/org/apache/avro/hadoop/io/AvroKeyDeserializer.java
@@ -61,6 +61,6 @@ public class AvroKeyDeserializer<D> extends AvroDeserializer<AvroWrapper<D>, D>
    */
   @Override
   protected AvroWrapper<D> createAvroWrapper() {
-    return new AvroKey<D>(null);
+    return new AvroKey<>(null);
   }
 }

http://git-wip-us.apache.org/repos/asf/avro/blob/8bc49510/lang/java/mapred/src/main/java/org/apache/avro/hadoop/io/AvroKeyValue.java
----------------------------------------------------------------------
diff --git a/lang/java/mapred/src/main/java/org/apache/avro/hadoop/io/AvroKeyValue.java b/lang/java/mapred/src/main/java/org/apache/avro/hadoop/io/AvroKeyValue.java
index 1dff5c9..0bdb53b 100644
--- a/lang/java/mapred/src/main/java/org/apache/avro/hadoop/io/AvroKeyValue.java
+++ b/lang/java/mapred/src/main/java/org/apache/avro/hadoop/io/AvroKeyValue.java
@@ -146,7 +146,7 @@ public class AvroKeyValue<K, V> {
       if (null == genericRecord) {
         return null;
       }
-      return new AvroKeyValue<K, V>(genericRecord);
+      return new AvroKeyValue<>(genericRecord);
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/avro/blob/8bc49510/lang/java/mapred/src/main/java/org/apache/avro/hadoop/io/AvroSerialization.java
----------------------------------------------------------------------
diff --git a/lang/java/mapred/src/main/java/org/apache/avro/hadoop/io/AvroSerialization.java b/lang/java/mapred/src/main/java/org/apache/avro/hadoop/io/AvroSerialization.java
index b7c4b7c..cc98141 100644
--- a/lang/java/mapred/src/main/java/org/apache/avro/hadoop/io/AvroSerialization.java
+++ b/lang/java/mapred/src/main/java/org/apache/avro/hadoop/io/AvroSerialization.java
@@ -80,14 +80,14 @@ public class AvroSerialization<T> extends Configured implements Serialization<Av
       DatumReader<T> datumReader = (readerSchema != null)
         ? dataModel.createDatumReader(writerSchema, readerSchema)
         : dataModel.createDatumReader(writerSchema);
-      return new AvroKeyDeserializer<T>(writerSchema, readerSchema, datumReader);
+      return new AvroKeyDeserializer<>(writerSchema, readerSchema, datumReader);
     } else if (AvroValue.class.isAssignableFrom(c)) {
       Schema writerSchema = getValueWriterSchema(conf);
       Schema readerSchema = getValueReaderSchema(conf);
       DatumReader<T> datumReader = (readerSchema != null)
         ? dataModel.createDatumReader(writerSchema, readerSchema)
         : dataModel.createDatumReader(writerSchema);
-      return new AvroValueDeserializer<T>(writerSchema, readerSchema, datumReader);
+      return new AvroValueDeserializer<>(writerSchema, readerSchema, datumReader);
     } else {
       throw new IllegalStateException("Only AvroKey and AvroValue are supported.");
     }
@@ -112,7 +112,7 @@ public class AvroSerialization<T> extends Configured implements Serialization<Av
     }
     GenericData dataModel = createDataModel(conf);
     DatumWriter<T> datumWriter = dataModel.createDatumWriter(schema);
-    return new AvroSerializer<T>(schema, datumWriter);
+    return new AvroSerializer<>(schema, datumWriter);
   }
 
   /**

http://git-wip-us.apache.org/repos/asf/avro/blob/8bc49510/lang/java/mapred/src/main/java/org/apache/avro/hadoop/io/AvroSerializer.java
----------------------------------------------------------------------
diff --git a/lang/java/mapred/src/main/java/org/apache/avro/hadoop/io/AvroSerializer.java b/lang/java/mapred/src/main/java/org/apache/avro/hadoop/io/AvroSerializer.java
index e71e0bb..ae483d2 100644
--- a/lang/java/mapred/src/main/java/org/apache/avro/hadoop/io/AvroSerializer.java
+++ b/lang/java/mapred/src/main/java/org/apache/avro/hadoop/io/AvroSerializer.java
@@ -70,7 +70,7 @@ public class AvroSerializer<T> implements Serializer<AvroWrapper<T>> {
       throw new IllegalArgumentException("Writer schema may not be null");
     }
     mWriterSchema = writerSchema;
-    mAvroDatumWriter = new ReflectDatumWriter<T>(writerSchema);
+    mAvroDatumWriter = new ReflectDatumWriter<>(writerSchema);
   }
 
   /**

http://git-wip-us.apache.org/repos/asf/avro/blob/8bc49510/lang/java/mapred/src/main/java/org/apache/avro/hadoop/io/AvroValueDeserializer.java
----------------------------------------------------------------------
diff --git a/lang/java/mapred/src/main/java/org/apache/avro/hadoop/io/AvroValueDeserializer.java b/lang/java/mapred/src/main/java/org/apache/avro/hadoop/io/AvroValueDeserializer.java
index 370f944..28351cb 100644
--- a/lang/java/mapred/src/main/java/org/apache/avro/hadoop/io/AvroValueDeserializer.java
+++ b/lang/java/mapred/src/main/java/org/apache/avro/hadoop/io/AvroValueDeserializer.java
@@ -61,6 +61,6 @@ public class AvroValueDeserializer<D> extends AvroDeserializer<AvroWrapper<D>, D
    */
   @Override
   protected AvroWrapper<D> createAvroWrapper() {
-    return new AvroValue<D>(null);
+    return new AvroValue<>(null);
   }
 }

http://git-wip-us.apache.org/repos/asf/avro/blob/8bc49510/lang/java/mapred/src/main/java/org/apache/avro/hadoop/util/AvroCharSequenceComparator.java
----------------------------------------------------------------------
diff --git a/lang/java/mapred/src/main/java/org/apache/avro/hadoop/util/AvroCharSequenceComparator.java b/lang/java/mapred/src/main/java/org/apache/avro/hadoop/util/AvroCharSequenceComparator.java
index 2a1c972..11c9a0f 100644
--- a/lang/java/mapred/src/main/java/org/apache/avro/hadoop/util/AvroCharSequenceComparator.java
+++ b/lang/java/mapred/src/main/java/org/apache/avro/hadoop/util/AvroCharSequenceComparator.java
@@ -36,7 +36,7 @@ import java.util.Comparator;
 public class AvroCharSequenceComparator<T> implements Comparator<T> {
   /** A singleton instance. */
   public static final AvroCharSequenceComparator<CharSequence> INSTANCE
-      = new AvroCharSequenceComparator<CharSequence>();
+      = new AvroCharSequenceComparator<>();
 
   /** {@inheritDoc} */
   @Override

http://git-wip-us.apache.org/repos/asf/avro/blob/8bc49510/lang/java/mapred/src/main/java/org/apache/avro/mapred/AvroAsTextInputFormat.java
----------------------------------------------------------------------
diff --git a/lang/java/mapred/src/main/java/org/apache/avro/mapred/AvroAsTextInputFormat.java b/lang/java/mapred/src/main/java/org/apache/avro/mapred/AvroAsTextInputFormat.java
index d0da121..58feec8 100644
--- a/lang/java/mapred/src/main/java/org/apache/avro/mapred/AvroAsTextInputFormat.java
+++ b/lang/java/mapred/src/main/java/org/apache/avro/mapred/AvroAsTextInputFormat.java
@@ -50,7 +50,7 @@ public class AvroAsTextInputFormat extends FileInputFormat<Text, Text> {
   protected FileStatus[] listStatus(JobConf job) throws IOException {
     if (job.getBoolean(AvroInputFormat.IGNORE_FILES_WITHOUT_EXTENSION_KEY,
         AvroInputFormat.IGNORE_INPUTS_WITHOUT_EXTENSION_DEFAULT)) {
-      List<FileStatus> result = new ArrayList<FileStatus>();
+      List<FileStatus> result = new ArrayList<>();
       for (FileStatus file : super.listStatus(job))
         if (file.getPath().getName().endsWith(AvroOutputFormat.EXT))
           result.add(file);

http://git-wip-us.apache.org/repos/asf/avro/blob/8bc49510/lang/java/mapred/src/main/java/org/apache/avro/mapred/AvroAsTextRecordReader.java
----------------------------------------------------------------------
diff --git a/lang/java/mapred/src/main/java/org/apache/avro/mapred/AvroAsTextRecordReader.java b/lang/java/mapred/src/main/java/org/apache/avro/mapred/AvroAsTextRecordReader.java
index 2ed2a61..6bd25d5 100644
--- a/lang/java/mapred/src/main/java/org/apache/avro/mapred/AvroAsTextRecordReader.java
+++ b/lang/java/mapred/src/main/java/org/apache/avro/mapred/AvroAsTextRecordReader.java
@@ -40,7 +40,7 @@ class AvroAsTextRecordReader<T> implements RecordReader<Text, Text> {
   public AvroAsTextRecordReader(JobConf job, FileSplit split)
     throws IOException {
     this(DataFileReader.openReader
-         (new FsInput(split.getPath(), job), new GenericDatumReader<T>()), split);
+         (new FsInput(split.getPath(), job), new GenericDatumReader<>()), split);
   }
 
   protected AvroAsTextRecordReader(FileReader<T> reader, FileSplit split)

http://git-wip-us.apache.org/repos/asf/avro/blob/8bc49510/lang/java/mapred/src/main/java/org/apache/avro/mapred/AvroInputFormat.java
----------------------------------------------------------------------
diff --git a/lang/java/mapred/src/main/java/org/apache/avro/mapred/AvroInputFormat.java b/lang/java/mapred/src/main/java/org/apache/avro/mapred/AvroInputFormat.java
index 5d8bad0..45dbd56 100644
--- a/lang/java/mapred/src/main/java/org/apache/avro/mapred/AvroInputFormat.java
+++ b/lang/java/mapred/src/main/java/org/apache/avro/mapred/AvroInputFormat.java
@@ -53,7 +53,7 @@ public class AvroInputFormat<T>
   protected FileStatus[] listStatus(JobConf job) throws IOException {
     if (job.getBoolean(IGNORE_FILES_WITHOUT_EXTENSION_KEY,
         IGNORE_INPUTS_WITHOUT_EXTENSION_DEFAULT)) {
-      List<FileStatus> result = new ArrayList<FileStatus>();
+      List<FileStatus> result = new ArrayList<>();
       for (FileStatus file : super.listStatus(job))
         if (file.getPath().getName().endsWith(AvroOutputFormat.EXT))
           result.add(file);
@@ -68,7 +68,7 @@ public class AvroInputFormat<T>
     getRecordReader(InputSplit split, JobConf job, Reporter reporter)
     throws IOException {
     reporter.setStatus(split.toString());
-    return new AvroRecordReader<T>(job, (FileSplit)split);
+    return new AvroRecordReader<>(job, (FileSplit) split);
   }
 
 }

http://git-wip-us.apache.org/repos/asf/avro/blob/8bc49510/lang/java/mapred/src/main/java/org/apache/avro/mapred/AvroMultipleInputs.java
----------------------------------------------------------------------
diff --git a/lang/java/mapred/src/main/java/org/apache/avro/mapred/AvroMultipleInputs.java b/lang/java/mapred/src/main/java/org/apache/avro/mapred/AvroMultipleInputs.java
index bdf6a5e..def4499 100644
--- a/lang/java/mapred/src/main/java/org/apache/avro/mapred/AvroMultipleInputs.java
+++ b/lang/java/mapred/src/main/java/org/apache/avro/mapred/AvroMultipleInputs.java
@@ -160,7 +160,7 @@ public class AvroMultipleInputs {
     if (conf.get(mappersKey) == null) {
       return Collections.emptyMap();
     }
-    Map<Path, Class<? extends AvroMapper>> m = new HashMap<Path, Class<? extends AvroMapper>>();
+    Map<Path, Class<? extends AvroMapper>> m = new HashMap<>();
     String[] pathMappings = conf.get(mappersKey).split(",");
     for (String pathMapping : pathMappings) {
       String[] split = pathMapping.split(";");
@@ -187,7 +187,7 @@ public class AvroMultipleInputs {
     if (conf.get(schemaKey) == null) {
       return Collections.emptyMap();
     }
-    Map<Path, Schema> m = new HashMap<Path, Schema>();
+    Map<Path, Schema> m = new HashMap<>();
     String[] schemaMappings =
         conf.get(schemaKey).split(",");
     Schema.Parser schemaParser = new Schema.Parser();

http://git-wip-us.apache.org/repos/asf/avro/blob/8bc49510/lang/java/mapred/src/main/java/org/apache/avro/mapred/AvroMultipleOutputs.java
----------------------------------------------------------------------
diff --git a/lang/java/mapred/src/main/java/org/apache/avro/mapred/AvroMultipleOutputs.java b/lang/java/mapred/src/main/java/org/apache/avro/mapred/AvroMultipleOutputs.java
index 5ae03e3..3931fbf 100644
--- a/lang/java/mapred/src/main/java/org/apache/avro/mapred/AvroMultipleOutputs.java
+++ b/lang/java/mapred/src/main/java/org/apache/avro/mapred/AvroMultipleOutputs.java
@@ -218,7 +218,7 @@ public class AvroMultipleOutputs {
    * @return List of channel Names
    */
   public static List<String> getNamedOutputsList(JobConf conf) {
-    List<String> names = new ArrayList<String>();
+    List<String> names = new ArrayList<>();
     StringTokenizer st = new StringTokenizer(conf.get(NAMED_OUTPUTS, ""), " ");
     while (st.hasMoreTokens()) {
       names.add(st.nextToken());
@@ -376,8 +376,8 @@ public class AvroMultipleOutputs {
     this.conf = job;
     outputFormat = new InternalFileOutputFormat();
     namedOutputs = Collections.unmodifiableSet(
-      new HashSet<String>(AvroMultipleOutputs.getNamedOutputsList(job)));
-    recordWriters = new HashMap<String, RecordWriter>();
+      new HashSet<>(AvroMultipleOutputs.getNamedOutputsList(job)));
+    recordWriters = new HashMap<>();
     countersEnabled = getCountersEnabled(job);
   }
 

http://git-wip-us.apache.org/repos/asf/avro/blob/8bc49510/lang/java/mapred/src/main/java/org/apache/avro/mapred/AvroRecordReader.java
----------------------------------------------------------------------
diff --git a/lang/java/mapred/src/main/java/org/apache/avro/mapred/AvroRecordReader.java b/lang/java/mapred/src/main/java/org/apache/avro/mapred/AvroRecordReader.java
index 351d3c5..8533b32 100644
--- a/lang/java/mapred/src/main/java/org/apache/avro/mapred/AvroRecordReader.java
+++ b/lang/java/mapred/src/main/java/org/apache/avro/mapred/AvroRecordReader.java
@@ -54,7 +54,7 @@ public class AvroRecordReader<T>
   }
 
   public AvroWrapper<T> createKey() {
-    return new AvroWrapper<T>(null);
+    return new AvroWrapper<>(null);
   }
 
   public NullWritable createValue() { return NullWritable.get(); }

http://git-wip-us.apache.org/repos/asf/avro/blob/8bc49510/lang/java/mapred/src/main/java/org/apache/avro/mapred/AvroReducer.java
----------------------------------------------------------------------
diff --git a/lang/java/mapred/src/main/java/org/apache/avro/mapred/AvroReducer.java b/lang/java/mapred/src/main/java/org/apache/avro/mapred/AvroReducer.java
index d7c0103..99bab8c 100644
--- a/lang/java/mapred/src/main/java/org/apache/avro/mapred/AvroReducer.java
+++ b/lang/java/mapred/src/main/java/org/apache/avro/mapred/AvroReducer.java
@@ -44,7 +44,7 @@ public class AvroReducer<K,V,OUT> extends Configured implements JobConfigurable,
                      AvroCollector<OUT> collector,
                      Reporter reporter) throws IOException {
     if (outputPair == null)
-      outputPair = new Pair<K,V>(AvroJob.getOutputSchema(getConf()));
+      outputPair = new Pair<>(AvroJob.getOutputSchema(getConf()));
     for (V value : values) {
       outputPair.set(key, value);
       collector.collect((OUT)outputPair);

http://git-wip-us.apache.org/repos/asf/avro/blob/8bc49510/lang/java/mapred/src/main/java/org/apache/avro/mapred/AvroSerialization.java
----------------------------------------------------------------------
diff --git a/lang/java/mapred/src/main/java/org/apache/avro/mapred/AvroSerialization.java b/lang/java/mapred/src/main/java/org/apache/avro/mapred/AvroSerialization.java
index c9c5df5..b8d35ec 100644
--- a/lang/java/mapred/src/main/java/org/apache/avro/mapred/AvroSerialization.java
+++ b/lang/java/mapred/src/main/java/org/apache/avro/mapred/AvroSerialization.java
@@ -80,7 +80,7 @@ public class AvroSerialization<T> extends Configured
       throws IOException {
       T datum = reader.read(wrapper == null ? null : wrapper.datum(), decoder);
       if (wrapper == null) {
-        wrapper = isKey? new AvroKey<T>(datum) : new AvroValue<T>(datum);
+        wrapper = isKey? new AvroKey<>(datum) : new AvroValue<>(datum);
       } else {
         wrapper.datum(datum);
       }

http://git-wip-us.apache.org/repos/asf/avro/blob/8bc49510/lang/java/mapred/src/main/java/org/apache/avro/mapred/AvroTextOutputFormat.java
----------------------------------------------------------------------
diff --git a/lang/java/mapred/src/main/java/org/apache/avro/mapred/AvroTextOutputFormat.java b/lang/java/mapred/src/main/java/org/apache/avro/mapred/AvroTextOutputFormat.java
index 917e894..90f8e8e 100644
--- a/lang/java/mapred/src/main/java/org/apache/avro/mapred/AvroTextOutputFormat.java
+++ b/lang/java/mapred/src/main/java/org/apache/avro/mapred/AvroTextOutputFormat.java
@@ -54,7 +54,7 @@ public class AvroTextOutputFormat<K, V> extends FileOutputFormat<K, V> {
       job.get("mapreduce.output.textoutputformat.separator", "\t").getBytes(UTF8);
 
     final DataFileWriter<ByteBuffer> writer =
-      new DataFileWriter<ByteBuffer>(new ReflectDatumWriter<ByteBuffer>());
+      new DataFileWriter<>(new ReflectDatumWriter<>());
 
     AvroOutputFormat.configureDataFileWriter(writer, job);
 

http://git-wip-us.apache.org/repos/asf/avro/blob/8bc49510/lang/java/mapred/src/main/java/org/apache/avro/mapred/AvroUtf8InputFormat.java
----------------------------------------------------------------------
diff --git a/lang/java/mapred/src/main/java/org/apache/avro/mapred/AvroUtf8InputFormat.java b/lang/java/mapred/src/main/java/org/apache/avro/mapred/AvroUtf8InputFormat.java
index abd8ae4..182244e 100644
--- a/lang/java/mapred/src/main/java/org/apache/avro/mapred/AvroUtf8InputFormat.java
+++ b/lang/java/mapred/src/main/java/org/apache/avro/mapred/AvroUtf8InputFormat.java
@@ -85,7 +85,7 @@ public class AvroUtf8InputFormat
 
     @Override
     public AvroWrapper<Utf8> createKey() {
-      return new AvroWrapper<Utf8>(null);
+      return new AvroWrapper<>(null);
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/avro/blob/8bc49510/lang/java/mapred/src/main/java/org/apache/avro/mapred/DelegatingInputFormat.java
----------------------------------------------------------------------
diff --git a/lang/java/mapred/src/main/java/org/apache/avro/mapred/DelegatingInputFormat.java b/lang/java/mapred/src/main/java/org/apache/avro/mapred/DelegatingInputFormat.java
index 1358e3c..6f96171 100644
--- a/lang/java/mapred/src/main/java/org/apache/avro/mapred/DelegatingInputFormat.java
+++ b/lang/java/mapred/src/main/java/org/apache/avro/mapred/DelegatingInputFormat.java
@@ -46,19 +46,19 @@ class DelegatingInputFormat<K, V> implements InputFormat<K, V> {
   public InputSplit[] getSplits(JobConf conf, int numSplits) throws IOException {
 
     JobConf confCopy = new JobConf(conf);
-    List<InputSplit> splits = new ArrayList<InputSplit>();
+    List<InputSplit> splits = new ArrayList<>();
 
     Map<Path, Class<? extends AvroMapper>> mapperMap = AvroMultipleInputs
        .getMapperTypeMap(conf);
     Map<Path, Schema> schemaMap = AvroMultipleInputs
         .getInputSchemaMap(conf);
     Map<Schema, List<Path>> schemaPaths
-        = new HashMap<Schema, List<Path>>();
+        = new HashMap<>();
 
     // First, build a map of Schemas to Paths
     for (Entry<Path, Schema> entry : schemaMap.entrySet()) {
       if (!schemaPaths.containsKey(entry.getValue())) {
-        schemaPaths.put(entry.getValue(), new LinkedList<Path>());
+        schemaPaths.put(entry.getValue(), new LinkedList<>());
         System.out.println(entry.getValue());
         System.out.println(entry.getKey());
       }
@@ -75,14 +75,14 @@ class DelegatingInputFormat<K, V> implements InputFormat<K, V> {
       List<Path> paths = schemaEntry.getValue();
 
       Map<Class<? extends AvroMapper>, List<Path>> mapperPaths
-          = new HashMap<Class<? extends AvroMapper>, List<Path>>();
+          = new HashMap<>();
 
       // Now, for each set of paths that have a common Schema, build
       // a map of Mappers to the paths they're used for
       for (Path path : paths) {
        Class<? extends AvroMapper> mapperClass = mapperMap.get(path);
        if (!mapperPaths.containsKey(mapperClass)) {
-         mapperPaths.put(mapperClass, new LinkedList<Path>());
+         mapperPaths.put(mapperClass, new LinkedList<>());
        }
 
        mapperPaths.get(mapperClass).add(path);

http://git-wip-us.apache.org/repos/asf/avro/blob/8bc49510/lang/java/mapred/src/main/java/org/apache/avro/mapred/HadoopCombiner.java
----------------------------------------------------------------------
diff --git a/lang/java/mapred/src/main/java/org/apache/avro/mapred/HadoopCombiner.java b/lang/java/mapred/src/main/java/org/apache/avro/mapred/HadoopCombiner.java
index 2717510..52670ec 100644
--- a/lang/java/mapred/src/main/java/org/apache/avro/mapred/HadoopCombiner.java
+++ b/lang/java/mapred/src/main/java/org/apache/avro/mapred/HadoopCombiner.java
@@ -38,8 +38,8 @@ class HadoopCombiner<K,V>
   }
 
   private class PairCollector extends AvroCollector<Pair<K,V>> {
-    private final AvroKey<K> keyWrapper = new AvroKey<K>(null);
-    private final AvroValue<V> valueWrapper = new AvroValue<V>(null);
+    private final AvroKey<K> keyWrapper = new AvroKey<>(null);
+    private final AvroValue<V> valueWrapper = new AvroValue<>(null);
     private OutputCollector<AvroKey<K>,AvroValue<V>> collector;
 
     public PairCollector(OutputCollector<AvroKey<K>,AvroValue<V>> collector) {

http://git-wip-us.apache.org/repos/asf/avro/blob/8bc49510/lang/java/mapred/src/main/java/org/apache/avro/mapred/HadoopMapper.java
----------------------------------------------------------------------
diff --git a/lang/java/mapred/src/main/java/org/apache/avro/mapred/HadoopMapper.java b/lang/java/mapred/src/main/java/org/apache/avro/mapred/HadoopMapper.java
index 54e1609..59ce2f0 100644
--- a/lang/java/mapred/src/main/java/org/apache/avro/mapred/HadoopMapper.java
+++ b/lang/java/mapred/src/main/java/org/apache/avro/mapred/HadoopMapper.java
@@ -52,7 +52,7 @@ class HadoopMapper<IN,OUT,K,V,KO,VO> extends MapReduceBase
                   OutputCollector<KO,VO> collector,
                   Reporter reporter) throws IOException {
     if (this.out == null)
-      this.out = new MapCollector<OUT,K,V,KO,VO>(collector, isMapOnly);
+      this.out = new MapCollector<>(collector, isMapOnly);
     mapper.map(wrapper.datum(), out, reporter);
   }
 

http://git-wip-us.apache.org/repos/asf/avro/blob/8bc49510/lang/java/mapred/src/main/java/org/apache/avro/mapred/HadoopReducer.java
----------------------------------------------------------------------
diff --git a/lang/java/mapred/src/main/java/org/apache/avro/mapred/HadoopReducer.java b/lang/java/mapred/src/main/java/org/apache/avro/mapred/HadoopReducer.java
index 2d78252..31f2e7b 100644
--- a/lang/java/mapred/src/main/java/org/apache/avro/mapred/HadoopReducer.java
+++ b/lang/java/mapred/src/main/java/org/apache/avro/mapred/HadoopReducer.java
@@ -38,7 +38,7 @@ class HadoopReducer<K,V,OUT>
   }
 
   private class ReduceCollector extends AvroCollector<OUT> {
-    private final AvroWrapper<OUT> wrapper = new AvroWrapper<OUT>(null);
+    private final AvroWrapper<OUT> wrapper = new AvroWrapper<>(null);
     private OutputCollector<AvroWrapper<OUT>, NullWritable> out;
 
     public ReduceCollector(OutputCollector<AvroWrapper<OUT>,NullWritable> out) {

http://git-wip-us.apache.org/repos/asf/avro/blob/8bc49510/lang/java/mapred/src/main/java/org/apache/avro/mapred/MapCollector.java
----------------------------------------------------------------------
diff --git a/lang/java/mapred/src/main/java/org/apache/avro/mapred/MapCollector.java b/lang/java/mapred/src/main/java/org/apache/avro/mapred/MapCollector.java
index 3a07574..4e8d5c0 100644
--- a/lang/java/mapred/src/main/java/org/apache/avro/mapred/MapCollector.java
+++ b/lang/java/mapred/src/main/java/org/apache/avro/mapred/MapCollector.java
@@ -25,9 +25,9 @@ import org.apache.hadoop.mapred.OutputCollector;
 
 @SuppressWarnings("unchecked")
 class MapCollector<OUT,K,V,KO,VO> extends AvroCollector<OUT> {
-  private final AvroWrapper<OUT> wrapper = new AvroWrapper<OUT>(null);
-  private final AvroKey<K> keyWrapper = new AvroKey<K>(null);
-  private final AvroValue<V> valueWrapper = new AvroValue<V>(null);
+  private final AvroWrapper<OUT> wrapper = new AvroWrapper<>(null);
+  private final AvroKey<K> keyWrapper = new AvroKey<>(null);
+  private final AvroValue<V> valueWrapper = new AvroValue<>(null);
   private OutputCollector<KO,VO> collector;
   private boolean isMapOnly;
 

http://git-wip-us.apache.org/repos/asf/avro/blob/8bc49510/lang/java/mapred/src/main/java/org/apache/avro/mapred/Pair.java
----------------------------------------------------------------------
diff --git a/lang/java/mapred/src/main/java/org/apache/avro/mapred/Pair.java b/lang/java/mapred/src/main/java/org/apache/avro/mapred/Pair.java
index a33de99..5ea1dee 100644
--- a/lang/java/mapred/src/main/java/org/apache/avro/mapred/Pair.java
+++ b/lang/java/mapred/src/main/java/org/apache/avro/mapred/Pair.java
@@ -75,7 +75,7 @@ public class Pair<K,V>
   }
 
   private static final Map<Schema,Map<Schema,Schema>> SCHEMA_CACHE =
-    new WeakHashMap<Schema,Map<Schema,Schema>>();
+    new WeakHashMap<>();
 
   /** Get a pair schema. */
   public static Schema getPairSchema(Schema key, Schema value) {
@@ -83,7 +83,7 @@ public class Pair<K,V>
     synchronized (SCHEMA_CACHE) {
       valueSchemas = SCHEMA_CACHE.get(key);
       if (valueSchemas == null) {
-        valueSchemas = new WeakHashMap<Schema,Schema>();
+        valueSchemas = new WeakHashMap<>();
         SCHEMA_CACHE.put(key, valueSchemas);
       }
       Schema result;
@@ -98,7 +98,7 @@ public class Pair<K,V>
 
   private static Schema makePairSchema(Schema key, Schema value) {
     Schema pair = Schema.createRecord(PAIR, null, null, false);
-    List<Field> fields = new ArrayList<Field>();
+    List<Field> fields = new ArrayList<>();
     fields.add(new Field(KEY, key, "", null));
     fields.add(new Field(VALUE, value, "", null, Field.Order.IGNORE));
     pair.setFields(fields);

http://git-wip-us.apache.org/repos/asf/avro/blob/8bc49510/lang/java/mapred/src/main/java/org/apache/avro/mapred/SequenceFileInputFormat.java
----------------------------------------------------------------------
diff --git a/lang/java/mapred/src/main/java/org/apache/avro/mapred/SequenceFileInputFormat.java b/lang/java/mapred/src/main/java/org/apache/avro/mapred/SequenceFileInputFormat.java
index f3bf5b8..a0c7d0c 100644
--- a/lang/java/mapred/src/main/java/org/apache/avro/mapred/SequenceFileInputFormat.java
+++ b/lang/java/mapred/src/main/java/org/apache/avro/mapred/SequenceFileInputFormat.java
@@ -37,7 +37,7 @@ public class SequenceFileInputFormat<K,V>
       getRecordReader(InputSplit split, JobConf job, Reporter reporter)
     throws IOException {
     reporter.setStatus(split.toString());
-    return new SequenceFileRecordReader<K,V>(job, (FileSplit)split);
+    return new SequenceFileRecordReader<>(job, (FileSplit) split);
   }
 
 }

http://git-wip-us.apache.org/repos/asf/avro/blob/8bc49510/lang/java/mapred/src/main/java/org/apache/avro/mapred/SequenceFileReader.java
----------------------------------------------------------------------
diff --git a/lang/java/mapred/src/main/java/org/apache/avro/mapred/SequenceFileReader.java b/lang/java/mapred/src/main/java/org/apache/avro/mapred/SequenceFileReader.java
index 36c9b61..312f905 100644
--- a/lang/java/mapred/src/main/java/org/apache/avro/mapred/SequenceFileReader.java
+++ b/lang/java/mapred/src/main/java/org/apache/avro/mapred/SequenceFileReader.java
@@ -127,7 +127,7 @@ public class SequenceFileReader<K,V> implements FileReader<Pair<K,V>> {
 
     Pair<K,V> result = reuse;
     if (result == null)
-      result = new Pair<K,V>(schema);
+      result = new Pair<>(schema);
 
     result.key(keyConverter.convert(key));
     reader.getCurrentValue(value);
@@ -156,7 +156,7 @@ public class SequenceFileReader<K,V> implements FileReader<Pair<K,V>> {
   @Override public long tell() throws IOException {return reader.getPosition();}
 
   private static final Map<Type,Schema> WRITABLE_SCHEMAS =
-    new HashMap<Type,Schema>();
+    new HashMap<>();
   static {
     WRITABLE_SCHEMAS.put(NullWritable.class,
                          Schema.create(Schema.Type.NULL));
@@ -196,7 +196,7 @@ public class SequenceFileReader<K,V> implements FileReader<Pair<K,V>> {
   }
 
   private static final Map<Type,Converter> WRITABLE_CONVERTERS =
-    new HashMap<Type,Converter>();
+    new HashMap<>();
   static {
     WRITABLE_CONVERTERS.put
       (NullWritable.class,

http://git-wip-us.apache.org/repos/asf/avro/blob/8bc49510/lang/java/mapred/src/main/java/org/apache/avro/mapred/SequenceFileRecordReader.java
----------------------------------------------------------------------
diff --git a/lang/java/mapred/src/main/java/org/apache/avro/mapred/SequenceFileRecordReader.java b/lang/java/mapred/src/main/java/org/apache/avro/mapred/SequenceFileRecordReader.java
index bb014a3..497bd42 100644
--- a/lang/java/mapred/src/main/java/org/apache/avro/mapred/SequenceFileRecordReader.java
+++ b/lang/java/mapred/src/main/java/org/apache/avro/mapred/SequenceFileRecordReader.java
@@ -28,7 +28,7 @@ public class SequenceFileRecordReader<K,V> extends AvroRecordReader<Pair<K,V>> {
 
   public SequenceFileRecordReader(JobConf job, FileSplit split)
     throws IOException {
-    super(new SequenceFileReader<K,V>(split.getPath().toUri(), job),
+    super(new SequenceFileReader<>(split.getPath().toUri(), job),
           split);
   }
 

http://git-wip-us.apache.org/repos/asf/avro/blob/8bc49510/lang/java/mapred/src/main/java/org/apache/avro/mapred/tether/TetherInputFormat.java
----------------------------------------------------------------------
diff --git a/lang/java/mapred/src/main/java/org/apache/avro/mapred/tether/TetherInputFormat.java b/lang/java/mapred/src/main/java/org/apache/avro/mapred/tether/TetherInputFormat.java
index e680324..93685c7 100644
--- a/lang/java/mapred/src/main/java/org/apache/avro/mapred/tether/TetherInputFormat.java
+++ b/lang/java/mapred/src/main/java/org/apache/avro/mapred/tether/TetherInputFormat.java
@@ -48,7 +48,7 @@ class TetherInputFormat
   protected FileStatus[] listStatus(JobConf job) throws IOException {
     if (job.getBoolean(AvroInputFormat.IGNORE_FILES_WITHOUT_EXTENSION_KEY,
         AvroInputFormat.IGNORE_INPUTS_WITHOUT_EXTENSION_DEFAULT)) {
-      List<FileStatus> result = new ArrayList<FileStatus>();
+      List<FileStatus> result = new ArrayList<>();
       for (FileStatus file : super.listStatus(job))
         if (file.getPath().getName().endsWith(AvroOutputFormat.EXT))
           result.add(file);

http://git-wip-us.apache.org/repos/asf/avro/blob/8bc49510/lang/java/mapred/src/main/java/org/apache/avro/mapred/tether/TetherJob.java
----------------------------------------------------------------------
diff --git a/lang/java/mapred/src/main/java/org/apache/avro/mapred/tether/TetherJob.java b/lang/java/mapred/src/main/java/org/apache/avro/mapred/tether/TetherJob.java
index 1c16618..da33a01 100644
--- a/lang/java/mapred/src/main/java/org/apache/avro/mapred/tether/TetherJob.java
+++ b/lang/java/mapred/src/main/java/org/apache/avro/mapred/tether/TetherJob.java
@@ -54,7 +54,7 @@ public class TetherJob extends Configured {
 
   /** Set the URI for the application's executable. Normally this in HDFS. */
   public static void setExecutable(JobConf job, File executable) {
-    setExecutable(job,executable, new ArrayList<String>(),false);
+    setExecutable(job,executable, new ArrayList<>(),false);
   }
 
   /**

http://git-wip-us.apache.org/repos/asf/avro/blob/8bc49510/lang/java/mapred/src/main/java/org/apache/avro/mapred/tether/TetherPartitioner.java
----------------------------------------------------------------------
diff --git a/lang/java/mapred/src/main/java/org/apache/avro/mapred/tether/TetherPartitioner.java b/lang/java/mapred/src/main/java/org/apache/avro/mapred/tether/TetherPartitioner.java
index eae1722..a04181c 100644
--- a/lang/java/mapred/src/main/java/org/apache/avro/mapred/tether/TetherPartitioner.java
+++ b/lang/java/mapred/src/main/java/org/apache/avro/mapred/tether/TetherPartitioner.java
@@ -30,7 +30,7 @@ import org.apache.avro.mapred.AvroJob;
 
 class TetherPartitioner implements Partitioner<TetherData, NullWritable> {
 
-  private static final ThreadLocal<Integer> CACHE = new ThreadLocal<Integer>();
+  private static final ThreadLocal<Integer> CACHE = new ThreadLocal<>();
 
   private Schema schema;
 

http://git-wip-us.apache.org/repos/asf/avro/blob/8bc49510/lang/java/mapred/src/main/java/org/apache/avro/mapred/tether/TetherRecordReader.java
----------------------------------------------------------------------
diff --git a/lang/java/mapred/src/main/java/org/apache/avro/mapred/tether/TetherRecordReader.java b/lang/java/mapred/src/main/java/org/apache/avro/mapred/tether/TetherRecordReader.java
index 2b8240c..793ae03 100644
--- a/lang/java/mapred/src/main/java/org/apache/avro/mapred/tether/TetherRecordReader.java
+++ b/lang/java/mapred/src/main/java/org/apache/avro/mapred/tether/TetherRecordReader.java
@@ -43,7 +43,7 @@ class TetherRecordReader
     throws IOException {
     this.in = new FsInput(split.getPath(), job);
     this.reader =
-      new DataFileReader<Object>(in, new GenericDatumReader<Object>());
+      new DataFileReader<>(in, new GenericDatumReader<>());
 
     reader.sync(split.getStart());                    // sync to start
     this.start = in.tell();

http://git-wip-us.apache.org/repos/asf/avro/blob/8bc49510/lang/java/mapred/src/main/java/org/apache/avro/mapred/tether/TetheredProcess.java
----------------------------------------------------------------------
diff --git a/lang/java/mapred/src/main/java/org/apache/avro/mapred/tether/TetheredProcess.java b/lang/java/mapred/src/main/java/org/apache/avro/mapred/tether/TetheredProcess.java
index e9be9e5..90ba881 100644
--- a/lang/java/mapred/src/main/java/org/apache/avro/mapred/tether/TetheredProcess.java
+++ b/lang/java/mapred/src/main/java/org/apache/avro/mapred/tether/TetheredProcess.java
@@ -153,7 +153,7 @@ class TetheredProcess  {
   private Process startSubprocess(JobConf job)
     throws IOException, InterruptedException {
     // get the executable command
-    List<String> command = new ArrayList<String>();
+    List<String> command = new ArrayList<>();
 
     String executable="";
     if (job.getBoolean(TetherJob.TETHER_EXEC_CACHED,false)){
@@ -205,7 +205,7 @@ class TetheredProcess  {
     stderr.getParentFile().mkdirs();
 
     // add output server's port to env
-    Map<String, String> env = new HashMap<String,String>();
+    Map<String, String> env = new HashMap<>();
     env.put("AVRO_TETHER_OUTPUT_PORT",
             Integer.toString(outputServer.getPort()));
 

http://git-wip-us.apache.org/repos/asf/avro/blob/8bc49510/lang/java/mapred/src/main/java/org/apache/avro/mapreduce/AvroKeyInputFormat.java
----------------------------------------------------------------------
diff --git a/lang/java/mapred/src/main/java/org/apache/avro/mapreduce/AvroKeyInputFormat.java b/lang/java/mapred/src/main/java/org/apache/avro/mapreduce/AvroKeyInputFormat.java
index f95b144..d517c62 100644
--- a/lang/java/mapred/src/main/java/org/apache/avro/mapreduce/AvroKeyInputFormat.java
+++ b/lang/java/mapred/src/main/java/org/apache/avro/mapreduce/AvroKeyInputFormat.java
@@ -49,6 +49,6 @@ public class AvroKeyInputFormat<T> extends FileInputFormat<AvroKey<T>, NullWrita
       LOG.warn("Reader schema was not set. Use AvroJob.setInputKeySchema() if desired.");
       LOG.info("Using a reader schema equal to the writer schema.");
     }
-    return new AvroKeyRecordReader<T>(readerSchema);
+    return new AvroKeyRecordReader<>(readerSchema);
   }
 }

http://git-wip-us.apache.org/repos/asf/avro/blob/8bc49510/lang/java/mapred/src/main/java/org/apache/avro/mapreduce/AvroKeyOutputFormat.java
----------------------------------------------------------------------
diff --git a/lang/java/mapred/src/main/java/org/apache/avro/mapreduce/AvroKeyOutputFormat.java b/lang/java/mapred/src/main/java/org/apache/avro/mapreduce/AvroKeyOutputFormat.java
index 125833c..6a92ec0 100644
--- a/lang/java/mapred/src/main/java/org/apache/avro/mapreduce/AvroKeyOutputFormat.java
+++ b/lang/java/mapred/src/main/java/org/apache/avro/mapreduce/AvroKeyOutputFormat.java
@@ -76,7 +76,7 @@ public class AvroKeyOutputFormat<T> extends AvroOutputFormatBase<AvroKey<T>, Nul
     protected RecordWriter<AvroKey<T>, NullWritable> create(
         Schema writerSchema, GenericData dataModel, CodecFactory compressionCodec,
         OutputStream outputStream, int syncInterval) throws IOException {
-      return new AvroKeyRecordWriter<T>(writerSchema, dataModel, compressionCodec, outputStream, syncInterval);
+      return new AvroKeyRecordWriter<>(writerSchema, dataModel, compressionCodec, outputStream, syncInterval);
     }
   }
 

http://git-wip-us.apache.org/repos/asf/avro/blob/8bc49510/lang/java/mapred/src/main/java/org/apache/avro/mapreduce/AvroKeyRecordReader.java
----------------------------------------------------------------------
diff --git a/lang/java/mapred/src/main/java/org/apache/avro/mapreduce/AvroKeyRecordReader.java b/lang/java/mapred/src/main/java/org/apache/avro/mapreduce/AvroKeyRecordReader.java
index 4b87582..9102f3d 100644
--- a/lang/java/mapred/src/main/java/org/apache/avro/mapreduce/AvroKeyRecordReader.java
+++ b/lang/java/mapred/src/main/java/org/apache/avro/mapreduce/AvroKeyRecordReader.java
@@ -44,7 +44,7 @@ public class AvroKeyRecordReader<T> extends AvroRecordReaderBase<AvroKey<T>, Nul
    */
   public AvroKeyRecordReader(Schema readerSchema) {
     super(readerSchema);
-    mCurrentRecord = new AvroKey<T>(null);
+    mCurrentRecord = new AvroKey<>(null);
   }
 
   /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/avro/blob/8bc49510/lang/java/mapred/src/main/java/org/apache/avro/mapreduce/AvroKeyValueInputFormat.java
----------------------------------------------------------------------
diff --git a/lang/java/mapred/src/main/java/org/apache/avro/mapreduce/AvroKeyValueInputFormat.java b/lang/java/mapred/src/main/java/org/apache/avro/mapreduce/AvroKeyValueInputFormat.java
index f2d73c3..1cb0057 100644
--- a/lang/java/mapred/src/main/java/org/apache/avro/mapreduce/AvroKeyValueInputFormat.java
+++ b/lang/java/mapred/src/main/java/org/apache/avro/mapreduce/AvroKeyValueInputFormat.java
@@ -57,6 +57,6 @@ public class AvroKeyValueInputFormat<K, V> extends FileInputFormat<AvroKey<K>, A
       LOG.warn("Value reader schema was not set. Use AvroJob.setInputValueSchema() if desired.");
       LOG.info("Using a value reader schema equal to the writer schema.");
     }
-    return new AvroKeyValueRecordReader<K, V>(keyReaderSchema, valueReaderSchema);
+    return new AvroKeyValueRecordReader<>(keyReaderSchema, valueReaderSchema);
   }
 }

http://git-wip-us.apache.org/repos/asf/avro/blob/8bc49510/lang/java/mapred/src/main/java/org/apache/avro/mapreduce/AvroKeyValueOutputFormat.java
----------------------------------------------------------------------
diff --git a/lang/java/mapred/src/main/java/org/apache/avro/mapreduce/AvroKeyValueOutputFormat.java b/lang/java/mapred/src/main/java/org/apache/avro/mapreduce/AvroKeyValueOutputFormat.java
index 7fd5d38..58385c5 100644
--- a/lang/java/mapred/src/main/java/org/apache/avro/mapreduce/AvroKeyValueOutputFormat.java
+++ b/lang/java/mapred/src/main/java/org/apache/avro/mapreduce/AvroKeyValueOutputFormat.java
@@ -62,7 +62,7 @@ public class AvroKeyValueOutputFormat<K, V> extends AvroOutputFormatBase<K, V> {
 
     OutputStream out = getAvroFileOutputStream(context);
     try {
-      return new AvroKeyValueRecordWriter<K, V>(keyConverter, valueConverter,
+      return new AvroKeyValueRecordWriter<>(keyConverter, valueConverter,
               dataModel, getCompressionCodec(context), out,
               getSyncInterval(context));
     } catch (IOException e) {

http://git-wip-us.apache.org/repos/asf/avro/blob/8bc49510/lang/java/mapred/src/main/java/org/apache/avro/mapreduce/AvroKeyValueRecordReader.java
----------------------------------------------------------------------
diff --git a/lang/java/mapred/src/main/java/org/apache/avro/mapreduce/AvroKeyValueRecordReader.java b/lang/java/mapred/src/main/java/org/apache/avro/mapreduce/AvroKeyValueRecordReader.java
index 64d427c..2b76b78 100644
--- a/lang/java/mapred/src/main/java/org/apache/avro/mapreduce/AvroKeyValueRecordReader.java
+++ b/lang/java/mapred/src/main/java/org/apache/avro/mapreduce/AvroKeyValueRecordReader.java
@@ -52,8 +52,8 @@ public class AvroKeyValueRecordReader<K, V>
    */
   public AvroKeyValueRecordReader(Schema keyReaderSchema, Schema valueReaderSchema) {
     super(AvroKeyValue.getSchema(keyReaderSchema, valueReaderSchema));
-    mCurrentKey = new AvroKey<K>(null);
-    mCurrentValue = new AvroValue<V>(null);
+    mCurrentKey = new AvroKey<>(null);
+    mCurrentValue = new AvroValue<>(null);
   }
 
   /** {@inheritDoc} */
@@ -61,7 +61,7 @@ public class AvroKeyValueRecordReader<K, V>
   public boolean nextKeyValue() throws IOException, InterruptedException {
     boolean hasNext = super.nextKeyValue();
     if (hasNext) {
-      AvroKeyValue<K, V> avroKeyValue = new AvroKeyValue<K, V>(getCurrentRecord());
+      AvroKeyValue<K, V> avroKeyValue = new AvroKeyValue<>(getCurrentRecord());
       mCurrentKey.datum(avroKeyValue.getKey());
       mCurrentValue.datum(avroKeyValue.getValue());
     } else {

http://git-wip-us.apache.org/repos/asf/avro/blob/8bc49510/lang/java/mapred/src/main/java/org/apache/avro/mapreduce/AvroKeyValueRecordWriter.java
----------------------------------------------------------------------
diff --git a/lang/java/mapred/src/main/java/org/apache/avro/mapreduce/AvroKeyValueRecordWriter.java b/lang/java/mapred/src/main/java/org/apache/avro/mapreduce/AvroKeyValueRecordWriter.java
index ee68c48..1376ff6 100644
--- a/lang/java/mapred/src/main/java/org/apache/avro/mapreduce/AvroKeyValueRecordWriter.java
+++ b/lang/java/mapred/src/main/java/org/apache/avro/mapreduce/AvroKeyValueRecordWriter.java
@@ -90,7 +90,7 @@ public class AvroKeyValueRecordWriter<K, V> extends RecordWriter<K, V> implement
     mValueConverter = valueConverter;
 
     // Create a reusable output record.
-    mOutputRecord = new AvroKeyValue<Object, Object>(new GenericData.Record(mKeyValuePairSchema));
+    mOutputRecord = new AvroKeyValue<>(new GenericData.Record(mKeyValuePairSchema));
   }
 
   /**

http://git-wip-us.apache.org/repos/asf/avro/blob/8bc49510/lang/java/mapred/src/main/java/org/apache/avro/mapreduce/AvroMultipleOutputs.java
----------------------------------------------------------------------
diff --git a/lang/java/mapred/src/main/java/org/apache/avro/mapreduce/AvroMultipleOutputs.java b/lang/java/mapred/src/main/java/org/apache/avro/mapreduce/AvroMultipleOutputs.java
index 3f8d7e0..8d4bc7c 100644
--- a/lang/java/mapred/src/main/java/org/apache/avro/mapreduce/AvroMultipleOutputs.java
+++ b/lang/java/mapred/src/main/java/org/apache/avro/mapreduce/AvroMultipleOutputs.java
@@ -141,7 +141,7 @@ public class AvroMultipleOutputs{
   /**
    * Cache for the taskContexts
    */
-  private Map<String, TaskAttemptContext> taskContexts = new HashMap<String, TaskAttemptContext>();
+  private Map<String, TaskAttemptContext> taskContexts = new HashMap<>();
 
   /**
    * Checks if a named output name is valid token.
@@ -204,7 +204,7 @@ public class AvroMultipleOutputs{
 
   // Returns list of channel names.
   private static List<String> getNamedOutputsList(JobContext job) {
-    List<String> names = new ArrayList<String>();
+    List<String> names = new ArrayList<>();
     StringTokenizer st = new StringTokenizer(
       job.getConfiguration().get(MULTIPLE_OUTPUTS, ""), " ");
     while (st.hasMoreTokens()) {
@@ -340,8 +340,8 @@ public class AvroMultipleOutputs{
       TaskInputOutputContext<?, ?, ?, ?> context) {
     this.context = context;
     namedOutputs = Collections.unmodifiableSet(
-      new HashSet<String>(AvroMultipleOutputs.getNamedOutputsList(context)));
-    recordWriters = new HashMap<String, RecordWriter<?, ?>>();
+      new HashSet<>(AvroMultipleOutputs.getNamedOutputsList(context)));
+    recordWriters = new HashMap<>();
     countersEnabled = getCountersEnabled(context);
   }
 

http://git-wip-us.apache.org/repos/asf/avro/blob/8bc49510/lang/java/mapred/src/main/java/org/apache/avro/mapreduce/AvroRecordReaderBase.java
----------------------------------------------------------------------
diff --git a/lang/java/mapred/src/main/java/org/apache/avro/mapreduce/AvroRecordReaderBase.java b/lang/java/mapred/src/main/java/org/apache/avro/mapreduce/AvroRecordReaderBase.java
index 82d0a8a..3b45991 100644
--- a/lang/java/mapred/src/main/java/org/apache/avro/mapreduce/AvroRecordReaderBase.java
+++ b/lang/java/mapred/src/main/java/org/apache/avro/mapreduce/AvroRecordReaderBase.java
@@ -180,6 +180,6 @@ public abstract class AvroRecordReaderBase<K, V, T> extends RecordReader<K, V> {
    */
   protected DataFileReader<T> createAvroFileReader(
       SeekableInput input, DatumReader<T> datumReader) throws IOException {
-    return new DataFileReader<T>(input, datumReader);
+    return new DataFileReader<>(input, datumReader);
   }
 }


Mime
View raw message