mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-03-22 15:19:59 +07:00
Add missing nullability annotations in the PyCustomStub API
GitOrigin-RevId: 2dd1d144d675a2449b2ba3292bfd4fd312b68fea
This commit is contained in:
committed by
intellij-monorepo-bot
parent
f51f790d44
commit
71b010feed
@@ -18,6 +18,7 @@ package com.jetbrains.python.psi.impl.stubs;
|
||||
import com.intellij.psi.stubs.StubInputStream;
|
||||
import com.jetbrains.python.psi.PyTargetExpression;
|
||||
import com.jetbrains.python.psi.stubs.PropertyStubStorage;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.io.IOException;
|
||||
@@ -26,12 +27,12 @@ import java.io.IOException;
|
||||
public final class PropertyStubType extends CustomTargetExpressionStubType<PropertyStubStorage> {
|
||||
@Nullable
|
||||
@Override
|
||||
public PropertyStubStorage createStub(PyTargetExpression psi) {
|
||||
public PropertyStubStorage createStub(@NotNull PyTargetExpression psi) {
|
||||
return PropertyStubStorage.fromCall(psi.findAssignedValue());
|
||||
}
|
||||
|
||||
@Override
|
||||
public PropertyStubStorage deserializeStub(StubInputStream stream) throws IOException {
|
||||
public PropertyStubStorage deserializeStub(@NotNull StubInputStream stream) throws IOException {
|
||||
return PropertyStubStorage.deserialize(stream);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ public final class PyTypingAliasStubType extends CustomTargetExpressionStubType<
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public PyTypingAliasStub createStub(PyTargetExpression psi) {
|
||||
public PyTypingAliasStub createStub(@NotNull PyTargetExpression psi) {
|
||||
final PyExpression value = getAssignedValueIfTypeAliasLike(psi, true);
|
||||
return value != null ? new PyTypingTypeAliasStubImpl(value.getText()) : null;
|
||||
}
|
||||
@@ -155,7 +155,7 @@ public final class PyTypingAliasStubType extends CustomTargetExpressionStubType<
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public PyTypingAliasStub deserializeStub(StubInputStream stream) throws IOException {
|
||||
public PyTypingAliasStub deserializeStub(@NotNull StubInputStream stream) throws IOException {
|
||||
String ref = stream.readNameString();
|
||||
return ref != null ? new PyTypingTypeAliasStubImpl(ref) : null;
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ public class PyTypingTypeAliasStubImpl implements PyTypingAliasStub {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void serialize(StubOutputStream stream) throws IOException {
|
||||
public void serialize(@NotNull StubOutputStream stream) throws IOException {
|
||||
stream.writeName(myText);
|
||||
}
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ public class PropertyStubStorage extends PropertyBunch<String> implements Custom
|
||||
}
|
||||
|
||||
@Override
|
||||
public void serialize(StubOutputStream stream) throws IOException {
|
||||
public void serialize(@NotNull StubOutputStream stream) throws IOException {
|
||||
writeOne(myGetter, stream);
|
||||
writeOne(mySetter, stream);
|
||||
writeOne(myDeleter, stream);
|
||||
|
||||
Reference in New Issue
Block a user