Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kurtakov2017-08-18 12:15:42 +0000
committerAlexander Kurtakov2017-08-18 12:15:42 +0000
commit191fe70301dcd993856a1869c08ecb22a4bafa84 (patch)
tree2c4671f56e96c2519d7f28afccfbdff463b2bbbd
parent08b1c52015387463c263add217c6807d0aec7dba (diff)
downloadrt.equinox.p2-191fe70301dcd993856a1869c08ecb22a4bafa84.tar.gz
rt.equinox.p2-191fe70301dcd993856a1869c08ecb22a4bafa84.tar.xz
rt.equinox.p2-191fe70301dcd993856a1869c08ecb22a4bafa84.zip
Bug 521114 - Move p2 engine to Java 8
Bump minor version, try-with-resources, remove duplicate type declarations. Change-Id: I33bc01cfef2272e444614f92fb4fcc313bffbe91 Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/.classpath2
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/.settings/org.eclipse.jdt.core.prefs11
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/META-INF/MANIFEST.MF4
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/pom.xml2
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/SimpleProfileRegistry.java22
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/SurrogateProfileHandler.java2
6 files changed, 14 insertions, 29 deletions
diff --git a/bundles/org.eclipse.equinox.p2.engine/.classpath b/bundles/org.eclipse.equinox.p2.engine/.classpath
index 098194ca4..eca7bdba8 100644
--- a/bundles/org.eclipse.equinox.p2.engine/.classpath
+++ b/bundles/org.eclipse.equinox.p2.engine/.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/JavaSE-1.7"/>
+ <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.engine/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.equinox.p2.engine/.settings/org.eclipse.jdt.core.prefs
index 97745307f..d4d0fa19b 100644
--- a/bundles/org.eclipse.equinox.p2.engine/.settings/org.eclipse.jdt.core.prefs
+++ b/bundles/org.eclipse.equinox.p2.engine/.settings/org.eclipse.jdt.core.prefs
@@ -17,9 +17,9 @@ org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nul
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.7
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.7
+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
@@ -36,7 +36,7 @@ org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=
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=ignore
+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
@@ -100,6 +100,9 @@ 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
@@ -120,7 +123,7 @@ 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.7
+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.engine/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.p2.engine/META-INF/MANIFEST.MF
index af3cb0869..6344c9212 100644
--- a/bundles/org.eclipse.equinox.p2.engine/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.equinox.p2.engine/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.equinox.p2.engine;singleton:=true
-Bundle-Version: 2.5.0.qualifier
+Bundle-Version: 2.6.0.qualifier
Bundle-Activator: org.eclipse.equinox.internal.p2.engine.EngineActivator
Bundle-Vendor: %providerName
Bundle-Localization: plugin
@@ -22,7 +22,7 @@ Require-Bundle: org.eclipse.equinox.common,
org.eclipse.equinox.registry,
org.eclipse.core.jobs;bundle-version="[3.4.0,4.0.0)"
Eclipse-RegisterBuddy: org.eclipse.equinox.p2.metadata.repository
-Bundle-RequiredExecutionEnvironment: JavaSE-1.7
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-ActivationPolicy: lazy
Service-Component: OSGI-INF/profileRegistry.xml, OSGI-INF/engine.xml
Import-Package: javax.xml.parsers,
diff --git a/bundles/org.eclipse.equinox.p2.engine/pom.xml b/bundles/org.eclipse.equinox.p2.engine/pom.xml
index 09fc35582..5f36d7ab2 100644
--- a/bundles/org.eclipse.equinox.p2.engine/pom.xml
+++ b/bundles/org.eclipse.equinox.p2.engine/pom.xml
@@ -9,6 +9,6 @@
</parent>
<groupId>org.eclipse.equinox</groupId>
<artifactId>org.eclipse.equinox.p2.engine</artifactId>
- <version>2.5.0-SNAPSHOT</version>
+ <version>2.6.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/SimpleProfileRegistry.java b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/SimpleProfileRegistry.java
index e8ae44844..328991eae 100644
--- a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/SimpleProfileRegistry.java
+++ b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/SimpleProfileRegistry.java
@@ -1054,19 +1054,10 @@ public class SimpleProfileRegistry implements IProfileRegistry, IAgentService {
lastAccessedProperties = new ProfileStateProperties(id, file, properties);
return properties;
}
- InputStream input = null;
- try {
- input = new BufferedInputStream(new FileInputStream(file));
+ try (InputStream input = new BufferedInputStream(new FileInputStream(file))) {
properties.load(input);
} catch (IOException e) {
throw new ProvisionException(new Status(IStatus.ERROR, EngineActivator.ID, Messages.SimpleProfileRegistry_States_Error_Reading_File, e));
- } finally {
- if (input != null)
- try {
- input.close();
- } catch (IOException e) {
- // Ignore
- }
}
//cache the value before we return
@@ -1083,22 +1074,13 @@ public class SimpleProfileRegistry implements IProfileRegistry, IAgentService {
File profileDirectory = getProfileFolder(id);
File file = new File(profileDirectory, PROFILE_PROPERTIES_FILE);
- OutputStream output = null;
Properties prunedProperties = properties;
- try {
- output = new BufferedOutputStream(new FileOutputStream(file));
+ try (OutputStream output = new BufferedOutputStream(new FileOutputStream(file));) {
prunedProperties = pruneStateProperties(id, properties);
prunedProperties.store(output, null);
output.flush();
} catch (IOException e) {
return new Status(IStatus.ERROR, EngineActivator.ID, Messages.SimpleProfileRegistry_States_Error_Writing_File, e);
- } finally {
- try {
- if (output != null)
- output.close();
- } catch (IOException e) {
- // ignore
- }
}
// cache the value
lastAccessedProperties = new ProfileStateProperties(id, file, prunedProperties);
diff --git a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/SurrogateProfileHandler.java b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/SurrogateProfileHandler.java
index 877007183..85708904f 100644
--- a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/SurrogateProfileHandler.java
+++ b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/SurrogateProfileHandler.java
@@ -163,7 +163,7 @@ public class SurrogateProfileHandler implements ISurrogateProfileHandler {
final Profile profile = (Profile) registry.getProfile(id, currentTimestamp);
if (profile != null)
- cachedProfile = new SoftReference<IProfile>(profile);
+ cachedProfile = new SoftReference<>(profile);
if (!EngineActivator.EXTENDED) {
return profile;

Back to the top