Rename class: AbstractDiagnosticFactory -> DiagnosticFactory
This commit is contained in:
@@ -28,7 +28,7 @@ import com.intellij.psi.PsiFile;
|
||||
import com.intellij.psi.util.PsiTreeUtil;
|
||||
import com.intellij.util.containers.Stack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.jet.lang.diagnostics.AbstractDiagnosticFactory;
|
||||
import org.jetbrains.jet.lang.diagnostics.DiagnosticFactory;
|
||||
import org.jetbrains.jet.lang.diagnostics.Diagnostic;
|
||||
import org.jetbrains.jet.lang.diagnostics.Severity;
|
||||
import org.jetbrains.jet.lang.psi.JetReferenceExpression;
|
||||
@@ -329,16 +329,16 @@ public class CheckerTestUtil {
|
||||
|
||||
public static class AbstractDiagnosticForTests implements Diagnostic {
|
||||
private final PsiElement element;
|
||||
private final AbstractDiagnosticFactory factory;
|
||||
private final DiagnosticFactory factory;
|
||||
|
||||
public AbstractDiagnosticForTests(@NotNull PsiElement element, @NotNull AbstractDiagnosticFactory factory) {
|
||||
public AbstractDiagnosticForTests(@NotNull PsiElement element, @NotNull DiagnosticFactory factory) {
|
||||
this.element = element;
|
||||
this.factory = factory;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public AbstractDiagnosticFactory getFactory() {
|
||||
public DiagnosticFactory getFactory() {
|
||||
return factory;
|
||||
}
|
||||
|
||||
@@ -372,7 +372,7 @@ public class CheckerTestUtil {
|
||||
}
|
||||
}
|
||||
|
||||
public static class SyntaxErrorDiagnosticFactory extends AbstractDiagnosticFactory {
|
||||
public static class SyntaxErrorDiagnosticFactory extends DiagnosticFactory {
|
||||
public static final SyntaxErrorDiagnosticFactory INSTANCE = new SyntaxErrorDiagnosticFactory();
|
||||
|
||||
private SyntaxErrorDiagnosticFactory() {}
|
||||
@@ -390,7 +390,7 @@ public class CheckerTestUtil {
|
||||
}
|
||||
}
|
||||
|
||||
public static class DebugInfoDiagnosticFactory extends AbstractDiagnosticFactory {
|
||||
public static class DebugInfoDiagnosticFactory extends DiagnosticFactory {
|
||||
public static final DebugInfoDiagnosticFactory ELEMENT_WITH_ERROR_TYPE = new DebugInfoDiagnosticFactory("ELEMENT_WITH_ERROR_TYPE");
|
||||
public static final DebugInfoDiagnosticFactory UNRESOLVED_WITH_TARGET = new DebugInfoDiagnosticFactory("UNRESOLVED_WITH_TARGET");
|
||||
public static final DebugInfoDiagnosticFactory MISSING_UNRESOLVED = new DebugInfoDiagnosticFactory("MISSING_UNRESOLVED");
|
||||
|
||||
@@ -24,7 +24,7 @@ import com.intellij.psi.util.PsiTreeUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.jet.JetNodeTypes;
|
||||
import org.jetbrains.jet.lang.descriptors.DeclarationDescriptor;
|
||||
import org.jetbrains.jet.lang.diagnostics.AbstractDiagnosticFactory;
|
||||
import org.jetbrains.jet.lang.diagnostics.DiagnosticFactory;
|
||||
import org.jetbrains.jet.lang.diagnostics.Diagnostic;
|
||||
import org.jetbrains.jet.lang.diagnostics.Errors;
|
||||
import org.jetbrains.jet.lang.psi.*;
|
||||
@@ -58,9 +58,9 @@ public class DebugInfoUtil {
|
||||
@NotNull final BindingContext bindingContext,
|
||||
@NotNull final DebugInfoReporter debugInfoReporter
|
||||
) {
|
||||
final Map<JetReferenceExpression, AbstractDiagnosticFactory> markedWithErrorElements = Maps.newHashMap();
|
||||
final Map<JetReferenceExpression, DiagnosticFactory> markedWithErrorElements = Maps.newHashMap();
|
||||
for (Diagnostic diagnostic : bindingContext.getDiagnostics()) {
|
||||
AbstractDiagnosticFactory factory = diagnostic.getFactory();
|
||||
DiagnosticFactory factory = diagnostic.getFactory();
|
||||
if (Errors.UNRESOLVED_REFERENCE_DIAGNOSTICS.contains(diagnostic.getFactory())) {
|
||||
markedWithErrorElements.put((JetReferenceExpression) diagnostic.getPsiElement(), factory);
|
||||
}
|
||||
@@ -131,7 +131,7 @@ public class DebugInfoUtil {
|
||||
boolean resolved = target != null;
|
||||
boolean markedWithError = markedWithErrorElements.containsKey(expression);
|
||||
JetType expressionType = bindingContext.get(EXPRESSION_TYPE, expression);
|
||||
AbstractDiagnosticFactory factory = markedWithErrorElements.get(expression);
|
||||
DiagnosticFactory factory = markedWithErrorElements.get(expression);
|
||||
if (declarationDescriptor != null &&
|
||||
(ErrorUtils.isError(declarationDescriptor) || ErrorUtils.containsErrorType(expressionType))) {
|
||||
if (factory != Errors.EXPRESSION_EXPECTED_NAMESPACE_FOUND) {
|
||||
|
||||
@@ -29,7 +29,7 @@ import org.jetbrains.jet.lang.cfg.PseudocodeTraverser.*;
|
||||
import org.jetbrains.jet.lang.cfg.PseudocodeVariablesData.VariableInitState;
|
||||
import org.jetbrains.jet.lang.cfg.PseudocodeVariablesData.VariableUseState;
|
||||
import org.jetbrains.jet.lang.descriptors.*;
|
||||
import org.jetbrains.jet.lang.diagnostics.AbstractDiagnosticFactory;
|
||||
import org.jetbrains.jet.lang.diagnostics.DiagnosticFactory;
|
||||
import org.jetbrains.jet.lang.diagnostics.Diagnostic;
|
||||
import org.jetbrains.jet.lang.diagnostics.Errors;
|
||||
import org.jetbrains.jet.lang.psi.*;
|
||||
@@ -49,7 +49,6 @@ import static org.jetbrains.jet.lang.cfg.PseudocodeTraverser.TraversalOrder.FORW
|
||||
import static org.jetbrains.jet.lang.cfg.PseudocodeVariablesData.VariableUseState.*;
|
||||
import static org.jetbrains.jet.lang.diagnostics.Errors.*;
|
||||
import static org.jetbrains.jet.lang.resolve.BindingContext.CAPTURED_IN_CLOSURE;
|
||||
import static org.jetbrains.jet.lang.types.TypeUtils.NO_EXPECTED_TYPE;
|
||||
import static org.jetbrains.jet.lang.types.TypeUtils.noExpectedType;
|
||||
|
||||
public class JetFlowInformationProvider {
|
||||
@@ -187,7 +186,7 @@ public class JetFlowInformationProvider {
|
||||
Map<Instruction, Edges<Map<VariableDescriptor,VariableInitState>>> initializers = pseudocodeVariablesData.getVariableInitializers();
|
||||
final Set<VariableDescriptor> declaredVariables = pseudocodeVariablesData.getDeclaredVariables(pseudocode, true);
|
||||
|
||||
final Map<Instruction, AbstractDiagnosticFactory> reportedDiagnosticMap = Maps.newHashMap();
|
||||
final Map<Instruction, DiagnosticFactory> reportedDiagnosticMap = Maps.newHashMap();
|
||||
|
||||
PseudocodeTraverser.traverse(pseudocode, FORWARD, initializers, new InstructionDataAnalyzeStrategy<Map<VariableDescriptor, PseudocodeVariablesData.VariableInitState>>() {
|
||||
@Override
|
||||
@@ -436,7 +435,7 @@ public class JetFlowInformationProvider {
|
||||
|
||||
public void markUnusedVariables() {
|
||||
Map<Instruction, Edges<Map<VariableDescriptor, VariableUseState>>> variableStatusData = pseudocodeVariablesData.getVariableUseStatusData();
|
||||
final Map<Instruction, AbstractDiagnosticFactory> reportedDiagnosticMap = Maps.newHashMap();
|
||||
final Map<Instruction, DiagnosticFactory> reportedDiagnosticMap = Maps.newHashMap();
|
||||
InstructionDataAnalyzeStrategy<Map<VariableDescriptor, VariableUseState>> variableStatusAnalyzeStrategy =
|
||||
new InstructionDataAnalyzeStrategy<Map<VariableDescriptor, PseudocodeVariablesData.VariableUseState>>() {
|
||||
@Override
|
||||
@@ -519,7 +518,7 @@ public class JetFlowInformationProvider {
|
||||
|
||||
public void markUnusedLiteralsInBlock() {
|
||||
assert pseudocode != null;
|
||||
final Map<Instruction, AbstractDiagnosticFactory> reportedDiagnosticMap = Maps.newHashMap();
|
||||
final Map<Instruction, DiagnosticFactory> reportedDiagnosticMap = Maps.newHashMap();
|
||||
PseudocodeTraverser.traverse(
|
||||
pseudocode, FORWARD, new InstructionAnalyzeStrategy() {
|
||||
@Override
|
||||
@@ -565,13 +564,13 @@ public class JetFlowInformationProvider {
|
||||
trace.report(diagnostic);
|
||||
return;
|
||||
}
|
||||
Map<Instruction, AbstractDiagnosticFactory> previouslyReported = ctxt.reportedDiagnosticMap;
|
||||
Map<Instruction, DiagnosticFactory> previouslyReported = ctxt.reportedDiagnosticMap;
|
||||
previouslyReported.put(instruction, diagnostic.getFactory());
|
||||
|
||||
boolean alreadyReported = false;
|
||||
boolean sameErrorForAllCopies = true;
|
||||
for (Instruction copy : instruction.getCopies()) {
|
||||
AbstractDiagnosticFactory previouslyReportedErrorFactory = previouslyReported.get(copy);
|
||||
DiagnosticFactory previouslyReportedErrorFactory = previouslyReported.get(copy);
|
||||
if (previouslyReportedErrorFactory != null) {
|
||||
alreadyReported = true;
|
||||
}
|
||||
@@ -594,7 +593,7 @@ public class JetFlowInformationProvider {
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean mustBeReportedOnAllCopies(@NotNull AbstractDiagnosticFactory diagnosticFactory) {
|
||||
private static boolean mustBeReportedOnAllCopies(@NotNull DiagnosticFactory diagnosticFactory) {
|
||||
return diagnosticFactory == UNUSED_VARIABLE
|
||||
|| diagnosticFactory == UNUSED_PARAMETER
|
||||
|| diagnosticFactory == UNUSED_CHANGED_VALUE;
|
||||
@@ -603,13 +602,13 @@ public class JetFlowInformationProvider {
|
||||
|
||||
|
||||
private class VariableContext {
|
||||
final Map<Instruction, AbstractDiagnosticFactory> reportedDiagnosticMap;
|
||||
final Map<Instruction, DiagnosticFactory> reportedDiagnosticMap;
|
||||
final Instruction instruction;
|
||||
final VariableDescriptor variableDescriptor;
|
||||
|
||||
private VariableContext(
|
||||
@NotNull Instruction instruction,
|
||||
@NotNull Map<Instruction, AbstractDiagnosticFactory> map
|
||||
@NotNull Map<Instruction, DiagnosticFactory> map
|
||||
) {
|
||||
this.instruction = instruction;
|
||||
reportedDiagnosticMap = map;
|
||||
@@ -623,7 +622,7 @@ public class JetFlowInformationProvider {
|
||||
|
||||
private VariableInitContext(
|
||||
@NotNull Instruction instruction,
|
||||
@NotNull Map<Instruction, AbstractDiagnosticFactory> map,
|
||||
@NotNull Map<Instruction, DiagnosticFactory> map,
|
||||
@NotNull Map<VariableDescriptor, VariableInitState> in,
|
||||
@NotNull Map<VariableDescriptor, VariableInitState> out
|
||||
) {
|
||||
@@ -640,7 +639,7 @@ public class JetFlowInformationProvider {
|
||||
|
||||
private VariableUseContext(
|
||||
@NotNull Instruction instruction,
|
||||
@NotNull Map<Instruction, AbstractDiagnosticFactory> map,
|
||||
@NotNull Map<Instruction, DiagnosticFactory> map,
|
||||
@NotNull Map<VariableDescriptor, VariableUseState> in,
|
||||
@NotNull Map<VariableDescriptor, VariableUseState> out
|
||||
) {
|
||||
|
||||
@@ -26,7 +26,7 @@ import java.util.List;
|
||||
public interface Diagnostic {
|
||||
|
||||
@NotNull
|
||||
AbstractDiagnosticFactory getFactory();
|
||||
DiagnosticFactory getFactory();
|
||||
|
||||
@NotNull
|
||||
Severity getSeverity();
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@ package org.jetbrains.jet.lang.diagnostics;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public abstract class AbstractDiagnosticFactory {
|
||||
public abstract class DiagnosticFactory {
|
||||
|
||||
private String name = null;
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@ import com.intellij.psi.PsiElement;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public abstract class DiagnosticFactoryWithPsiElement<E extends PsiElement> extends AbstractDiagnosticFactory {
|
||||
public abstract class DiagnosticFactoryWithPsiElement<E extends PsiElement> extends DiagnosticFactory {
|
||||
protected final Severity severity;
|
||||
protected final PositioningStrategy<? super E> positioningStrategy;
|
||||
|
||||
|
||||
@@ -560,13 +560,13 @@ public interface Errors {
|
||||
|
||||
|
||||
// Error sets
|
||||
ImmutableSet<? extends AbstractDiagnosticFactory> UNRESOLVED_REFERENCE_DIAGNOSTICS = ImmutableSet.of(
|
||||
ImmutableSet<? extends DiagnosticFactory> UNRESOLVED_REFERENCE_DIAGNOSTICS = ImmutableSet.of(
|
||||
UNRESOLVED_REFERENCE, NAMED_PARAMETER_NOT_FOUND, UNRESOLVED_REFERENCE_WRONG_RECEIVER);
|
||||
ImmutableSet<? extends AbstractDiagnosticFactory> UNUSED_ELEMENT_DIAGNOSTICS = ImmutableSet.of(
|
||||
ImmutableSet<? extends DiagnosticFactory> UNUSED_ELEMENT_DIAGNOSTICS = ImmutableSet.of(
|
||||
UNUSED_VARIABLE, UNUSED_PARAMETER, ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE);
|
||||
ImmutableSet<? extends AbstractDiagnosticFactory> REDECLARATION_DIAGNOSTICS = ImmutableSet.of(
|
||||
ImmutableSet<? extends DiagnosticFactory> REDECLARATION_DIAGNOSTICS = ImmutableSet.of(
|
||||
REDECLARATION, NAME_SHADOWING);
|
||||
ImmutableSet<? extends AbstractDiagnosticFactory> TYPE_INFERENCE_ERRORS = ImmutableSet.of(
|
||||
ImmutableSet<? extends DiagnosticFactory> TYPE_INFERENCE_ERRORS = ImmutableSet.of(
|
||||
TYPE_INFERENCE_NO_INFORMATION_FOR_PARAMETER, TYPE_INFERENCE_CONFLICTING_SUBSTITUTIONS, TYPE_INFERENCE_TYPE_CONSTRUCTOR_MISMATCH,
|
||||
TYPE_INFERENCE_UPPER_BOUND_VIOLATED, TYPE_INFERENCE_EXPECTED_TYPE_MISMATCH);
|
||||
|
||||
@@ -584,8 +584,8 @@ public interface Errors {
|
||||
if (Modifier.isStatic(field.getModifiers())) {
|
||||
try {
|
||||
Object value = field.get(null);
|
||||
if (value instanceof AbstractDiagnosticFactory) {
|
||||
AbstractDiagnosticFactory factory = (AbstractDiagnosticFactory)value;
|
||||
if (value instanceof DiagnosticFactory) {
|
||||
DiagnosticFactory factory = (DiagnosticFactory)value;
|
||||
factory.setName(field.getName());
|
||||
}
|
||||
}
|
||||
|
||||
+4
-4
@@ -17,7 +17,7 @@
|
||||
package org.jetbrains.jet.lang.diagnostics.rendering;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.jet.lang.diagnostics.AbstractDiagnosticFactory;
|
||||
import org.jetbrains.jet.lang.diagnostics.DiagnosticFactory;
|
||||
import org.jetbrains.jet.lang.diagnostics.Diagnostic;
|
||||
import org.jetbrains.jet.lang.diagnostics.Errors;
|
||||
import org.jetbrains.jet.lang.psi.JetExpression;
|
||||
@@ -474,9 +474,9 @@ public class DefaultErrorMessages {
|
||||
if (Modifier.isStatic(field.getModifiers())) {
|
||||
try {
|
||||
Object fieldValue = field.get(null);
|
||||
if (fieldValue instanceof AbstractDiagnosticFactory) {
|
||||
if (MAP.get((AbstractDiagnosticFactory) fieldValue) == null) {
|
||||
throw new IllegalStateException("No default diagnostic renderer is provided for " + ((AbstractDiagnosticFactory)fieldValue).getName());
|
||||
if (fieldValue instanceof DiagnosticFactory) {
|
||||
if (MAP.get((DiagnosticFactory) fieldValue) == null) {
|
||||
throw new IllegalStateException("No default diagnostic renderer is provided for " + ((DiagnosticFactory)fieldValue).getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -26,8 +26,8 @@ import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public final class DiagnosticFactoryToRendererMap {
|
||||
private final Map<AbstractDiagnosticFactory, DiagnosticRenderer<?>> map =
|
||||
new HashMap<AbstractDiagnosticFactory, DiagnosticRenderer<?>>();
|
||||
private final Map<DiagnosticFactory, DiagnosticRenderer<?>> map =
|
||||
new HashMap<DiagnosticFactory, DiagnosticRenderer<?>>();
|
||||
private boolean immutable = false;
|
||||
|
||||
private void checkMutability() {
|
||||
@@ -64,7 +64,7 @@ public final class DiagnosticFactoryToRendererMap {
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public DiagnosticRenderer<?> get(@NotNull AbstractDiagnosticFactory factory) {
|
||||
public DiagnosticRenderer<?> get(@NotNull DiagnosticFactory factory) {
|
||||
return map.get(factory);
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -22,7 +22,7 @@ import com.intellij.psi.tree.IElementType;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.jet.JetNodeTypes;
|
||||
import org.jetbrains.jet.lang.diagnostics.AbstractDiagnosticFactory;
|
||||
import org.jetbrains.jet.lang.diagnostics.DiagnosticFactory;
|
||||
import org.jetbrains.jet.lang.diagnostics.Diagnostic;
|
||||
import org.jetbrains.jet.lang.diagnostics.rendering.DefaultErrorMessages;
|
||||
import org.jetbrains.jet.lang.psi.JetConstantExpression;
|
||||
@@ -50,8 +50,8 @@ public class CompileTimeConstantResolver {
|
||||
@NotNull JetType expectedType
|
||||
) {
|
||||
CompileTimeConstant<?> compileTimeConstant = getCompileTimeConstant(expression, expectedType);
|
||||
Set<AbstractDiagnosticFactory> errorsThatDependOnExpectedType =
|
||||
Sets.<AbstractDiagnosticFactory>newHashSet(CONSTANT_EXPECTED_TYPE_MISMATCH, NULL_FOR_NONNULL_TYPE);
|
||||
Set<DiagnosticFactory> errorsThatDependOnExpectedType =
|
||||
Sets.<DiagnosticFactory>newHashSet(CONSTANT_EXPECTED_TYPE_MISMATCH, NULL_FOR_NONNULL_TYPE);
|
||||
|
||||
if (compileTimeConstant instanceof ErrorValueWithDiagnostic) {
|
||||
Diagnostic diagnostic = ((ErrorValueWithDiagnostic) compileTimeConstant).getDiagnostic();
|
||||
|
||||
+2
-2
@@ -27,7 +27,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.jet.JetNodeTypes;
|
||||
import org.jetbrains.jet.lang.descriptors.*;
|
||||
import org.jetbrains.jet.lang.diagnostics.AbstractDiagnosticFactory;
|
||||
import org.jetbrains.jet.lang.diagnostics.DiagnosticFactory;
|
||||
import org.jetbrains.jet.lang.diagnostics.Diagnostic;
|
||||
import org.jetbrains.jet.lang.diagnostics.Errors;
|
||||
import org.jetbrains.jet.lang.psi.*;
|
||||
@@ -459,7 +459,7 @@ public class ExpressionTypingUtils {
|
||||
|
||||
@Override
|
||||
public void report(@NotNull Diagnostic diagnostic) {
|
||||
AbstractDiagnosticFactory factory = diagnostic.getFactory();
|
||||
DiagnosticFactory factory = diagnostic.getFactory();
|
||||
if ((factory == TYPE_MISMATCH || factory == CONSTANT_EXPECTED_TYPE_MISMATCH || factory == NULL_FOR_NONNULL_TYPE)
|
||||
&& diagnostic.getPsiElement() == expressionToWatch) {
|
||||
mismatchFound[0] = true;
|
||||
|
||||
@@ -52,7 +52,7 @@ public abstract class AbstractJetDiagnosticsTest extends JetLiteFixture {
|
||||
|
||||
public static final String DIAGNOSTICS_DIRECTIVE = "DIAGNOSTICS";
|
||||
public static final Pattern DIAGNOSTICS_PATTERN = Pattern.compile("([\\+\\-!])(\\w+)\\s*");
|
||||
public static final ImmutableSet<AbstractDiagnosticFactory> DIAGNOSTICS_TO_INCLUDE_ANYWAY =
|
||||
public static final ImmutableSet<DiagnosticFactory> DIAGNOSTICS_TO_INCLUDE_ANYWAY =
|
||||
ImmutableSet.of(
|
||||
Errors.UNRESOLVED_REFERENCE,
|
||||
Errors.UNRESOLVED_REFERENCE_WRONG_RECEIVER,
|
||||
|
||||
@@ -19,7 +19,7 @@ package org.jetbrains.jet.plugin.quickfix;
|
||||
import com.google.common.collect.HashMultimap;
|
||||
import com.google.common.collect.Multimap;
|
||||
import com.intellij.codeInsight.intention.IntentionAction;
|
||||
import org.jetbrains.jet.lang.diagnostics.AbstractDiagnosticFactory;
|
||||
import org.jetbrains.jet.lang.diagnostics.DiagnosticFactory;
|
||||
import org.jetbrains.jet.lang.psi.JetClass;
|
||||
import org.jetbrains.jet.plugin.codeInsight.ImplementMethodsHandler;
|
||||
|
||||
@@ -30,14 +30,14 @@ import static org.jetbrains.jet.lexer.JetTokens.*;
|
||||
|
||||
public class QuickFixes {
|
||||
|
||||
private static final Multimap<AbstractDiagnosticFactory, JetIntentionActionsFactory> factories = HashMultimap.create();
|
||||
private static final Multimap<AbstractDiagnosticFactory, IntentionAction> actions = HashMultimap.create();
|
||||
private static final Multimap<DiagnosticFactory, JetIntentionActionsFactory> factories = HashMultimap.create();
|
||||
private static final Multimap<DiagnosticFactory, IntentionAction> actions = HashMultimap.create();
|
||||
|
||||
public static Collection<JetIntentionActionsFactory> getActionsFactories(AbstractDiagnosticFactory diagnosticFactory) {
|
||||
public static Collection<JetIntentionActionsFactory> getActionsFactories(DiagnosticFactory diagnosticFactory) {
|
||||
return factories.get(diagnosticFactory);
|
||||
}
|
||||
|
||||
public static Collection<IntentionAction> getActions(AbstractDiagnosticFactory diagnosticFactory) {
|
||||
public static Collection<IntentionAction> getActions(DiagnosticFactory diagnosticFactory) {
|
||||
return actions.get(diagnosticFactory);
|
||||
}
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ import org.jetbrains.jet.lang.descriptors.CallableDescriptor;
|
||||
import org.jetbrains.jet.lang.descriptors.SimpleFunctionDescriptor;
|
||||
import org.jetbrains.jet.lang.descriptors.TypeParameterDescriptor;
|
||||
import org.jetbrains.jet.lang.descriptors.ValueParameterDescriptor;
|
||||
import org.jetbrains.jet.lang.diagnostics.AbstractDiagnosticFactory;
|
||||
import org.jetbrains.jet.lang.diagnostics.DiagnosticFactory;
|
||||
import org.jetbrains.jet.lang.diagnostics.Diagnostic;
|
||||
import org.jetbrains.jet.lang.diagnostics.Errors;
|
||||
import org.jetbrains.jet.lang.psi.*;
|
||||
@@ -303,7 +303,7 @@ public class KotlinInlineValHandler extends InlineActionHandler {
|
||||
JetFunctionLiteral functionLiteral = functionLiteralExpression.getFunctionLiteral();
|
||||
BindingContext context = cancelableResolveSession.resolveToElement(functionLiteralExpression);
|
||||
for (Diagnostic diagnostic : context.getDiagnostics()) {
|
||||
AbstractDiagnosticFactory factory = diagnostic.getFactory();
|
||||
DiagnosticFactory factory = diagnostic.getFactory();
|
||||
PsiElement element = diagnostic.getPsiElement();
|
||||
boolean hasCantInferParameter = factory == Errors.CANNOT_INFER_PARAMETER_TYPE && element.getParent().getParent() == functionLiteral;
|
||||
boolean hasUnresolvedItOrThis = factory == Errors.UNRESOLVED_REFERENCE && element.getText().equals("it") &&
|
||||
|
||||
@@ -23,7 +23,7 @@ import org.jetbrains.jet.ConfigurationKind;
|
||||
import org.jetbrains.jet.JetLiteFixture;
|
||||
import org.jetbrains.jet.analyzer.AnalyzeExhaust;
|
||||
import org.jetbrains.jet.cli.jvm.compiler.JetCoreEnvironment;
|
||||
import org.jetbrains.jet.lang.diagnostics.AbstractDiagnosticFactory;
|
||||
import org.jetbrains.jet.lang.diagnostics.DiagnosticFactory;
|
||||
import org.jetbrains.jet.lang.diagnostics.Diagnostic;
|
||||
import org.jetbrains.jet.lang.diagnostics.Errors;
|
||||
import org.jetbrains.jet.lang.diagnostics.rendering.DefaultErrorMessages;
|
||||
@@ -48,14 +48,14 @@ public class DiagnosticMessageTest extends JetLiteFixture {
|
||||
return PluginTestCaseBase.getTestDataPathBase() + "/diagnosticMessage/";
|
||||
}
|
||||
|
||||
public void doTest(String name, int diagnosticNumber, AbstractDiagnosticFactory... diagnosticFactories) throws Exception {
|
||||
public void doTest(String name, int diagnosticNumber, DiagnosticFactory... diagnosticFactories) throws Exception {
|
||||
String fileName = name + ".kt";
|
||||
JetFile psiFile = createPsiFile(null, fileName, loadFile(fileName));
|
||||
|
||||
AnalyzeExhaust analyzeExhaust = AnalyzerFacadeForJVM.analyzeOneFileWithJavaIntegration(psiFile, Collections.<AnalyzerScriptParameter>emptyList());
|
||||
BindingContext bindingContext = analyzeExhaust.getBindingContext();
|
||||
|
||||
final Set<AbstractDiagnosticFactory> factoriesSet = Sets.newHashSet(diagnosticFactories);
|
||||
final Set<DiagnosticFactory> factoriesSet = Sets.newHashSet(diagnosticFactories);
|
||||
List<Diagnostic> diagnostics = ContainerUtil.filter(bindingContext.getDiagnostics().all(), new Condition<Diagnostic>() {
|
||||
@Override
|
||||
public boolean value(Diagnostic diagnostic) {
|
||||
|
||||
Reference in New Issue
Block a user