From d42af4575f9b7159e83fbd1c440cbef0d8a81880 Mon Sep 17 00:00:00 2001 From: Peter Marheine Date: Thu, 23 May 2019 10:37:35 +1000 Subject: [PATCH] Add some @Nullable annotations Making it easier to tell where API contracts allow nulls, where it's otherwise unclear without reading the implementation. --- airsonic-main/pom.xml | 6 ++++++ .../org/airsonic/player/controller/StreamController.java | 3 +++ 2 files changed, 9 insertions(+) diff --git a/airsonic-main/pom.xml b/airsonic-main/pom.xml index acf07efd..d50db52b 100755 --- a/airsonic-main/pom.xml +++ b/airsonic-main/pom.xml @@ -184,6 +184,12 @@ commons-lang3 + + com.google.code.findbugs + jsr305 + 3.0.2 + + com.google.guava guava diff --git a/airsonic-main/src/main/java/org/airsonic/player/controller/StreamController.java b/airsonic-main/src/main/java/org/airsonic/player/controller/StreamController.java index d02d076c..aa4e476c 100644 --- a/airsonic-main/src/main/java/org/airsonic/player/controller/StreamController.java +++ b/airsonic-main/src/main/java/org/airsonic/player/controller/StreamController.java @@ -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;