Add some @Nullable annotations

Making it easier to tell where API contracts allow nulls, where it's
otherwise unclear without reading the implementation.
This commit is contained in:
Peter Marheine
2019-05-23 10:37:35 +10:00
parent 5077e0d5e1
commit d42af4575f
2 changed files with 9 additions and 0 deletions
@@ -41,6 +41,7 @@ import org.springframework.web.bind.ServletRequestUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import javax.annotation.Nullable;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@@ -314,6 +315,7 @@ public class StreamController {
return duration * (long)maxBitRate * 1000L / 8L;
}
@Nullable
private HttpRange getRange(HttpServletRequest request, MediaFile file) {
// First, look for "Range" HTTP header.
@@ -332,6 +334,7 @@ public class StreamController {
return null;
}
@Nullable
private HttpRange parseAndConvertOffsetSeconds(String offsetSeconds, MediaFile file) {
if (offsetSeconds == null) {
return null;