[infrastructure] add external null-annotations (#8848)

Signed-off-by: Jan N. Klug <jan.n.klug@rub.de>
This commit is contained in:
J-N-K
2020-10-31 00:29:03 +01:00
committed by GitHub
parent 47d05055db
commit bd664ff0c8
162 changed files with 933 additions and 575 deletions

View File

@@ -248,7 +248,7 @@ public class MediaRendererService implements UpnpIOParticipant, SamsungTvService
try {
newValue = DataConverters.convertCommandToIntValue(command, 0, 100,
Integer.valueOf(stateMap.get("CurrentVolume")));
Integer.valueOf(stateMap.getOrDefault("CurrentVolume", "")));
} catch (NumberFormatException e) {
throw new NumberFormatException("Command '" + command + "' not supported");
}
@@ -281,7 +281,7 @@ public class MediaRendererService implements UpnpIOParticipant, SamsungTvService
try {
newValue = DataConverters.convertCommandToIntValue(command, 0, 100,
Integer.valueOf(stateMap.get("CurrentBrightness")));
Integer.valueOf(stateMap.getOrDefault("CurrentBrightness", "")));
} catch (NumberFormatException e) {
throw new NumberFormatException("Command '" + command + "' not supported");
}
@@ -297,7 +297,7 @@ public class MediaRendererService implements UpnpIOParticipant, SamsungTvService
try {
newValue = DataConverters.convertCommandToIntValue(command, 0, 100,
Integer.valueOf(stateMap.get("CurrentContrast")));
Integer.valueOf(stateMap.getOrDefault("CurrentContrast", "")));
} catch (NumberFormatException e) {
throw new NumberFormatException("Command '" + command + "' not supported");
}
@@ -313,7 +313,7 @@ public class MediaRendererService implements UpnpIOParticipant, SamsungTvService
try {
newValue = DataConverters.convertCommandToIntValue(command, 0, 100,
Integer.valueOf(stateMap.get("CurrentSharpness")));
Integer.valueOf(stateMap.getOrDefault("CurrentSharpness", "")));
} catch (NumberFormatException e) {
throw new NumberFormatException("Command '" + command + "' not supported");
}
@@ -329,7 +329,7 @@ public class MediaRendererService implements UpnpIOParticipant, SamsungTvService
try {
newValue = DataConverters.convertCommandToIntValue(command, 0, 4,
Integer.valueOf(stateMap.get("CurrentColorTemperature")));
Integer.valueOf(stateMap.getOrDefault("CurrentColorTemperature", "")));
} catch (NumberFormatException e) {
throw new NumberFormatException("Command '" + command + "' not supported");
}

View File

@@ -86,7 +86,7 @@ public class ServiceFactory {
* @param serviceName Name of the service
* @return Class of the service
*/
public static Class<? extends SamsungTvService> getClassByServiceName(String serviceName) {
public static @Nullable Class<? extends SamsungTvService> getClassByServiceName(String serviceName) {
return SERVICEMAP.get(serviceName);
}
}