weaken access as suggested by IDEA
This commit is contained in:
@@ -103,7 +103,7 @@ public final class TipsManager {
|
||||
else {
|
||||
Collection<DeclarationDescriptor> descriptorsSet = Sets.newHashSet();
|
||||
|
||||
ArrayList<ReceiverDescriptor> result = new ArrayList<ReceiverDescriptor>();
|
||||
List<ReceiverDescriptor> result = new ArrayList<ReceiverDescriptor>();
|
||||
resolutionScope.getImplicitReceiversHierarchy(result);
|
||||
|
||||
for (ReceiverDescriptor receiverDescriptor : result) {
|
||||
@@ -119,7 +119,10 @@ public final class TipsManager {
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static Collection<DeclarationDescriptor> getPackageReferenceVariants(JetSimpleNameExpression expression, BindingContext context) {
|
||||
public static Collection<DeclarationDescriptor> getPackageReferenceVariants(
|
||||
JetSimpleNameExpression expression,
|
||||
BindingContext context
|
||||
) {
|
||||
JetScope resolutionScope = context.get(BindingContext.RESOLUTION_SCOPE, expression);
|
||||
if (resolutionScope != null) {
|
||||
return excludeNonPackageDescriptors(resolutionScope.getAllDescriptors());
|
||||
@@ -129,7 +132,8 @@ public final class TipsManager {
|
||||
}
|
||||
|
||||
public static Collection<DeclarationDescriptor> excludePrivateDescriptors(
|
||||
@NotNull Collection<DeclarationDescriptor> descriptors) {
|
||||
@NotNull Collection<DeclarationDescriptor> descriptors
|
||||
) {
|
||||
|
||||
return Collections2.filter(descriptors, new Predicate<DeclarationDescriptor>() {
|
||||
@Override
|
||||
@@ -148,7 +152,7 @@ public final class TipsManager {
|
||||
) {
|
||||
final Set<DeclarationDescriptor> descriptorsSet = Sets.newHashSet(descriptors);
|
||||
|
||||
final ArrayList<ReceiverDescriptor> result = new ArrayList<ReceiverDescriptor>();
|
||||
final List<ReceiverDescriptor> result = new ArrayList<ReceiverDescriptor>();
|
||||
scope.getImplicitReceiversHierarchy(result);
|
||||
|
||||
descriptorsSet.removeAll(
|
||||
@@ -169,9 +173,10 @@ public final class TipsManager {
|
||||
|
||||
return Lists.newArrayList(descriptorsSet);
|
||||
}
|
||||
|
||||
|
||||
private static Collection<DeclarationDescriptor> excludeNonPackageDescriptors(
|
||||
@NotNull Collection<DeclarationDescriptor> descriptors) {
|
||||
@NotNull Collection<DeclarationDescriptor> descriptors
|
||||
) {
|
||||
return Collections2.filter(descriptors, new Predicate<DeclarationDescriptor>() {
|
||||
@Override
|
||||
public boolean apply(DeclarationDescriptor declarationDescriptor) {
|
||||
@@ -195,12 +200,12 @@ public final class TipsManager {
|
||||
|
||||
descriptorsSet.addAll(
|
||||
Collections2.filter(JetScopeUtils.getAllExtensions(externalScope),
|
||||
new Predicate<CallableDescriptor>() {
|
||||
@Override
|
||||
public boolean apply(CallableDescriptor callableDescriptor) {
|
||||
return ExpressionTypingUtils.checkIsExtensionCallable(receiverDescriptor, callableDescriptor);
|
||||
}
|
||||
}));
|
||||
new Predicate<CallableDescriptor>() {
|
||||
@Override
|
||||
public boolean apply(CallableDescriptor callableDescriptor) {
|
||||
return ExpressionTypingUtils.checkIsExtensionCallable(receiverDescriptor, callableDescriptor);
|
||||
}
|
||||
}));
|
||||
|
||||
return descriptorsSet;
|
||||
}
|
||||
|
||||
@@ -173,7 +173,7 @@ public class ClosureAnnotator {
|
||||
jetFile.accept(visitor);
|
||||
}
|
||||
|
||||
ArrayList<JetFile> namespaceFiles = new ArrayList<JetFile>();
|
||||
Collection<JetFile> namespaceFiles = new ArrayList<JetFile>();
|
||||
for (JetFile jetFile : entry.getValue()) {
|
||||
Collection<JetDeclaration> fileFunctions = new ArrayList<JetDeclaration>();
|
||||
for (JetDeclaration declaration : jetFile.getDeclarations()) {
|
||||
|
||||
@@ -26,6 +26,7 @@ import org.jetbrains.jet.lang.resolve.java.JvmClassName;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import static org.jetbrains.jet.codegen.JetTypeMapper.TYPE_OBJECT;
|
||||
|
||||
@@ -223,7 +224,7 @@ public abstract class CodegenContext {
|
||||
|
||||
public abstract boolean isStatic();
|
||||
|
||||
public void copyAccessors(HashMap<DeclarationDescriptor, DeclarationDescriptor> accessors) {
|
||||
public void copyAccessors(Map<DeclarationDescriptor, DeclarationDescriptor> accessors) {
|
||||
if (accessors != null) {
|
||||
if (this.accessors == null) {
|
||||
this.accessors = new HashMap<DeclarationDescriptor, DeclarationDescriptor>();
|
||||
|
||||
@@ -607,7 +607,7 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen {
|
||||
|
||||
ObjectOrClosureCodegen closure = context.closure;
|
||||
int firstSuperArgument = -1;
|
||||
final LinkedList<JvmMethodParameterSignature> consArgTypes =
|
||||
final List<JvmMethodParameterSignature> consArgTypes =
|
||||
new LinkedList<JvmMethodParameterSignature>(constructorMethod.getKotlinParameterTypes());
|
||||
|
||||
int insert = 0;
|
||||
@@ -737,7 +737,7 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen {
|
||||
Type classType = typeMapper.mapType(descriptor.getDefaultType(), MapTypeMode.IMPL);
|
||||
JvmClassName classname = JvmClassName.byType(classType);
|
||||
|
||||
HashSet<FunctionDescriptor> overridden = new HashSet<FunctionDescriptor>();
|
||||
Collection<FunctionDescriptor> overridden = new HashSet<FunctionDescriptor>();
|
||||
for (JetDeclaration declaration : myClass.getDeclarations()) {
|
||||
if (declaration instanceof JetNamedFunction) {
|
||||
SimpleFunctionDescriptor functionDescriptor = bindingContext.get(BindingContext.FUNCTION, declaration);
|
||||
|
||||
Reference in New Issue
Block a user