aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Vogel2015-09-11 11:53:58 -0400
committerLars Vogel2015-09-11 12:58:55 -0400
commite0c1dc5111c5200d39f4611082b34110d735ac29 (patch)
treee1e0ed4f58226e467dde773d51941462b6c98222 /bundles/org.eclipse.core.jobs
parent20d75252bd80ad698bcec1c64ad7eb247b05ca63 (diff)
downloadeclipse.platform.runtime-e0c1dc5111c5200d39f4611082b34110d735ac29.tar.gz
eclipse.platform.runtime-e0c1dc5111c5200d39f4611082b34110d735ac29.tar.xz
eclipse.platform.runtime-e0c1dc5111c5200d39f4611082b34110d735ac29.zip
Bug 477227 - Update org.eclipse.core.jobs to Java 8 to use lambdas and
to use @FunctionalInterface annotation AFAICS the update of the minor version segment was already done, so I think this change does not require a minor version bump. Change-Id: I096050de7bf51f7ebe3f86116a62bdb55f4516cf Signed-off-by: Lars Vogel <Lars.Vogel@vogella.com>
Diffstat (limited to 'bundles/org.eclipse.core.jobs')
-rw-r--r--bundles/org.eclipse.core.jobs/.classpath2
-rw-r--r--bundles/org.eclipse.core.jobs/.settings/org.eclipse.jdt.core.prefs6
-rw-r--r--bundles/org.eclipse.core.jobs/META-INF/MANIFEST.MF2
-rw-r--r--bundles/org.eclipse.core.jobs/build.properties5
-rw-r--r--bundles/org.eclipse.core.jobs/src/org/eclipse/core/internal/jobs/JobListeners.java44
-rw-r--r--bundles/org.eclipse.core.jobs/src/org/eclipse/core/runtime/jobs/IJobFunction.java2
6 files changed, 17 insertions, 44 deletions
diff --git a/bundles/org.eclipse.core.jobs/.classpath b/bundles/org.eclipse.core.jobs/.classpath
index e8ea977a6..4f83b2397 100644
--- a/bundles/org.eclipse.core.jobs/.classpath
+++ b/bundles/org.eclipse.core.jobs/.classpath
@@ -2,6 +2,6 @@
<classpath>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
- <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="output" path="bin"/>
</classpath>
diff --git a/bundles/org.eclipse.core.jobs/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.core.jobs/.settings/org.eclipse.jdt.core.prefs
index 739b00f59..b72538a7c 100644
--- a/bundles/org.eclipse.core.jobs/.settings/org.eclipse.jdt.core.prefs
+++ b/bundles/org.eclipse.core.jobs/.settings/org.eclipse.jdt.core.prefs
@@ -7,9 +7,9 @@ org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nul
org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
-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
@@ -110,7 +110,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_annotation=0
diff --git a/bundles/org.eclipse.core.jobs/META-INF/MANIFEST.MF b/bundles/org.eclipse.core.jobs/META-INF/MANIFEST.MF
index 6e10c87f6..326c94f09 100644
--- a/bundles/org.eclipse.core.jobs/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.core.jobs/META-INF/MANIFEST.MF
@@ -9,7 +9,7 @@ Export-Package: org.eclipse.core.internal.jobs;x-internal:=true,
org.eclipse.core.runtime.jobs
Bundle-Activator: org.eclipse.core.internal.jobs.JobActivator
Require-Bundle: org.eclipse.equinox.common;bundle-version="[3.8.0,4.0.0)"
-Bundle-RequiredExecutionEnvironment: JavaSE-1.7
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-ActivationPolicy: lazy
Import-Package: org.eclipse.osgi.service.debug,
org.eclipse.osgi.util,
diff --git a/bundles/org.eclipse.core.jobs/build.properties b/bundles/org.eclipse.core.jobs/build.properties
index 87ec7df29..670e76e9a 100644
--- a/bundles/org.eclipse.core.jobs/build.properties
+++ b/bundles/org.eclipse.core.jobs/build.properties
@@ -1,5 +1,5 @@
###############################################################################
-# Copyright (c) 2005, 2014 IBM Corporation and others.
+# Copyright (c) 2005, 2015 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,5 +16,4 @@ bin.includes = META-INF/,\
.options,\
about.html,\
plugin.xml
-src.includes = about.html
-jre.compilation.profile = JavaSE-1.7 \ No newline at end of file
+src.includes = about.html \ No newline at end of file
diff --git a/bundles/org.eclipse.core.jobs/src/org/eclipse/core/internal/jobs/JobListeners.java b/bundles/org.eclipse.core.jobs/src/org/eclipse/core/internal/jobs/JobListeners.java
index 81a422b11..e79418af2 100644
--- a/bundles/org.eclipse.core.jobs/src/org/eclipse/core/internal/jobs/JobListeners.java
+++ b/bundles/org.eclipse.core.jobs/src/org/eclipse/core/internal/jobs/JobListeners.java
@@ -20,46 +20,18 @@ import org.eclipse.osgi.util.NLS;
* specialized iterator to ensure the complex iteration logic is contained in one place.
*/
class JobListeners {
+
+ @FunctionalInterface
interface IListenerDoit {
public void notify(IJobChangeListener listener, IJobChangeEvent event);
}
- private final IListenerDoit aboutToRun = new IListenerDoit() {
- @Override
- public void notify(IJobChangeListener listener, IJobChangeEvent event) {
- listener.aboutToRun(event);
- }
- };
- private final IListenerDoit awake = new IListenerDoit() {
- @Override
- public void notify(IJobChangeListener listener, IJobChangeEvent event) {
- listener.awake(event);
- }
- };
- private final IListenerDoit done = new IListenerDoit() {
- @Override
- public void notify(IJobChangeListener listener, IJobChangeEvent event) {
- listener.done(event);
- }
- };
- private final IListenerDoit running = new IListenerDoit() {
- @Override
- public void notify(IJobChangeListener listener, IJobChangeEvent event) {
- listener.running(event);
- }
- };
- private final IListenerDoit scheduled = new IListenerDoit() {
- @Override
- public void notify(IJobChangeListener listener, IJobChangeEvent event) {
- listener.scheduled(event);
- }
- };
- private final IListenerDoit sleeping = new IListenerDoit() {
- @Override
- public void notify(IJobChangeListener listener, IJobChangeEvent event) {
- listener.sleeping(event);
- }
- };
+ private final IListenerDoit aboutToRun = (listener, event) -> listener.aboutToRun(event);
+ private final IListenerDoit awake = (listener, event) -> listener.awake(event);
+ private final IListenerDoit done = (listener, event) -> listener.done(event);
+ private final IListenerDoit running = (listener, event) -> listener.running(event);
+ private final IListenerDoit scheduled = (listener, event) -> listener.scheduled(event);
+ private final IListenerDoit sleeping = (listener, event) -> listener.sleeping(event);
/**
* The global job listeners.
*/
diff --git a/bundles/org.eclipse.core.jobs/src/org/eclipse/core/runtime/jobs/IJobFunction.java b/bundles/org.eclipse.core.jobs/src/org/eclipse/core/runtime/jobs/IJobFunction.java
index 0b5fa10a4..bacd4c677 100644
--- a/bundles/org.eclipse.core.jobs/src/org/eclipse/core/runtime/jobs/IJobFunction.java
+++ b/bundles/org.eclipse.core.jobs/src/org/eclipse/core/runtime/jobs/IJobFunction.java
@@ -20,6 +20,8 @@ import org.eclipse.core.runtime.*;
* @see Job#create(String, IJobFunction)
* @since 3.6
*/
+
+@FunctionalInterface
public interface IJobFunction {
/**
* Executes this job. Returns the result of the execution.