Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kurtakov2017-10-06 01:47:07 -0400
committerAlexander Kurtakov2017-10-06 01:47:07 -0400
commit7bcf3cb720e96922a7583e69e06f8ffdffe52c7d (patch)
tree7d0c9bb37bf2e3b71dc47a8d723ef287ab044dae
parent54f9c77dda57a5588fb8c1595a60db34eab5738c (diff)
downloadrt.equinox.p2-7bcf3cb720e96922a7583e69e06f8ffdffe52c7d.tar.gz
rt.equinox.p2-7bcf3cb720e96922a7583e69e06f8ffdffe52c7d.tar.xz
rt.equinox.p2-7bcf3cb720e96922a7583e69e06f8ffdffe52c7d.zip
Bug 525653 - Move extensionlocation bundle to Java 8
* Bump BREE. * Bump minor version. * Enable additional warnings for Java 8 * Remove redundant type arguments. * Try-with-resources. * Add missing Override annotations * Lambda conversion. Change-Id: I72528e99cad928cd3560901b6380cedb587d02ed Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
-rw-r--r--bundles/org.eclipse.equinox.p2.extensionlocation/.classpath2
-rw-r--r--bundles/org.eclipse.equinox.p2.extensionlocation/.settings/org.eclipse.jdt.core.prefs64
-rw-r--r--bundles/org.eclipse.equinox.p2.extensionlocation/META-INF/MANIFEST.MF4
-rw-r--r--bundles/org.eclipse.equinox.p2.extensionlocation/pom.xml2
-rw-r--r--bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/Activator.java12
-rw-r--r--bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/BundlePoolFilteredListener.java14
-rw-r--r--bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/ExtensionLocationArtifactRepository.java38
-rw-r--r--bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/ExtensionLocationArtifactRepositoryFactory.java10
-rw-r--r--bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/ExtensionLocationMetadataRepository.java34
-rw-r--r--bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/ExtensionLocationMetadataRepositoryFactory.java10
-rw-r--r--bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/SiteListener.java51
11 files changed, 132 insertions, 109 deletions
diff --git a/bundles/org.eclipse.equinox.p2.extensionlocation/.classpath b/bundles/org.eclipse.equinox.p2.extensionlocation/.classpath
index 64c5e31b7..eca7bdba8 100644
--- a/bundles/org.eclipse.equinox.p2.extensionlocation/.classpath
+++ b/bundles/org.eclipse.equinox.p2.extensionlocation/.classpath
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
diff --git a/bundles/org.eclipse.equinox.p2.extensionlocation/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.equinox.p2.extensionlocation/.settings/org.eclipse.jdt.core.prefs
index d50f6a296..49c2785f3 100644
--- a/bundles/org.eclipse.equinox.p2.extensionlocation/.settings/org.eclipse.jdt.core.prefs
+++ b/bundles/org.eclipse.equinox.p2.extensionlocation/.settings/org.eclipse.jdt.core.prefs
@@ -7,29 +7,45 @@ org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch
org.eclipse.jdt.core.circularClasspath=error
org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
+org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled
+org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
+org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
+org.eclipse.jdt.core.compiler.annotation.nonnull.secondary=
+org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
+org.eclipse.jdt.core.compiler.annotation.nonnullbydefault.secondary=
+org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
+org.eclipse.jdt.core.compiler.annotation.nullable.secondary=
+org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.doc.comment.support=enabled
org.eclipse.jdt.core.compiler.maxProblemPerUnit=1000
+org.eclipse.jdt.core.compiler.problem.APILeak=warning
org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
+org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
+org.eclipse.jdt.core.compiler.problem.deadCode=warning
org.eclipse.jdt.core.compiler.problem.deprecation=warning
org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled
org.eclipse.jdt.core.compiler.problem.discouragedReference=error
org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=warning
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore
org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning
@@ -37,41 +53,79 @@ org.eclipse.jdt.core.compiler.problem.invalidJavadoc=error
org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=private
org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning
org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
+org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=enabled
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=public
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
+org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
+org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning
+org.eclipse.jdt.core.compiler.problem.nonnullTypeVariableFromLegacyInvocation=warning
+org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
+org.eclipse.jdt.core.compiler.problem.nullReference=warning
+org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
+org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.pessimisticNullAnalysisForFreeTypeVariables=warning
org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
+org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=warning
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
+org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled
org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=warning
+org.eclipse.jdt.core.compiler.problem.terminalDeprecation=warning
org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning
org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=warning
org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentType=warning
+org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentTypeStrict=disabled
+org.eclipse.jdt.core.compiler.problem.unlikelyEqualsArgumentType=info
org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning
org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=enabled
+org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedImport=error
+org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore
org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=enabled
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=enabled
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
+org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.5
+org.eclipse.jdt.core.compiler.source=1.8
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
diff --git a/bundles/org.eclipse.equinox.p2.extensionlocation/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.p2.extensionlocation/META-INF/MANIFEST.MF
index d67e7750a..70eae7b61 100644
--- a/bundles/org.eclipse.equinox.p2.extensionlocation/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.equinox.p2.extensionlocation/META-INF/MANIFEST.MF
@@ -2,14 +2,14 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.equinox.p2.extensionlocation;singleton:=true
-Bundle-Version: 1.2.300.qualifier
+Bundle-Version: 1.3.0.qualifier
Bundle-Activator: org.eclipse.equinox.internal.p2.extensionlocation.Activator
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Export-Package: org.eclipse.equinox.internal.p2.extensionlocation;x-friends:="org.eclipse.equinox.p2.reconciler.dropins,org.eclipse.equinox.p2.ui.importexport"
Require-Bundle: org.eclipse.equinox.common;bundle-version="[3.5.0,4.0.0)",
org.eclipse.equinox.p2.metadata
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-ActivationPolicy: lazy
Import-Package: org.eclipse.equinox.internal.p2.artifact.repository.simple,
org.eclipse.equinox.internal.p2.core.helpers,
diff --git a/bundles/org.eclipse.equinox.p2.extensionlocation/pom.xml b/bundles/org.eclipse.equinox.p2.extensionlocation/pom.xml
index aa6637876..5acd91638 100644
--- a/bundles/org.eclipse.equinox.p2.extensionlocation/pom.xml
+++ b/bundles/org.eclipse.equinox.p2.extensionlocation/pom.xml
@@ -9,6 +9,6 @@
</parent>
<groupId>org.eclipse.equinox</groupId>
<artifactId>org.eclipse.equinox.p2.extensionlocation</artifactId>
- <version>1.2.300-SNAPSHOT</version>
+ <version>1.3.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/Activator.java b/bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/Activator.java
index 028641f6d..cb6a54dc5 100644
--- a/bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/Activator.java
+++ b/bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/Activator.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2015 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,18 +30,12 @@ public class Activator implements BundleActivator {
public static final String ID = "org.eclipse.equinox.p2.extensionlocation"; //$NON-NLS-1$null;
private static volatile BundleContext bundleContext;
- /*
- * (non-Javadoc)
- * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
- */
+ @Override
public void start(BundleContext context) throws Exception {
bundleContext = context;
}
- /*
- * (non-Javadoc)
- * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
- */
+ @Override
public void stop(BundleContext context) throws Exception {
bundleContext = null;
}
diff --git a/bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/BundlePoolFilteredListener.java b/bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/BundlePoolFilteredListener.java
index 7b818a48c..74674fc55 100644
--- a/bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/BundlePoolFilteredListener.java
+++ b/bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/BundlePoolFilteredListener.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
@@ -10,19 +10,18 @@
*******************************************************************************/
package org.eclipse.equinox.internal.p2.extensionlocation;
-import org.eclipse.equinox.p2.query.IQueryResult;
-
import java.io.File;
import java.util.*;
import org.eclipse.equinox.internal.provisional.p2.directorywatcher.DirectoryChangeListener;
import org.eclipse.equinox.p2.metadata.IArtifactKey;
+import org.eclipse.equinox.p2.query.IQueryResult;
import org.eclipse.equinox.p2.repository.artifact.ArtifactKeyQuery;
import org.eclipse.equinox.p2.repository.artifact.IFileArtifactRepository;
public class BundlePoolFilteredListener extends DirectoryChangeListener {
private DirectoryChangeListener delegate;
- private Set<File> bundlePoolFiles = new HashSet<File>();
+ private Set<File> bundlePoolFiles = new HashSet<>();
public BundlePoolFilteredListener(DirectoryChangeListener listener) {
delegate = listener;
@@ -38,18 +37,22 @@ public class BundlePoolFilteredListener extends DirectoryChangeListener {
}
}
+ @Override
public boolean added(File file) {
return delegate.added(file);
}
+ @Override
public boolean changed(File file) {
return delegate.changed(file);
}
+ @Override
public Long getSeenFile(File file) {
return delegate.getSeenFile(file);
}
+ @Override
public boolean isInterested(File file) {
if (bundlePoolFiles.contains(file))
return false;
@@ -57,14 +60,17 @@ public class BundlePoolFilteredListener extends DirectoryChangeListener {
return delegate.isInterested(file);
}
+ @Override
public boolean removed(File file) {
return delegate.removed(file);
}
+ @Override
public void startPoll() {
delegate.startPoll();
}
+ @Override
public void stopPoll() {
delegate.stopPoll();
}
diff --git a/bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/ExtensionLocationArtifactRepository.java b/bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/ExtensionLocationArtifactRepository.java
index 342e33ee2..b31a3d50a 100644
--- a/bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/ExtensionLocationArtifactRepository.java
+++ b/bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/ExtensionLocationArtifactRepository.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2016 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
@@ -99,11 +99,7 @@ public class ExtensionLocationArtifactRepository extends AbstractRepository<IArt
}
private static boolean containsStandardP2Repository(File base) {
- File[] foundRepos = base.listFiles(new FilenameFilter() {
- public boolean accept(File dir, String name) {
- return (STANDARD_P2_REPOSITORY_FILE_NAMES.contains(name));
- }
- });
+ File[] foundRepos = base.listFiles((FilenameFilter) (dir, name) -> (STANDARD_P2_REPOSITORY_FILE_NAMES.contains(name)));
return foundRepos.length > 0;
}
@@ -147,119 +143,144 @@ public class ExtensionLocationArtifactRepository extends AbstractRepository<IArt
return plugins.isDirectory() || features.isDirectory();
}
+ @Override
public void addDescriptor(IArtifactDescriptor descriptor, IProgressMonitor monitor) {
throw new UnsupportedOperationException();
}
+ @Override
@Deprecated
public void addDescriptor(IArtifactDescriptor descriptor) {
throw new UnsupportedOperationException();
}
+ @Override
public void addDescriptors(IArtifactDescriptor[] descriptors, IProgressMonitor monitor) {
throw new UnsupportedOperationException();
}
+ @Override
@Deprecated
public void addDescriptors(IArtifactDescriptor[] descriptors) {
throw new UnsupportedOperationException();
}
+ @Override
public void removeAll(IProgressMonitor monitor) {
throw new UnsupportedOperationException();
}
+ @Override
@Deprecated
public void removeAll() {
throw new UnsupportedOperationException();
}
+ @Override
public void removeDescriptor(IArtifactDescriptor descriptor, IProgressMonitor monitor) {
throw new UnsupportedOperationException();
}
+ @Override
@Deprecated
public void removeDescriptor(IArtifactDescriptor descriptor) {
throw new UnsupportedOperationException();
}
+ @Override
public void removeDescriptor(IArtifactKey key, IProgressMonitor monitor) {
throw new UnsupportedOperationException();
}
+ @Override
@Deprecated
public void removeDescriptor(IArtifactKey key) {
throw new UnsupportedOperationException();
}
+ @Override
public void removeDescriptors(IArtifactDescriptor[] descriptors, IProgressMonitor monitor) {
throw new UnsupportedOperationException();
}
+ @Override
@Deprecated
public void removeDescriptors(IArtifactDescriptor[] descriptors) {
throw new UnsupportedOperationException();
}
+ @Override
public void removeDescriptors(IArtifactKey[] keys, IProgressMonitor monitor) {
throw new UnsupportedOperationException();
}
+ @Override
@Deprecated
public void removeDescriptors(IArtifactKey[] keys) {
throw new UnsupportedOperationException();
}
+ @Override
public boolean contains(IArtifactDescriptor descriptor) {
ensureInitialized();
return artifactRepository.contains(descriptor);
}
+ @Override
public boolean contains(IArtifactKey key) {
ensureInitialized();
return artifactRepository.contains(key);
}
+ @Override
public IStatus getArtifact(IArtifactDescriptor descriptor, OutputStream destination, IProgressMonitor monitor) {
ensureInitialized();
return artifactRepository.getArtifact(descriptor, destination, monitor);
}
+ @Override
public IStatus getRawArtifact(IArtifactDescriptor descriptor, OutputStream destination, IProgressMonitor monitor) {
ensureInitialized();
return artifactRepository.getRawArtifact(descriptor, destination, monitor);
}
+ @Override
public IArtifactDescriptor[] getArtifactDescriptors(IArtifactKey key) {
ensureInitialized();
return artifactRepository.getArtifactDescriptors(key);
}
+ @Override
public IStatus getArtifacts(IArtifactRequest[] requests, IProgressMonitor monitor) {
ensureInitialized();
return artifactRepository.getArtifacts(requests, monitor);
}
+ @Override
public OutputStream getOutputStream(IArtifactDescriptor descriptor) throws ProvisionException {
ensureInitialized();
return artifactRepository.getOutputStream(descriptor);
}
+ @Override
public File getArtifactFile(IArtifactKey key) {
ensureInitialized();
return artifactRepository.getArtifactFile(key);
}
+ @Override
public File getArtifactFile(IArtifactDescriptor descriptor) {
ensureInitialized();
return artifactRepository.getArtifactFile(descriptor);
}
+ @Override
public Map<String, String> getProperties() {
ensureInitialized();
return artifactRepository.getProperties();
}
+ @Override
public String setProperty(String key, String value, IProgressMonitor monitor) {
try {
ensureInitialized();
@@ -279,24 +300,29 @@ public class ExtensionLocationArtifactRepository extends AbstractRepository<IArt
}
}
+ @Override
public IArtifactDescriptor createArtifactDescriptor(IArtifactKey key) {
return artifactRepository.createArtifactDescriptor(key);
}
+ @Override
public IArtifactKey createArtifactKey(String classifier, String id, Version version) {
return artifactRepository.createArtifactKey(classifier, id, version);
}
+ @Override
public IQueryable<IArtifactDescriptor> descriptorQueryable() {
ensureInitialized();
return artifactRepository.descriptorQueryable();
}
+ @Override
public IQueryResult<IArtifactKey> query(IQuery<IArtifactKey> query, IProgressMonitor monitor) {
ensureInitialized();
return artifactRepository.query(query, monitor);
}
+ @Override
public IStatus executeBatch(IRunnableWithProgress runnable, IProgressMonitor monitor) {
try {
runnable.run(monitor);
diff --git a/bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/ExtensionLocationArtifactRepositoryFactory.java b/bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/ExtensionLocationArtifactRepositoryFactory.java
index 2aec8e62d..cd1f67d3e 100644
--- a/bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/ExtensionLocationArtifactRepositoryFactory.java
+++ b/bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/ExtensionLocationArtifactRepositoryFactory.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
@@ -23,9 +23,7 @@ import org.eclipse.osgi.util.NLS;
public class ExtensionLocationArtifactRepositoryFactory extends ArtifactRepositoryFactory {
- /* (non-Javadoc)
- * @see org.eclipse.equinox.internal.provisional.spi.p2.artifact.repository.ArtifactRepositoryFactory#create(java.net.URL, java.lang.String, java.lang.String, java.util.Map)
- */
+ @Override
public IArtifactRepository create(URI location, String name, String type, Map<String, String> properties) throws ProvisionException {
// TODO proper progress monitoring
IStatus status = validate(location, null);
@@ -54,9 +52,7 @@ public class ExtensionLocationArtifactRepositoryFactory extends ArtifactReposito
return new ExtensionLocationArtifactRepository(getAgent(), location, repo, null);
}
- /* (non-Javadoc)
- * @see org.eclipse.equinox.internal.provisional.spi.p2.artifact.repository.ArtifactRepositoryFactory#load(java.net.URL, org.eclipse.core.runtime.IProgressMonitor)
- */
+ @Override
public IArtifactRepository load(URI location, int flags, IProgressMonitor monitor) throws ProvisionException {
//return null if the caller wanted a modifiable repo
if ((flags & IRepositoryManager.REPOSITORY_HINT_MODIFIABLE) > 0) {
diff --git a/bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/ExtensionLocationMetadataRepository.java b/bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/ExtensionLocationMetadataRepository.java
index 8a2f0e4c5..a92823631 100644
--- a/bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/ExtensionLocationMetadataRepository.java
+++ b/bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/ExtensionLocationMetadataRepository.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2016 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
@@ -83,40 +83,27 @@ public class ExtensionLocationMetadataRepository extends AbstractMetadataReposit
state = value;
}
- /* (non-Javadoc)
- * @see org.eclipse.equinox.p2.repository.metadata.IMetadataRepository#getReferences()
- */
+ @Override
public Collection<IRepositoryReference> getReferences() {
return Collections.emptyList();
}
- /* (non-Javadoc)
- * @see org.eclipse.equinox.p2.repository.metadata.IMetadataRepository#addInstallableUnits(java.util.Collection)
- */
@Override
public void addInstallableUnits(Collection<IInstallableUnit> installableUnits) {
throw new UnsupportedOperationException();
}
- /* (non-Javadoc)
- * @see org.eclipse.equinox.p2.repository.metadata.spi.AbstractMetadataRepository#removeAll()
- */
@Override
public void removeAll() {
throw new UnsupportedOperationException();
}
- /* (non-Javadoc)
- * @see org.eclipse.equinox.p2.repository.metadata.IMetadataRepository#removeInstallableUnits(java.util.Collection)
- */
@Override
public boolean removeInstallableUnits(Collection<IInstallableUnit> installableUnits) {
throw new UnsupportedOperationException();
}
- /* (non-Javadoc)
- * @see org.eclipse.equinox.p2.query.IQueryable#query(org.eclipse.equinox.p2.query.IQuery, org.eclipse.core.runtime.IProgressMonitor)
- */
+ @Override
public IQueryResult<IInstallableUnit> query(IQuery<IInstallableUnit> query, IProgressMonitor monitor) {
ensureInitialized();
return metadataRepository.query(query, monitor);
@@ -137,11 +124,7 @@ public class ExtensionLocationMetadataRepository extends AbstractMetadataReposit
}
private static boolean containsStandardP2Repository(File base) {
- File[] foundRepos = base.listFiles(new FilenameFilter() {
- public boolean accept(File dir, String name) {
- return (STANDARD_P2_REPOSITORY_FILE_NAMES.contains(name));
- }
- });
+ File[] foundRepos = base.listFiles((FilenameFilter) (dir, name) -> (STANDARD_P2_REPOSITORY_FILE_NAMES.contains(name)));
return foundRepos.length > 0;
}
@@ -185,26 +168,17 @@ public class ExtensionLocationMetadataRepository extends AbstractMetadataReposit
return plugins.isDirectory() || features.isDirectory();
}
- /* (non-Javadoc)
- * @see org.eclipse.equinox.p2.repository.spi.AbstractRepository#getProperties()
- */
@Override
public Map<String, String> getProperties() {
ensureInitialized();
return metadataRepository.getProperties();
}
- /* (non-Javadoc)
- * @see org.eclipse.equinox.p2.repository.metadata.spi.AbstractMetadataRepository#initialize(org.eclipse.equinox.p2.repository.metadata.spi.AbstractMetadataRepository.RepositoryState)
- */
@Override
public void initialize(RepositoryState repositoryState) {
//nothing to do
}
- /* (non-Javadoc)
- * @see org.eclipse.equinox.p2.repository.spi.AbstractRepository#setProperty(java.lang.String, java.lang.String)
- */
@Override
public String setProperty(String key, String value, IProgressMonitor monitor) {
try {
diff --git a/bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/ExtensionLocationMetadataRepositoryFactory.java b/bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/ExtensionLocationMetadataRepositoryFactory.java
index 8f00b923e..e4705e7ce 100644
--- a/bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/ExtensionLocationMetadataRepositoryFactory.java
+++ b/bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/ExtensionLocationMetadataRepositoryFactory.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
@@ -22,9 +22,7 @@ import org.eclipse.osgi.util.NLS;
public class ExtensionLocationMetadataRepositoryFactory extends MetadataRepositoryFactory {
- /* (non-Javadoc)
- * @see org.eclipse.equinox.p2.repository.metadata.spi.MetadataRepositoryFactory#create(java.net.URL, java.lang.String, java.lang.String, java.util.Map)
- */
+ @Override
public IMetadataRepository create(URI location, String name, String type, Map<String, String> properties) throws ProvisionException {
// TODO proper progress monitoring
IStatus status = validate(location, null);
@@ -53,9 +51,7 @@ public class ExtensionLocationMetadataRepositoryFactory extends MetadataReposito
return new ExtensionLocationMetadataRepository(getAgent(), location, repository, null);
}
- /* (non-Javadoc)
- * @see org.eclipse.equinox.p2.repository.metadata.spi.MetadataRepositoryFactory#load(java.net.URL, org.eclipse.core.runtime.IProgressMonitor)
- */
+ @Override
public IMetadataRepository load(URI location, int flags, IProgressMonitor monitor) throws ProvisionException {
//return null if the caller wanted a modifiable repo
if ((flags & IRepositoryManager.REPOSITORY_HINT_MODIFIABLE) > 0) {
diff --git a/bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/SiteListener.java b/bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/SiteListener.java
index 7203f1c46..4cd2c43b0 100644
--- a/bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/SiteListener.java
+++ b/bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/SiteListener.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
@@ -120,7 +120,7 @@ public class SiteListener extends DirectoryChangeListener {
this.siteLocation = url;
this.delegate = delegate;
this.policy = properties.get(SITE_POLICY);
- Collection<String> listCollection = new HashSet<String>();
+ Collection<String> listCollection = new HashSet<>();
String listString = properties.get(SITE_LIST);
if (listString != null)
for (StringTokenizer tokenizer = new StringTokenizer(listString, ","); tokenizer.hasMoreTokens();) //$NON-NLS-1$
@@ -128,9 +128,7 @@ public class SiteListener extends DirectoryChangeListener {
this.list = normalize(listCollection.toArray(new String[listCollection.size()]));
}
- /* (non-Javadoc)
- * @see org.eclipse.equinox.internal.provisional.p2.directorywatcher.DirectoryChangeListener#isInterested(java.io.File)
- */
+ @Override
public boolean isInterested(File file) {
// make sure that our delegate and super-class are both interested in
// the file before we consider it
@@ -214,24 +212,15 @@ public class SiteListener extends DirectoryChangeListener {
// set it to be empty here in case we don't have a match in the file
toBeRemoved = new String[0];
Properties properties = new Properties();
- InputStream input = null;
- try {
- input = new BufferedInputStream(new FileInputStream(toBeUninstalledFile));
+ try (InputStream input = new BufferedInputStream(new FileInputStream(toBeUninstalledFile))) {
properties.load(input);
} catch (IOException e) {
// TODO
- } finally {
- try {
- if (input != null)
- input.close();
- } catch (IOException e) {
- // ignore
- }
}
String urlString = siteLocation;
if (urlString.endsWith(Constants.EXTENSION_LOCATION))
urlString = urlString.substring(0, urlString.length() - Constants.EXTENSION_LOCATION.length());
- List<String> result = new ArrayList<String>();
+ List<String> result = new ArrayList<>();
for (Enumeration<Object> e = properties.elements(); e.hasMoreElements();) {
String line = (String) e.nextElement();
StringTokenizer tokenizer = new StringTokenizer(line, ";"); //$NON-NLS-1$
@@ -260,7 +249,7 @@ public class SiteListener extends DirectoryChangeListener {
private String[] getManagedFiles() {
if (managedFiles != null)
return managedFiles;
- List<String> result = new ArrayList<String>();
+ List<String> result = new ArrayList<>();
File siteFile;
try {
siteFile = URIUtil.toFile(new URI(siteLocation));
@@ -293,7 +282,7 @@ public class SiteListener extends DirectoryChangeListener {
* File to Feature objects (from the generator bundle)
*/
private Map<File, Feature> getFeatures(File location) {
- Map<File, Feature> result = new HashMap<File, Feature>();
+ Map<File, Feature> result = new HashMap<>();
File featureDir = new File(location, FEATURES);
File[] children = featureDir.listFiles();
for (int i = 0; children != null && i < children.length; i++) {
@@ -314,7 +303,7 @@ public class SiteListener extends DirectoryChangeListener {
*/
private Map<String, File> getPlugins(File location) {
File[] plugins = new File(location, PLUGINS).listFiles();
- Map<String, File> result = new HashMap<String, File>();
+ Map<String, File> result = new HashMap<>();
for (int i = 0; plugins != null && i < plugins.length; i++) {
File bundleLocation = plugins[i];
if (bundleLocation.isDirectory() || bundleLocation.getName().endsWith(".jar")) { //$NON-NLS-1$
@@ -329,44 +318,32 @@ public class SiteListener extends DirectoryChangeListener {
return result;
}
- /* (non-Javadoc)
- * @see org.eclipse.equinox.internal.provisional.p2.directorywatcher.RepositoryListener#added(java.io.File)
- */
+ @Override
public boolean added(File file) {
return delegate.added(file);
}
- /* (non-Javadoc)
- * @see org.eclipse.equinox.internal.provisional.p2.directorywatcher.RepositoryListener#changed(java.io.File)
- */
+ @Override
public boolean changed(File file) {
return delegate.changed(file);
}
- /* (non-Javadoc)
- * @see org.eclipse.equinox.internal.provisional.p2.directorywatcher.RepositoryListener#getSeenFile(java.io.File)
- */
+ @Override
public Long getSeenFile(File file) {
return delegate.getSeenFile(file);
}
- /* (non-Javadoc)
- * @see org.eclipse.equinox.internal.provisional.p2.directorywatcher.RepositoryListener#removed(java.io.File)
- */
+ @Override
public boolean removed(File file) {
return delegate.removed(file);
}
- /* (non-Javadoc)
- * @see org.eclipse.equinox.internal.provisional.p2.directorywatcher.RepositoryListener#startPoll()
- */
+ @Override
public void startPoll() {
delegate.startPoll();
}
- /* (non-Javadoc)
- * @see org.eclipse.equinox.internal.provisional.p2.directorywatcher.RepositoryListener#stopPoll()
- */
+ @Override
public void stopPoll() {
delegate.stopPoll();
}

Back to the top