Move from deprecated ISourceModule to IModuleSource.
Only for internals to preserve compatibility.
Change-Id: I70bec4372192d6dcad6a64d371dc88d782f7baac
Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
diff --git a/core/plugins/org.eclipse.dltk.core/compiler/org/eclipse/dltk/internal/compiler/env/NameEnvironmentAnswer.java b/core/plugins/org.eclipse.dltk.core/compiler/org/eclipse/dltk/internal/compiler/env/NameEnvironmentAnswer.java
index 33c988b..c9c08f5 100644
--- a/core/plugins/org.eclipse.dltk.core/compiler/org/eclipse/dltk/internal/compiler/env/NameEnvironmentAnswer.java
+++ b/core/plugins/org.eclipse.dltk.core/compiler/org/eclipse/dltk/internal/compiler/env/NameEnvironmentAnswer.java
@@ -5,19 +5,19 @@
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
-
+
*******************************************************************************/
package org.eclipse.dltk.internal.compiler.env;
-import org.eclipse.dltk.compiler.env.ISourceModule;
+import org.eclipse.dltk.compiler.env.IModuleSource;
import org.eclipse.dltk.compiler.env.ISourceType;
public class NameEnvironmentAnswer {
- private ISourceModule compilationUnit;
+ private IModuleSource compilationUnit;
private ISourceType[] sourceTypes;
private AccessRestriction accessRestriction;
- public NameEnvironmentAnswer(ISourceModule compilationUnit,
+ public NameEnvironmentAnswer(IModuleSource compilationUnit,
AccessRestriction accessRestriction) {
this.compilationUnit = compilationUnit;
this.accessRestriction = accessRestriction;
@@ -40,14 +40,14 @@
* Answer the compilation unit or null if the receiver represents a binary
* or source type.
*/
- public ISourceModule getSourceModule() {
+ public IModuleSource getSourceModule() {
return this.compilationUnit;
}
/**
* Answer the unresolved source forms for the type or null if the receiver
* represents a compilation unit or binary type.
- *
+ *
* Multiple source forms can be answered in case the originating compilation
* unit did contain several type at once. Then the first type is guaranteed
* to be the requested type.
@@ -86,8 +86,7 @@
return true;
if (this.accessRestriction == null)
return true;
- return otherAnswer.accessRestriction != null
- && this.accessRestriction.getProblemId() < otherAnswer.accessRestriction
- .getProblemId();
+ return otherAnswer.accessRestriction != null && this.accessRestriction
+ .getProblemId() < otherAnswer.accessRestriction.getProblemId();
}
}
diff --git a/core/plugins/org.eclipse.dltk.core/model/org/eclipse/dltk/internal/core/AbstractSourceModule.java b/core/plugins/org.eclipse.dltk.core/model/org/eclipse/dltk/internal/core/AbstractSourceModule.java
index f3adbb9..c7f997e 100644
--- a/core/plugins/org.eclipse.dltk.core/model/org/eclipse/dltk/internal/core/AbstractSourceModule.java
+++ b/core/plugins/org.eclipse.dltk.core/model/org/eclipse/dltk/internal/core/AbstractSourceModule.java
@@ -23,6 +23,7 @@
import org.eclipse.core.runtime.IStatus;
import org.eclipse.dltk.annotations.Nullable;
import org.eclipse.dltk.compiler.CharOperation;
+import org.eclipse.dltk.compiler.env.IModuleSource;
import org.eclipse.dltk.core.BufferChangedEvent;
import org.eclipse.dltk.core.CompletionRequestor;
import org.eclipse.dltk.core.DLTKContentTypeManager;
@@ -54,7 +55,7 @@
import org.eclipse.dltk.utils.CorePrinter;
public abstract class AbstractSourceModule extends Openable
- implements ISourceModule, org.eclipse.dltk.compiler.env.ISourceModule {
+ implements ISourceModule, IModuleSource {
private static final int DEFAULT_COMPLETION_TIMEOUT = 5000;
// ~ Static fields/initializers
diff --git a/core/plugins/org.eclipse.dltk.core/model/org/eclipse/dltk/internal/core/BuiltinSourceModule.java b/core/plugins/org.eclipse.dltk.core/model/org/eclipse/dltk/internal/core/BuiltinSourceModule.java
index cac1e53..ccd05af 100644
--- a/core/plugins/org.eclipse.dltk.core/model/org/eclipse/dltk/internal/core/BuiltinSourceModule.java
+++ b/core/plugins/org.eclipse.dltk.core/model/org/eclipse/dltk/internal/core/BuiltinSourceModule.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
@@ -12,6 +12,7 @@
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
+import org.eclipse.dltk.compiler.env.IModuleSource;
import org.eclipse.dltk.core.IDLTKLanguageToolkit;
import org.eclipse.dltk.core.IScriptProject;
import org.eclipse.dltk.core.ISourceModule;
@@ -20,8 +21,8 @@
/**
* Represents a builtin source module.
*/
-public class BuiltinSourceModule extends AbstractExternalSourceModule implements
- org.eclipse.dltk.compiler.env.ISourceModule {
+public class BuiltinSourceModule extends AbstractExternalSourceModule
+ implements IModuleSource {
public BuiltinSourceModule(BuiltinScriptFolder parent, String name,
WorkingCopyOwner owner) {
diff --git a/core/plugins/org.eclipse.dltk.core/model/org/eclipse/dltk/internal/core/SearchableEnvironment.java b/core/plugins/org.eclipse.dltk.core/model/org/eclipse/dltk/internal/core/SearchableEnvironment.java
index f02b054..2d4e160 100644
--- a/core/plugins/org.eclipse.dltk.core/model/org/eclipse/dltk/internal/core/SearchableEnvironment.java
+++ b/core/plugins/org.eclipse.dltk.core/model/org/eclipse/dltk/internal/core/SearchableEnvironment.java
@@ -1,15 +1,14 @@
/*******************************************************************************
- * 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
* http://www.eclipse.org/legal/epl-v10.html
*
-
*******************************************************************************/
package org.eclipse.dltk.internal.core;
-import org.eclipse.dltk.compiler.env.ISourceModule;
+import org.eclipse.dltk.compiler.env.IModuleSource;
import org.eclipse.dltk.core.DLTKCore;
import org.eclipse.dltk.core.DLTKLanguageManager;
import org.eclipse.dltk.core.ISearchableEnvironment;
@@ -25,7 +24,7 @@
public class SearchableEnvironment implements ISearchableEnvironment {
public NameLookup nameLookup;
- protected ISourceModule unitToSkip;
+ protected IModuleSource unitToSkip;
protected org.eclipse.dltk.core.ISourceModule[] workingCopies;
@@ -57,8 +56,8 @@
this.searchScope = BasicSearchEngine.createSearchScope(project);
} else {
this.searchScope = BasicSearchEngine.createSearchScope(
- this.nameLookup.projectFragments, DLTKLanguageManager
- .getLanguageToolkit(project));
+ this.nameLookup.projectFragments,
+ DLTKLanguageManager.getLanguageToolkit(project));
}
}
@@ -67,8 +66,10 @@
*/
public SearchableEnvironment(ScriptProject project, WorkingCopyOwner owner)
throws ModelException {
- this(project, owner == null ? null : ModelManager.getModelManager()
- .getWorkingCopies(owner, true)); // add primary WCs
+ this(project, owner == null ? null
+ : ModelManager.getModelManager().getWorkingCopies(owner, true)); // add
+ // primary
+ // WCs
}
@Override
diff --git a/core/plugins/org.eclipse.dltk.core/model/org/eclipse/dltk/internal/core/SearchableEnvironmentRequestor.java b/core/plugins/org.eclipse.dltk.core/model/org/eclipse/dltk/internal/core/SearchableEnvironmentRequestor.java
index 515c6ef..425db26 100644
--- a/core/plugins/org.eclipse.dltk.core/model/org/eclipse/dltk/internal/core/SearchableEnvironmentRequestor.java
+++ b/core/plugins/org.eclipse.dltk.core/model/org/eclipse/dltk/internal/core/SearchableEnvironmentRequestor.java
@@ -9,7 +9,7 @@
package org.eclipse.dltk.internal.core;
import org.eclipse.dltk.compiler.CharOperation;
-import org.eclipse.dltk.compiler.env.ISourceModule;
+import org.eclipse.dltk.compiler.env.IModuleSource;
import org.eclipse.dltk.core.DLTKCore;
import org.eclipse.dltk.core.IModelElement;
import org.eclipse.dltk.core.IProjectFragment;
@@ -35,7 +35,7 @@
* The <code>ICompilationUNit</code> this ModelElementRequestor will not
* accept types within.
*/
- protected ISourceModule unitToSkip;
+ protected IModuleSource unitToSkip;
protected IScriptProject project;
@@ -62,7 +62,7 @@
* <code>unitToSkip</code>.
*/
public SearchableEnvironmentRequestor(ISearchRequestor requestor,
- ISourceModule unitToSkip, IScriptProject project,
+ IModuleSource unitToSkip, IScriptProject project,
NameLookup nameLookup) {
this.requestor = requestor;
this.unitToSkip = unitToSkip;
@@ -79,8 +79,8 @@
*/
@Override
public void acceptScriptFolder(IScriptFolder ScriptFolder) {
- this.requestor.acceptPackage(ScriptFolder.getElementName()
- .toCharArray());
+ this.requestor
+ .acceptPackage(ScriptFolder.getElementName().toCharArray());
}
/**
@@ -116,14 +116,15 @@
char[] fileWithoutExtension = type.getElementName()
.toCharArray();
accessRestriction = accessRuleSet
- .getViolatedRestriction(CharOperation
- .concatWith(packageChars,
+ .getViolatedRestriction(
+ CharOperation.concatWith(packageChars,
fileWithoutExtension, '/'));
}
}
}
- this.requestor.acceptType(packageName, type.getElementName()
- .toCharArray(), null, type.getFlags(), accessRestriction);
+ this.requestor.acceptType(packageName,
+ type.getElementName().toCharArray(), null, type.getFlags(),
+ accessRestriction);
} catch (ModelException jme) {
// ignore
}