Remove unused code and convert to lambdas.

Change-Id: Id27953e371ccdc9597a870bef85887a8cb8e5b4d
Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
diff --git a/plugins/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/typeinference/RubyEvaluatorFactory.java b/plugins/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/typeinference/RubyEvaluatorFactory.java
index 27f1eb4..b60a245 100644
--- a/plugins/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/typeinference/RubyEvaluatorFactory.java
+++ b/plugins/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/typeinference/RubyEvaluatorFactory.java
@@ -2,7 +2,6 @@
 
 import java.util.ArrayList;
 import java.util.Arrays;
-import java.util.Comparator;
 import java.util.List;
 
 import org.eclipse.core.runtime.IConfigurationElement;
@@ -57,12 +56,7 @@
 			}
 		}
 		f = factories.toArray(new FactoryInfo[factories.size()]);
-		Arrays.sort(f, new Comparator<FactoryInfo>() {
-			@Override
-			public int compare(FactoryInfo f1, FactoryInfo f2) {
-				return f2.priority - f1.priority; 
-			}
-		});
+		Arrays.sort(f, (f1, f2) -> f2.priority - f1.priority);
 	}
 
 	@Override
diff --git a/plugins/org.eclipse.dltk.ruby.formatter/src/org/eclipse/dltk/ruby/formatter/internal/RubyFormatterNodeBuilder.java b/plugins/org.eclipse.dltk.ruby.formatter/src/org/eclipse/dltk/ruby/formatter/internal/RubyFormatterNodeBuilder.java
index d274800..8c97651 100644
--- a/plugins/org.eclipse.dltk.ruby.formatter/src/org/eclipse/dltk/ruby/formatter/internal/RubyFormatterNodeBuilder.java
+++ b/plugins/org.eclipse.dltk.ruby.formatter/src/org/eclipse/dltk/ruby/formatter/internal/RubyFormatterNodeBuilder.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2008, 2016 xored software, Inc. and others.
+ * Copyright (c) 2008, 2017 xored software, Inc. and others.
  *
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
@@ -361,11 +361,6 @@
 				return null;
 			}
 
-			/*
-			 * @see
-			 * org.jruby.ast.visitor.AbstractVisitor#visitBeginNode(org.jruby
-			 * .ast.BeginNode)
-			 */
 			@Override
 			public Instruction visitBeginNode(BeginNode visited) {
 				FormatterBeginNode beginNode = new FormatterBeginNode(document);
@@ -636,13 +631,7 @@
 				- position.getStartOffset());
 	}
 
-	protected static final Comparator<Node> POSITION_COMPARATOR = new Comparator<Node>() {
-
-		@Override
-		public int compare(Node node1, Node node2) {
-			return node1.getStartOffset() - node2.getStartOffset();
-		}
-
-	};
+	protected static final Comparator<Node> POSITION_COMPARATOR = (node1, node2) -> node1.getStartOffset()
+			- node2.getStartOffset();
 
 }
diff --git a/plugins/org.eclipse.dltk.ruby.ui/src/org/eclipse/dltk/ruby/internal/ui/RubyUILanguageToolkit.java b/plugins/org.eclipse.dltk.ruby.ui/src/org/eclipse/dltk/ruby/internal/ui/RubyUILanguageToolkit.java
index b2f7848..b00321b 100644
--- a/plugins/org.eclipse.dltk.ruby.ui/src/org/eclipse/dltk/ruby/internal/ui/RubyUILanguageToolkit.java
+++ b/plugins/org.eclipse.dltk.ruby.ui/src/org/eclipse/dltk/ruby/internal/ui/RubyUILanguageToolkit.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2016 IBM Corporation and others.
+ * Copyright (c) 2005, 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
@@ -55,10 +55,6 @@
 			buf.append(s);
 		}
 
-		protected char getTypeDelimiter() {
-			return '$';
-		}
-
 		@Override
 		protected void getImportContainerLabel(IModelElement element,
 				long flags, StringBuffer buf) {
diff --git a/plugins/org.eclipse.dltk.ruby.ui/src/org/eclipse/dltk/ruby/internal/ui/text/RubyCodeScanner.java b/plugins/org.eclipse.dltk.ruby.ui/src/org/eclipse/dltk/ruby/internal/ui/text/RubyCodeScanner.java
index 647c45b..0d14bbc 100644
--- a/plugins/org.eclipse.dltk.ruby.ui/src/org/eclipse/dltk/ruby/internal/ui/text/RubyCodeScanner.java
+++ b/plugins/org.eclipse.dltk.ruby.ui/src/org/eclipse/dltk/ruby/internal/ui/text/RubyCodeScanner.java
@@ -1,11 +1,10 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2016 IBM Corporation and others.
+ * Copyright (c) 2005, 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
  * http://www.eclipse.org/legal/epl-v10.html
  *
- 
  *******************************************************************************/
 package org.eclipse.dltk.ruby.internal.ui.text;
 
@@ -44,10 +43,6 @@
 		return Arrays.binarySearch(pseudoKeywords, keyword) >= 0;
 	}
 
