Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kurtakov2017-08-19 07:11:49 +0000
committerAlexander Kurtakov2017-08-19 07:11:49 +0000
commit3bf7cf1ff4a2b8d9a448e3f3bfc99f0caa1c37f1 (patch)
treeb52ae2e527bf38dbc64a816bf09e06ab336afb15 /bundles/org.eclipse.equinox.p2.repository.tools/src_ant
parent56284608e960d37831deab796372604aa40b7771 (diff)
downloadrt.equinox.p2-3bf7cf1ff4a2b8d9a448e3f3bfc99f0caa1c37f1.tar.gz
rt.equinox.p2-3bf7cf1ff4a2b8d9a448e3f3bfc99f0caa1c37f1.tar.xz
rt.equinox.p2-3bf7cf1ff4a2b8d9a448e3f3bfc99f0caa1c37f1.zip
Bug 521145 - Move p2 repository.tools to Java 8
Bump minor version, remove redundant type declarations, add missing Override annotations and some lambda conversions. Change-Id: Ibb59354ee15f179eb40e71db1ee800c3c8522557 Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.repository.tools/src_ant')
-rw-r--r--bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/AbstractRepositoryTask.java10
-rw-r--r--bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/AntMirrorLog.java8
-rw-r--r--bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/ArtifactDescription.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/CompositeRepositoryTask.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/CreateCompositeArtifactRepositoryTask.java8
-rw-r--r--bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/ElementList.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/IUDescription.java7
-rw-r--r--bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/MirrorArtifactsTask.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/MirrorMetadataTask.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/MirrorTask.java5
-rw-r--r--bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/ProcessRepoTask.java12
-rw-r--r--bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/RemoveIUTask.java8
-rw-r--r--bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/Repo2RunnableTask.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/RepositoryList.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/ValidateTask.java6
15 files changed, 47 insertions, 55 deletions
diff --git a/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/AbstractRepositoryTask.java b/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/AbstractRepositoryTask.java
index 9c14eaebd..77397c118 100644
--- a/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/AbstractRepositoryTask.java
+++ b/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/AbstractRepositoryTask.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2015 IBM Corporation and others.
+ * Copyright (c) 2009, 2017 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -31,9 +31,9 @@ import org.eclipse.osgi.util.NLS;
public abstract class AbstractRepositoryTask extends Task {
protected static final String ANT_PREFIX = "${"; //$NON-NLS-1$
protected AbstractApplication application;
- protected List<IUDescription> iuTasks = new ArrayList<IUDescription>();
- protected List<FileSet> sourceRepos = new ArrayList<FileSet>();
- protected List<DestinationRepository> destinations = new ArrayList<DestinationRepository>();
+ protected List<IUDescription> iuTasks = new ArrayList<>();
+ protected List<FileSet> sourceRepos = new ArrayList<>();
+ protected List<DestinationRepository> destinations = new ArrayList<>();
protected void addMetadataSourceRepository(URI repoLocation, boolean optional) {
RepositoryDescriptor source = new RepositoryDescriptor();
@@ -177,7 +177,7 @@ public abstract class AbstractRepositoryTask extends Task {
return null;
IMetadataRepository repository = application.getCompositeMetadataRepository();
- List<IInstallableUnit> result = new ArrayList<IInstallableUnit>();
+ List<IInstallableUnit> result = new ArrayList<>();
for (IUDescription iu : iuTasks) {
IQuery<IInstallableUnit> iuQuery = iu.createQuery();
diff --git a/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/AntMirrorLog.java b/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/AntMirrorLog.java
index 819b12b25..a1a9a5e1d 100644
--- a/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/AntMirrorLog.java
+++ b/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/AntMirrorLog.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2016 IBM Corporation and others.
+ * Copyright (c) 2009, 2017 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,12 +10,11 @@
*******************************************************************************/
package org.eclipse.equinox.p2.internal.repository.tools.tasks;
-import org.eclipse.equinox.p2.internal.repository.mirroring.IArtifactMirrorLog;
-
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.equinox.internal.p2.artifact.repository.Messages;
+import org.eclipse.equinox.p2.internal.repository.mirroring.IArtifactMirrorLog;
import org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor;
public class AntMirrorLog implements IArtifactMirrorLog {
@@ -33,11 +32,13 @@ public class AntMirrorLog implements IArtifactMirrorLog {
}
}
+ @Override
public void log(IArtifactDescriptor descriptor, IStatus status) {
log(descriptor.toString(), status.getSeverity());
log(status);
}
+ @Override
public void log(IStatus status) {
int severity = status.getSeverity();
// Log the status message
@@ -53,6 +54,7 @@ public class AntMirrorLog implements IArtifactMirrorLog {
log(nestedStatus[i]);
}
+ @Override
public void close() {
// nothing to do here
}
diff --git a/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/ArtifactDescription.java b/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/ArtifactDescription.java
index a672f38e6..33e0d5a6b 100644
--- a/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/ArtifactDescription.java
+++ b/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/ArtifactDescription.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011 IBM Corporation and others.
+ * Copyright (c) 2011, 2017 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -44,7 +44,7 @@ public class ArtifactDescription extends DataType {
public void addConfiguredProperty(Parameter property) {
if (properties == null)
- properties = new HashMap<String, String>();
+ properties = new HashMap<>();
properties.put(property.getName(), property.getValue());
}
diff --git a/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/CompositeRepositoryTask.java b/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/CompositeRepositoryTask.java
index 83b4df5d0..a560829c2 100644
--- a/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/CompositeRepositoryTask.java
+++ b/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/CompositeRepositoryTask.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2015 IBM Corporation and others.
+ * Copyright (c) 2009, 2017 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -27,9 +27,7 @@ public class CompositeRepositoryTask extends AbstractRepositoryTask {
application = new CompositeRepositoryApplication();
}
- /* (non-Javadoc)
- * @see org.apache.tools.ant.Task#execute()
- */
+ @Override
public void execute() throws BuildException {
try {
IStatus result = application.run(null);
diff --git a/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/CreateCompositeArtifactRepositoryTask.java b/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/CreateCompositeArtifactRepositoryTask.java
index 000d325b2..16cc1b2b3 100644
--- a/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/CreateCompositeArtifactRepositoryTask.java
+++ b/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/CreateCompositeArtifactRepositoryTask.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2011 IBM Corporation and others.
+ * Copyright (c) 2008, 2017 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -34,11 +34,9 @@ public class CreateCompositeArtifactRepositoryTask extends Task {
boolean atomic = true; // bug 356561: newly created repositories shall be atomic (by default)
boolean compressed = true;
boolean failOnExists = false; // should we fail if a repo already exists?
- Map<String, String> properties = new HashMap<String, String>();
+ Map<String, String> properties = new HashMap<>();
- /* (non-Javadoc)
- * @see org.apache.tools.ant.Task#execute()
- */
+ @Override
public void execute() {
validate();
IArtifactRepositoryManager manager = (IArtifactRepositoryManager) AbstractRepositoryTask.getAgent().getService(IArtifactRepositoryManager.SERVICE_NAME);
diff --git a/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/ElementList.java b/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/ElementList.java
index 6968e4217..2c5cf9f91 100644
--- a/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/ElementList.java
+++ b/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/ElementList.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
+ * Copyright (c) 2010, 2017 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -17,7 +17,7 @@ import org.apache.tools.ant.types.DataType;
public class ElementList<T> extends DataType {
- private List<T> elements = new ArrayList<T>();
+ private List<T> elements = new ArrayList<>();
public void addConfigured(T element) {
elements.add(element);
diff --git a/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/IUDescription.java b/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/IUDescription.java
index b6cfec4be..73513433a 100644
--- a/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/IUDescription.java
+++ b/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/IUDescription.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2010 IBM Corporation and others.
+ * Copyright (c) 2009, 2017 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -84,6 +84,7 @@ public class IUDescription extends DataType {
return version;
}
+ @Override
public String toString() {
StringBuffer buffer = new StringBuffer("Installable Unit ["); //$NON-NLS-1$
if (id != null) {
@@ -103,7 +104,7 @@ public class IUDescription extends DataType {
}
public IQuery<IInstallableUnit> createQuery() {
- List<IQuery<IInstallableUnit>> queries = new ArrayList<IQuery<IInstallableUnit>>();
+ List<IQuery<IInstallableUnit>> queries = new ArrayList<>();
if (id != null) {
if (version == null || version.length() == 0) {
// Get the latest version of the iu
@@ -151,7 +152,7 @@ public class IUDescription extends DataType {
if (attributes == null || attributes.length() == 0)
return Collections.<String, String> emptyMap();
- Map<String, String> result = new HashMap<String, String>();
+ Map<String, String> result = new HashMap<>();
int start = 0;
int idx = 0;
while ((idx = attributes.indexOf('@', start)) > -1) {
diff --git a/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/MirrorArtifactsTask.java b/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/MirrorArtifactsTask.java
index 081123343..dcf51572b 100644
--- a/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/MirrorArtifactsTask.java
+++ b/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/MirrorArtifactsTask.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2010 IBM Corporation and others.
+ * Copyright (c) 2008, 2017 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -37,9 +37,7 @@ public class MirrorArtifactsTask extends Task {
boolean verbose = false;
boolean references = true;
- /* (non-Javadoc)
- * @see org.apache.tools.ant.Task#execute()
- */
+ @Override
public void execute() {
// Compare against if baseline specified
RepositoryDescriptor destinationRepo = new RepositoryDescriptor();
diff --git a/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/MirrorMetadataTask.java b/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/MirrorMetadataTask.java
index 20b058a00..708ccfe3c 100644
--- a/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/MirrorMetadataTask.java
+++ b/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/MirrorMetadataTask.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2010 IBM Corporation and others.
+ * Copyright (c) 2008, 2017 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -30,9 +30,7 @@ public class MirrorMetadataTask extends Task {
String writeMode;
boolean references = true;
- /* (non-Javadoc)
- * @see org.apache.tools.ant.Task#execute()
- */
+ @Override
public void execute() {
RepositoryDescriptor destinationRepo = new RepositoryDescriptor();
destinationRepo.setName(destinationName);
diff --git a/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/MirrorTask.java b/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/MirrorTask.java
index 002d53e62..2e067a149 100644
--- a/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/MirrorTask.java
+++ b/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/MirrorTask.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2010 IBM Corporation and others.
+ * Copyright (c) 2009, 2017 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -33,6 +33,7 @@ public class MirrorTask extends AbstractRepositoryTask {
application = new MirrorApplication();
}
+ @Override
public void execute() throws BuildException {
try {
if (mirrorLog != null)
@@ -75,7 +76,7 @@ public class MirrorTask extends AbstractRepositoryTask {
return null;
List<ArtifactDescription> artifacts = comparator.getExcluded();
- List<IQuery<IArtifactDescriptor>> queries = new ArrayList<IQuery<IArtifactDescriptor>>();
+ List<IQuery<IArtifactDescriptor>> queries = new ArrayList<>();
for (ArtifactDescription artifactDescription : artifacts)
queries.add(artifactDescription.createDescriptorQuery());
diff --git a/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/ProcessRepoTask.java b/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/ProcessRepoTask.java
index ae4298449..d87c76284 100644
--- a/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/ProcessRepoTask.java
+++ b/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/ProcessRepoTask.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2015 IBM Corporation and others.
+ * Copyright (c) 2009, 2017 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -61,11 +61,11 @@ public class ProcessRepoTask extends Task {
private SigningOptions signing = null;
private JarProcessorTask jarProcessor = null;
+ @Override
public void execute() throws BuildException {
File file = URIUtil.toFile(repository);
if (file == null || !file.exists()) {
- throw new BuildException(NLS.bind(
- Messages.ProcessRepo_must_be_local, repository.toString()));
+ throw new BuildException(NLS.bind(Messages.ProcessRepo_must_be_local, repository.toString()));
}
if (pack | repack | signing != null) {
if (jarProcessor == null)
@@ -77,8 +77,7 @@ public class ProcessRepoTask extends Task {
jarProcessor.setStorepass(signing.storepass);
jarProcessor.setUnsign(signing.unsign);
- if (signing.alias != null && signing.alias.length() > 0
- && !signing.alias.startsWith("${")) //$NON-NLS-1$
+ if (signing.alias != null && signing.alias.length() > 0 && !signing.alias.startsWith("${")) //$NON-NLS-1$
jarProcessor.setSign(true);
}
jarProcessor.setPack(pack);
@@ -106,8 +105,7 @@ public class ProcessRepoTask extends Task {
try {
this.repository = URIUtil.fromString(repository);
} catch (URISyntaxException e) {
- throw new IllegalArgumentException(NLS.bind(
- Messages.ProcessRepo_location_not_url, repository));
+ throw new IllegalArgumentException(NLS.bind(Messages.ProcessRepo_location_not_url, repository));
}
}
diff --git a/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/RemoveIUTask.java b/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/RemoveIUTask.java
index 447f605b0..b9b8bd9e9 100644
--- a/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/RemoveIUTask.java
+++ b/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/RemoveIUTask.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2010 IBM Corporation and others.
+ * Copyright (c) 2009, 2017 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -35,6 +35,7 @@ public class RemoveIUTask extends AbstractRepositoryTask {
protected static class RemoveIUApplication extends AbstractApplication {
//Only need the application to reuse super's repo management.
+ @Override
public IStatus run(IProgressMonitor monitor) {
return null;
}
@@ -48,6 +49,7 @@ public class RemoveIUTask extends AbstractRepositoryTask {
this.application = new RemoveIUApplication();
}
+ @Override
public void execute() throws BuildException {
try {
if (iuTasks == null || iuTasks.isEmpty())
@@ -60,7 +62,7 @@ public class RemoveIUTask extends AbstractRepositoryTask {
IMetadataRepository repository = application.getDestinationMetadataRepository();
IArtifactRepository artifacts = application.getDestinationArtifactRepository();
- final Set<IInstallableUnit> toRemove = new HashSet<IInstallableUnit>();
+ final Set<IInstallableUnit> toRemove = new HashSet<>();
for (IUDescription iu : iuTasks) {
IQuery<IInstallableUnit> iuQuery = iu.createQuery();
@@ -117,7 +119,7 @@ public class RemoveIUTask extends AbstractRepositoryTask {
}
private Dictionary<String, Object> createDictionary(IArtifactDescriptor descriptor) {
- Hashtable<String, Object> result = new Hashtable<String, Object>(5);
+ Hashtable<String, Object> result = new Hashtable<>(5);
result.putAll(descriptor.getProperties());
IArtifactKey key = descriptor.getArtifactKey();
result.put(CLASSIFIER, key.getClassifier());
diff --git a/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/Repo2RunnableTask.java b/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/Repo2RunnableTask.java
index 492d99ee6..a414e661b 100644
--- a/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/Repo2RunnableTask.java
+++ b/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/Repo2RunnableTask.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2013 IBM Corporation and others.
+ * Copyright (c) 2009, 2017 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -45,9 +45,7 @@ public class Repo2RunnableTask extends AbstractRepositoryTask {
this.application = new Repo2Runnable();
}
- /* (non-Javadoc)
- * @see org.apache.tools.ant.Task#execute()
- */
+ @Override
public void execute() throws BuildException {
try {
prepareSourceRepos();
diff --git a/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/RepositoryList.java b/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/RepositoryList.java
index 7d51e9372..a2e08cbf9 100644
--- a/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/RepositoryList.java
+++ b/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/RepositoryList.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2010 IBM Corporation and others.
+ * Copyright (c) 2009, 2017 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -16,8 +16,8 @@ import org.apache.tools.ant.types.FileSet;
public class RepositoryList extends RepositoryFileSet {
// TODO this class should extend DataType, currently RepoFileSet to support <source location="xxx" />
- List<DestinationRepository> repositories = new ArrayList<DestinationRepository>();
- List<FileSet> sourceFileSets = new ArrayList<FileSet>();
+ List<DestinationRepository> repositories = new ArrayList<>();
+ List<FileSet> sourceFileSets = new ArrayList<>();
public DestinationRepository createRepository() {
DestinationRepository repo = new DestinationRepository();
diff --git a/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/ValidateTask.java b/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/ValidateTask.java
index 21407c52a..d741f8c16 100644
--- a/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/ValidateTask.java
+++ b/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/ValidateTask.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2010 IBM Corporation and others.
+ * Copyright (c) 2008, 2017 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -26,9 +26,7 @@ public class ValidateTask extends AbstractRepositoryTask {
private String comparatorID; // specifies the comparator we want to use.
- /* (non-Javadoc)
- * @see org.apache.tools.ant.Task#execute()
- */
+ @Override
public void execute() {
IArtifactRepositoryManager manager = (IArtifactRepositoryManager) getAgent().getService(IArtifactRepositoryManager.SERVICE_NAME);
if (manager == null)

Back to the top