Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kurtakov2018-07-18 11:56:15 -0400
committerAlexander Kurtakov2018-07-18 11:56:15 -0400
commit13f5f0b15fcbd21d97a3746b88323cd354645303 (patch)
tree5937397c55fb4a12ff2028ee21f02628e6996d9d /org.eclipse.ui.workbench.texteditor
parente73a322d845e119eda68a22dbd59e2fce44acfe4 (diff)
downloadeclipse.platform.text-13f5f0b15fcbd21d97a3746b88323cd354645303.tar.gz
eclipse.platform.text-13f5f0b15fcbd21d97a3746b88323cd354645303.tar.xz
eclipse.platform.text-13f5f0b15fcbd21d97a3746b88323cd354645303.zip
Comparator to lambda.
And other lambda conversions done by the quick fix. Change-Id: Iba9da0ae5028783913f66c04eb3e7e221332b119 Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
Diffstat (limited to 'org.eclipse.ui.workbench.texteditor')
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/rulers/RulerColumnRegistry.java19
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/templates/TemplateVariableProcessor.java10
2 files changed, 11 insertions, 18 deletions
diff --git a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/rulers/RulerColumnRegistry.java b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/rulers/RulerColumnRegistry.java
index 9baa4e649..beaa24efa 100644
--- a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/rulers/RulerColumnRegistry.java
+++ b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/rulers/RulerColumnRegistry.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2015 IBM Corporation and others.
+ * Copyright (c) 2000, 2018 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
@@ -233,16 +233,13 @@ public final class RulerColumnRegistry {
}
}
- Comparator<RulerColumnDescriptor> gravityComp= new Comparator<RulerColumnDescriptor>() {
- @Override
- public int compare(RulerColumnDescriptor o1, RulerColumnDescriptor o2) {
- float diff= o1.getPlacement().getGravity() - o2.getPlacement().getGravity();
- if (diff == 0)
- return 0;
- if (diff < 0)
- return -1;
- return 1;
- }
+ Comparator<RulerColumnDescriptor> gravityComp = (o1, o2) -> {
+ float diff = o1.getPlacement().getGravity() - o2.getPlacement().getGravity();
+ if (diff == 0)
+ return 0;
+ if (diff < 0)
+ return -1;
+ return 1;
};
/* Topological sort - always select the source with the least gravity */
diff --git a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/templates/TemplateVariableProcessor.java b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/templates/TemplateVariableProcessor.java
index 18b983acc..f543351a0 100644
--- a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/templates/TemplateVariableProcessor.java
+++ b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/templates/TemplateVariableProcessor.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2015 IBM Corporation and others.
+ * Copyright (c) 2000, 2018 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,12 +37,8 @@ import org.eclipse.jface.text.templates.TemplateVariableResolver;
*/
final class TemplateVariableProcessor implements IContentAssistProcessor {
- private static Comparator<TemplateVariableProposal> fgTemplateVariableProposalComparator= new Comparator<TemplateVariableProposal>() {
- @Override
- public int compare(TemplateVariableProposal proposal0, TemplateVariableProposal proposal1) {
- return proposal0.getDisplayString().compareTo(proposal1.getDisplayString());
- }
- };
+ private static Comparator<TemplateVariableProposal> fgTemplateVariableProposalComparator = (proposal0,
+ proposal1) -> proposal0.getDisplayString().compareTo(proposal1.getDisplayString());
/** the context type */

Back to the top