Unused code removed
This commit is contained in:
+1
-1
@@ -142,7 +142,7 @@ public enum AnalyzerFacadeForJVM implements AnalyzerFacade {
|
|||||||
BodiesResolveContext bodiesResolveContext = storeContextForBodiesResolve ?
|
BodiesResolveContext bodiesResolveContext = storeContextForBodiesResolve ?
|
||||||
new CachedBodiesResolveContext(topDownAnalysisContext) :
|
new CachedBodiesResolveContext(topDownAnalysisContext) :
|
||||||
null;
|
null;
|
||||||
return AnalyzeExhaust.success(trace.getBindingContext(), bodiesResolveContext, module);
|
return AnalyzeExhaust.success(trace.getBindingContext(), module);
|
||||||
}
|
}
|
||||||
finally {
|
finally {
|
||||||
injector.destroy();
|
injector.destroy();
|
||||||
|
|||||||
@@ -20,51 +20,35 @@ import org.jetbrains.annotations.NotNull;
|
|||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
import org.jetbrains.jet.lang.descriptors.ModuleDescriptor;
|
import org.jetbrains.jet.lang.descriptors.ModuleDescriptor;
|
||||||
import org.jetbrains.jet.lang.resolve.BindingContext;
|
import org.jetbrains.jet.lang.resolve.BindingContext;
|
||||||
import org.jetbrains.jet.lang.resolve.BodiesResolveContext;
|
|
||||||
import org.jetbrains.jet.lang.types.ErrorUtils;
|
import org.jetbrains.jet.lang.types.ErrorUtils;
|
||||||
|
|
||||||
public class AnalyzeExhaust {
|
public class AnalyzeExhaust {
|
||||||
public static final AnalyzeExhaust EMPTY = success(BindingContext.EMPTY, ErrorUtils.getErrorModule());
|
public static final AnalyzeExhaust EMPTY = success(BindingContext.EMPTY, ErrorUtils.getErrorModule());
|
||||||
|
|
||||||
public static AnalyzeExhaust success(@NotNull BindingContext bindingContext, @NotNull ModuleDescriptor module) {
|
|
||||||
return new AnalyzeExhaust(bindingContext, module, null, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
public static AnalyzeExhaust success(@NotNull BindingContext bindingContext,
|
public static AnalyzeExhaust success(@NotNull BindingContext bindingContext, @NotNull ModuleDescriptor module) {
|
||||||
@Nullable BodiesResolveContext bodiesResolveContext,
|
return new AnalyzeExhaust(bindingContext, module, null);
|
||||||
@NotNull ModuleDescriptor module
|
|
||||||
) {
|
|
||||||
return new AnalyzeExhaust(bindingContext, module, bodiesResolveContext, null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
public static AnalyzeExhaust error(@NotNull BindingContext bindingContext, @NotNull Throwable error) {
|
public static AnalyzeExhaust error(@NotNull BindingContext bindingContext, @NotNull Throwable error) {
|
||||||
return new AnalyzeExhaust(bindingContext, ErrorUtils.getErrorModule(), null, error);
|
return new AnalyzeExhaust(bindingContext, ErrorUtils.getErrorModule(), error);
|
||||||
}
|
}
|
||||||
|
|
||||||
private final BindingContext bindingContext;
|
private final BindingContext bindingContext;
|
||||||
private final Throwable error;
|
private final Throwable error;
|
||||||
private final BodiesResolveContext bodiesResolveContext;
|
|
||||||
private final ModuleDescriptor moduleDescriptor;
|
private final ModuleDescriptor moduleDescriptor;
|
||||||
|
|
||||||
private AnalyzeExhaust(
|
private AnalyzeExhaust(
|
||||||
@NotNull BindingContext bindingContext,
|
@NotNull BindingContext bindingContext,
|
||||||
@NotNull ModuleDescriptor moduleDescriptor,
|
@NotNull ModuleDescriptor moduleDescriptor,
|
||||||
@Nullable BodiesResolveContext bodiesResolveContext,
|
|
||||||
@Nullable Throwable error
|
@Nullable Throwable error
|
||||||
) {
|
) {
|
||||||
this.bindingContext = bindingContext;
|
this.bindingContext = bindingContext;
|
||||||
this.error = error;
|
this.error = error;
|
||||||
this.bodiesResolveContext = bodiesResolveContext;
|
|
||||||
this.moduleDescriptor = moduleDescriptor;
|
this.moduleDescriptor = moduleDescriptor;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nullable
|
|
||||||
public BodiesResolveContext getBodiesResolveContext() {
|
|
||||||
return bodiesResolveContext;
|
|
||||||
}
|
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
public BindingContext getBindingContext() {
|
public BindingContext getBindingContext() {
|
||||||
return bindingContext;
|
return bindingContext;
|
||||||
|
|||||||
@@ -1,25 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2010-2013 JetBrains s.r.o.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package org.jetbrains.jet.plugin.caches.resolve;
|
|
||||||
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
|
||||||
import org.jetbrains.jet.lang.resolve.BindingContext;
|
|
||||||
|
|
||||||
public interface KotlinDeclarationsCache {
|
|
||||||
@NotNull
|
|
||||||
BindingContext getBindingContext();
|
|
||||||
}
|
|
||||||
@@ -1,56 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2010-2013 JetBrains s.r.o.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package org.jetbrains.jet.plugin.caches.resolve;
|
|
||||||
|
|
||||||
import com.intellij.openapi.diagnostic.Logger;
|
|
||||||
import com.intellij.openapi.util.ModificationTracker;
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
|
||||||
import org.jetbrains.jet.analyzer.AnalyzeExhaust;
|
|
||||||
import org.jetbrains.jet.lang.resolve.BindingContext;
|
|
||||||
import org.jetbrains.jet.lang.resolve.BodiesResolveContext;
|
|
||||||
|
|
||||||
public class KotlinDeclarationsCacheImpl implements KotlinDeclarationsCache, ModificationTracker {
|
|
||||||
|
|
||||||
private static final Logger LOG = Logger.getInstance(KotlinDeclarationsCacheImpl.class);
|
|
||||||
|
|
||||||
private final AnalyzeExhaust exhaust;
|
|
||||||
|
|
||||||
public KotlinDeclarationsCacheImpl(@NotNull AnalyzeExhaust exhaust) {
|
|
||||||
this.exhaust = exhaust;
|
|
||||||
if (exhaust.isError()) {
|
|
||||||
LOG.error(exhaust.getError());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@NotNull
|
|
||||||
public BindingContext getBindingContext() {
|
|
||||||
return exhaust.getBindingContext();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public long getModificationCount() {
|
|
||||||
BodiesResolveContext context = exhaust.getBodiesResolveContext();
|
|
||||||
if (context == null) return 0;
|
|
||||||
return context.getExceptionTracker().getModificationCount();
|
|
||||||
}
|
|
||||||
|
|
||||||
@NotNull
|
|
||||||
public AnalyzeExhaust getAnalyzeExhaust() {
|
|
||||||
return exhaust;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -232,7 +232,7 @@ private class KotlinResolveCache(
|
|||||||
resolveSession.getModuleDescriptor(),
|
resolveSession.getModuleDescriptor(),
|
||||||
MemberFilter.ALWAYS_TRUE
|
MemberFilter.ALWAYS_TRUE
|
||||||
)
|
)
|
||||||
val resultingContext = injector.getLazyTopDownAnalyzer()!!.analyzeDeclarations(
|
injector.getLazyTopDownAnalyzer()!!.analyzeDeclarations(
|
||||||
resolveSession,
|
resolveSession,
|
||||||
TopDownAnalysisParameters.createForLazy(
|
TopDownAnalysisParameters.createForLazy(
|
||||||
resolveSession.getStorageManager(),
|
resolveSession.getStorageManager(),
|
||||||
@@ -245,7 +245,6 @@ private class KotlinResolveCache(
|
|||||||
)
|
)
|
||||||
return AnalyzeExhaust.success(
|
return AnalyzeExhaust.success(
|
||||||
trace.getBindingContext(),
|
trace.getBindingContext(),
|
||||||
resultingContext,
|
|
||||||
resolveSession.getModuleDescriptor()
|
resolveSession.getModuleDescriptor()
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -112,7 +112,7 @@ public final class AnalyzerFacadeForJS {
|
|||||||
BodiesResolveContext bodiesResolveContext = storeContextForBodiesResolve ?
|
BodiesResolveContext bodiesResolveContext = storeContextForBodiesResolve ?
|
||||||
new CachedBodiesResolveContext(topDownAnalysisContext) :
|
new CachedBodiesResolveContext(topDownAnalysisContext) :
|
||||||
null;
|
null;
|
||||||
return AnalyzeExhaust.success(trace.getBindingContext(), bodiesResolveContext, owner);
|
return AnalyzeExhaust.success(trace.getBindingContext(), owner);
|
||||||
}
|
}
|
||||||
finally {
|
finally {
|
||||||
injector.destroy();
|
injector.destroy();
|
||||||
|
|||||||
Reference in New Issue
Block a user