Renames "possibly nothing" to "probably nothing"

This commit is contained in:
Valentin Kipyatkov
2014-11-19 18:50:59 +03:00
parent e5579bcf32
commit 3b77d337e8
15 changed files with 53 additions and 54 deletions
@@ -29,5 +29,5 @@ public interface KotlinFunctionStub extends KotlinStubWithFqName<JetNamedFunctio
boolean hasTypeParameterListBeforeFunctionName();
boolean isPossiblyNothingType();
boolean isProbablyNothingType();
}
@@ -27,5 +27,5 @@ public interface KotlinPropertyStub extends KotlinStubWithFqName<JetProperty> {
boolean hasReceiverTypeRef();
boolean hasReturnTypeRef();
boolean isPossiblyNothingType();
boolean isProbablyNothingType();
}
@@ -44,10 +44,9 @@ public class JetFunctionElementType extends JetStubElementType<KotlinFunctionStu
FqName fqName = ResolveSessionUtils.safeFqNameForLazyResolve(psi);
boolean hasBlockBody = psi.hasBlockBody();
boolean hasBody = psi.hasBody();
boolean isNothing = ElementsPackage.isPossiblyNothing(psi.getTypeReference());
return new KotlinFunctionStubImpl(parentStub, StringRef.fromString(psi.getName()), isTopLevel, fqName,
isExtension, hasBlockBody, hasBody, psi.hasTypeParameterListBeforeFunctionName(),
isNothing);
ElementsPackage.isProbablyNothing(psi.getTypeReference()));
}
@Override
@@ -62,7 +61,7 @@ public class JetFunctionElementType extends JetStubElementType<KotlinFunctionStu
dataStream.writeBoolean(stub.hasBlockBody());
dataStream.writeBoolean(stub.hasBody());
dataStream.writeBoolean(stub.hasTypeParameterListBeforeFunctionName());
dataStream.writeBoolean(stub.isPossiblyNothingType());
dataStream.writeBoolean(stub.isProbablyNothingType());
}
@NotNull
@@ -78,10 +77,10 @@ public class JetFunctionElementType extends JetStubElementType<KotlinFunctionStu
boolean hasBlockBody = dataStream.readBoolean();
boolean hasBody = dataStream.readBoolean();
boolean hasTypeParameterListBeforeFunctionName = dataStream.readBoolean();
boolean possiblyNothingType = dataStream.readBoolean();
boolean probablyNothingType = dataStream.readBoolean();
return new KotlinFunctionStubImpl(parentStub, name, isTopLevel, fqName, isExtension, hasBlockBody, hasBody,
hasTypeParameterListBeforeFunctionName, possiblyNothingType);
hasTypeParameterListBeforeFunctionName, probablyNothingType);
}
@Override
@@ -47,7 +47,7 @@ public class JetPropertyElementType extends JetStubElementType<KotlinPropertyStu
psi.isVar(), psi.isTopLevel(), psi.hasDelegate(),
psi.hasDelegateExpression(), psi.hasInitializer(),
psi.getReceiverTypeReference() != null, psi.getTypeReference() != null,
ElementsPackage.isPossiblyNothing(psi.getTypeReference()),
ElementsPackage.isProbablyNothing(psi.getTypeReference()),
ResolveSessionUtils.safeFqNameForLazyResolve(psi)
);
}
@@ -62,7 +62,7 @@ public class JetPropertyElementType extends JetStubElementType<KotlinPropertyStu
dataStream.writeBoolean(stub.hasInitializer());
dataStream.writeBoolean(stub.hasReceiverTypeRef());
dataStream.writeBoolean(stub.hasReturnTypeRef());
dataStream.writeBoolean(stub.isPossiblyNothingType());
dataStream.writeBoolean(stub.isProbablyNothingType());
FqName fqName = stub.getFqName();
dataStream.writeName(fqName != null ? fqName.asString() : null);
@@ -79,13 +79,13 @@ public class JetPropertyElementType extends JetStubElementType<KotlinPropertyStu
boolean hasInitializer = dataStream.readBoolean();
boolean hasReceiverTypeRef = dataStream.readBoolean();
boolean hasReturnTypeRef = dataStream.readBoolean();
boolean possiblyNothing = dataStream.readBoolean();
boolean probablyNothing = dataStream.readBoolean();
StringRef fqNameAsString = dataStream.readName();
FqName fqName = fqNameAsString != null ? new FqName(fqNameAsString.toString()) : null;
return new KotlinPropertyStubImpl(parentStub, name, isVar, isTopLevel, hasDelegate,
hasDelegateExpression, hasInitializer, hasReceiverTypeRef, hasReturnTypeRef, possiblyNothing,
hasDelegateExpression, hasInitializer, hasReceiverTypeRef, hasReturnTypeRef, probablyNothing,
fqName);
}
@@ -19,5 +19,5 @@ package org.jetbrains.jet.lang.psi.stubs.elements
import org.jetbrains.jet.lang.psi.JetUserType
import org.jetbrains.jet.lang.psi.JetTypeReference
fun JetTypeReference?.isPossiblyNothing()
fun JetTypeReference?.isProbablyNothing()
= (this?.getTypeElement() as? JetUserType)?.getReferencedName() == "Nothing"
@@ -34,7 +34,7 @@ public class KotlinFunctionStubImpl extends KotlinStubBaseImpl<JetNamedFunction>
private final boolean hasBlockBody;
private final boolean hasBody;
private final boolean hasTypeParameterListBeforeFunctionName;
private final boolean possiblyNothingType;
private final boolean probablyNothingType;
public KotlinFunctionStubImpl(
@NotNull StubElement parent,
@@ -45,7 +45,7 @@ public class KotlinFunctionStubImpl extends KotlinStubBaseImpl<JetNamedFunction>
boolean hasBlockBody,
boolean hasBody,
boolean hasTypeParameterListBeforeFunctionName,
boolean possiblyNothingType
boolean probablyNothingType
) {
super(parent, JetStubElementTypes.FUNCTION);
@@ -60,7 +60,7 @@ public class KotlinFunctionStubImpl extends KotlinStubBaseImpl<JetNamedFunction>
this.hasBlockBody = hasBlockBody;
this.hasBody = hasBody;
this.hasTypeParameterListBeforeFunctionName = hasTypeParameterListBeforeFunctionName;
this.possiblyNothingType = possiblyNothingType;
this.probablyNothingType = probablyNothingType;
}
@Override
@@ -100,7 +100,7 @@ public class KotlinFunctionStubImpl extends KotlinStubBaseImpl<JetNamedFunction>
}
@Override
public boolean isPossiblyNothingType() {
return possiblyNothingType;
public boolean isProbablyNothingType() {
return probablyNothingType;
}
}
@@ -33,7 +33,7 @@ public class KotlinPropertyStubImpl extends KotlinStubBaseImpl<JetProperty> impl
private final boolean hasInitializer;
private final boolean hasReceiverTypeRef;
private final boolean hasReturnTypeRef;
private final boolean possiblyNothingType;
private final boolean probablyNothingType;
private final FqName fqName;
public KotlinPropertyStubImpl(
@@ -46,7 +46,7 @@ public class KotlinPropertyStubImpl extends KotlinStubBaseImpl<JetProperty> impl
boolean hasInitializer,
boolean hasReceiverTypeRef,
boolean hasReturnTypeRef,
boolean possiblyNothingType,
boolean probablyNothingType,
@Nullable FqName fqName
) {
super(parent, JetStubElementTypes.PROPERTY);
@@ -66,7 +66,7 @@ public class KotlinPropertyStubImpl extends KotlinStubBaseImpl<JetProperty> impl
this.hasInitializer = hasInitializer;
this.hasReceiverTypeRef = hasReceiverTypeRef;
this.hasReturnTypeRef = hasReturnTypeRef;
this.possiblyNothingType = possiblyNothingType;
this.probablyNothingType = probablyNothingType;
this.fqName = fqName;
}
@@ -106,8 +106,8 @@ public class KotlinPropertyStubImpl extends KotlinStubBaseImpl<JetProperty> impl
}
@Override
public boolean isPossiblyNothingType() {
return possiblyNothingType;
public boolean isProbablyNothingType() {
return probablyNothingType;
}
@Nullable