diff --git a/python/psi-api/src/com/jetbrains/python/psi/PyStubElementType.java b/python/psi-api/src/com/jetbrains/python/psi/PyStubElementType.java index 63aa84ac338a..7ac7547e2c47 100644 --- a/python/psi-api/src/com/jetbrains/python/psi/PyStubElementType.java +++ b/python/psi-api/src/com/jetbrains/python/psi/PyStubElementType.java @@ -24,9 +24,10 @@ public abstract class PyStubElementType { return ((PyFile)file).getLanguageLevel(); } + @NotNull @Override public String getExternalId() { return "python.FILE"; } @Override - public void serialize(PyFileStub stub, StubOutputStream dataStream) throws IOException { + public void serialize(@NotNull PyFileStub stub, @NotNull StubOutputStream dataStream) throws IOException { writeNullableList(dataStream, stub.getDunderAll()); writeBitSet(dataStream, stub.getFutureFeatures()); dataStream.writeName(stub.getDeprecationMessage()); } + @NotNull @Override - public PyFileStub deserialize(StubInputStream dataStream, StubElement parentStub) throws IOException { + public PyFileStub deserialize(@NotNull StubInputStream dataStream, StubElement parentStub) throws IOException { List all = readNullableList(dataStream); BitSet future_features = readBitSet(dataStream); StringRef deprecationMessage = dataStream.readName(); diff --git a/python/src/com/jetbrains/python/psi/impl/stubs/PyAnnotationElementType.java b/python/src/com/jetbrains/python/psi/impl/stubs/PyAnnotationElementType.java index 7512acd3befd..daa5038f2f45 100644 --- a/python/src/com/jetbrains/python/psi/impl/stubs/PyAnnotationElementType.java +++ b/python/src/com/jetbrains/python/psi/impl/stubs/PyAnnotationElementType.java @@ -38,11 +38,12 @@ public class PyAnnotationElementType extends PyStubElementType getStubElementType()); } - public void serialize(final PyClassStub pyClassStub, final StubOutputStream dataStream) throws IOException { + public void serialize(@NotNull final PyClassStub pyClassStub, @NotNull final StubOutputStream dataStream) throws IOException { dataStream.writeName(pyClassStub.getName()); final PyQualifiedName[] classes = pyClassStub.getSuperClasses(); dataStream.writeByte(classes.length); @@ -66,7 +66,8 @@ public class PyClassElementType extends PyStubElementType dataStream.writeUTFFast(docString != null ? docString : ""); } - public PyClassStub deserialize(final StubInputStream dataStream, final StubElement parentStub) throws IOException { + @NotNull + public PyClassStub deserialize(@NotNull final StubInputStream dataStream, final StubElement parentStub) throws IOException { String name = StringRef.toString(dataStream.readName()); int superClassCount = dataStream.readByte(); PyQualifiedName[] superClasses = new PyQualifiedName[superClassCount]; @@ -78,7 +79,7 @@ public class PyClassElementType extends PyStubElementType return new PyClassStubImpl(name, parentStub, superClasses, slots, docString.length() > 0 ? docString : null, getStubElementType()); } - public void indexStub(final PyClassStub stub, final IndexSink sink) { + public void indexStub(@NotNull final PyClassStub stub, @NotNull final IndexSink sink) { final String name = stub.getName(); if (name != null) { sink.occurrence(PyClassNameIndex.KEY, name); diff --git a/python/src/com/jetbrains/python/psi/impl/stubs/PyDecoratorCallElementType.java b/python/src/com/jetbrains/python/psi/impl/stubs/PyDecoratorCallElementType.java index 9eff8fae4d23..1d78a798d5aa 100644 --- a/python/src/com/jetbrains/python/psi/impl/stubs/PyDecoratorCallElementType.java +++ b/python/src/com/jetbrains/python/psi/impl/stubs/PyDecoratorCallElementType.java @@ -36,11 +36,12 @@ public class PyDecoratorCallElementType extends PyStubElementType 0 ? docString : null, deprecationMessage, parentStub, getStubElementType()); } - public void indexStub(final PyFunctionStub stub, final IndexSink sink) { + public void indexStub(@NotNull final PyFunctionStub stub, @NotNull final IndexSink sink) { final String name = stub.getName(); if (name != null) { sink.occurrence(PyFunctionNameIndex.KEY, name); diff --git a/python/src/com/jetbrains/python/psi/impl/stubs/PyImportElementElementType.java b/python/src/com/jetbrains/python/psi/impl/stubs/PyImportElementElementType.java index 3cbc48b5fa9b..e2d6dad14c8e 100644 --- a/python/src/com/jetbrains/python/psi/impl/stubs/PyImportElementElementType.java +++ b/python/src/com/jetbrains/python/psi/impl/stubs/PyImportElementElementType.java @@ -46,12 +46,13 @@ public class PyImportElementElementType extends PyStubElementType