Unused parameter removed

This commit is contained in:
Andrey Breslav
2014-04-09 17:28:30 +04:00
parent fdc42c6c1d
commit 5e2630bc12
5 changed files with 10 additions and 13 deletions
@@ -145,7 +145,7 @@ public class AnnotationResolver {
);
}
if (shouldResolveArguments) {
resolveAnnotationArguments(entryElement, scope, trace);
resolveAnnotationArguments(entryElement, trace);
}
result.add(descriptor);
@@ -199,27 +199,26 @@ public class AnnotationResolver {
);
}
public void resolveAnnotationsArguments(@NotNull JetScope scope, @Nullable JetModifierList modifierList, @NotNull BindingTrace trace) {
public void resolveAnnotationsArguments(@Nullable JetModifierList modifierList, @NotNull BindingTrace trace) {
if (modifierList == null) {
return;
}
for (JetAnnotationEntry annotationEntry : modifierList.getAnnotationEntries()) {
resolveAnnotationArguments(annotationEntry, scope, trace);
resolveAnnotationArguments(annotationEntry, trace);
}
}
public void resolveAnnotationsArguments(@NotNull Annotated descriptor, @NotNull BindingTrace trace, @NotNull JetScope scope) {
public void resolveAnnotationsArguments(@NotNull Annotated descriptor, @NotNull BindingTrace trace) {
for (AnnotationDescriptor annotationDescriptor : descriptor.getAnnotations()) {
JetAnnotationEntry annotationEntry = trace.getBindingContext().get(ANNOTATION_DESCRIPTOR_TO_PSI_ELEMENT, annotationDescriptor);
assert annotationEntry != null : "Cannot find annotation entry: " + annotationDescriptor;
resolveAnnotationArguments(annotationEntry, scope, trace);
resolveAnnotationArguments(annotationEntry, trace);
}
}
private static void resolveAnnotationArguments(
@NotNull JetAnnotationEntry annotationEntry,
@NotNull JetScope scope,
@NotNull BindingTrace trace
) {
AnnotationDescriptor annotationDescriptor = trace.getBindingContext().get(BindingContext.ANNOTATION, annotationEntry);
@@ -36,7 +36,6 @@ import org.jetbrains.jet.lang.resolve.scopes.receivers.ReceiverValue;
import org.jetbrains.jet.lang.types.*;
import org.jetbrains.jet.lang.types.expressions.DataFlowUtils;
import org.jetbrains.jet.lang.types.expressions.ExpressionTypingServices;
import org.jetbrains.jet.lexer.JetKeywordToken;
import org.jetbrains.jet.lexer.JetModifierKeywordToken;
import org.jetbrains.jet.lexer.JetTokens;
import org.jetbrains.jet.util.Box;
@@ -384,7 +383,7 @@ public class BodyResolver {
ClassDescriptorWithResolutionScopes classDescriptor = entry.getValue();
ConstructorDescriptor unsubstitutedPrimaryConstructor = classDescriptor.getUnsubstitutedPrimaryConstructor();
annotationResolver.resolveAnnotationsArguments(classDescriptor.getScopeForClassHeaderResolution(), klass.getPrimaryConstructorModifierList(), trace);
annotationResolver.resolveAnnotationsArguments(klass.getPrimaryConstructorModifierList(), trace);
if (unsubstitutedPrimaryConstructor != null) {
WritableScope parameterScope = getPrimaryConstructorParametersScope(classDescriptor.getScopeForClassHeaderResolution(), unsubstitutedPrimaryConstructor);
@@ -645,7 +644,7 @@ public class BodyResolver {
}
private void resolveAnnotationArguments(@NotNull JetScope scope, @NotNull JetModifierListOwner owner) {
annotationResolver.resolveAnnotationsArguments(scope, owner.getModifierList(), trace);
annotationResolver.resolveAnnotationsArguments(owner.getModifierList(), trace);
}
private static void computeDeferredType(JetType type) {
@@ -185,7 +185,7 @@ public abstract class AbstractLazyMemberScope<D extends DeclarationDescriptor, D
// thus doesn't have a surrounding data flow
DataFlowInfo.EMPTY);
result.add(propertyDescriptor);
resolveSession.getAnnotationResolver().resolveAnnotationsArguments(propertyDescriptor, trace, resolutionScope);
resolveSession.getAnnotationResolver().resolveAnnotationsArguments(propertyDescriptor, trace);
}
getNonDeclaredProperties(name, result);
@@ -378,7 +378,7 @@ public class ExpressionTypingServices {
ValueParameterDescriptor valueParameterDescriptor = valueParameterDescriptors.get(i);
JetParameter jetParameter = valueParameters.get(i);
annotationResolver.resolveAnnotationsArguments(declaringScope, jetParameter.getModifierList(), trace);
annotationResolver.resolveAnnotationsArguments(jetParameter.getModifierList(), trace);
if (!needCompleteAnalysis) continue;
@@ -213,8 +213,7 @@ public class ResolveElementCache {
resolveSession.getAnnotationResolver().resolveAnnotationsArguments(
descriptor,
resolveSession.getTrace(),
resolveSession.getScopeProvider().getResolutionScopeForDeclaration(declaration)
resolveSession.getTrace()
);
ForceResolveUtil.forceResolveAllContents(descriptor.getAnnotations());