Modified: ace/trunk/org.apache.ace.authentication/test/org/apache/ace/authentication/processor/password/PasswordAuthenticationProcessorTest.java URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.authentication/test/org/apache/ace/authentication/processor/password/PasswordAuthenticationProcessorTest.java?rev=1727499&r1=1727498&r2=1727499&view=diff ============================================================================== --- ace/trunk/org.apache.ace.authentication/test/org/apache/ace/authentication/processor/password/PasswordAuthenticationProcessorTest.java (original) +++ ace/trunk/org.apache.ace.authentication/test/org/apache/ace/authentication/processor/password/PasswordAuthenticationProcessorTest.java Fri Jan 29 08:59:31 2016 @@ -26,9 +26,11 @@ import static org.mockito.Matchers.eq; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; -import java.util.Properties; +import java.util.Dictionary; +import java.util.Hashtable; + +import javax.servlet.http.HttpServletRequest; -import org.apache.ace.authentication.processor.password.PasswordAuthenticationProcessor; import org.apache.commons.codec.digest.DigestUtils; import org.mockito.Mockito; import org.osgi.service.cm.ConfigurationException; @@ -190,7 +192,8 @@ public class PasswordAuthenticationProce final String keyUsername = "foo"; final String keyPassword = "bar"; - Properties props = new Properties(); + Dictionary<String, Object> props = new Hashtable<>(); + props.put(PROPERTY_KEY_USERNAME, keyUsername); props.put(PROPERTY_KEY_PASSWORD, keyPassword); props.put(PROPERTY_PASSWORD_HASHMETHOD, "sha1"); @@ -219,7 +222,8 @@ public class PasswordAuthenticationProce */ @Test(groups = { UNIT }, expectedExceptions = ConfigurationException.class) public void testUpdatedDoesNotAcceptEmptyKeyPassword() throws ConfigurationException { - Properties props = new Properties(); + Dictionary<String, Object> props = new Hashtable<>(); + props.put(PROPERTY_KEY_USERNAME, "foo"); props.put(PROPERTY_KEY_PASSWORD, ""); props.put(PROPERTY_PASSWORD_HASHMETHOD, "none"); @@ -232,7 +236,8 @@ public class PasswordAuthenticationProce */ @Test(groups = { UNIT }, expectedExceptions = ConfigurationException.class) public void testUpdatedDoesNotAcceptEmptyKeyUsername() throws ConfigurationException { - Properties props = new Properties(); + Dictionary<String, Object> props = new Hashtable<>(); + props.put(PROPERTY_KEY_USERNAME, ""); props.put(PROPERTY_KEY_PASSWORD, "foo"); props.put(PROPERTY_PASSWORD_HASHMETHOD, "none"); @@ -245,7 +250,8 @@ public class PasswordAuthenticationProce */ @Test(groups = { UNIT }, expectedExceptions = ConfigurationException.class) public void testUpdatedDoesNotAcceptEmptyPasswordHashType() throws ConfigurationException { - Properties props = new Properties(); + Dictionary<String, Object> props = new Hashtable<>(); + props.put(PROPERTY_KEY_USERNAME, "foo"); props.put(PROPERTY_KEY_PASSWORD, "bar"); props.put(PROPERTY_PASSWORD_HASHMETHOD, ""); @@ -258,7 +264,8 @@ public class PasswordAuthenticationProce */ @Test(groups = { UNIT }, expectedExceptions = ConfigurationException.class) public void testUpdatedDoesNotAcceptMissingKeyPassword() throws ConfigurationException { - Properties props = new Properties(); + Dictionary<String, Object> props = new Hashtable<>(); + props.put(PROPERTY_KEY_USERNAME, "foo"); props.put(PROPERTY_PASSWORD_HASHMETHOD, "none"); @@ -270,7 +277,8 @@ public class PasswordAuthenticationProce */ @Test(groups = { UNIT }, expectedExceptions = ConfigurationException.class) public void testUpdatedDoesNotAcceptMissingKeyUsername() throws ConfigurationException { - Properties props = new Properties(); + Dictionary<String, Object> props = new Hashtable<>(); + props.put(PROPERTY_KEY_PASSWORD, "foo"); props.put(PROPERTY_PASSWORD_HASHMETHOD, "none"); @@ -282,7 +290,8 @@ public class PasswordAuthenticationProce */ @Test(groups = { UNIT }, expectedExceptions = ConfigurationException.class) public void testUpdatedDoesNotAcceptMissingPasswordHashType() throws ConfigurationException { - Properties props = new Properties(); + Dictionary<String, Object> props = new Hashtable<>(); + props.put(PROPERTY_KEY_USERNAME, "foo"); props.put(PROPERTY_KEY_PASSWORD, "foo");
Modified: ace/trunk/org.apache.ace.builder/src/org/apache/ace/builder/DeploymentPackageBuilder.java URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.builder/src/org/apache/ace/builder/DeploymentPackageBuilder.java?rev=1727499&r1=1727498&r2=1727499&view=diff ============================================================================== --- ace/trunk/org.apache.ace.builder/src/org/apache/ace/builder/DeploymentPackageBuilder.java (original) +++ ace/trunk/org.apache.ace.builder/src/org/apache/ace/builder/DeploymentPackageBuilder.java Fri Jan 29 08:59:31 2016 @@ -59,9 +59,9 @@ public class DeploymentPackageBuilder { private final String m_symbolicName; private final String m_version; - private final List<ArtifactData> m_bundles = new ArrayList<ArtifactData>(); - private final List<ArtifactData> m_processors = new ArrayList<ArtifactData>(); - private final List<ArtifactData> m_artifacts = new ArrayList<ArtifactData>(); + private final List<ArtifactData> m_bundles = new ArrayList<>(); + private final List<ArtifactData> m_processors = new ArrayList<>(); + private final List<ArtifactData> m_artifacts = new ArrayList<>(); private int m_id = 1; @@ -142,7 +142,7 @@ public class DeploymentPackageBuilder { */ public void generate(OutputStream output) throws Exception { validateArtifacts(); - List<ArtifactData> artifacts = new ArrayList<ArtifactData>(); + List<ArtifactData> artifacts = new ArrayList<>(); artifacts.addAll(m_bundles); artifacts.addAll(m_processors); artifacts.addAll(m_artifacts); Modified: ace/trunk/org.apache.ace.client.repository.itest/src/org/apache/ace/it/repositoryadmin/BaseRepositoryAdminTest.java URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.client.repository.itest/src/org/apache/ace/it/repositoryadmin/BaseRepositoryAdminTest.java?rev=1727499&r1=1727498&r2=1727499&view=diff ============================================================================== --- ace/trunk/org.apache.ace.client.repository.itest/src/org/apache/ace/it/repositoryadmin/BaseRepositoryAdminTest.java (original) +++ ace/trunk/org.apache.ace.client.repository.itest/src/org/apache/ace/it/repositoryadmin/BaseRepositoryAdminTest.java Fri Jan 29 08:59:31 2016 @@ -215,12 +215,12 @@ public abstract class BaseRepositoryAdmi protected ArtifactObject createBasicArtifactObject(String name, String mimetype, String processorPID) throws InterruptedException { - Map<String, String> attr = new HashMap<String, String>(); + Map<String, String> attr = new HashMap<>(); attr.put(ArtifactObject.KEY_ARTIFACT_NAME, name); attr.put(ArtifactObject.KEY_MIMETYPE, mimetype); attr.put(ArtifactObject.KEY_URL, "http://" + name); attr.put(ArtifactObject.KEY_PROCESSOR_PID, processorPID); - Map<String, String> tags = new HashMap<String, String>(); + Map<String, String> tags = new HashMap<>(); return m_artifactRepository.create(attr, tags); } @@ -234,7 +234,7 @@ public abstract class BaseRepositoryAdmi } protected ArtifactObject createBasicBundleObject(String symbolicName, String version, String processorPID, String size) { - Map<String, String> attr = new HashMap<String, String>(); + Map<String, String> attr = new HashMap<>(); attr.put(BundleHelper.KEY_SYMBOLICNAME, symbolicName); attr.put(ArtifactObject.KEY_MIMETYPE, BundleHelper.MIMETYPE); attr.put(ArtifactObject.KEY_URL, "http://" + symbolicName + "-" + ((version == null) ? "null" : version)); @@ -249,30 +249,30 @@ public abstract class BaseRepositoryAdmi attr.put(ArtifactObject.KEY_SIZE, size); } - Map<String, String> tags = new HashMap<String, String>(); + Map<String, String> tags = new HashMap<>(); return m_artifactRepository.create(attr, tags); } protected DistributionObject createBasicDistributionObject(String name) { - Map<String, String> attr = new HashMap<String, String>(); + Map<String, String> attr = new HashMap<>(); attr.put(DistributionObject.KEY_NAME, name); - Map<String, String> tags = new HashMap<String, String>(); + Map<String, String> tags = new HashMap<>(); return m_distributionRepository.create(attr, tags); } protected FeatureObject createBasicFeatureObject(String name) { - Map<String, String> attr = new HashMap<String, String>(); + Map<String, String> attr = new HashMap<>(); attr.put(FeatureObject.KEY_NAME, name); - Map<String, String> tags = new HashMap<String, String>(); + Map<String, String> tags = new HashMap<>(); return m_featureRepository.create(attr, tags); } protected TargetObject createBasicTargetObject(String id) { - Map<String, String> attr = new HashMap<String, String>(); + Map<String, String> attr = new HashMap<>(); attr.put(TargetObject.KEY_ID, id); - Map<String, String> tags = new HashMap<String, String>(); + Map<String, String> tags = new HashMap<>(); return m_targetRepository.create(attr, tags); } @@ -351,10 +351,10 @@ public abstract class BaseRepositoryAdmi } protected <T> T runAndWaitForEvent(Callable<T> callable, final boolean debug, final List<Event> events, final String... topicList) throws Exception { - Dictionary<String, Object> topics = new Hashtable<String, Object>(); + Dictionary<String, Object> topics = new Hashtable<>(); topics.put(EventConstants.EVENT_TOPIC, topicList); - final CopyOnWriteArrayList<String> waitingForTopic = new CopyOnWriteArrayList<String>(Arrays.asList(topicList)); + final CopyOnWriteArrayList<String> waitingForTopic = new CopyOnWriteArrayList<>(Arrays.asList(topicList)); final CountDownLatch topicLatch = new CountDownLatch(topicList.length); final CountDownLatch startLatch = new CountDownLatch(1); Modified: ace/trunk/org.apache.ace.client.repository.itest/src/org/apache/ace/it/repositoryadmin/ClientAutomationTest.java URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.client.repository.itest/src/org/apache/ace/it/repositoryadmin/ClientAutomationTest.java?rev=1727499&r1=1727498&r2=1727499&view=diff ============================================================================== --- ace/trunk/org.apache.ace.client.repository.itest/src/org/apache/ace/it/repositoryadmin/ClientAutomationTest.java (original) +++ ace/trunk/org.apache.ace.client.repository.itest/src/org/apache/ace/it/repositoryadmin/ClientAutomationTest.java Fri Jan 29 08:59:31 2016 @@ -89,7 +89,7 @@ public class ClientAutomationTest extend } private void doAutoTargetReg() throws Exception { - List<Event> events = new ArrayList<Event>(); + List<Event> events = new ArrayList<>(); events.add(new Event("anotherTarget", 1, 1, 1, AuditEvent.FRAMEWORK_STARTED)); // fill auditlog; no install data m_auditLogStore.put(events); @@ -97,7 +97,7 @@ public class ClientAutomationTest extend int initRepoSize = m_statefulTargetRepository.get().size(); // Get the processauditlog task and run it - ServiceTracker<Runnable, Runnable> tracker = new ServiceTracker<Runnable, Runnable>( + ServiceTracker<Runnable, Runnable> tracker = new ServiceTracker<>( m_bundleContext, m_bundleContext.createFilter("(&(" + Constants.OBJECTCLASS + "=" + Runnable.class.getName() + ")(" + SchedulerConstants.SCHEDULER_NAME_KEY + "=" + "org.apache.ace.client.processauditlog" + "))"), null); Modified: ace/trunk/org.apache.ace.client.repository.itest/src/org/apache/ace/it/repositoryadmin/RepositoryAdminTest.java URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.client.repository.itest/src/org/apache/ace/it/repositoryadmin/RepositoryAdminTest.java?rev=1727499&r1=1727498&r2=1727499&view=diff ============================================================================== --- ace/trunk/org.apache.ace.client.repository.itest/src/org/apache/ace/it/repositoryadmin/RepositoryAdminTest.java (original) +++ ace/trunk/org.apache.ace.client.repository.itest/src/org/apache/ace/it/repositoryadmin/RepositoryAdminTest.java Fri Jan 29 08:59:31 2016 @@ -61,7 +61,7 @@ public class RepositoryAdminTest extends final Artifact2FeatureAssociation bg = runAndWaitForEvent(new Callable<Artifact2FeatureAssociation>() { public Artifact2FeatureAssociation call() throws Exception { - Map<String, String> properties = new HashMap<String, String>(); + Map<String, String> properties = new HashMap<>(); properties.put(BundleHelper.KEY_ASSOCIATION_VERSIONSTATEMENT, "[1,3)"); return m_artifact2featureRepository.create(b1, properties, g1, null); } @@ -192,7 +192,7 @@ public class RepositoryAdminTest extends sgo.approve(); - List<Event> events = new ArrayList<Event>(); + List<Event> events = new ArrayList<>(); runAndWaitForEvent(new Callable<Void>() { public Void call() throws Exception { m_repositoryAdmin.commit(); @@ -486,7 +486,7 @@ public class RepositoryAdminTest extends // expected } - List<Event> events = new ArrayList<Event>(); + List<Event> events = new ArrayList<>(); runAndWaitForEvent(new Callable<Object>() { public Object call() throws Exception { m_repositoryAdmin.checkout(); Modified: ace/trunk/org.apache.ace.client.repository.itest/src/org/apache/ace/it/repositoryadmin/StatefulTargetRepositoryTest.java URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.client.repository.itest/src/org/apache/ace/it/repositoryadmin/StatefulTargetRepositoryTest.java?rev=1727499&r1=1727498&r2=1727499&view=diff ============================================================================== --- ace/trunk/org.apache.ace.client.repository.itest/src/org/apache/ace/it/repositoryadmin/StatefulTargetRepositoryTest.java (original) +++ ace/trunk/org.apache.ace.client.repository.itest/src/org/apache/ace/it/repositoryadmin/StatefulTargetRepositoryTest.java Fri Jan 29 08:59:31 2016 @@ -62,10 +62,10 @@ public class StatefulTargetRepositoryTes final String targetId = "myNewTarget2"; - final Map<String, String> attr = new HashMap<String, String>(); + final Map<String, String> attr = new HashMap<>(); attr.put(TargetObject.KEY_ID, targetId); - final Map<String, String> tags = new HashMap<String, String>(); + final Map<String, String> tags = new HashMap<>(); final StatefulTargetObject sgo = runAndWaitForEvent(new Callable<StatefulTargetObject>() { public StatefulTargetObject call() throws Exception { return m_statefulTargetRepository.preregister(attr, tags); @@ -168,9 +168,9 @@ public class StatefulTargetRepositoryTes setUpTestCase(); // preregister target - final Map<String, String> attr = new HashMap<String, String>(); + final Map<String, String> attr = new HashMap<>(); attr.put(TargetObject.KEY_ID, "myNewTarget3"); - final Map<String, String> tags = new HashMap<String, String>(); + final Map<String, String> tags = new HashMap<>(); final StatefulTargetObject sgo1 = runAndWaitForEvent(new Callable<StatefulTargetObject>() { public StatefulTargetObject call() throws Exception { @@ -182,15 +182,15 @@ public class StatefulTargetRepositoryTes assertTrue("We just preregistered a target, so it should be registered.", sgo1.isRegistered()); // add auditlog data - List<Event> events = new ArrayList<Event>(); + List<Event> events = new ArrayList<>(); events.add(new Event("myNewTarget3", 1, 1, 1, AuditEvent.FRAMEWORK_STARTED)); // add an (old) set of target properties - Map<String, String> props2 = new HashMap<String, String>(); + Map<String, String> props2 = new HashMap<>(); props2.put("mykey", "myoldvalue"); props2.put("myoldkey", "myoldvalue"); events.add(new Event("myNewTarget3", 1, 2, 2, AuditEvent.TARGETPROPERTIES_SET, props2)); // add a new set of target properties - Map<String, String> props3 = new HashMap<String, String>(); + Map<String, String> props3 = new HashMap<>(); props3.put("mykey", "myvalue"); events.add(new Event("myNewTarget3", 1, 3, 3, AuditEvent.TARGETPROPERTIES_SET, props3)); m_auditLogStore.put(events); @@ -204,7 +204,7 @@ public class StatefulTargetRepositoryTes assertTrue("Adding auditlog data for a target does not influence its isRegistered().", sgo1.isRegistered()); // add auditlog data for other target - events = new ArrayList<Event>(); + events = new ArrayList<>(); events.add(new Event("myNewTarget4", 1, 1, 1, AuditEvent.FRAMEWORK_STARTED)); m_auditLogStore.put(events); runAndWaitForEvent(new Callable<Object>() { @@ -319,9 +319,9 @@ public class StatefulTargetRepositoryTes setUpTestCase(); // preregister gateway - final Map<String, String> attr = new HashMap<String, String>(); + final Map<String, String> attr = new HashMap<>(); attr.put(TargetObject.KEY_ID, "myNewGatewayA"); - final Map<String, String> tags = new HashMap<String, String>(); + final Map<String, String> tags = new HashMap<>(); final StatefulTargetObject sgo1 = runAndWaitForEvent(new Callable<StatefulTargetObject>() { public StatefulTargetObject call() throws Exception { @@ -333,7 +333,7 @@ public class StatefulTargetRepositoryTes assertTrue("We just preregistered a gateway, so it should be registered.", sgo1.isRegistered()); // add auditlog data - List<Event> events = new ArrayList<Event>(); + List<Event> events = new ArrayList<>(); events.add(new Event("myNewGatewayA", 1, 1, 1, AuditEvent.FRAMEWORK_STARTED)); m_auditLogStore.put(events); m_statefulTargetRepository.refresh(); @@ -347,7 +347,7 @@ public class StatefulTargetRepositoryTes assertTrue("We should be able to get sgo1's gatewayObject.", false); } // add auditlog data for other gateway - events = new ArrayList<Event>(); + events = new ArrayList<>(); events.add(new Event("myNewGatewayB", 1, 1, 1, AuditEvent.FRAMEWORK_STARTED)); m_auditLogStore.put(events); runAndWaitForEvent(new Callable<Object>() { @@ -444,7 +444,7 @@ public class StatefulTargetRepositoryTes final String targetId = String.format("target-%s", Long.toHexString(System.nanoTime())); - List<Event> events = new ArrayList<Event>(); + List<Event> events = new ArrayList<>(); events.add(new Event(targetId, 1, 1, 1, AuditEvent.FRAMEWORK_STARTED)); // fill auditlog; no install data @@ -463,8 +463,8 @@ public class StatefulTargetRepositoryTes assertEquals("We expect our object's provisioning state to be Idle;", ProvisioningState.Idle, sgo.getProvisioningState()); // fill auditlog with complete-data - events = new ArrayList<Event>(); - Map<String, String> props = new HashMap<String, String>(); + events = new ArrayList<>(); + Map<String, String> props = new HashMap<>(); props.put(AuditEvent.KEY_NAME, "mypackage"); props.put(AuditEvent.KEY_VERSION, "123"); events.add(new Event(targetId, 1, 2, 2, AuditEvent.DEPLOYMENTCONTROL_INSTALL, props)); @@ -482,8 +482,8 @@ public class StatefulTargetRepositoryTes assertEquals("We expect our object's provisioning state to be InProgress;", ProvisioningState.InProgress, sgo.getProvisioningState()); // fill auditlog with install data - events = new ArrayList<Event>(); - props = new HashMap<String, String>(); + events = new ArrayList<>(); + props = new HashMap<>(); props.put(AuditEvent.KEY_NAME, "mypackage"); props.put(AuditEvent.KEY_VERSION, "123"); props.put(AuditEvent.KEY_SUCCESS, "false"); @@ -507,8 +507,8 @@ public class StatefulTargetRepositoryTes assertEquals("We expect our object's provisioning state to be Idle;", ProvisioningState.Idle, sgo.getProvisioningState()); // add another install event. - events = new ArrayList<Event>(); - props = new HashMap<String, String>(); + events = new ArrayList<>(); + props = new HashMap<>(); props.put(AuditEvent.KEY_NAME, "mypackage"); props.put(AuditEvent.KEY_VERSION, "124"); events.add(new Event(targetId, 1, 4, 4, AuditEvent.DEPLOYMENTCONTROL_INSTALL, props)); @@ -526,8 +526,8 @@ public class StatefulTargetRepositoryTes assertEquals("We expect our object's provisioning state to be InProgress;", ProvisioningState.InProgress, sgo.getProvisioningState()); // fill auditlog with install data - events = new ArrayList<Event>(); - props = new HashMap<String, String>(); + events = new ArrayList<>(); + props = new HashMap<>(); props.put(AuditEvent.KEY_NAME, "mypackage"); props.put(AuditEvent.KEY_VERSION, "124"); props.put(AuditEvent.KEY_SUCCESS, "true"); @@ -556,9 +556,9 @@ public class StatefulTargetRepositoryTes final String targetId = "myNewTarget1"; - final Map<String, String> attr = new HashMap<String, String>(); + final Map<String, String> attr = new HashMap<>(); attr.put(TargetObject.KEY_ID, targetId); - final Map<String, String> tags = new HashMap<String, String>(); + final Map<String, String> tags = new HashMap<>(); try { m_statefulTargetRepository.create(attr, tags); @@ -590,10 +590,10 @@ public class StatefulTargetRepositoryTes final String targetId = "a_target"; // register target with - final Map<String, String> attr = new HashMap<String, String>(); + final Map<String, String> attr = new HashMap<>(); attr.put(TargetObject.KEY_ID, targetId); attr.put(TargetObject.KEY_AUTO_APPROVE, String.valueOf(true)); - final Map<String, String> tags = new HashMap<String, String>(); + final Map<String, String> tags = new HashMap<>(); final StatefulTargetObject sgo = runAndWaitForEvent(new Callable<StatefulTargetObject>() { public StatefulTargetObject call() throws Exception { @@ -623,7 +623,7 @@ public class StatefulTargetRepositoryTes final String targetID = ":)"; - List<Event> events = new ArrayList<Event>(); + List<Event> events = new ArrayList<>(); // add a target with a weird name. events.add(new Event(targetID, 1, 1, 1, AuditEvent.FRAMEWORK_STARTED)); @@ -656,10 +656,10 @@ public class StatefulTargetRepositoryTes final String targetId = "myNewTarget3"; - final Map<String, String> attr = new HashMap<String, String>(); + final Map<String, String> attr = new HashMap<>(); attr.put(TargetObject.KEY_ID, targetId); - final Map<String, String> tags = new HashMap<String, String>(); + final Map<String, String> tags = new HashMap<>(); final StatefulTargetObject sgo = runAndWaitForEvent(new Callable<StatefulTargetObject>() { public StatefulTargetObject call() throws Exception { return m_statefulTargetRepository.preregister(attr, tags); @@ -717,14 +717,14 @@ public class StatefulTargetRepositoryTes private DeploymentVersionObject createBasicDeploymentVersionObject(String targetID, String version, ArtifactObject... bundles) { - Map<String, String> attr = new HashMap<String, String>(); + Map<String, String> attr = new HashMap<>(); attr.put(DeploymentVersionObject.KEY_TARGETID, targetID); attr.put(DeploymentVersionObject.KEY_VERSION, version); - Map<String, String> tags = new HashMap<String, String>(); + Map<String, String> tags = new HashMap<>(); - List<DeploymentArtifact> artifacts = new ArrayList<DeploymentArtifact>(); + List<DeploymentArtifact> artifacts = new ArrayList<>(); for (ArtifactObject artifact : bundles) { - Map<String, String> directives = new HashMap<String, String>(); + Map<String, String> directives = new HashMap<>(); directives.put(BundleHelper.KEY_SYMBOLICNAME, artifact.getAttribute(BundleHelper.KEY_SYMBOLICNAME)); directives.put(DeploymentArtifact.DIRECTIVE_KEY_BASEURL, artifact.getURL()); if (artifact.getAttribute(BundleHelper.KEY_VERSION) != null) { @@ -737,7 +737,7 @@ public class StatefulTargetRepositoryTes private Artifact2FeatureAssociation createDynamicBundle2FeatureAssociation(ArtifactObject artifact, FeatureObject feature) { - Map<String, String> properties = new HashMap<String, String>(); + Map<String, String> properties = new HashMap<>(); properties.put(BundleHelper.KEY_ASSOCIATION_VERSIONSTATEMENT, "0.0.0"); return m_artifact2featureRepository.create(artifact, properties, feature, null); } Modified: ace/trunk/org.apache.ace.client.repository.itest/src/org/apache/ace/it/repositoryadmin/TemplateProcessorTest.java URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.client.repository.itest/src/org/apache/ace/it/repositoryadmin/TemplateProcessorTest.java?rev=1727499&r1=1727498&r2=1727499&view=diff ============================================================================== --- ace/trunk/org.apache.ace.client.repository.itest/src/org/apache/ace/it/repositoryadmin/TemplateProcessorTest.java (original) +++ ace/trunk/org.apache.ace.client.repository.itest/src/org/apache/ace/it/repositoryadmin/TemplateProcessorTest.java Fri Jan 29 08:59:31 2016 @@ -139,18 +139,18 @@ public class TemplateProcessorTest exten m_dependencyManager.add(myHelperService); // Empty tag map to be reused througout test - final Map<String, String> tags = new HashMap<String, String>(); + final Map<String, String> tags = new HashMap<>(); // First, create a bundle and two artifacts, but do not provide a processor for the artifacts. ArtifactObject b1 = createBasicBundleObject("bundle1"); - Map<String, String> attr = new HashMap<String, String>(); + Map<String, String> attr = new HashMap<>(); attr.put(ArtifactObject.KEY_URL, "http://myobject"); attr.put(ArtifactObject.KEY_PROCESSOR_PID, "my.processor.pid"); attr.put(ArtifactHelper.KEY_MIMETYPE, "mymime"); ArtifactObject a1 = m_artifactRepository.create(attr, tags); - attr = new HashMap<String, String>(); + attr = new HashMap<>(); attr.put(ArtifactObject.KEY_URL, "http://myotherobject"); attr.put(ArtifactObject.KEY_PROCESSOR_PID, "my.processor.pid"); attr.put(ArtifactObject.KEY_RESOURCE_ID, "mymime"); @@ -161,7 +161,7 @@ public class TemplateProcessorTest exten FeatureObject g = createBasicFeatureObject("feature"); DistributionObject l = createBasicDistributionObject("distribution"); - attr = new HashMap<String, String>(); + attr = new HashMap<>(); attr.put(TargetObject.KEY_ID, "myTarget"); StatefulTargetObject sgo = m_statefulTargetRepository.preregister(attr, tags); @@ -184,7 +184,7 @@ public class TemplateProcessorTest exten assertEquals("Store state for target should still be new, because the resource processor is missing.", StoreState.New, sgo.getStoreState()); // Now, add a processor for the artifact. - attr = new HashMap<String, String>(); + attr = new HashMap<>(); attr.put(ArtifactObject.KEY_URL, "http://myprocessor"); attr.put(BundleHelper.KEY_RESOURCE_PROCESSOR_PID, "my.processor.pid"); attr.put(BundleHelper.KEY_SYMBOLICNAME, "my.processor.bundle"); @@ -226,7 +226,7 @@ public class TemplateProcessorTest exten // Now, add a new version of the processor (ACE-373) assertFalse("There should be no changes.", sgo.needsApprove()); - attr = new HashMap<String, String>(); + attr = new HashMap<>(); attr.put(ArtifactObject.KEY_URL, "http://myprocessor/v2"); attr.put(BundleHelper.KEY_RESOURCE_PROCESSOR_PID, "my.processor.pid"); attr.put(BundleHelper.KEY_SYMBOLICNAME, "my.processor.bundle"); @@ -284,7 +284,7 @@ public class TemplateProcessorTest exten assertFalse("There should be no changes.", sgo.needsApprove()); - attr = new HashMap<String, String>(); + attr = new HashMap<>(); attr.put(ArtifactObject.KEY_URL, "http://myprocessor/v1.5"); attr.put(BundleHelper.KEY_RESOURCE_PROCESSOR_PID, "my.processor.pid"); attr.put(BundleHelper.KEY_SYMBOLICNAME, "my.processor.bundle"); Modified: ace/trunk/org.apache.ace.client.repository/src/org/apache/ace/client/repository/helper/base/VelocityArtifactPreprocessor.java URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.client.repository/src/org/apache/ace/client/repository/helper/base/VelocityArtifactPreprocessor.java?rev=1727499&r1=1727498&r2=1727499&view=diff ============================================================================== --- ace/trunk/org.apache.ace.client.repository/src/org/apache/ace/client/repository/helper/base/VelocityArtifactPreprocessor.java (original) +++ ace/trunk/org.apache.ace.client.repository/src/org/apache/ace/client/repository/helper/base/VelocityArtifactPreprocessor.java Fri Jan 29 08:59:31 2016 @@ -75,8 +75,8 @@ public class VelocityArtifactPreprocesso throw new RuntimeException("Failed to create VelocityArtifactPreprocessor instance!", e); } - m_cachedArtifacts = new ConcurrentHashMap<String, Reference<byte[]>>(); - m_cachedHashes = new ConcurrentHashMap<String, Reference<String>>(); + m_cachedArtifacts = new ConcurrentHashMap<>(); + m_cachedHashes = new ConcurrentHashMap<>(); } @Override @@ -226,7 +226,7 @@ public class VelocityArtifactPreprocesso if (hash == null) { try { hash = hash(getBytesFromUrl(getFullUrl(url, target, version))); - m_cachedHashes.put(key, new SoftReference<String>(hash)); + m_cachedHashes.put(key, new SoftReference<>(hash)); } catch (IOException e) { return null; @@ -254,7 +254,7 @@ public class VelocityArtifactPreprocesso */ private void setHashForVersion(String url, String target, String version, String hash) { String key = createHashKey(url, target, version); - m_cachedHashes.put(key, new WeakReference<String>(hash)); + m_cachedHashes.put(key, new WeakReference<>(hash)); } /** @@ -315,7 +315,7 @@ public class VelocityArtifactPreprocesso baos.write(buf, 0, count); } result = baos.toByteArray(); - m_cachedArtifacts.put(url, new SoftReference<byte[]>(result)); + m_cachedArtifacts.put(url, new SoftReference<>(result)); } finally { silentlyClose(in); Modified: ace/trunk/org.apache.ace.client.repository/src/org/apache/ace/client/repository/helper/bundle/impl/Activator.java URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.client.repository/src/org/apache/ace/client/repository/helper/bundle/impl/Activator.java?rev=1727499&r1=1727498&r2=1727499&view=diff ============================================================================== --- ace/trunk/org.apache.ace.client.repository/src/org/apache/ace/client/repository/helper/bundle/impl/Activator.java (original) +++ ace/trunk/org.apache.ace.client.repository/src/org/apache/ace/client/repository/helper/bundle/impl/Activator.java Fri Jan 29 08:59:31 2016 @@ -36,7 +36,7 @@ public class Activator extends Dependenc @Override public synchronized void init(BundleContext context, DependencyManager manager) throws Exception { - Dictionary<String, String> props = new Hashtable<String, String>(); + Dictionary<String, String> props = new Hashtable<>(); props.put(ArtifactObject.KEY_MIMETYPE, BundleHelper.MIMETYPE); BundleHelperImpl helperImpl = new BundleHelperImpl(); manager.add(createComponent() Modified: ace/trunk/org.apache.ace.client.repository/src/org/apache/ace/client/repository/helper/bundle/impl/BundleHelperImpl.java URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.client.repository/src/org/apache/ace/client/repository/helper/bundle/impl/BundleHelperImpl.java?rev=1727499&r1=1727498&r2=1727499&view=diff ============================================================================== --- ace/trunk/org.apache.ace.client.repository/src/org/apache/ace/client/repository/helper/bundle/impl/BundleHelperImpl.java (original) +++ ace/trunk/org.apache.ace.client.repository/src/org/apache/ace/client/repository/helper/bundle/impl/BundleHelperImpl.java Fri Jan 29 08:59:31 2016 @@ -304,7 +304,7 @@ public class BundleHelperImpl implements */ private Map<String, String> extractLocalizedHeaders(ArtifactResource artifact) throws IOException { - Map<String, String> localizedHeaders = new HashMap<String, String>(); + Map<String, String> localizedHeaders = new HashMap<>(); JarInputStream jarInputStream = null; try { jarInputStream = new JarInputStream(artifact.openStream()); @@ -367,7 +367,7 @@ public class BundleHelperImpl implements localizationBaseName = Constants.BUNDLE_LOCALIZATION_DEFAULT_BASENAME; } - List<String> localeEntryNames = new ArrayList<String>(); + List<String> localeEntryNames = new ArrayList<>(); for (Locale locale : MANIFEST_LOCALIZATION_LOCALES) { localeEntryNames.add(localizationBaseName + "_" + locale.toString() + ".properties"); } Modified: ace/trunk/org.apache.ace.client.repository/src/org/apache/ace/client/repository/helper/configuration/impl/Activator.java URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.client.repository/src/org/apache/ace/client/repository/helper/configuration/impl/Activator.java?rev=1727499&r1=1727498&r2=1727499&view=diff ============================================================================== --- ace/trunk/org.apache.ace.client.repository/src/org/apache/ace/client/repository/helper/configuration/impl/Activator.java (original) +++ ace/trunk/org.apache.ace.client.repository/src/org/apache/ace/client/repository/helper/configuration/impl/Activator.java Fri Jan 29 08:59:31 2016 @@ -38,7 +38,7 @@ public class Activator extends Dependenc @Override public void init(BundleContext context, DependencyManager manager) throws Exception { - Dictionary<String, String> props = new Hashtable<String, String>(); + Dictionary<String, String> props = new Hashtable<>(); props.put(ArtifactObject.KEY_MIMETYPE, ConfigurationHelper.MIMETYPE); ConfigurationHelperImpl helperImpl = new ConfigurationHelperImpl(); Modified: ace/trunk/org.apache.ace.client.repository/src/org/apache/ace/client/repository/helper/configuration/impl/ConfigurationHelperImpl.java URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.client.repository/src/org/apache/ace/client/repository/helper/configuration/impl/ConfigurationHelperImpl.java?rev=1727499&r1=1727498&r2=1727499&view=diff ============================================================================== --- ace/trunk/org.apache.ace.client.repository/src/org/apache/ace/client/repository/helper/configuration/impl/ConfigurationHelperImpl.java (original) +++ ace/trunk/org.apache.ace.client.repository/src/org/apache/ace/client/repository/helper/configuration/impl/ConfigurationHelperImpl.java Fri Jan 29 08:59:31 2016 @@ -151,7 +151,7 @@ public class ConfigurationHelperImpl imp } public Map<String, String> extractMetaData(ArtifactResource artifact) throws IllegalArgumentException { - Map<String, String> result = new HashMap<String, String>(); + Map<String, String> result = new HashMap<>(); result.put(ArtifactObject.KEY_PROCESSOR_PID, PROCESSOR); result.put(ArtifactObject.KEY_MIMETYPE, MIMETYPE); String name = new File(artifact.getURL().getFile()).getName(); Modified: ace/trunk/org.apache.ace.client.repository/src/org/apache/ace/client/repository/helper/user/impl/UserHelperImpl.java URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.client.repository/src/org/apache/ace/client/repository/helper/user/impl/UserHelperImpl.java?rev=1727499&r1=1727498&r2=1727499&view=diff ============================================================================== --- ace/trunk/org.apache.ace.client.repository/src/org/apache/ace/client/repository/helper/user/impl/UserHelperImpl.java (original) +++ ace/trunk/org.apache.ace.client.repository/src/org/apache/ace/client/repository/helper/user/impl/UserHelperImpl.java Fri Jan 29 08:59:31 2016 @@ -161,7 +161,7 @@ public class UserHelperImpl implements A } public Map<String, String> extractMetaData(ArtifactResource artifact) throws IllegalArgumentException { - Map<String, String> result = new HashMap<String, String>(); + Map<String, String> result = new HashMap<>(); result.put(ArtifactObject.KEY_PROCESSOR_PID, PROCESSOR); result.put(ArtifactObject.KEY_MIMETYPE, MIMETYPE); String name = new File(artifact.getURL().getFile()).getName(); Modified: ace/trunk/org.apache.ace.client.repository/src/org/apache/ace/client/repository/impl/Activator.java URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.client.repository/src/org/apache/ace/client/repository/impl/Activator.java?rev=1727499&r1=1727498&r2=1727499&view=diff ============================================================================== --- ace/trunk/org.apache.ace.client.repository/src/org/apache/ace/client/repository/impl/Activator.java (original) +++ ace/trunk/org.apache.ace.client.repository/src/org/apache/ace/client/repository/impl/Activator.java Fri Jan 29 08:59:31 2016 @@ -68,7 +68,7 @@ public class Activator extends Dependenc * Small container that keeps the session-related services for us. */ private static final class SessionData { - private final List<Component> m_services = new ArrayList<Component>(); + private final List<Component> m_services = new ArrayList<>(); final void addComponents(DependencyManager manager, Component... comps) { synchronized (m_services) { @@ -103,7 +103,7 @@ public class Activator extends Dependenc private static final String PID = "org.apache.ace.client.repository"; - private final Map<String, SessionData> m_sessions = new HashMap<String, SessionData>(); + private final Map<String, SessionData> m_sessions = new HashMap<>(); private final RepositoryConfigurationImpl m_repoConfiguration = new RepositoryConfigurationImpl(); private volatile DependencyManager m_dependencyManager; Modified: ace/trunk/org.apache.ace.client.repository/src/org/apache/ace/client/repository/impl/ArtifactRepositoryImpl.java URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.client.repository/src/org/apache/ace/client/repository/impl/ArtifactRepositoryImpl.java?rev=1727499&r1=1727498&r2=1727499&view=diff ============================================================================== --- ace/trunk/org.apache.ace.client.repository/src/org/apache/ace/client/repository/impl/ArtifactRepositoryImpl.java (original) +++ ace/trunk/org.apache.ace.client.repository/src/org/apache/ace/client/repository/impl/ArtifactRepositoryImpl.java Fri Jan 29 08:59:31 2016 @@ -68,7 +68,7 @@ public class ArtifactRepositoryImpl exte private volatile LogService m_log; private volatile ConnectionFactory m_connectionFactory; - private final Map<String, ArtifactHelper> m_helpers = new HashMap<String, ArtifactHelper>(); + private final Map<String, ArtifactHelper> m_helpers = new HashMap<>(); public ArtifactRepositoryImpl(ChangeNotifier notifier, RepositoryConfiguration repoConfig) { super(notifier, XML_NODE, repoConfig); @@ -81,7 +81,7 @@ public class ArtifactRepositoryImpl exte catch (InvalidSyntaxException e) { m_log.log(LogService.LOG_ERROR, "getResourceProcessors' filter returned an InvalidSyntaxException.", e); } - return new ArrayList<ArtifactObject>(); + return new ArrayList<>(); } @Override @@ -94,7 +94,7 @@ public class ArtifactRepositoryImpl exte catch (InvalidSyntaxException e) { m_log.log(LogService.LOG_ERROR, "Extending " + filter.toString() + " resulted in an InvalidSyntaxException.", e); } - return new ArrayList<ArtifactObject>(); + return new ArrayList<>(); } @Override @@ -107,7 +107,7 @@ public class ArtifactRepositoryImpl exte catch (InvalidSyntaxException e) { m_log.log(LogService.LOG_ERROR, "get's filter returned an InvalidSyntaxException.", e); } - return new ArrayList<ArtifactObject>(); + return new ArrayList<>(); } @Override @@ -250,7 +250,7 @@ public class ArtifactRepositoryImpl exte } // Package the results in the map. - Map<Class<?>, Object> result = new HashMap<Class<?>, Object>(); + Map<Class<?>, Object> result = new HashMap<>(); result.put(ArtifactRecognizer.class, recognizer); if (mimetype == null) { result.put(ArtifactHelper.class, getHelper(foundMimetype)); @@ -317,7 +317,7 @@ public class ArtifactRepositoryImpl exte ArtifactResource resource = convertToArtifactResource(artifact); Map<String, String> attributes = recognizer.extractMetaData(resource); - Map<String, String> tags = new HashMap<String, String>(); + Map<String, String> tags = new HashMap<>(); helper.checkAttributes(attributes); attributes.put(ArtifactObject.KEY_ARTIFACT_DESCRIPTION, ""); Modified: ace/trunk/org.apache.ace.client.repository/src/org/apache/ace/client/repository/impl/AssociationImpl.java URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.client.repository/src/org/apache/ace/client/repository/impl/AssociationImpl.java?rev=1727499&r1=1727498&r2=1727499&view=diff ============================================================================== --- ace/trunk/org.apache.ace.client.repository/src/org/apache/ace/client/repository/impl/AssociationImpl.java (original) +++ ace/trunk/org.apache.ace.client.repository/src/org/apache/ace/client/repository/impl/AssociationImpl.java Fri Jan 29 08:59:31 2016 @@ -51,8 +51,8 @@ public class AssociationImpl<L extends R /* These lists are volatile, since we use copy-on-write semantics for * updating them. */ - private volatile List<L> m_left = new ArrayList<L>(); - private volatile List<R> m_right = new ArrayList<R>(); + private volatile List<L> m_left = new ArrayList<>(); + private volatile List<R> m_right = new ArrayList<>(); private final Object m_lock = new Object(); private final Filter m_filterLeft; @@ -138,11 +138,11 @@ public class AssociationImpl<L extends R } public List<L> getLeft() { - return new ArrayList<L>(m_left); + return new ArrayList<>(m_left); } public List<R> getRight() { - return new ArrayList<R>(m_right); + return new ArrayList<>(m_right); } public void remove() { @@ -179,8 +179,8 @@ public class AssociationImpl<L extends R } } - List<TYPE> oldEndpoints = new ArrayList<TYPE>(endpoints); - List<TYPE> newEndpoints = new ArrayList<TYPE>(); + List<TYPE> oldEndpoints = new ArrayList<>(endpoints); + List<TYPE> newEndpoints = new ArrayList<>(); for (int i = 0; (i < cardinality) && !candidates.isEmpty(); i++) { TYPE current = candidates.remove(0); newEndpoints.add(current); @@ -204,8 +204,8 @@ public class AssociationImpl<L extends R List<L> newEndpoints = locateEndpoint(m_leftRepository, m_filterLeft, m_left, (getAttribute(LEFT_CARDINALITY) == null ? 1 : Integer.parseInt(getAttribute(LEFT_CARDINALITY))), m_rightClass, notify); if (!newEndpoints.equals(m_left)) { if (notify) { - List<L> oldEndpoints = new ArrayList<L>(m_left); - m_left = new ArrayList<L>(newEndpoints); + List<L> oldEndpoints = new ArrayList<>(m_left); + m_left = new ArrayList<>(newEndpoints); Properties props = new Properties(); props.put(EVENT_OLD, oldEndpoints); props.put(EVENT_NEW, newEndpoints); @@ -228,8 +228,8 @@ public class AssociationImpl<L extends R List<R> newEndpoints = locateEndpoint(m_rightRepository, m_filterRight, m_right, (getAttribute(RIGHT_CARDINALITY) == null ? 1 : Integer.parseInt(getAttribute(RIGHT_CARDINALITY))), m_leftClass, notify); if (!newEndpoints.equals(m_right)) { if (notify) { - List<R> oldEndpoints = new ArrayList<R>(m_right); - m_right = new ArrayList<R>(newEndpoints); + List<R> oldEndpoints = new ArrayList<>(m_right); + m_right = new ArrayList<>(newEndpoints); Properties props = new Properties(); props.put(EVENT_OLD, oldEndpoints); props.put(EVENT_NEW, newEndpoints); Modified: ace/trunk/org.apache.ace.client.repository/src/org/apache/ace/client/repository/impl/AssociationRepositoryImpl.java URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.client.repository/src/org/apache/ace/client/repository/impl/AssociationRepositoryImpl.java?rev=1727499&r1=1727498&r2=1727499&view=diff ============================================================================== --- ace/trunk/org.apache.ace.client.repository/src/org/apache/ace/client/repository/impl/AssociationRepositoryImpl.java (original) +++ ace/trunk/org.apache.ace.client.repository/src/org/apache/ace/client/repository/impl/AssociationRepositoryImpl.java Fri Jan 29 08:59:31 2016 @@ -53,7 +53,7 @@ public abstract class AssociationReposit synchronized (m_lock) { T association = null; try { - Map<String, String> attributes = new HashMap<String, String>(); + Map<String, String> attributes = new HashMap<>(); attributes.put(Association.LEFT_ENDPOINT, left); attributes.put(Association.RIGHT_ENDPOINT, right); attributes.put(Association.LEFT_CARDINALITY, "" + leftCardinality); Modified: ace/trunk/org.apache.ace.client.repository/src/org/apache/ace/client/repository/impl/DeploymentArtifactImpl.java URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.client.repository/src/org/apache/ace/client/repository/impl/DeploymentArtifactImpl.java?rev=1727499&r1=1727498&r2=1727499&view=diff ============================================================================== --- ace/trunk/org.apache.ace.client.repository/src/org/apache/ace/client/repository/impl/DeploymentArtifactImpl.java (original) +++ ace/trunk/org.apache.ace.client.repository/src/org/apache/ace/client/repository/impl/DeploymentArtifactImpl.java Fri Jan 29 08:59:31 2016 @@ -38,7 +38,7 @@ public class DeploymentArtifactImpl impl private final String m_url; private final long m_size; - private final Map<String, String> m_directives = new HashMap<String, String>(); + private final Map<String, String> m_directives = new HashMap<>(); /** * Creates a new DeploymentArtifactImpl. Modified: ace/trunk/org.apache.ace.client.repository/src/org/apache/ace/client/repository/impl/DeploymentVersionObjectImpl.java URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.client.repository/src/org/apache/ace/client/repository/impl/DeploymentVersionObjectImpl.java?rev=1727499&r1=1727498&r2=1727499&view=diff ============================================================================== --- ace/trunk/org.apache.ace.client.repository/src/org/apache/ace/client/repository/impl/DeploymentVersionObjectImpl.java (original) +++ ace/trunk/org.apache.ace.client.repository/src/org/apache/ace/client/repository/impl/DeploymentVersionObjectImpl.java Fri Jan 29 08:59:31 2016 @@ -106,7 +106,7 @@ public class DeploymentVersionObjectImpl @Override protected void readCustom(HierarchicalStreamReader reader) { - List<DeploymentArtifact> result = new ArrayList<DeploymentArtifact>(); + List<DeploymentArtifact> result = new ArrayList<>(); reader.moveDown(); while (reader.hasMoreChildren()) { reader.moveDown(); Modified: ace/trunk/org.apache.ace.client.repository/src/org/apache/ace/client/repository/impl/DeploymentVersionRepositoryImpl.java URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.client.repository/src/org/apache/ace/client/repository/impl/DeploymentVersionRepositoryImpl.java?rev=1727499&r1=1727498&r2=1727499&view=diff ============================================================================== --- ace/trunk/org.apache.ace.client.repository/src/org/apache/ace/client/repository/impl/DeploymentVersionRepositoryImpl.java (original) +++ ace/trunk/org.apache.ace.client.repository/src/org/apache/ace/client/repository/impl/DeploymentVersionRepositoryImpl.java Fri Jan 29 08:59:31 2016 @@ -86,7 +86,7 @@ public class DeploymentVersionRepository } catch (InvalidSyntaxException e) { // Too bad, probably an illegal targetID. - result = new ArrayList<DeploymentVersionObject>(); + result = new ArrayList<>(); } return result; } @@ -131,12 +131,12 @@ public class DeploymentVersionRepository * @return an index of deployment versions (sorted!) per target, never <code>null</code>. */ private Map<String, SortedSet<DeploymentVersionObject>> createDeploymentVersionIndex() { - Map<String, SortedSet<DeploymentVersionObject>> index = new HashMap<String, SortedSet<DeploymentVersionObject>>(); + Map<String, SortedSet<DeploymentVersionObject>> index = new HashMap<>(); for (DeploymentVersionObject dvo : get()) { SortedSet<DeploymentVersionObject> versions = index.get(dvo.getTargetID()); if (versions == null) { // store all DeploymentVersions in ascending order (oldest version first)... - versions = new TreeSet<DeploymentVersionObject>(this.versionComparator); + versions = new TreeSet<>(this.versionComparator); index.put(dvo.getTargetID(), versions); } versions.add(dvo); Modified: ace/trunk/org.apache.ace.client.repository/src/org/apache/ace/client/repository/impl/ObjectRepositoryImpl.java URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.client.repository/src/org/apache/ace/client/repository/impl/ObjectRepositoryImpl.java?rev=1727499&r1=1727498&r2=1727499&view=diff ============================================================================== --- ace/trunk/org.apache.ace.client.repository/src/org/apache/ace/client/repository/impl/ObjectRepositoryImpl.java (original) +++ ace/trunk/org.apache.ace.client.repository/src/org/apache/ace/client/repository/impl/ObjectRepositoryImpl.java Fri Jan 29 08:59:31 2016 @@ -54,8 +54,8 @@ abstract class ObjectRepositoryImpl<I ex // for thread-safety protected final ReadWriteLock m_lock = new ReentrantReadWriteLock(); - private final List<T> m_repo = new ArrayList<T>(); - private final Map<String, T> m_index = new HashMap<String, T>(); + private final List<T> m_repo = new ArrayList<>(); + private final Map<String, T> m_index = new HashMap<>(); private final ChangeNotifier m_notifier; private final String m_xmlNode; private final RepositoryConfiguration m_repoConfig; @@ -96,7 +96,7 @@ abstract class ObjectRepositoryImpl<I ex Lock readLock = m_lock.readLock(); readLock.lock(); try { - return new ArrayList<T>(m_repo); + return new ArrayList<>(m_repo); } finally { readLock.unlock(); @@ -107,7 +107,7 @@ abstract class ObjectRepositoryImpl<I ex Lock readLock = m_lock.readLock(); readLock.lock(); try { - List<T> result = new ArrayList<T>(); + List<T> result = new ArrayList<>(); for (T entry : m_repo) { if (filter.matchCase(entry.getDictionary())) { result.add(entry); Modified: ace/trunk/org.apache.ace.client.repository/src/org/apache/ace/client/repository/impl/RepositoryAdminImpl.java URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.client.repository/src/org/apache/ace/client/repository/impl/RepositoryAdminImpl.java?rev=1727499&r1=1727498&r2=1727499&view=diff ============================================================================== --- ace/trunk/org.apache.ace.client.repository/src/org/apache/ace/client/repository/impl/RepositoryAdminImpl.java (original) +++ ace/trunk/org.apache.ace.client.repository/src/org/apache/ace/client/repository/impl/RepositoryAdminImpl.java Fri Jan 29 08:59:31 2016 @@ -125,7 +125,7 @@ public class RepositoryAdminImpl impleme public RepositoryAdminImpl(String sessionID, RepositoryConfiguration repoConfig) { m_sessionID = sessionID; m_repositoryConfig = repoConfig; - m_preCommitMembers = new ArrayList<PreCommitMember>(); + m_preCommitMembers = new ArrayList<>(); m_sessionProps = new Properties(); m_sessionProps.put(SessionFactory.SERVICE_SID, sessionID); m_changeNotifierManager = new ChangeNotifierManager(); @@ -210,7 +210,7 @@ public class RepositoryAdminImpl impleme m_dm.add(artifactRepoService); m_dm.add(artifactHandlerService); - m_services = new ArrayList<Component[]>(); + m_services = new ArrayList<>(); m_services.add(new Component[] { artifactRepoService, artifactHandlerService }); // register all repositories are services. Keep the service objects around, we need them to pull the services @@ -227,7 +227,7 @@ public class RepositoryAdminImpl impleme m_services.add(registerRepository(DeploymentVersionRepository.class, m_deploymentVersionRepositoryImpl, new String[] {})); // prepare the results. - Map<Class<? extends ObjectRepository>, ObjectRepositoryImpl> result = new HashMap<Class<? extends ObjectRepository>, ObjectRepositoryImpl>(); + Map<Class<? extends ObjectRepository>, ObjectRepositoryImpl> result = new HashMap<>(); result.put(ArtifactRepository.class, m_artifactRepositoryImpl); result.put(Artifact2FeatureAssociationRepository.class, m_artifact2FeatureAssociationRepositoryImpl); Modified: ace/trunk/org.apache.ace.client.repository/src/org/apache/ace/client/repository/impl/RepositoryAdminLoginContextImpl.java URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.client.repository/src/org/apache/ace/client/repository/impl/RepositoryAdminLoginContextImpl.java?rev=1727499&r1=1727498&r2=1727499&view=diff ============================================================================== --- ace/trunk/org.apache.ace.client.repository/src/org/apache/ace/client/repository/impl/RepositoryAdminLoginContextImpl.java (original) +++ ace/trunk/org.apache.ace.client.repository/src/org/apache/ace/client/repository/impl/RepositoryAdminLoginContextImpl.java Fri Jan 29 08:59:31 2016 @@ -40,7 +40,7 @@ public class RepositoryAdminLoginContext private final String m_sessionid; private final User m_user; - private final List<RepositorySetDescriptor> m_descriptors = new ArrayList<RepositorySetDescriptor>(); + private final List<RepositorySetDescriptor> m_descriptors = new ArrayList<>(); RepositoryAdminLoginContextImpl(User user, String sessionid) { m_user = user; @@ -99,7 +99,7 @@ public class RepositoryAdminLoginContext public List<RepositorySetDescriptor> getDescriptors() { List<RepositorySetDescriptor> result; synchronized (m_descriptors) { - result = new ArrayList<RepositorySetDescriptor>(m_descriptors); + result = new ArrayList<>(m_descriptors); } return result; } @@ -119,8 +119,8 @@ public class RepositoryAdminLoginContext * the to-be-added repository set descriptor, cannot be <code>null</code>. */ private void checkConsistency(RepositorySetDescriptor descriptor) { - List<Class<? extends ObjectRepository>> seenClasses = new ArrayList<Class<? extends ObjectRepository>>(); - List<String> seenNames = new ArrayList<String>(); + List<Class<? extends ObjectRepository>> seenClasses = new ArrayList<>(); + List<String> seenNames = new ArrayList<>(); // Presumption: initially we start out without any duplication... for (RepositorySetDescriptor rsd : getDescriptors()) { Modified: ace/trunk/org.apache.ace.client.repository/src/org/apache/ace/client/repository/impl/RepositoryObjectImpl.java URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.client.repository/src/org/apache/ace/client/repository/impl/RepositoryObjectImpl.java?rev=1727499&r1=1727498&r2=1727499&view=diff ============================================================================== --- ace/trunk/org.apache.ace.client.repository/src/org/apache/ace/client/repository/impl/RepositoryObjectImpl.java (original) +++ ace/trunk/org.apache.ace.client.repository/src/org/apache/ace/client/repository/impl/RepositoryObjectImpl.java Fri Jan 29 08:59:31 2016 @@ -49,11 +49,11 @@ import com.thoughtworks.xstream.io.Hiera * filter. */ public class RepositoryObjectImpl<T extends RepositoryObject> extends Dictionary<String, Object> implements RepositoryObject, EventHandler { - private final Map<String, String> m_attributes = new HashMap<String, String>(); - private final Map<String, String> m_tags = new HashMap<String, String>(); + private final Map<String, String> m_attributes = new HashMap<>(); + private final Map<String, String> m_tags = new HashMap<>(); /** see ACE-463 */ - private final Set<String> m_mergedAttrTags = new HashSet<String>(); - private final Map<Class, List<Association>> m_associations = new HashMap<Class, List<Association>>(); + private final Set<String> m_mergedAttrTags = new HashSet<>(); + private final Map<Class, List<Association>> m_associations = new HashMap<>(); private final ChangeNotifier m_notifier; private final String m_xmlNode; private static final Pattern VALID_KEY_PATTERN = Pattern.compile("[a-zA-Z]([a-zA-Z0-9_:.-])*"); @@ -291,7 +291,7 @@ public class RepositoryObjectImpl<T exte public Enumeration<String> getAttributeKeys() { synchronized (m_attributes) { - return new KeysEnumeration(new HashSet<String>(m_attributes.keySet()).iterator()); + return new KeysEnumeration(new HashSet<>(m_attributes.keySet()).iterator()); } } @@ -301,7 +301,7 @@ public class RepositoryObjectImpl<T exte public Enumeration<String> getTagKeys() { synchronized (m_attributes) { - return new KeysEnumeration(new HashSet<String>(m_tags.keySet()).iterator()); + return new KeysEnumeration(new HashSet<>(m_tags.keySet()).iterator()); } } @@ -309,7 +309,7 @@ public class RepositoryObjectImpl<T exte synchronized (m_associations) { List<Association> associations = m_associations.get(clazz); if (associations == null) { - associations = new ArrayList<Association>(); + associations = new ArrayList<>(); m_associations.put(clazz, associations); } associations.add(association); @@ -327,7 +327,7 @@ public class RepositoryObjectImpl<T exte public <A extends Associatable> List<A> getAssociations(Class<A> clazz) { synchronized (m_associations) { - List<A> result = new ArrayList<A>(); + List<A> result = new ArrayList<>(); List<Association> associations = m_associations.get(clazz); if (associations != null) { for (Association association : associations) { @@ -362,7 +362,7 @@ public class RepositoryObjectImpl<T exte @SuppressWarnings("unchecked") public <TA extends Associatable, A extends Association> List<A> getAssociationsWith(Associatable other, Class<TA> clazz, Class<A> associationType) { - List<A> result = new ArrayList<A>(); + List<A> result = new ArrayList<>(); synchronized (m_associations) { if (other == null) { return result; @@ -476,7 +476,7 @@ public class RepositoryObjectImpl<T exte static Map<String, String> readMap(HierarchicalStreamReader reader) { reader.moveDown(); - Map<String, String> result = new HashMap<String, String>(); + Map<String, String> result = new HashMap<>(); while (reader.hasMoreChildren()) { reader.moveDown(); result.put(reader.getNodeName(), reader.getValue()); Modified: ace/trunk/org.apache.ace.client.repository/src/org/apache/ace/client/repository/impl/RepositoryPropertyResolver.java URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.client.repository/src/org/apache/ace/client/repository/impl/RepositoryPropertyResolver.java?rev=1727499&r1=1727498&r2=1727499&view=diff ============================================================================== --- ace/trunk/org.apache.ace.client.repository/src/org/apache/ace/client/repository/impl/RepositoryPropertyResolver.java (original) +++ ace/trunk/org.apache.ace.client.repository/src/org/apache/ace/client/repository/impl/RepositoryPropertyResolver.java Fri Jan 29 08:59:31 2016 @@ -84,7 +84,7 @@ public class RepositoryPropertyResolver else if (ob instanceof FeatureObject) { return ((FeatureObject) ob).getArtifacts(); } - return new ArrayList<RepositoryObject>(); + return new ArrayList<>(); } private String findKeyInObject(RepositoryObject ro, String key) { Modified: ace/trunk/org.apache.ace.client.repository/src/org/apache/ace/client/repository/impl/RepositorySerializer.java URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.client.repository/src/org/apache/ace/client/repository/impl/RepositorySerializer.java?rev=1727499&r1=1727498&r2=1727499&view=diff ============================================================================== --- ace/trunk/org.apache.ace.client.repository/src/org/apache/ace/client/repository/impl/RepositorySerializer.java (original) +++ ace/trunk/org.apache.ace.client.repository/src/org/apache/ace/client/repository/impl/RepositorySerializer.java Fri Jan 29 08:59:31 2016 @@ -39,7 +39,7 @@ import com.thoughtworks.xstream.io.Hiera * xstream's writer in a delegate object, so this will not require changes to the repositories and objects. */ class RepositorySerializer implements Converter { - private final Map<String, ObjectRepositoryImpl> m_tagToRepo = new HashMap<String, ObjectRepositoryImpl>(); + private final Map<String, ObjectRepositoryImpl> m_tagToRepo = new HashMap<>(); private final RepositorySet m_set; Modified: ace/trunk/org.apache.ace.client.repository/src/org/apache/ace/client/repository/impl/RepositorySet.java URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.client.repository/src/org/apache/ace/client/repository/impl/RepositorySet.java?rev=1727499&r1=1727498&r2=1727499&view=diff ============================================================================== --- ace/trunk/org.apache.ace.client.repository/src/org/apache/ace/client/repository/impl/RepositorySet.java (original) +++ ace/trunk/org.apache.ace.client.repository/src/org/apache/ace/client/repository/impl/RepositorySet.java Fri Jan 29 08:59:31 2016 @@ -81,7 +81,7 @@ class RepositorySet { * </ul> */ RepositorySet(ChangeNotifier notifier, LogService log, User user, Preferences prefs, ObjectRepositoryImpl[] repos, CachedRepository repository, String name, boolean writeAccess) { - m_workingState = new ConcurrentHashMap<RepositoryObject, WorkingState>(); + m_workingState = new ConcurrentHashMap<>(); m_notifier = notifier; m_log = log; m_user = user; @@ -151,7 +151,7 @@ class RepositorySet { @SuppressWarnings("unchecked") void loadPreferences() { Preferences workingNode = m_prefs.node(PREFS_LOCAL_WORKING_STATE); - Map<String, WorkingState> entries = new HashMap<String, WorkingState>(); + Map<String, WorkingState> entries = new HashMap<>(); // First, get all nodes and their workingstate. try { String defaultWorkingState = WorkingState.Unchanged.toString(); @@ -281,7 +281,7 @@ class RepositorySet { if (m_modifiedHandler != null) { throw new IllegalStateException("A handler is already registered; only one can be used at a time."); } - Dictionary<String, Object> topic = new Hashtable<String, Object>(); + Dictionary<String, Object> topic = new Hashtable<>(); topic.put(EventConstants.EVENT_TOPIC, topics); topic.put(EventConstants.EVENT_FILTER, "(" + SessionFactory.SERVICE_SID + "=" + sessionID + ")"); m_modifiedHandler = context.registerService(EventHandler.class.getName(), new ModifiedHandler(), topic); Modified: ace/trunk/org.apache.ace.client.repository/src/org/apache/ace/client/repository/impl/TargetPropertyResolver.java URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.client.repository/src/org/apache/ace/client/repository/impl/TargetPropertyResolver.java?rev=1727499&r1=1727498&r2=1727499&view=diff ============================================================================== --- ace/trunk/org.apache.ace.client.repository/src/org/apache/ace/client/repository/impl/TargetPropertyResolver.java (original) +++ ace/trunk/org.apache.ace.client.repository/src/org/apache/ace/client/repository/impl/TargetPropertyResolver.java Fri Jan 29 08:59:31 2016 @@ -36,7 +36,7 @@ public class TargetPropertyResolver exte @SuppressWarnings("unchecked") public Collection<PropertyResolver> getDistributions() { - List<PropertyResolver> list = new ArrayList<PropertyResolver>(); + List<PropertyResolver> list = new ArrayList<>(); List<RepositoryObject> distributions = (List<RepositoryObject>) getChildren(); @@ -48,9 +48,9 @@ public class TargetPropertyResolver exte } public Collection<PropertyResolver> getFeatures() { - List<PropertyResolver> list = new ArrayList<PropertyResolver>(); + List<PropertyResolver> list = new ArrayList<>(); - Set<RepositoryObject> features = new HashSet<RepositoryObject>(); + Set<RepositoryObject> features = new HashSet<>(); for (RepositoryObject repositoryObject : getChildren()) { features.addAll(getChildren(repositoryObject)); @@ -63,10 +63,10 @@ public class TargetPropertyResolver exte } public Collection<PropertyResolver> getArtifacts() { - List<PropertyResolver> list = new ArrayList<PropertyResolver>(); + List<PropertyResolver> list = new ArrayList<>(); - Set<RepositoryObject> artifacts = new HashSet<RepositoryObject>(); - Set<RepositoryObject> features = new HashSet<RepositoryObject>(); + Set<RepositoryObject> artifacts = new HashSet<>(); + Set<RepositoryObject> features = new HashSet<>(); for (RepositoryObject repositoryObject : getChildren()) { features.addAll(getChildren(repositoryObject)); Modified: ace/trunk/org.apache.ace.client.repository/src/org/apache/ace/client/repository/stateful/impl/StatefulTargetObjectImpl.java URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.client.repository/src/org/apache/ace/client/repository/stateful/impl/StatefulTargetObjectImpl.java?rev=1727499&r1=1727498&r2=1727499&view=diff ============================================================================== --- ace/trunk/org.apache.ace.client.repository/src/org/apache/ace/client/repository/stateful/impl/StatefulTargetObjectImpl.java (original) +++ ace/trunk/org.apache.ace.client.repository/src/org/apache/ace/client/repository/stateful/impl/StatefulTargetObjectImpl.java Fri Jan 29 08:59:31 2016 @@ -55,9 +55,9 @@ public class StatefulTargetObjectImpl im private final StatefulTargetRepositoryImpl m_repository; private final Object m_lock = new Object(); private TargetObject m_targetObject; - private List<Descriptor> m_processedAuditEvents = new ArrayList<Descriptor>(); + private List<Descriptor> m_processedAuditEvents = new ArrayList<>(); private Map<String, String> m_processedTargetProperties; - private Map<String, String> m_attributes = new HashMap<String, String>(); + private Map<String, String> m_attributes = new HashMap<>(); /** This boolean is used to suppress STATUS_CHANGED events during the creation of the object. */ private boolean m_inConstructor = true; /** Boolean to ensure we don't recursively enter the determineProvisioningState() method. */ @@ -248,7 +248,7 @@ public class StatefulTargetObjectImpl im private void determineStoreState(DeploymentVersionObject deploymentVersionObject) { synchronized (m_lock) { - SortedSet<String> fromShop = new TreeSet<String>(); + SortedSet<String> fromShop = new TreeSet<>(); ArtifactObject[] artifactsFromShop = m_repository.getNecessaryArtifacts(getID()); DeploymentVersionObject mostRecentVersion; if (deploymentVersionObject == null) { @@ -271,7 +271,7 @@ public class StatefulTargetObjectImpl im fromShop.add(ao.getURL()); } - SortedSet<String> fromDeployment = new TreeSet<String>(); + SortedSet<String> fromDeployment = new TreeSet<>(); for (DeploymentArtifact da : getArtifactsFromDeployment()) { fromDeployment.add(da.getDirective(DeploymentArtifact.DIRECTIVE_KEY_BASEURL)); } @@ -390,7 +390,7 @@ public class StatefulTargetObjectImpl im m_processedTargetProperties = null; // clear "old" tags starting with the prefix Enumeration<String> keys = m_targetObject.getTagKeys(); - ArrayList<String> keysToDelete = new ArrayList<String>(); + ArrayList<String> keysToDelete = new ArrayList<>(); while (keys.hasMoreElements()) { String key = keys.nextElement(); if (key.startsWith(TARGETPROPERTIES_PREFIX)) { @@ -567,7 +567,7 @@ public class StatefulTargetObjectImpl im public Enumeration<String> getAttributeKeys() { synchronized (m_lock) { - List<String> statusKeys = new ArrayList<String>(); + List<String> statusKeys = new ArrayList<>(); for (String s : KEYS_ALL) { statusKeys.add(s); } @@ -575,7 +575,7 @@ public class StatefulTargetObjectImpl im if (m_targetObject != null) { attributeKeys = m_targetObject.getAttributeKeys(); } - return new ExtendedEnumeration<String>(attributeKeys, statusKeys, true); + return new ExtendedEnumeration<>(attributeKeys, statusKeys, true); } } @@ -710,7 +710,7 @@ public class StatefulTargetObjectImpl im @Override public Enumeration<Object> elements() { - List<Object> statusVals = new ArrayList<Object>(); + List<Object> statusVals = new ArrayList<>(); for (String key : KEYS_ALL) { statusVals.add(getStatusAttribute(key)); } @@ -718,7 +718,7 @@ public class StatefulTargetObjectImpl im if (m_dict != null) { attributeVals = m_dict.elements(); } - return new ExtendedEnumeration<Object>(attributeVals, statusVals, true); + return new ExtendedEnumeration<>(attributeVals, statusVals, true); } @Override @@ -753,7 +753,7 @@ public class StatefulTargetObjectImpl im @Override public Enumeration<String> keys() { - List<String> statusKeys = new ArrayList<String>(); + List<String> statusKeys = new ArrayList<>(); for (String key : KEYS_ALL) { statusKeys.add(key); } @@ -761,7 +761,7 @@ public class StatefulTargetObjectImpl im if (m_dict != null) { attributeKeys = m_dict.keys(); } - return new ExtendedEnumeration<String>(attributeKeys, statusKeys, false); + return new ExtendedEnumeration<>(attributeKeys, statusKeys, false); } @Override @@ -794,7 +794,6 @@ public class StatefulTargetObjectImpl im return Integer.MAX_VALUE; } - @SuppressWarnings("rawtypes") public Comparator getComparator() { return null; } Modified: ace/trunk/org.apache.ace.client.repository/src/org/apache/ace/client/repository/stateful/impl/StatefulTargetRepositoryImpl.java URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.client.repository/src/org/apache/ace/client/repository/stateful/impl/StatefulTargetRepositoryImpl.java?rev=1727499&r1=1727498&r2=1727499&view=diff ============================================================================== --- ace/trunk/org.apache.ace.client.repository/src/org/apache/ace/client/repository/stateful/impl/StatefulTargetRepositoryImpl.java (original) +++ ace/trunk/org.apache.ace.client.repository/src/org/apache/ace/client/repository/stateful/impl/StatefulTargetRepositoryImpl.java Fri Jan 29 08:59:31 2016 @@ -79,8 +79,8 @@ public class StatefulTargetRepositoryImp private LogService m_log; /* Injected by dependency manager */ private BundleHelper m_bundleHelper; /* Injected by dependency manager */ // TODO: Make the concurrencyLevel of this concurrent hashmap settable? - private Map<String, StatefulTargetObjectImpl> m_repository = new ConcurrentHashMap<String, StatefulTargetObjectImpl>(); - private Map<String, StatefulTargetObjectImpl> m_index = new ConcurrentHashMap<String, StatefulTargetObjectImpl>(); + private Map<String, StatefulTargetObjectImpl> m_repository = new ConcurrentHashMap<>(); + private Map<String, StatefulTargetObjectImpl> m_index = new ConcurrentHashMap<>(); private final String m_sessionID; private final RepositoryConfiguration m_repoConfig; @@ -98,7 +98,7 @@ public class StatefulTargetRepositoryImp public List<StatefulTargetObject> get() { synchronized (m_repository) { - List<StatefulTargetObject> result = new ArrayList<StatefulTargetObject>(); + List<StatefulTargetObject> result = new ArrayList<>(); for (StatefulTargetObjectImpl sgoi : m_repository.values()) { result.add(sgoi); } @@ -108,7 +108,7 @@ public class StatefulTargetRepositoryImp public List<StatefulTargetObject> get(Filter filter) { synchronized (m_repository) { - List<StatefulTargetObject> result = new ArrayList<StatefulTargetObject>(); + List<StatefulTargetObject> result = new ArrayList<>(); for (StatefulTargetObject entry : m_repository.values()) { if (filter.matchCase(entry.getDictionary())) { result.add(entry); @@ -273,7 +273,7 @@ public class StatefulTargetRepositoryImp * @return A list of LogDescriptors, in no particular order. */ List<Descriptor> getAllDescriptors(String targetID) { - List<Descriptor> result = new ArrayList<Descriptor>(); + List<Descriptor> result = new ArrayList<>(); try { List<Descriptor> descriptors = m_auditLogStore.getDescriptors(targetID); if (descriptors != null) { @@ -300,7 +300,7 @@ public class StatefulTargetRepositoryImp */ List<Event> getAuditEvents(List<Descriptor> events) { // Get all events from the audit log store, if possible. - List<Event> result = new ArrayList<Event>(); + List<Event> result = new ArrayList<>(); for (Descriptor l : events) { try { result.addAll(m_auditLogStore.get(l)); @@ -316,7 +316,7 @@ public class StatefulTargetRepositoryImp } List<Descriptor> diffLogDescriptorLists(List<Descriptor> all, List<Descriptor> seen) { - List<Descriptor> descriptors = new ArrayList<Descriptor>(); + List<Descriptor> descriptors = new ArrayList<>(); // Find out what events should be returned for (Descriptor s : all) { @@ -347,9 +347,9 @@ public class StatefulTargetRepositoryImp * A string representing the ID of the new target. */ void register(String targetID) { - Map<String, String> attr = new HashMap<String, String>(); + Map<String, String> attr = new HashMap<>(); attr.put(TargetObject.KEY_ID, targetID); - Map<String, String> tags = new HashMap<String, String>(); + Map<String, String> tags = new HashMap<>(); m_targetRepository.create(attr, tags); getStatefulTargetObject(targetID).updateTargetObject(false); } @@ -393,7 +393,7 @@ public class StatefulTargetRepositoryImp */ private void populate() { synchronized (m_repository) { - List<StatefulTargetObjectImpl> touched = new ArrayList<StatefulTargetObjectImpl>(); + List<StatefulTargetObjectImpl> touched = new ArrayList<>(); touched.addAll(parseTargetRepository()); if (isShowUnregisteredTargets()) { touched.addAll(parseAuditLog()); @@ -401,7 +401,7 @@ public class StatefulTargetRepositoryImp // Now, it is possible we have not touched all objects. Find out which these are, and make // them check whether they should still exist. - List<StatefulTargetObjectImpl> all = new ArrayList<StatefulTargetObjectImpl>(m_repository.values()); + List<StatefulTargetObjectImpl> all = new ArrayList<>(m_repository.values()); all.removeAll(touched); for (StatefulTargetObjectImpl stoi : all) { stoi.updateTargetObject(false); @@ -426,7 +426,7 @@ public class StatefulTargetRepositoryImp * @return A list of all the target objects that have been touched by this action. */ private List<StatefulTargetObjectImpl> parseTargetRepository() { - List<StatefulTargetObjectImpl> result = new ArrayList<StatefulTargetObjectImpl>(); + List<StatefulTargetObjectImpl> result = new ArrayList<>(); for (TargetObject to : m_targetRepository.get()) { StatefulTargetObjectImpl stoi = getStatefulTargetObject(to.getID()); if (stoi == null) { @@ -447,7 +447,7 @@ public class StatefulTargetRepositoryImp * states whether the objects which are 'touched' by this actions should verify their existence. */ private List<StatefulTargetObjectImpl> parseAuditLog() { - List<StatefulTargetObjectImpl> result = new ArrayList<StatefulTargetObjectImpl>(); + List<StatefulTargetObjectImpl> result = new ArrayList<>(); List<Descriptor> descriptors = null; try { descriptors = m_auditLogStore.getDescriptors(); @@ -460,7 +460,7 @@ public class StatefulTargetRepositoryImp return result; } - Set<String> targetIDs = new HashSet<String>(); + Set<String> targetIDs = new HashSet<>(); for (Descriptor l : descriptors) { targetIDs.add(l.getTargetID()); } @@ -521,10 +521,10 @@ public class StatefulTargetRepositoryImp DeploymentArtifact[] getNecessaryDeploymentArtifacts(String targetID, String version) throws IOException { TargetObject to = getTargetObject(targetID); - Map<ArtifactObject, String> bundles = new HashMap<ArtifactObject, String>(); - Map<ArtifactObject, String> artifacts = new HashMap<ArtifactObject, String>(); + Map<ArtifactObject, String> bundles = new HashMap<>(); + Map<ArtifactObject, String> artifacts = new HashMap<>(); Map<ArtifactObject, Map<FeatureObject, List<DistributionObject>>> path = - new HashMap<ArtifactObject, Map<FeatureObject, List<DistributionObject>>>(); + new HashMap<>(); // First, find all basic bundles and artifacts. An while we're traversing the // tree of objects, build the tree of properties. @@ -540,12 +540,12 @@ public class StatefulTargetRepositoryImp } Map<FeatureObject, List<DistributionObject>> featureToDistribution = path.get(artifact); if (featureToDistribution == null) { - featureToDistribution = new HashMap<FeatureObject, List<DistributionObject>>(); + featureToDistribution = new HashMap<>(); path.put(artifact, featureToDistribution); } List<DistributionObject> distributions = featureToDistribution.get(feature); if (distributions == null) { - distributions = new ArrayList<DistributionObject>(); + distributions = new ArrayList<>(); featureToDistribution.put(feature, distributions); } distributions.add(distribution); @@ -569,10 +569,10 @@ public class StatefulTargetRepositoryImp } } - List<DeploymentArtifact> result = new ArrayList<DeploymentArtifact>(); + List<DeploymentArtifact> result = new ArrayList<>(); for (ArtifactObject bundle : bundles.keySet()) { - Map<String, String> directives = new HashMap<String, String>(); + Map<String, String> directives = new HashMap<>(); if (m_bundleHelper.isResourceProcessor(bundle)) { // it's a resource processor, mark it as such. directives.put(DeploymentArtifact.DIRECTIVE_ISCUSTOMIZER, "true"); @@ -594,7 +594,7 @@ public class StatefulTargetRepositoryImp } for (ArtifactObject artifact : artifacts.keySet()) { - Map<String, String> directives = new HashMap<String, String>(); + Map<String, String> directives = new HashMap<>(); directives.put(DeploymentArtifact.DIRECTIVE_KEY_PROCESSORID, artifact.getProcessorPID()); directives.put(DeploymentArtifact.DIRECTIVE_KEY_BASEURL, artifact.getURL()); if (artifact.getResourceId() != null) { @@ -619,7 +619,7 @@ public class StatefulTargetRepositoryImp * @return a map of all resource processors, indexed by processor ID */ private Map<String, ArtifactObject> getAllProcessors() { - Map<String, ArtifactObject> allProcessors = new HashMap<String, ArtifactObject>(); + Map<String, ArtifactObject> allProcessors = new HashMap<>(); for (ArtifactObject processorBundle : m_artifactRepository.getResourceProcessors()) { String pid = m_bundleHelper.getResourceProcessorPIDs(processorBundle); ArtifactObject existingProcessorBundle = allProcessors.get(pid); @@ -664,7 +664,7 @@ public class StatefulTargetRepositoryImp */ // TODO this method strongly resembles part of getNecessaryDeploymentArtifacts(), merge code?! ArtifactObject[] getNecessaryArtifacts(String targetID) { - List<ArtifactObject> result = new ArrayList<ArtifactObject>(); + List<ArtifactObject> result = new ArrayList<>(); TargetObject to = getTargetObject(targetID); Map<String, ArtifactObject> allProcessors = getAllProcessors(); @@ -706,9 +706,9 @@ public class StatefulTargetRepositoryImp * When there is a problem determining the artifacts to be deployed. */ DeploymentVersionObject generateDeploymentVersion(String targetID) throws IOException { - Map<String, String> attr = new HashMap<String, String>(); + Map<String, String> attr = new HashMap<>(); attr.put(DeploymentVersionObject.KEY_TARGETID, targetID); - Map<String, String> tags = new HashMap<String, String>(); + Map<String, String> tags = new HashMap<>(); DeploymentVersionObject mostRecentDeploymentVersion = getMostRecentDeploymentVersion(targetID); String nextVersion; @@ -870,7 +870,7 @@ public class StatefulTargetRepositoryImp } } else if (entity instanceof ArtifactObject) { - List<ArtifactObject> reachableArtifacts = new ArrayList<ArtifactObject>(); + List<ArtifactObject> reachableArtifacts = new ArrayList<>(); for (DistributionObject dist : target.getDistributions()) { for (FeatureObject feat : dist.getFeatures()) { if (feat.isAssociated(entity, ArtifactObject.class)) { Modified: ace/trunk/org.apache.ace.client.repository/test/org/apache/ace/client/repository/impl/ArtifactTest.java URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.client.repository/test/org/apache/ace/client/repository/impl/ArtifactTest.java?rev=1727499&r1=1727498&r2=1727499&view=diff ============================================================================== --- ace/trunk/org.apache.ace.client.repository/test/org/apache/ace/client/repository/impl/ArtifactTest.java (original) +++ ace/trunk/org.apache.ace.client.repository/test/org/apache/ace/client/repository/impl/ArtifactTest.java Fri Jan 29 08:59:31 2016 @@ -126,7 +126,7 @@ public class ArtifactTest { } private ArtifactObject createArtifact(String mimetype, String URL, String symbolicName, String processorPID, String size) { - Map<String, String> attributes = new HashMap<String, String>(); + Map<String, String> attributes = new HashMap<>(); attributes.put(ArtifactObject.KEY_MIMETYPE, mimetype); attributes.put(ArtifactObject.KEY_URL, URL); if (size != null) { @@ -139,7 +139,7 @@ public class ArtifactTest { attributes.put(BundleHelper.KEY_RESOURCE_PROCESSOR_PID, processorPID); } - Map<String, String> tags = new HashMap<String, String>(); + Map<String, String> tags = new HashMap<>(); return m_artifactRepository.create(attributes, tags); } }
