Migrate away from deprecated APIs.

* SourceRange - use the API not the internal.
* MixinModel.find*() use the non-deprecated API that takes
ProgressMonitor as additional param.
* Don't use the wrongly named TypePatten but the proper TypePattern
class name.

Change-Id: I07042e7f970975419d02bea07059931776d9e9a4
Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
diff --git a/plugins/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/core/model/FakeMethod.java b/plugins/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/core/model/FakeMethod.java
index 6aec6b4..2db9903 100644
--- a/plugins/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/core/model/FakeMethod.java
+++ b/plugins/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/core/model/FakeMethod.java
@@ -1,11 +1,10 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation and others.
+ * Copyright (c) 2005, 2016 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.core.model;
 
@@ -13,10 +12,10 @@
 import org.eclipse.dltk.core.IScriptProject;
 import org.eclipse.dltk.core.ISourceRange;
 import org.eclipse.dltk.core.ModelException;
+import org.eclipse.dltk.core.SourceRange;
 import org.eclipse.dltk.internal.core.ModelElement;
 import org.eclipse.dltk.internal.core.SourceMethod;
 import org.eclipse.dltk.internal.core.SourceMethodUtils;
-import org.eclipse.dltk.internal.core.SourceRange;
 
 public class FakeMethod extends SourceMethod {
 
diff --git a/plugins/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/core/utils/RubySyntaxUtils.java b/plugins/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/core/utils/RubySyntaxUtils.java
index a99e8a9..32698c3 100644
--- a/plugins/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/core/utils/RubySyntaxUtils.java
+++ b/plugins/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/core/utils/RubySyntaxUtils.java
@@ -1,18 +1,17 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation and others.
+ * Copyright (c) 2005, 2016 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.core.utils;
 
 import java.util.regex.Pattern;
 
 import org.eclipse.dltk.core.ISourceRange;
-import org.eclipse.dltk.internal.core.SourceRange;
+import org.eclipse.dltk.core.SourceRange;
 
 public class RubySyntaxUtils {
 	
diff --git a/plugins/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/internal/core/codeassist/RubyCompletionEngine.java b/plugins/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/internal/core/codeassist/RubyCompletionEngine.java
index dad4ea2..e253750 100644
--- a/plugins/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/internal/core/codeassist/RubyCompletionEngine.java
+++ b/plugins/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/internal/core/codeassist/RubyCompletionEngine.java
@@ -15,6 +15,7 @@
 import java.util.List;
 import java.util.Set;
 
+import org.eclipse.core.runtime.NullProgressMonitor;
 import org.eclipse.dltk.ast.ASTNode;
 import org.eclipse.dltk.ast.Modifiers;
 import org.eclipse.dltk.ast.declarations.MethodDeclaration;
@@ -564,7 +565,7 @@
 				position);
 
 		IMixinElement[] elements = mixinModel.getRawModel().find(
-				(prefix != null ? prefix : Util.EMPTY_STRING) + "*"); //$NON-NLS-1$
+				(prefix != null ? prefix : Util.EMPTY_STRING) + "*", new NullProgressMonitor()); //$NON-NLS-1$
 
 		// String[] findKeys = RubyMixinModel.getRawInstance().findKeys(
 		// prefix + "*");
@@ -749,7 +750,7 @@
 
 		if (prefix != null && prefix.length() > 0) {
 			String varkey = "Object" + MixinModel.SEPARATOR + prefix; //$NON-NLS-1$
-			String[] keys2 = mixinModel.getRawModel().findKeys(varkey + "*"); //$NON-NLS-1$
+			String[] keys2 = mixinModel.getRawModel().findKeys(varkey + "*", new NullProgressMonitor()); //$NON-NLS-1$
 			for (int i = 0; i < keys2.length; i++) {
 				IRubyMixinElement element = mixinModel
 						.createRubyElement(keys2[i]);
diff --git a/plugins/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/internal/core/search/RubySearchPatternProcessor.java b/plugins/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/internal/core/search/RubySearchPatternProcessor.java
index 0faa5f6..26de3c2 100644
--- a/plugins/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/internal/core/search/RubySearchPatternProcessor.java
+++ b/plugins/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/internal/core/search/RubySearchPatternProcessor.java
@@ -57,11 +57,11 @@
 	public ITypePattern parseType(String patternString) {
 		final int pos = patternString.lastIndexOf(TYPE_DELIMITER);
 		if (pos != -1) {
-			return new TypePatten(patternString.substring(0, pos).replace(
+			return new TypePattern(patternString.substring(0, pos).replace(
 					TYPE_DELIMITER, TYPE_SEPARATOR_STR),
 					patternString.substring(pos + TYPE_DELIMITER.length()));
 		} else {
-			return new TypePatten(null, patternString);
+			return new TypePattern(null, patternString);
 		}
 	}
 
diff --git a/plugins/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/typeinference/RubyModelUtils.java b/plugins/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/typeinference/RubyModelUtils.java
index 32aa591..838e976 100644
--- a/plugins/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/typeinference/RubyModelUtils.java
+++ b/plugins/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/typeinference/RubyModelUtils.java
@@ -13,6 +13,7 @@
 
 import org.eclipse.core.runtime.Assert;
 import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.NullProgressMonitor;
 import org.eclipse.dltk.ast.ASTNode;
 import org.eclipse.dltk.ast.ASTVisitor;
 import org.eclipse.dltk.ast.declarations.MethodDeclaration;
@@ -200,7 +201,7 @@
 			String inner = keys[keys.length - 1];
 			if (prefix.length() > 0 && !prefix.startsWith("@")) { //$NON-NLS-1$ // locals & constants
 				String varkey = inner + MixinModel.SEPARATOR + prefix;
-				String[] keys2 = rubyModel.getRawModel().findKeys(varkey + "*"); //$NON-NLS-1$
+				String[] keys2 = rubyModel.getRawModel().findKeys(varkey + "*", new NullProgressMonitor()); //$NON-NLS-1$
 				for (int i = 0; i < keys2.length; i++) {
 					IRubyMixinElement element = rubyModel
 							.createRubyElement(keys2[i]);