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
+6
View File
@@ -184,6 +184,12 @@
<artifactId>commons-lang3</artifactId>
</dependency>
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
<version>3.0.2</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
@@ -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;