-	// TODO: use
-	private static final String[] additionalKeywords = {
-			"initialize", "new", "loop" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-
 	private static final String[] fgPseudoVariables = {
 			"true", "false", "self", "nil" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
 
diff --git a/plugins/org.eclipse.dltk.ruby.ui/src/org/eclipse/dltk/ruby/internal/ui/text/completion/RubyCompletionProposalCollector.java b/plugins/org.eclipse.dltk.ruby.ui/src/org/eclipse/dltk/ruby/internal/ui/text/completion/RubyCompletionProposalCollector.java
index 149f7a0..bb0f35a 100644
--- a/plugins/org.eclipse.dltk.ruby.ui/src/org/eclipse/dltk/ruby/internal/ui/text/completion/RubyCompletionProposalCollector.java
+++ b/plugins/org.eclipse.dltk.ruby.ui/src/org/eclipse/dltk/ruby/internal/ui/text/completion/RubyCompletionProposalCollector.java
@@ -1,11 +1,10 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2016 IBM Corporation and others.
+ * Copyright (c) 2005, 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
  * http://www.eclipse.org/legal/epl-v10.html
  *
- 
  *******************************************************************************/
 package org.eclipse.dltk.ruby.internal.ui.text.completion;
 
@@ -55,8 +54,7 @@
 			IScriptProject scriptProject, ISourceModule compilationUnit,
 			String name, String[] paramTypes, int start, int length,
 			String displayName, String completionProposal) {
-		return new RubyOverrideCompletionProposal(scriptProject,
-				compilationUnit, name, paramTypes, start, length, displayName,
+		return new RubyOverrideCompletionProposal(compilationUnit, name, start, length, displayName,
 				completionProposal);
 	}
 
diff --git a/plugins/org.eclipse.dltk.ruby.ui/src/org/eclipse/dltk/ruby/internal/ui/text/completion/RubyOverrideCompletionProposal.java b/plugins/org.eclipse.dltk.ruby.ui/src/org/eclipse/dltk/ruby/internal/ui/text/completion/RubyOverrideCompletionProposal.java
index 8477b68..05af679 100644
--- a/plugins/org.eclipse.dltk.ruby.ui/src/org/eclipse/dltk/ruby/internal/ui/text/completion/RubyOverrideCompletionProposal.java
+++ b/plugins/org.eclipse.dltk.ruby.ui/src/org/eclipse/dltk/ruby/internal/ui/text/completion/RubyOverrideCompletionProposal.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2016 IBM Corporation and others.
+ * Copyright (c) 2000, 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,7 +10,6 @@
 
 import org.eclipse.core.runtime.Assert;
 import org.eclipse.core.runtime.CoreException;
-import org.eclipse.dltk.core.IScriptProject;
 import org.eclipse.dltk.core.ISourceModule;
 import org.eclipse.dltk.ui.text.completion.ScriptTypeCompletionProposal;
 import org.eclipse.jface.text.BadLocationException;
@@ -23,22 +22,15 @@
 
 public class RubyOverrideCompletionProposal extends ScriptTypeCompletionProposal implements ICompletionProposalExtension4 {
 
-	private IScriptProject fDTLKProject;
 	private String fMethodName;
-	private String[] fParamTypes;
 
-	public RubyOverrideCompletionProposal(IScriptProject jproject, ISourceModule cu, String methodName, String[] paramTypes, int start, int length, String displayName, String completionProposal) {
+	public RubyOverrideCompletionProposal(ISourceModule cu, String methodName, int start, int length, String displayName, String completionProposal) {
 		super(completionProposal, cu, start, length, null, displayName, 0);
-		Assert.isNotNull(jproject);
 		Assert.isNotNull(methodName);
-		Assert.isNotNull(paramTypes);
 		Assert.isNotNull(cu);
 
-		fParamTypes= paramTypes;
 		fMethodName= methodName;
 
-		fDTLKProject= jproject;
-		
 		StringBuffer buffer= new StringBuffer();
 		buffer.append(completionProposal);