knox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m...@apache.org
Subject [1/2] knox git commit: KNOX-937 - Remove redundant type information from Collections (Colm O hEigeartaigh via Sandeep More)
Date Fri, 19 May 2017 14:01:18 GMT
Repository: knox
Updated Branches:
  refs/heads/master efc361ddc -> 551505640


http://git-wip-us.apache.org/repos/asf/knox/blob/55150564/gateway-server/src/test/java/org/apache/hadoop/gateway/services/topology/DefaultTopologyServiceTest.java
----------------------------------------------------------------------
diff --git a/gateway-server/src/test/java/org/apache/hadoop/gateway/services/topology/DefaultTopologyServiceTest.java b/gateway-server/src/test/java/org/apache/hadoop/gateway/services/topology/DefaultTopologyServiceTest.java
index a8c84ad..55cd5cc 100644
--- a/gateway-server/src/test/java/org/apache/hadoop/gateway/services/topology/DefaultTopologyServiceTest.java
+++ b/gateway-server/src/test/java/org/apache/hadoop/gateway/services/topology/DefaultTopologyServiceTest.java
@@ -86,7 +86,7 @@ public class DefaultTopologyServiceTest {
       FileAlterationMonitor monitor = new FileAlterationMonitor(Long.MAX_VALUE);
 
       TopologyService provider = new DefaultTopologyService();
-      Map<String, String> c = new HashMap<String, String>();
+      Map<String, String> c = new HashMap<>();
 
       GatewayConfig config = EasyMock.createNiceMock(GatewayConfig.class);
       EasyMock.expect(config.getGatewayTopologyDir()).andReturn(dir.toString()).anyTimes();
@@ -114,7 +114,7 @@ public class DefaultTopologyServiceTest {
       provider.reloadTopologies();
       topologies = provider.getTopologies();
       assertThat(topologies.size(), is(2));
-      Set<String> names = new HashSet<String>(Arrays.asList("one", "two"));
+      Set<String> names = new HashSet<>(Arrays.asList("one", "two"));
       Iterator<Topology> iterator = topologies.iterator();
       topology = iterator.next();
       assertThat(names, hasItem(topology.getName()));
@@ -135,7 +135,7 @@ public class DefaultTopologyServiceTest {
       provider.reloadTopologies();
       topologies = provider.getTopologies();
       assertThat(topologies.size(), is(2));
-      names = new HashSet<String>(Arrays.asList("one", "two"));
+      names = new HashSet<>(Arrays.asList("one", "two"));
       iterator = topologies.iterator();
       topology = iterator.next();
       assertThat(names, hasItem(topology.getName()));

http://git-wip-us.apache.org/repos/asf/knox/blob/55150564/gateway-server/src/test/java/org/apache/hadoop/gateway/websockets/BadUrlTest.java
----------------------------------------------------------------------
diff --git a/gateway-server/src/test/java/org/apache/hadoop/gateway/websockets/BadUrlTest.java b/gateway-server/src/test/java/org/apache/hadoop/gateway/websockets/BadUrlTest.java
index 135b385..559b2a1 100644
--- a/gateway-server/src/test/java/org/apache/hadoop/gateway/websockets/BadUrlTest.java
+++ b/gateway-server/src/test/java/org/apache/hadoop/gateway/websockets/BadUrlTest.java
@@ -197,7 +197,7 @@ public class BadUrlTest {
 
     final TestTopologyListener topoListener = new TestTopologyListener();
 
-    final Map<String, String> options = new HashMap<String, String>();
+    final Map<String, String> options = new HashMap<>();
     options.put("persist-master", "false");
     options.put("master", "password");
 

http://git-wip-us.apache.org/repos/asf/knox/blob/55150564/gateway-server/src/test/java/org/apache/hadoop/gateway/websockets/WebsocketEchoTest.java
----------------------------------------------------------------------
diff --git a/gateway-server/src/test/java/org/apache/hadoop/gateway/websockets/WebsocketEchoTest.java b/gateway-server/src/test/java/org/apache/hadoop/gateway/websockets/WebsocketEchoTest.java
index d6d60a4..5d1a117 100644
--- a/gateway-server/src/test/java/org/apache/hadoop/gateway/websockets/WebsocketEchoTest.java
+++ b/gateway-server/src/test/java/org/apache/hadoop/gateway/websockets/WebsocketEchoTest.java
@@ -262,7 +262,7 @@ public class WebsocketEchoTest {
 
     final TestTopologyListener topoListener = new TestTopologyListener();
 
-    final Map<String, String> options = new HashMap<String, String>();
+    final Map<String, String> options = new HashMap<>();
     options.put("persist-master", "false");
     options.put("master", "password");
 

http://git-wip-us.apache.org/repos/asf/knox/blob/55150564/gateway-server/src/test/java/org/apache/hadoop/gateway/websockets/WebsocketMultipleConnectionTest.java
----------------------------------------------------------------------
diff --git a/gateway-server/src/test/java/org/apache/hadoop/gateway/websockets/WebsocketMultipleConnectionTest.java b/gateway-server/src/test/java/org/apache/hadoop/gateway/websockets/WebsocketMultipleConnectionTest.java
index 6ca2a8b..676c98c 100644
--- a/gateway-server/src/test/java/org/apache/hadoop/gateway/websockets/WebsocketMultipleConnectionTest.java
+++ b/gateway-server/src/test/java/org/apache/hadoop/gateway/websockets/WebsocketMultipleConnectionTest.java
@@ -275,7 +275,7 @@ public class WebsocketMultipleConnectionTest {
 
     final TestTopologyListener topoListener = new TestTopologyListener();
 
-    final Map<String, String> options = new HashMap<String, String>();
+    final Map<String, String> options = new HashMap<>();
     options.put("persist-master", "false");
     options.put("master", "password");
 

http://git-wip-us.apache.org/repos/asf/knox/blob/55150564/gateway-service-admin/src/main/java/org/apache/hadoop/gateway/service/admin/TopologyCollectionMarshaller.java
----------------------------------------------------------------------
diff --git a/gateway-service-admin/src/main/java/org/apache/hadoop/gateway/service/admin/TopologyCollectionMarshaller.java b/gateway-service-admin/src/main/java/org/apache/hadoop/gateway/service/admin/TopologyCollectionMarshaller.java
index 5ebdef6..41c706b 100644
--- a/gateway-service-admin/src/main/java/org/apache/hadoop/gateway/service/admin/TopologyCollectionMarshaller.java
+++ b/gateway-service-admin/src/main/java/org/apache/hadoop/gateway/service/admin/TopologyCollectionMarshaller.java
@@ -56,7 +56,7 @@ public class TopologyCollectionMarshaller implements MessageBodyWriter<Topologie
   @Override
   public void writeTo(TopologiesResource.SimpleTopologyWrapper instance, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream) throws IOException, WebApplicationException {
     try {
-      Map<String, Object> properties = new HashMap<String, Object>(1);
+      Map<String, Object> properties = new HashMap<>(1);
       properties.put( JAXBContextProperties.MEDIA_TYPE, mediaType.toString());
       JAXBContext context = JAXBContext.newInstance(new Class[]{TopologiesResource.SimpleTopologyWrapper.class}, properties);
       Marshaller m = context.createMarshaller();

http://git-wip-us.apache.org/repos/asf/knox/blob/55150564/gateway-service-admin/src/main/java/org/apache/hadoop/gateway/service/admin/TopologyMarshaller.java
----------------------------------------------------------------------
diff --git a/gateway-service-admin/src/main/java/org/apache/hadoop/gateway/service/admin/TopologyMarshaller.java b/gateway-service-admin/src/main/java/org/apache/hadoop/gateway/service/admin/TopologyMarshaller.java
index eac4860..ddc6a7d 100644
--- a/gateway-service-admin/src/main/java/org/apache/hadoop/gateway/service/admin/TopologyMarshaller.java
+++ b/gateway-service-admin/src/main/java/org/apache/hadoop/gateway/service/admin/TopologyMarshaller.java
@@ -59,7 +59,7 @@ public class TopologyMarshaller implements MessageBodyWriter<Topology>, MessageB
   @Override
   public void writeTo(Topology instance, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream) throws IOException, WebApplicationException {
     try {
-      Map<String, Object> properties = new HashMap<String, Object>(1);
+      Map<String, Object> properties = new HashMap<>(1);
       properties.put( JAXBContextProperties.MEDIA_TYPE, mediaType.toString());
       JAXBContext context = JAXBContext.newInstance(new Class[]{Topology.class}, properties);
       Marshaller m = context.createMarshaller();

http://git-wip-us.apache.org/repos/asf/knox/blob/55150564/gateway-service-admin/src/main/java/org/apache/hadoop/gateway/service/admin/VersionMarshaller.java
----------------------------------------------------------------------
diff --git a/gateway-service-admin/src/main/java/org/apache/hadoop/gateway/service/admin/VersionMarshaller.java b/gateway-service-admin/src/main/java/org/apache/hadoop/gateway/service/admin/VersionMarshaller.java
index a33cb3a..90331b6 100644
--- a/gateway-service-admin/src/main/java/org/apache/hadoop/gateway/service/admin/VersionMarshaller.java
+++ b/gateway-service-admin/src/main/java/org/apache/hadoop/gateway/service/admin/VersionMarshaller.java
@@ -58,7 +58,7 @@ public class VersionMarshaller implements MessageBodyWriter<VersionResource.Serv
   @Override
   public void writeTo(VersionResource.ServerVersion instance, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream) throws IOException, WebApplicationException {
     try {
-      Map<String, Object> properties = new HashMap<String, Object>(1);
+      Map<String, Object> properties = new HashMap<>(1);
       properties.put( JAXBContextProperties.MEDIA_TYPE, mediaType.toString());
       JAXBContext context = JAXBContext.newInstance(new Class[]{VersionResource.ServerVersion.class}, properties);
       Marshaller m = context.createMarshaller();

http://git-wip-us.apache.org/repos/asf/knox/blob/55150564/gateway-service-admin/src/test/java/org/apache/hadoop/gateway/service/admin/TopologyMarshallerTest.java
----------------------------------------------------------------------
diff --git a/gateway-service-admin/src/test/java/org/apache/hadoop/gateway/service/admin/TopologyMarshallerTest.java b/gateway-service-admin/src/test/java/org/apache/hadoop/gateway/service/admin/TopologyMarshallerTest.java
index ba62cf2..2944e9a 100644
--- a/gateway-service-admin/src/test/java/org/apache/hadoop/gateway/service/admin/TopologyMarshallerTest.java
+++ b/gateway-service-admin/src/test/java/org/apache/hadoop/gateway/service/admin/TopologyMarshallerTest.java
@@ -45,7 +45,7 @@ public class TopologyMarshallerTest {
     StringWriter writer = new StringWriter();
     String xml;
 
-    Map<String,Object> properties = new HashMap<String,Object>(2);
+    Map<String,Object> properties = new HashMap<>(2);
     properties.put( "eclipselink-oxm-xml", "org/apache/hadoop/gateway/topology/topology_binding-xml.xml" );
     properties.put( "eclipselink.media-type", "application/xml" );
     JAXBContext jaxbContext = JAXBContext.newInstance( Topology.class.getPackage().getName(), Topology.class.getClassLoader() , properties );

http://git-wip-us.apache.org/repos/asf/knox/blob/55150564/gateway-service-knoxtoken/src/main/java/org/apache/hadoop/gateway/service/knoxtoken/TokenResource.java
----------------------------------------------------------------------
diff --git a/gateway-service-knoxtoken/src/main/java/org/apache/hadoop/gateway/service/knoxtoken/TokenResource.java b/gateway-service-knoxtoken/src/main/java/org/apache/hadoop/gateway/service/knoxtoken/TokenResource.java
index 3641400..4fda69f 100644
--- a/gateway-service-knoxtoken/src/main/java/org/apache/hadoop/gateway/service/knoxtoken/TokenResource.java
+++ b/gateway-service-knoxtoken/src/main/java/org/apache/hadoop/gateway/service/knoxtoken/TokenResource.java
@@ -90,7 +90,7 @@ public class TokenResource {
 
     String clientData = context.getInitParameter(TOKEN_CLIENT_DATA);
     if (clientData != null) {
-      tokenClientDataMap = new HashMap<String,Object>();
+      tokenClientDataMap = new HashMap<>();
       String[] tokenClientData = clientData.split(",");
       addClientDataToMap(tokenClientData, tokenClientDataMap);
     }
@@ -131,7 +131,7 @@ public class TokenResource {
       if (token != null) {
         String accessToken = token.toString();
   
-        HashMap<String, Object> map = new HashMap<String, Object>();
+        HashMap<String, Object> map = new HashMap<>();
         map.put(ACCESS_TOKEN, accessToken);
         map.put(TOKEN_TYPE, BEARER);
         map.put(EXPIRES_IN, expires);

http://git-wip-us.apache.org/repos/asf/knox/blob/55150564/gateway-service-knoxtoken/src/test/java/org/apache/hadoop/gateway/service/knoxtoken/TokenServiceResourceTest.java
----------------------------------------------------------------------
diff --git a/gateway-service-knoxtoken/src/test/java/org/apache/hadoop/gateway/service/knoxtoken/TokenServiceResourceTest.java b/gateway-service-knoxtoken/src/test/java/org/apache/hadoop/gateway/service/knoxtoken/TokenServiceResourceTest.java
index 2f81af0..2b4fea1 100644
--- a/gateway-service-knoxtoken/src/test/java/org/apache/hadoop/gateway/service/knoxtoken/TokenServiceResourceTest.java
+++ b/gateway-service-knoxtoken/src/test/java/org/apache/hadoop/gateway/service/knoxtoken/TokenServiceResourceTest.java
@@ -38,15 +38,15 @@ public class TokenServiceResourceTest {
   public void testClientData() throws Exception {
     TokenResource tr = new TokenResource();
 
-    Map<String,Object> clientDataMap = new HashMap<String,Object>();
+    Map<String,Object> clientDataMap = new HashMap<>();
     tr.addClientDataToMap("cookie.name=hadoop-jwt,test=value".split(","), clientDataMap);
     Assert.assertTrue(clientDataMap.size() == 2);
 
-    clientDataMap = new HashMap<String,Object>();
+    clientDataMap = new HashMap<>();
     tr.addClientDataToMap("cookie.name=hadoop-jwt".split(","), clientDataMap);
     Assert.assertTrue(clientDataMap.size() == 1);
 
-    clientDataMap = new HashMap<String,Object>();
+    clientDataMap = new HashMap<>();
     tr.addClientDataToMap("".split(","), clientDataMap);
     Assert.assertTrue(clientDataMap.size() == 0);
   }

http://git-wip-us.apache.org/repos/asf/knox/blob/55150564/gateway-service-test/src/main/java/org/apache/hadoop/gateway/service/test/ServiceTestWrapperMarshaller.java
----------------------------------------------------------------------
diff --git a/gateway-service-test/src/main/java/org/apache/hadoop/gateway/service/test/ServiceTestWrapperMarshaller.java b/gateway-service-test/src/main/java/org/apache/hadoop/gateway/service/test/ServiceTestWrapperMarshaller.java
index 95f053d..888a6ed 100644
--- a/gateway-service-test/src/main/java/org/apache/hadoop/gateway/service/test/ServiceTestWrapperMarshaller.java
+++ b/gateway-service-test/src/main/java/org/apache/hadoop/gateway/service/test/ServiceTestWrapperMarshaller.java
@@ -58,7 +58,7 @@ public class ServiceTestWrapperMarshaller implements MessageBodyWriter<ServiceTe
   @Override
   public void writeTo(ServiceTestResource.ServiceTestWrapper instance, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream) throws IOException, WebApplicationException {
     try {
-      Map<String, Object> properties = new HashMap<String, Object>(1);
+      Map<String, Object> properties = new HashMap<>(1);
       properties.put( JAXBContextProperties.MEDIA_TYPE, mediaType.toString());
       JAXBContext context = JAXBContext.newInstance(new Class[]{ServiceTestResource.ServiceTestWrapper.class}, properties);
       Marshaller m = context.createMarshaller();

http://git-wip-us.apache.org/repos/asf/knox/blob/55150564/gateway-shell/src/main/java/org/apache/hadoop/gateway/shell/Hadoop.java
----------------------------------------------------------------------
diff --git a/gateway-shell/src/main/java/org/apache/hadoop/gateway/shell/Hadoop.java b/gateway-shell/src/main/java/org/apache/hadoop/gateway/shell/Hadoop.java
index b830014..92ec67e 100644
--- a/gateway-shell/src/main/java/org/apache/hadoop/gateway/shell/Hadoop.java
+++ b/gateway-shell/src/main/java/org/apache/hadoop/gateway/shell/Hadoop.java
@@ -82,7 +82,7 @@ public class Hadoop implements Closeable {
   CloseableHttpClient client;
   BasicHttpContext context;
   ExecutorService executor;
-  Map<String, String> headers = new HashMap<String, String>();
+  Map<String, String> headers = new HashMap<>();
 
   public Map<String, String> getHeaders() {
     return headers;

http://git-wip-us.apache.org/repos/asf/knox/blob/55150564/gateway-shell/src/main/java/org/apache/hadoop/gateway/shell/KnoxSh.java
----------------------------------------------------------------------
diff --git a/gateway-shell/src/main/java/org/apache/hadoop/gateway/shell/KnoxSh.java b/gateway-shell/src/main/java/org/apache/hadoop/gateway/shell/KnoxSh.java
index 15ad535..21e0bc3 100644
--- a/gateway-shell/src/main/java/org/apache/hadoop/gateway/shell/KnoxSh.java
+++ b/gateway-shell/src/main/java/org/apache/hadoop/gateway/shell/KnoxSh.java
@@ -189,7 +189,7 @@ public class KnoxSh {
         File tokenfile = new File(System.getProperty("user.home"), ".knoxtokencache");
         try( FileOutputStream fos = new FileOutputStream(tokenfile) ) {
           fos.write(text.getBytes("UTF-8"));
-          Set<PosixFilePermission> perms = new HashSet<PosixFilePermission>();
+          Set<PosixFilePermission> perms = new HashSet<>();
           //add owners permission only
           perms.add(PosixFilePermission.OWNER_READ);
           perms.add(PosixFilePermission.OWNER_WRITE);

http://git-wip-us.apache.org/repos/asf/knox/blob/55150564/gateway-spi/src/main/java/org/apache/hadoop/gateway/security/principal/SimplePrincipalMapper.java
----------------------------------------------------------------------
diff --git a/gateway-spi/src/main/java/org/apache/hadoop/gateway/security/principal/SimplePrincipalMapper.java b/gateway-spi/src/main/java/org/apache/hadoop/gateway/security/principal/SimplePrincipalMapper.java
index 802166b..fac1c21 100644
--- a/gateway-spi/src/main/java/org/apache/hadoop/gateway/security/principal/SimplePrincipalMapper.java
+++ b/gateway-spi/src/main/java/org/apache/hadoop/gateway/security/principal/SimplePrincipalMapper.java
@@ -45,7 +45,7 @@ public class SimplePrincipalMapper implements PrincipalMapper {
     if (mappings == null) {
       return null;
     }
-    HashMap<String, String[]> table = new HashMap<String, String[]>();
+    HashMap<String, String[]> table = new HashMap<>();
     try {
       StringTokenizer t = new StringTokenizer(mappings, ";");
       if (t.hasMoreTokens()) {

http://git-wip-us.apache.org/repos/asf/knox/blob/55150564/gateway-spi/src/main/java/org/apache/hadoop/gateway/services/hostmap/FileBasedHostMapper.java
----------------------------------------------------------------------
diff --git a/gateway-spi/src/main/java/org/apache/hadoop/gateway/services/hostmap/FileBasedHostMapper.java b/gateway-spi/src/main/java/org/apache/hadoop/gateway/services/hostmap/FileBasedHostMapper.java
index cdfbddf..df58946 100644
--- a/gateway-spi/src/main/java/org/apache/hadoop/gateway/services/hostmap/FileBasedHostMapper.java
+++ b/gateway-spi/src/main/java/org/apache/hadoop/gateway/services/hostmap/FileBasedHostMapper.java
@@ -27,8 +27,8 @@ import java.util.Map;
 
 public class FileBasedHostMapper implements HostMapper {
 
-  private Map<String, String> inbound = new HashMap<String, String>();
-  private Map<String, String> outbound = new HashMap<String, String>();
+  private Map<String, String> inbound = new HashMap<>();
+  private Map<String, String> outbound = new HashMap<>();
 
   public FileBasedHostMapper( URL url ) throws IOException {
     if( url != null ) {

http://git-wip-us.apache.org/repos/asf/knox/blob/55150564/gateway-spi/src/main/java/org/apache/hadoop/gateway/topology/Topology.java
----------------------------------------------------------------------
diff --git a/gateway-spi/src/main/java/org/apache/hadoop/gateway/topology/Topology.java b/gateway-spi/src/main/java/org/apache/hadoop/gateway/topology/Topology.java
index 87f73df..7f37336 100644
--- a/gateway-spi/src/main/java/org/apache/hadoop/gateway/topology/Topology.java
+++ b/gateway-spi/src/main/java/org/apache/hadoop/gateway/topology/Topology.java
@@ -33,11 +33,11 @@ public class Topology {
   private String name;
   private long timestamp;
   public List<Provider> providerList = new ArrayList<Provider>();
-  private Map<String,Map<String,Provider>> providerMap = new HashMap<String,Map<String,Provider>>();
+  private Map<String,Map<String,Provider>> providerMap = new HashMap<>();
   public List<Service> services = new ArrayList<Service>();
   private MultiKeyMap serviceMap;
   private List<Application> applications = new ArrayList<Application>();
-  private Map<String,Application> applicationMap = new HashMap<String,Application>();
+  private Map<String,Application> applicationMap = new HashMap<>();
 
   public Topology() {
     serviceMap = MultiKeyMap.decorate(new HashedMap());
@@ -133,7 +133,7 @@ public class Topology {
     String role = provider.getRole();
     Map<String,Provider> nameMap = providerMap.get( role );
     if( nameMap == null ) {
-      nameMap = new HashMap<String,Provider>();
+      nameMap = new HashMap<>();
       providerMap.put( role, nameMap );
     }
     nameMap.put( provider.getName(), provider );

http://git-wip-us.apache.org/repos/asf/knox/blob/55150564/gateway-test-release-utils/src/main/java/org/apache/hadoop/gateway/GatewayTestDriver.java
----------------------------------------------------------------------
diff --git a/gateway-test-release-utils/src/main/java/org/apache/hadoop/gateway/GatewayTestDriver.java b/gateway-test-release-utils/src/main/java/org/apache/hadoop/gateway/GatewayTestDriver.java
index b8254fc..c6d085c 100644
--- a/gateway-test-release-utils/src/main/java/org/apache/hadoop/gateway/GatewayTestDriver.java
+++ b/gateway-test-release-utils/src/main/java/org/apache/hadoop/gateway/GatewayTestDriver.java
@@ -103,7 +103,7 @@ public class GatewayTestDriver {
     stream.close();
 
     DefaultGatewayServices srvcs = new DefaultGatewayServices();
-    Map<String,String> options = new HashMap<String,String>();
+    Map<String,String> options = new HashMap<>();
     options.put("persist-master", "false");
     options.put("master", "password");
     try {

http://git-wip-us.apache.org/repos/asf/knox/blob/55150564/gateway-test-utils/src/main/java/org/apache/hadoop/test/mock/MockRequestMatcher.java
----------------------------------------------------------------------
diff --git a/gateway-test-utils/src/main/java/org/apache/hadoop/test/mock/MockRequestMatcher.java b/gateway-test-utils/src/main/java/org/apache/hadoop/test/mock/MockRequestMatcher.java
index 3b2b20b..e107e6f 100644
--- a/gateway-test-utils/src/main/java/org/apache/hadoop/test/mock/MockRequestMatcher.java
+++ b/gateway-test-utils/src/main/java/org/apache/hadoop/test/mock/MockRequestMatcher.java
@@ -80,7 +80,7 @@ public class MockRequestMatcher {
 
   public MockRequestMatcher method( String... methods ) {
     if( this.methods == null ) {
-      this.methods = new HashSet<String>();
+      this.methods = new HashSet<>();
     }
     if( methods != null ) {
       for( String method: methods ) {
@@ -102,7 +102,7 @@ public class MockRequestMatcher {
 
   public MockRequestMatcher header( String name, String value ) {
     if( headers == null ) {
-      headers = new HashMap<String, Matcher>();
+      headers = new HashMap<>();
     }
     headers.put( name, Matchers.is(value) );
     return this;
@@ -110,7 +110,7 @@ public class MockRequestMatcher {
 
   public MockRequestMatcher header( String name, Matcher matcher ) {
     if( headers == null ) {
-      headers = new HashMap<String, Matcher>();
+      headers = new HashMap<>();
     }
     headers.put( name, matcher );
     return this;
@@ -118,7 +118,7 @@ public class MockRequestMatcher {
 
   public MockRequestMatcher cookie( Cookie cookie ) {
     if( cookies == null ) {
-      cookies = new HashSet<Cookie>();
+      cookies = new HashSet<>();
     }
     cookies.add( cookie );
     return this;
@@ -126,7 +126,7 @@ public class MockRequestMatcher {
 
   public MockRequestMatcher attribute( String name, Object value ) {
     if( this.attributes == null ) {
-      this.attributes = new HashMap<String,Object>();
+      this.attributes = new HashMap<>();
     }
     attributes.put( name, value );
     return this;
@@ -134,7 +134,7 @@ public class MockRequestMatcher {
 
   public MockRequestMatcher queryParam( String name, String value ) {
     if( this.queryParams == null ) {
-      this.queryParams = new HashMap<String, String>();
+      this.queryParams = new HashMap<>();
     }
     queryParams.put( name, value );
     return this;
@@ -145,7 +145,7 @@ public class MockRequestMatcher {
       throw new IllegalStateException( "Entity already specified." );
     }
     if( formParams == null ) {
-      formParams = new HashMap<String, String[]>();
+      formParams = new HashMap<>();
     }
     String[] currentValues = formParams.get( name );
     if( currentValues == null ) {

http://git-wip-us.apache.org/repos/asf/knox/blob/55150564/gateway-test-utils/src/main/java/org/apache/hadoop/test/mock/MockResponseProvider.java
----------------------------------------------------------------------
diff --git a/gateway-test-utils/src/main/java/org/apache/hadoop/test/mock/MockResponseProvider.java b/gateway-test-utils/src/main/java/org/apache/hadoop/test/mock/MockResponseProvider.java
index 21952e1..b1b1178 100644
--- a/gateway-test-utils/src/main/java/org/apache/hadoop/test/mock/MockResponseProvider.java
+++ b/gateway-test-utils/src/main/java/org/apache/hadoop/test/mock/MockResponseProvider.java
@@ -63,7 +63,7 @@ public class MockResponseProvider {
 
   public MockResponseProvider header( String name, String value ) {
     if( headers == null ) {
-      headers = new HashMap<String, String>();
+      headers = new HashMap<>();
     }
     headers.put( name, value );
     return this;
@@ -71,7 +71,7 @@ public class MockResponseProvider {
 
   public MockResponseProvider cookie( Cookie cookie ) {
     if( cookies == null ) {
-      cookies = new HashSet<Cookie>();
+      cookies = new HashSet<>();
     }
     cookies.add( cookie );
     return this;

http://git-wip-us.apache.org/repos/asf/knox/blob/55150564/gateway-test/src/test/java/org/apache/hadoop/gateway/AmbariServiceDefinitionTest.java
----------------------------------------------------------------------
diff --git a/gateway-test/src/test/java/org/apache/hadoop/gateway/AmbariServiceDefinitionTest.java b/gateway-test/src/test/java/org/apache/hadoop/gateway/AmbariServiceDefinitionTest.java
index 9441e2a..9c418ea 100644
--- a/gateway-test/src/test/java/org/apache/hadoop/gateway/AmbariServiceDefinitionTest.java
+++ b/gateway-test/src/test/java/org/apache/hadoop/gateway/AmbariServiceDefinitionTest.java
@@ -136,7 +136,7 @@ public class AmbariServiceDefinitionTest {
 
   public static void startGatewayServer() throws Exception {
     services = new DefaultGatewayServices();
-    Map<String,String> options = new HashMap<String,String>();
+    Map<String,String> options = new HashMap<>();
     options.put( "persist-master", "false" );
     options.put( "master", "password" );
     try {

http://git-wip-us.apache.org/repos/asf/knox/blob/55150564/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayAdminFuncTest.java
----------------------------------------------------------------------
diff --git a/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayAdminFuncTest.java b/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayAdminFuncTest.java
index 9762a81..5f0ad3a 100644
--- a/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayAdminFuncTest.java
+++ b/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayAdminFuncTest.java
@@ -112,7 +112,7 @@ public class GatewayAdminFuncTest {
     stream.close();
 
     DefaultGatewayServices srvcs = new DefaultGatewayServices();
-    Map<String,String> options = new HashMap<String,String>();
+    Map<String,String> options = new HashMap<>();
     options.put( "persist-master", "false" );
     options.put( "master", "password" );
     try {

http://git-wip-us.apache.org/repos/asf/knox/blob/55150564/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayAdminTopologyFuncTest.java
----------------------------------------------------------------------
diff --git a/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayAdminTopologyFuncTest.java b/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayAdminTopologyFuncTest.java
index 94b458e..a64b60d 100644
--- a/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayAdminTopologyFuncTest.java
+++ b/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayAdminTopologyFuncTest.java
@@ -134,7 +134,7 @@ public class GatewayAdminTopologyFuncTest {
     stream.close();
 
     DefaultGatewayServices srvcs = new DefaultGatewayServices();
-    Map<String,String> options = new HashMap<String,String>();
+    Map<String,String> options = new HashMap<>();
     options.put( "persist-master", "false" );
     options.put( "master", "password" );
 

http://git-wip-us.apache.org/repos/asf/knox/blob/55150564/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayAppFuncTest.java
----------------------------------------------------------------------
diff --git a/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayAppFuncTest.java b/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayAppFuncTest.java
index 4bd956d..282182e 100644
--- a/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayAppFuncTest.java
+++ b/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayAppFuncTest.java
@@ -151,7 +151,7 @@ public class GatewayAppFuncTest {
 
   public static void startGatewayServer() throws Exception {
     services = new DefaultGatewayServices();
-    Map<String,String> options = new HashMap<String,String>();
+    Map<String,String> options = new HashMap<>();
     options.put( "persist-master", "false" );
     options.put( "master", "password" );
     try {

http://git-wip-us.apache.org/repos/asf/knox/blob/55150564/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayBasicFuncTest.java
----------------------------------------------------------------------
diff --git a/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayBasicFuncTest.java b/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayBasicFuncTest.java
index dc6e80e..2108bea 100644
--- a/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayBasicFuncTest.java
+++ b/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayBasicFuncTest.java
@@ -2134,7 +2134,7 @@ public class GatewayBasicFuncTest {
     getYarnRmApps( ContentType.XML, null );
     getYarnRmApps( ContentType.JSON, null );
 
-    Map<String, String> params = new HashMap<String, String>();
+    Map<String, String> params = new HashMap<>();
     params.put( "states", "FINISHED" );
     params.put( "finalStatus", "SUCCEEDED" );
     params.put( "user", "test" );
@@ -2487,7 +2487,7 @@ public class GatewayBasicFuncTest {
     getYarnRmNodes( ContentType.JSON, null );
     getYarnRmNodes( ContentType.XML, null );
 
-    Map<String, String> params = new HashMap<String, String>();
+    Map<String, String> params = new HashMap<>();
     params.put( "state", "new,running" );
     params.put( "healthy", "true" );
 
@@ -2578,7 +2578,7 @@ public class GatewayBasicFuncTest {
     String path = "/v1/cluster/apps/application_1399541193872_0033/";
     String gatewayPath = driver.getUrl( "RESOURCEMANAGER" ) + path;
 
-    Map<String, Matcher<?>> matchers = new HashMap<String, Matcher<?>>();
+    Map<String, Matcher<?>> matchers = new HashMap<>();
 
     VelocityEngine velocity = new VelocityEngine();
     velocity.setProperty( RuntimeConstants.RUNTIME_LOG_LOGSYSTEM_CLASS, "org.apache.velocity.runtime.log.NullLogSystem" );

http://git-wip-us.apache.org/repos/asf/knox/blob/55150564/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayDeployFuncTest.java
----------------------------------------------------------------------
diff --git a/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayDeployFuncTest.java b/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayDeployFuncTest.java
index 1e8cf3a..56b749f 100644
--- a/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayDeployFuncTest.java
+++ b/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayDeployFuncTest.java
@@ -122,7 +122,7 @@ public class GatewayDeployFuncTest {
     deployDir.mkdirs();
 
     DefaultGatewayServices srvcs = new DefaultGatewayServices();
-    Map<String,String> options = new HashMap<String,String>();
+    Map<String,String> options = new HashMap<>();
     options.put( "persist-master", "false" );
     options.put( "master", "password" );
     try {

http://git-wip-us.apache.org/repos/asf/knox/blob/55150564/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayFuncTestDriver.java
----------------------------------------------------------------------
diff --git a/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayFuncTestDriver.java b/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayFuncTestDriver.java
index c06e602..13920d1 100644
--- a/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayFuncTestDriver.java
+++ b/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayFuncTestDriver.java
@@ -82,7 +82,7 @@ public class GatewayFuncTestDriver {
   private static Logger log = LoggerFactory.getLogger( GatewayFuncTestDriver.class );
 
   public Class<?> resourceBaseClass;
-  public Map<String,Service> services = new HashMap<String,Service>();
+  public Map<String,Service> services = new HashMap<>();
   public SimpleLdapDirectoryServer ldap;
   public TcpTransport ldapTransport;
   public boolean useGateway;
@@ -148,7 +148,7 @@ public class GatewayFuncTestDriver {
     stream.close();
 
     DefaultGatewayServices srvcs = new DefaultGatewayServices();
-    Map<String,String> options = new HashMap<String,String>();
+    Map<String,String> options = new HashMap<>();
     options.put("persist-master", "false");
     options.put("master", "password");
     try {

http://git-wip-us.apache.org/repos/asf/knox/blob/55150564/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayLdapDynamicGroupFuncTest.java
----------------------------------------------------------------------
diff --git a/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayLdapDynamicGroupFuncTest.java b/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayLdapDynamicGroupFuncTest.java
index a68bb14..fcf4458 100755
--- a/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayLdapDynamicGroupFuncTest.java
+++ b/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayLdapDynamicGroupFuncTest.java
@@ -128,7 +128,7 @@ public class GatewayLdapDynamicGroupFuncTest {
     deployDir.mkdirs();
 
     DefaultGatewayServices srvcs = new DefaultGatewayServices();
-    Map<String,String> options = new HashMap<String,String>();
+    Map<String,String> options = new HashMap<>();
     options.put( "persist-master", "false" );
     options.put( "master", "password" );
     try {

http://git-wip-us.apache.org/repos/asf/knox/blob/55150564/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayLdapGroupFuncTest.java
----------------------------------------------------------------------
diff --git a/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayLdapGroupFuncTest.java b/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayLdapGroupFuncTest.java
index c67c992..06a3dbb 100644
--- a/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayLdapGroupFuncTest.java
+++ b/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayLdapGroupFuncTest.java
@@ -128,7 +128,7 @@ public class GatewayLdapGroupFuncTest {
     deployDir.mkdirs();
 
     DefaultGatewayServices srvcs = new DefaultGatewayServices();
-    Map<String,String> options = new HashMap<String,String>();
+    Map<String,String> options = new HashMap<>();
     options.put( "persist-master", "true" );
     options.put( "master", "hadoop" );
 

http://git-wip-us.apache.org/repos/asf/knox/blob/55150564/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayLdapPosixGroupFuncTest.java
----------------------------------------------------------------------
diff --git a/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayLdapPosixGroupFuncTest.java b/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayLdapPosixGroupFuncTest.java
index 80c3207..586383d 100644
--- a/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayLdapPosixGroupFuncTest.java
+++ b/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayLdapPosixGroupFuncTest.java
@@ -128,7 +128,7 @@ public class GatewayLdapPosixGroupFuncTest {
     deployDir.mkdirs();
 
     DefaultGatewayServices srvcs = new DefaultGatewayServices();
-    Map<String,String> options = new HashMap<String,String>();
+    Map<String,String> options = new HashMap<>();
     options.put( "persist-master", "true" );
     options.put( "master", "hadoop" );
 

http://git-wip-us.apache.org/repos/asf/knox/blob/55150564/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayLocalServiceFuncTest.java
----------------------------------------------------------------------
diff --git a/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayLocalServiceFuncTest.java b/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayLocalServiceFuncTest.java
index a8fa17e..40b3bf0 100644
--- a/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayLocalServiceFuncTest.java
+++ b/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayLocalServiceFuncTest.java
@@ -118,7 +118,7 @@ public class GatewayLocalServiceFuncTest {
     stream.close();
 
     DefaultGatewayServices srvcs = new DefaultGatewayServices();
-    Map<String,String> options = new HashMap<String,String>();
+    Map<String,String> options = new HashMap<>();
     options.put( "persist-master", "false" );
     options.put( "master", "password" );
     try {

http://git-wip-us.apache.org/repos/asf/knox/blob/55150564/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayMultiFuncTest.java
----------------------------------------------------------------------
diff --git a/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayMultiFuncTest.java b/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayMultiFuncTest.java
index 97c266f..97b64eb 100644
--- a/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayMultiFuncTest.java
+++ b/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayMultiFuncTest.java
@@ -146,7 +146,7 @@ public class GatewayMultiFuncTest {
 
   public static void startGatewayServer() throws Exception {
     services = new DefaultGatewayServices();
-    Map<String,String> options = new HashMap<String,String>();
+    Map<String,String> options = new HashMap<>();
     options.put( "persist-master", "false" );
     options.put( "master", "password" );
     try {

http://git-wip-us.apache.org/repos/asf/knox/blob/55150564/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewaySampleFuncTest.java
----------------------------------------------------------------------
diff --git a/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewaySampleFuncTest.java b/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewaySampleFuncTest.java
index d59f194..0111265 100644
--- a/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewaySampleFuncTest.java
+++ b/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewaySampleFuncTest.java
@@ -115,7 +115,7 @@ public class GatewaySampleFuncTest {
     stream.close();
 
     DefaultGatewayServices srvcs = new DefaultGatewayServices();
-    Map<String,String> options = new HashMap<String,String>();
+    Map<String,String> options = new HashMap<>();
     options.put( "persist-master", "false" );
     options.put( "master", "password" );
     try {

http://git-wip-us.apache.org/repos/asf/knox/blob/55150564/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewaySslFuncTest.java
----------------------------------------------------------------------
diff --git a/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewaySslFuncTest.java b/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewaySslFuncTest.java
index 163b209..6dd18c2 100644
--- a/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewaySslFuncTest.java
+++ b/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewaySslFuncTest.java
@@ -175,7 +175,7 @@ public class GatewaySslFuncTest {
   public static void startGatewayServer() throws Exception {
     instantiateGatewayServices();
     services = new DefaultGatewayServices();
-    Map<String,String> options = new HashMap<String,String>();
+    Map<String,String> options = new HashMap<>();
     options.put( "persist-master", "false" );
     options.put( "master", "password" );
     try {

http://git-wip-us.apache.org/repos/asf/knox/blob/55150564/gateway-test/src/test/java/org/apache/hadoop/gateway/Knox242FuncTest.java
----------------------------------------------------------------------
diff --git a/gateway-test/src/test/java/org/apache/hadoop/gateway/Knox242FuncTest.java b/gateway-test/src/test/java/org/apache/hadoop/gateway/Knox242FuncTest.java
index a9baec1..a16f7c2 100755
--- a/gateway-test/src/test/java/org/apache/hadoop/gateway/Knox242FuncTest.java
+++ b/gateway-test/src/test/java/org/apache/hadoop/gateway/Knox242FuncTest.java
@@ -129,7 +129,7 @@ public class Knox242FuncTest {
     deployDir.mkdirs();
 
     DefaultGatewayServices srvcs = new DefaultGatewayServices();
-    Map<String,String> options = new HashMap<String,String>();
+    Map<String,String> options = new HashMap<>();
     options.put( "persist-master", "false" );
     options.put( "master", "password" );
     try {

http://git-wip-us.apache.org/repos/asf/knox/blob/55150564/gateway-test/src/test/java/org/apache/hadoop/gateway/KnoxCliLdapFuncTestNegative.java
----------------------------------------------------------------------
diff --git a/gateway-test/src/test/java/org/apache/hadoop/gateway/KnoxCliLdapFuncTestNegative.java b/gateway-test/src/test/java/org/apache/hadoop/gateway/KnoxCliLdapFuncTestNegative.java
index 65f0aaa..f51d93a 100644
--- a/gateway-test/src/test/java/org/apache/hadoop/gateway/KnoxCliLdapFuncTestNegative.java
+++ b/gateway-test/src/test/java/org/apache/hadoop/gateway/KnoxCliLdapFuncTestNegative.java
@@ -120,7 +120,7 @@ public class KnoxCliLdapFuncTestNegative {
     createTopology(topoDir, "bad-cluster.xml", false);
 
     DefaultGatewayServices srvcs = new DefaultGatewayServices();
-    Map<String,String> options = new HashMap<String,String>();
+    Map<String,String> options = new HashMap<>();
     options.put( "persist-master", "false" );
     options.put( "master", "password" );
     try {

http://git-wip-us.apache.org/repos/asf/knox/blob/55150564/gateway-test/src/test/java/org/apache/hadoop/gateway/KnoxCliLdapFuncTestPositive.java
----------------------------------------------------------------------
diff --git a/gateway-test/src/test/java/org/apache/hadoop/gateway/KnoxCliLdapFuncTestPositive.java b/gateway-test/src/test/java/org/apache/hadoop/gateway/KnoxCliLdapFuncTestPositive.java
index d6aba41..0758744 100644
--- a/gateway-test/src/test/java/org/apache/hadoop/gateway/KnoxCliLdapFuncTestPositive.java
+++ b/gateway-test/src/test/java/org/apache/hadoop/gateway/KnoxCliLdapFuncTestPositive.java
@@ -118,7 +118,7 @@ public class KnoxCliLdapFuncTestPositive {
     createTopology(topoDir, "bad-cluster.xml", false);
 
     DefaultGatewayServices srvcs = new DefaultGatewayServices();
-    Map<String,String> options = new HashMap<String,String>();
+    Map<String,String> options = new HashMap<>();
     options.put( "persist-master", "false" );
     options.put( "master", "password" );
     try {

http://git-wip-us.apache.org/repos/asf/knox/blob/55150564/gateway-test/src/test/java/org/apache/hadoop/gateway/KnoxCliSysBindTest.java
----------------------------------------------------------------------
diff --git a/gateway-test/src/test/java/org/apache/hadoop/gateway/KnoxCliSysBindTest.java b/gateway-test/src/test/java/org/apache/hadoop/gateway/KnoxCliSysBindTest.java
index cc5874d..6308c2c 100644
--- a/gateway-test/src/test/java/org/apache/hadoop/gateway/KnoxCliSysBindTest.java
+++ b/gateway-test/src/test/java/org/apache/hadoop/gateway/KnoxCliSysBindTest.java
@@ -120,7 +120,7 @@ public class KnoxCliSysBindTest {
 
 
     DefaultGatewayServices srvcs = new DefaultGatewayServices();
-    Map<String,String> options = new HashMap<String,String>();
+    Map<String,String> options = new HashMap<>();
     options.put( "persist-master", "false" );
     options.put( "master", "password" );
     try {

http://git-wip-us.apache.org/repos/asf/knox/blob/55150564/gateway-test/src/test/java/org/apache/hadoop/gateway/deploy/DeploymentFactoryFuncTest.java
----------------------------------------------------------------------
diff --git a/gateway-test/src/test/java/org/apache/hadoop/gateway/deploy/DeploymentFactoryFuncTest.java b/gateway-test/src/test/java/org/apache/hadoop/gateway/deploy/DeploymentFactoryFuncTest.java
index 798c84f..3d8a8df 100644
--- a/gateway-test/src/test/java/org/apache/hadoop/gateway/deploy/DeploymentFactoryFuncTest.java
+++ b/gateway-test/src/test/java/org/apache/hadoop/gateway/deploy/DeploymentFactoryFuncTest.java
@@ -92,7 +92,7 @@ public class DeploymentFactoryFuncTest {
 
     addStacksDir(config, targetDir);
     DefaultGatewayServices srvcs = new DefaultGatewayServices();
-    Map<String,String> options = new HashMap<String,String>();
+    Map<String,String> options = new HashMap<>();
     options.put("persist-master", "false");
     options.put("master", "password");
     try {
@@ -156,7 +156,7 @@ public class DeploymentFactoryFuncTest {
     addStacksDir(config, targetDir);
 
     DefaultGatewayServices srvcs = new DefaultGatewayServices();
-    Map<String,String> options = new HashMap<String,String>();
+    Map<String,String> options = new HashMap<>();
     options.put("persist-master", "false");
     options.put("master", "password");
     try {
@@ -215,7 +215,7 @@ public class DeploymentFactoryFuncTest {
     addStacksDir(config, targetDir);
 
     DefaultGatewayServices srvcs = new DefaultGatewayServices();
-    Map<String,String> options = new HashMap<String,String>();
+    Map<String,String> options = new HashMap<>();
     options.put("persist-master", "false");
     options.put("master", "password");
     try {
@@ -336,7 +336,7 @@ public class DeploymentFactoryFuncTest {
       deployDir.mkdirs();
 
       DefaultGatewayServices srvcs = new DefaultGatewayServices();
-      Map<String, String> options = new HashMap<String, String>();
+      Map<String, String> options = new HashMap<>();
       options.put("persist-master", "false");
       options.put("master", "password");
       try {
@@ -414,7 +414,7 @@ public class DeploymentFactoryFuncTest {
     addStacksDir(config, targetDir);
 
     DefaultGatewayServices srvcs = new DefaultGatewayServices();
-    Map<String, String> options = new HashMap<String, String>();
+    Map<String, String> options = new HashMap<>();
     options.put("persist-master", "false");
     options.put("master", "password");
     try {
@@ -509,7 +509,7 @@ public class DeploymentFactoryFuncTest {
     ((GatewayTestConfig)config).setGatewayApplicationsDir(appsDir.getAbsolutePath());
 
     DefaultGatewayServices srvcs = new DefaultGatewayServices();
-    Map<String, String> options = new HashMap<String, String>();
+    Map<String, String> options = new HashMap<>();
     options.put("persist-master", "false");
     options.put("master", "password");
     try {
@@ -568,7 +568,7 @@ public class DeploymentFactoryFuncTest {
     ((GatewayTestConfig)config).setGatewayApplicationsDir(appsDir.getAbsolutePath());
 
     DefaultGatewayServices srvcs = new DefaultGatewayServices();
-    Map<String, String> options = new HashMap<String, String>();
+    Map<String, String> options = new HashMap<>();
     options.put("persist-master", "false");
     options.put("master", "password");
     try {

http://git-wip-us.apache.org/repos/asf/knox/blob/55150564/gateway-util-common/src/main/java/org/apache/hadoop/gateway/util/HttpUtils.java
----------------------------------------------------------------------
diff --git a/gateway-util-common/src/main/java/org/apache/hadoop/gateway/util/HttpUtils.java b/gateway-util-common/src/main/java/org/apache/hadoop/gateway/util/HttpUtils.java
index 357a09f..5cf62d6 100644
--- a/gateway-util-common/src/main/java/org/apache/hadoop/gateway/util/HttpUtils.java
+++ b/gateway-util-common/src/main/java/org/apache/hadoop/gateway/util/HttpUtils.java
@@ -27,7 +27,7 @@ import java.util.StringTokenizer;
 public class HttpUtils {
 
   public static Map<String,String[]> parseQueryString( String queryString ) {
-    Map<String,String[]> map = new HashMap<String,String[]>();
+    Map<String,String[]> map = new HashMap<>();
     if( queryString != null && !queryString.isEmpty() ) {
       StringTokenizer parser = new StringTokenizer( queryString, "&?;=", true );
       String name = null;

http://git-wip-us.apache.org/repos/asf/knox/blob/55150564/gateway-util-common/src/main/java/org/apache/hadoop/gateway/util/MimeTypeMap.java
----------------------------------------------------------------------
diff --git a/gateway-util-common/src/main/java/org/apache/hadoop/gateway/util/MimeTypeMap.java b/gateway-util-common/src/main/java/org/apache/hadoop/gateway/util/MimeTypeMap.java
index a20d3e6..2bf4f5f 100644
--- a/gateway-util-common/src/main/java/org/apache/hadoop/gateway/util/MimeTypeMap.java
+++ b/gateway-util-common/src/main/java/org/apache/hadoop/gateway/util/MimeTypeMap.java
@@ -29,7 +29,7 @@ public class MimeTypeMap<V> {
   private Map<String,V> map;
 
   public MimeTypeMap() {
-    map = new HashMap<String,V>();
+    map = new HashMap<>();
   }
 
   public int size() {

http://git-wip-us.apache.org/repos/asf/knox/blob/55150564/gateway-util-common/src/test/java/org/apache/hadoop/gateway/audit/JdbmQueueTest.java
----------------------------------------------------------------------
diff --git a/gateway-util-common/src/test/java/org/apache/hadoop/gateway/audit/JdbmQueueTest.java b/gateway-util-common/src/test/java/org/apache/hadoop/gateway/audit/JdbmQueueTest.java
index faccb1e..91d5acb 100644
--- a/gateway-util-common/src/test/java/org/apache/hadoop/gateway/audit/JdbmQueueTest.java
+++ b/gateway-util-common/src/test/java/org/apache/hadoop/gateway/audit/JdbmQueueTest.java
@@ -169,7 +169,7 @@ public class JdbmQueueTest {
     System.out.println( "Running " + Thread.currentThread().getStackTrace()[1].getClassName() + "#" + Thread.currentThread().getStackTrace()[1].getMethodName() );
 
     int iterations = 100;
-    HashSet<String> consumed = new HashSet<String>();
+    HashSet<String> consumed = new HashSet<>();
     Consumer consumer = new Consumer( consumed );
     consumer.start();
     Producer producer1 = new Producer( iterations );
@@ -191,7 +191,7 @@ public class JdbmQueueTest {
     System.out.println( "Running " + Thread.currentThread().getStackTrace()[1].getClassName() + "#" + Thread.currentThread().getStackTrace()[1].getMethodName() );
 
     int iterations = 100;
-    HashSet<String> consumed = new HashSet<String>();
+    HashSet<String> consumed = new HashSet<>();
     Processor consumer = new Processor( consumed );
     consumer.start();
     Producer producer1 = new Producer( iterations );

http://git-wip-us.apache.org/repos/asf/knox/blob/55150564/gateway-util-common/src/test/java/org/apache/hadoop/gateway/util/JsonPathTest.java
----------------------------------------------------------------------
diff --git a/gateway-util-common/src/test/java/org/apache/hadoop/gateway/util/JsonPathTest.java b/gateway-util-common/src/test/java/org/apache/hadoop/gateway/util/JsonPathTest.java
index b561a84..1775cbb 100644
--- a/gateway-util-common/src/test/java/org/apache/hadoop/gateway/util/JsonPathTest.java
+++ b/gateway-util-common/src/test/java/org/apache/hadoop/gateway/util/JsonPathTest.java
@@ -551,7 +551,7 @@ public class JsonPathTest {
 
     expression = JsonPath.compile( "$..field" );
     matches = expression.evaluate( root );
-    matchValues = new HashSet<String>();
+    matchValues = new HashSet<>();
     assertThat( matches.size(), is( 1 ) );
     for( JsonPath.Match match : matches ) {
       matchValues.add( match.getNode().asText() );
@@ -565,7 +565,7 @@ public class JsonPathTest {
     expression = JsonPath.compile( "$..field" );
     matches = expression.evaluate( root );
     assertThat( matches.size(), is( 5 ) );
-    matchValues = new HashSet<String>();
+    matchValues = new HashSet<>();
     for( JsonPath.Match match : matches ) {
       matchValues.add( match.getNode().asText() );
     }

http://git-wip-us.apache.org/repos/asf/knox/blob/55150564/gateway-util-configinjector/src/main/java/org/apache/hadoop/gateway/config/impl/ConfigurationAdapterFactory.java
----------------------------------------------------------------------
diff --git a/gateway-util-configinjector/src/main/java/org/apache/hadoop/gateway/config/impl/ConfigurationAdapterFactory.java b/gateway-util-configinjector/src/main/java/org/apache/hadoop/gateway/config/impl/ConfigurationAdapterFactory.java
index 73cd97b..db87054 100755
--- a/gateway-util-configinjector/src/main/java/org/apache/hadoop/gateway/config/impl/ConfigurationAdapterFactory.java
+++ b/gateway-util-configinjector/src/main/java/org/apache/hadoop/gateway/config/impl/ConfigurationAdapterFactory.java
@@ -42,7 +42,7 @@ public class ConfigurationAdapterFactory {
 
   private static void loadAdapters() {
     Map<Class<?>, Class<? extends ConfigurationAdapter>> all =
-        new HashMap<Class<?>, Class<? extends ConfigurationAdapter>>();
+        new HashMap<>();
     ServiceLoader<ConfigurationAdapterDescriptor> loader = ServiceLoader.load( ConfigurationAdapterDescriptor.class );
     if( loader != null ) {
       Iterator<ConfigurationAdapterDescriptor> i = loader.iterator();

http://git-wip-us.apache.org/repos/asf/knox/blob/55150564/gateway-util-configinjector/src/main/java/org/apache/hadoop/gateway/config/spi/AbstractConfigurationAdapterDescriptor.java
----------------------------------------------------------------------
diff --git a/gateway-util-configinjector/src/main/java/org/apache/hadoop/gateway/config/spi/AbstractConfigurationAdapterDescriptor.java b/gateway-util-configinjector/src/main/java/org/apache/hadoop/gateway/config/spi/AbstractConfigurationAdapterDescriptor.java
index 49fd416..daf6dc4 100755
--- a/gateway-util-configinjector/src/main/java/org/apache/hadoop/gateway/config/spi/AbstractConfigurationAdapterDescriptor.java
+++ b/gateway-util-configinjector/src/main/java/org/apache/hadoop/gateway/config/spi/AbstractConfigurationAdapterDescriptor.java
@@ -25,7 +25,7 @@ import java.util.Map;
 public abstract class AbstractConfigurationAdapterDescriptor implements ConfigurationAdapterDescriptor {
 
   private static final Map<Class<?>, Class<? extends ConfigurationAdapter>> ADAPTERS =
-      new HashMap<Class<?>, Class<? extends ConfigurationAdapter>>();
+      new HashMap<>();
 
   protected AbstractConfigurationAdapterDescriptor() {
   }

http://git-wip-us.apache.org/repos/asf/knox/blob/55150564/gateway-util-configinjector/src/test/java/org/apache/hadoop/gateway/config/FuncTest.java
----------------------------------------------------------------------
diff --git a/gateway-util-configinjector/src/test/java/org/apache/hadoop/gateway/config/FuncTest.java b/gateway-util-configinjector/src/test/java/org/apache/hadoop/gateway/config/FuncTest.java
index f4898ac..6002dc3 100755
--- a/gateway-util-configinjector/src/test/java/org/apache/hadoop/gateway/config/FuncTest.java
+++ b/gateway-util-configinjector/src/test/java/org/apache/hadoop/gateway/config/FuncTest.java
@@ -81,7 +81,7 @@ public class FuncTest {
   @Test
   public void testMapOfStrings() {
 
-    Map<String,String> testConfig = new HashMap<String,String>();
+    Map<String,String> testConfig = new HashMap<>();
     testConfig.put( "stringMember", "stringValue" );
     testConfig.put( "intMember", "2" );
     testConfig.put( "integerMember", "2" );
@@ -154,7 +154,7 @@ public class FuncTest {
   @Test
   public void testExplicitProvider() {
 
-    Map<String,String> testConfig = new HashMap<String,String>();
+    Map<String,String> testConfig = new HashMap<>();
     testConfig.put( "stringMember", "stringValue" );
     testConfig.put( "intMember", "2" );
     testConfig.put( "integerMember", "2" );
@@ -183,7 +183,7 @@ public class FuncTest {
   @Test
   public void testMapOfObjects() {
 
-    Map<Object,Object> testConfig = new HashMap<Object,Object>();
+    Map<Object,Object> testConfig = new HashMap<>();
     testConfig.put( "stringMember", "stringValue" );
     testConfig.put( "intMember", 42 );
     testConfig.put( "integerMember", new Integer(42) );

http://git-wip-us.apache.org/repos/asf/knox/blob/55150564/gateway-util-configinjector/src/test/java/org/apache/hadoop/gateway/config/MapFieldSampleTest.java
----------------------------------------------------------------------
diff --git a/gateway-util-configinjector/src/test/java/org/apache/hadoop/gateway/config/MapFieldSampleTest.java b/gateway-util-configinjector/src/test/java/org/apache/hadoop/gateway/config/MapFieldSampleTest.java
index b9336b5..ae01e30 100755
--- a/gateway-util-configinjector/src/test/java/org/apache/hadoop/gateway/config/MapFieldSampleTest.java
+++ b/gateway-util-configinjector/src/test/java/org/apache/hadoop/gateway/config/MapFieldSampleTest.java
@@ -32,7 +32,7 @@ public class MapFieldSampleTest {
     private int retryLimit = 3;
   }
 
-  static Map<String,String> config = new HashMap<String,String>();
+  static Map<String,String> config = new HashMap<>();
   static { config.put( "retryLimit", "5" ); }
 
   @Test

http://git-wip-us.apache.org/repos/asf/knox/blob/55150564/gateway-util-configinjector/src/test/java/org/apache/hadoop/gateway/config/MapMethodSampleTest.java
----------------------------------------------------------------------
diff --git a/gateway-util-configinjector/src/test/java/org/apache/hadoop/gateway/config/MapMethodSampleTest.java b/gateway-util-configinjector/src/test/java/org/apache/hadoop/gateway/config/MapMethodSampleTest.java
index 96f46ec..37596df 100755
--- a/gateway-util-configinjector/src/test/java/org/apache/hadoop/gateway/config/MapMethodSampleTest.java
+++ b/gateway-util-configinjector/src/test/java/org/apache/hadoop/gateway/config/MapMethodSampleTest.java
@@ -36,7 +36,7 @@ public class MapMethodSampleTest {
     }
   }
 
-  static Map<String,String> config = new HashMap<String,String>();
+  static Map<String,String> config = new HashMap<>();
   static { config.put( "retryLimit", "5" ); }
 
   @Test

http://git-wip-us.apache.org/repos/asf/knox/blob/55150564/gateway-util-launcher/src/main/java/org/apache/hadoop/gateway/launcher/Command.java
----------------------------------------------------------------------
diff --git a/gateway-util-launcher/src/main/java/org/apache/hadoop/gateway/launcher/Command.java b/gateway-util-launcher/src/main/java/org/apache/hadoop/gateway/launcher/Command.java
index c11eaee..a92597b 100644
--- a/gateway-util-launcher/src/main/java/org/apache/hadoop/gateway/launcher/Command.java
+++ b/gateway-util-launcher/src/main/java/org/apache/hadoop/gateway/launcher/Command.java
@@ -80,7 +80,7 @@ class Command {
 
   void consumeSysPropsAndEnvVars( Properties config ) {
     props = new Properties();
-    vars = new HashMap<String,String>();
+    vars = new HashMap<>();
     for( String name : config.stringPropertyNames() ) {
       String value = config.getProperty( name );
       if( name.startsWith( ENV_PREFIX ) ) {

http://git-wip-us.apache.org/repos/asf/knox/blob/55150564/gateway-util-urltemplate/src/main/java/org/apache/hadoop/gateway/util/urltemplate/Expander.java
----------------------------------------------------------------------
diff --git a/gateway-util-urltemplate/src/main/java/org/apache/hadoop/gateway/util/urltemplate/Expander.java b/gateway-util-urltemplate/src/main/java/org/apache/hadoop/gateway/util/urltemplate/Expander.java
index 22cfe9e..d373c49 100644
--- a/gateway-util-urltemplate/src/main/java/org/apache/hadoop/gateway/util/urltemplate/Expander.java
+++ b/gateway-util-urltemplate/src/main/java/org/apache/hadoop/gateway/util/urltemplate/Expander.java
@@ -51,7 +51,7 @@ public class Expander {
     if( params == null ) {
       params = EMPTY_PARAMS;
     }
-    Set<String> names = new HashSet<String>( params.getNames() );
+    Set<String> names = new HashSet<>( params.getNames() );
     expandScheme( template, names, params, evaluator, builder );
     expandAuthority( template, names, params, evaluator, builder );
     expandPath( template, names, params, evaluator, builder );

http://git-wip-us.apache.org/repos/asf/knox/blob/55150564/gateway-util-urltemplate/src/main/java/org/apache/hadoop/gateway/util/urltemplate/Matcher.java
----------------------------------------------------------------------
diff --git a/gateway-util-urltemplate/src/main/java/org/apache/hadoop/gateway/util/urltemplate/Matcher.java b/gateway-util-urltemplate/src/main/java/org/apache/hadoop/gateway/util/urltemplate/Matcher.java
index f1268fe..b818774 100644
--- a/gateway-util-urltemplate/src/main/java/org/apache/hadoop/gateway/util/urltemplate/Matcher.java
+++ b/gateway-util-urltemplate/src/main/java/org/apache/hadoop/gateway/util/urltemplate/Matcher.java
@@ -374,7 +374,7 @@ public class Matcher<V> {
 
   private class MatchParams implements Params {
 
-    private Map<String,List<String>> map = new HashMap<String,List<String>>();
+    private Map<String,List<String>> map = new HashMap<>();
 
     public Set<String> getNames() {
       return map.keySet();

http://git-wip-us.apache.org/repos/asf/knox/blob/55150564/gateway-util-urltemplate/src/main/java/org/apache/hadoop/gateway/util/urltemplate/MockParams.java
----------------------------------------------------------------------
diff --git a/gateway-util-urltemplate/src/main/java/org/apache/hadoop/gateway/util/urltemplate/MockParams.java b/gateway-util-urltemplate/src/main/java/org/apache/hadoop/gateway/util/urltemplate/MockParams.java
index ecdeb3c..fe12933 100644
--- a/gateway-util-urltemplate/src/main/java/org/apache/hadoop/gateway/util/urltemplate/MockParams.java
+++ b/gateway-util-urltemplate/src/main/java/org/apache/hadoop/gateway/util/urltemplate/MockParams.java
@@ -25,7 +25,7 @@ import java.util.Set;
 
 public class MockParams implements Params {
 
-  private Map<String,List<String>> map = new HashMap<String,List<String>>();
+  private Map<String,List<String>> map = new HashMap<>();
 
   public Set<String> getNames() {
     return map.keySet();


Mime
View raw message