PY-16771 Never return null as description in section based docstrings
authorMikhail Golubev <mikhail.golubev@jetbrains.com>
Thu, 24 Sep 2015 16:00:38 +0000 (19:00 +0300)
committerMikhail Golubev <mikhail.golubev@jetbrains.com>
Fri, 25 Sep 2015 12:38:34 +0000 (15:38 +0300)
python/psi-api/src/com/jetbrains/python/psi/StructuredDocString.java
python/src/com/jetbrains/python/documentation/docstrings/EpydocString.java
python/src/com/jetbrains/python/documentation/docstrings/PlainDocString.java
python/src/com/jetbrains/python/documentation/docstrings/SectionBasedDocString.java
python/src/com/jetbrains/python/documentation/docstrings/SphinxDocString.java
python/src/com/jetbrains/python/documentation/docstrings/TagBasedDocString.java

index 3e701cec9900beb4dac35a93d011f7b57fa2addb..3ffc323479cd46683b14f856d259f5f766a15ed3 100644 (file)
@@ -27,6 +27,7 @@ import java.util.List;
 public interface StructuredDocString {
 
   String getSummary();
+  @NotNull
   String getDescription(); // for formatter
 
   @NotNull
index 25fb496e9139b0e82e6560f5140f6f7ebf567f04..f2110768371dc9b6916fb12f5ed152f35cd10ec1 100644 (file)
@@ -50,6 +50,7 @@ public class EpydocString extends TagBasedDocString {
     super(docstringText, "@");
   }
 
+  @NotNull
   @Override
   public String getDescription() {
     final String html = inlineMarkupToHTML(myDescription);
index e023000dbaf248e6e81656e9906d16936f25e3cd..169427608f20187e15eaee7789c3cfd3b802b4d7 100644 (file)
@@ -57,6 +57,7 @@ public class PlainDocString extends DocStringLineParser implements StructuredDoc
     return mySummary;
   }
 
+  @NotNull
   @Override
   public String getDescription() {
     return myDescription;
index 7e6e8efd171d0e914f940d281488c19cf7c99999..2a678c468b03eae7da969164cb31d3fc3960d9f2 100644 (file)
@@ -299,9 +299,10 @@ public abstract class SectionBasedDocString extends DocStringLineParser implemen
     return mySummary != null ? mySummary.concatTrimmedLines("\n") : "";
   }
 
+  @NotNull
   @Override
   public String getDescription() {
-    return null;
+    return "";
   }
 
   @NotNull
index 5f850863cdc19577eb599f175c0a9bb41f1281d3..37f2d2cbcfdfc8bf325b4b276b40fa4db5a6a0bf 100644 (file)
@@ -123,6 +123,7 @@ public class SphinxDocString extends TagBasedDocString {
     return paramName == null ? getTagValue("type") : getTagValue("type", paramName);
   }
 
+  @NotNull
   @Override
   public String getDescription() {
     return myDescription.replaceAll("\n", "<br/>");
index 745c4f2a953e614b6e72771fd1d5406cbfe79579..2c17f050fa7d716994f7c6ba3ad2cef0ef324a5e 100644 (file)
@@ -74,6 +74,7 @@ public abstract class TagBasedDocString extends DocStringLineParser implements S
 
   public abstract List<String> getAdditionalTags();
 
+  @NotNull
   @Override
   public String getDescription() {
     return myDescription;