Add some @Nullable annotations

Making it easier to tell where API contracts allow nulls, where it's
otherwise unclear without reading the implementation.
master
Peter Marheine 5 years ago
parent 5077e0d5e1
commit d42af4575f
  1. 6
      airsonic-main/pom.xml
  2. 3
      airsonic-main/src/main/java/org/airsonic/player/controller/StreamController.java

@ -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;

Loading…
Cancel
Save