[infrastructure] add external null-annotations (#8848)
Signed-off-by: Jan N. Klug <jan.n.klug@rub.de>
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
package org.openhab.binding.openweathermap.internal.connection;
|
||||
|
||||
import org.eclipse.jdt.annotation.NonNullByDefault;
|
||||
import org.eclipse.jdt.annotation.Nullable;
|
||||
|
||||
/**
|
||||
* The {@link OpenWeatherMapCommunicationException} is a communication exception for the connections to OpenWeatherMap
|
||||
@@ -37,7 +38,7 @@ public class OpenWeatherMapCommunicationException extends RuntimeException {
|
||||
*
|
||||
* @param message Detail message
|
||||
*/
|
||||
public OpenWeatherMapCommunicationException(String message) {
|
||||
public OpenWeatherMapCommunicationException(@Nullable String message) {
|
||||
super(message);
|
||||
}
|
||||
|
||||
@@ -46,7 +47,7 @@ public class OpenWeatherMapCommunicationException extends RuntimeException {
|
||||
*
|
||||
* @param cause The cause
|
||||
*/
|
||||
public OpenWeatherMapCommunicationException(Throwable cause) {
|
||||
public OpenWeatherMapCommunicationException(@Nullable Throwable cause) {
|
||||
super(cause);
|
||||
}
|
||||
|
||||
@@ -56,7 +57,7 @@ public class OpenWeatherMapCommunicationException extends RuntimeException {
|
||||
* @param message Detail message
|
||||
* @param cause The cause
|
||||
*/
|
||||
public OpenWeatherMapCommunicationException(String message, Throwable cause) {
|
||||
public OpenWeatherMapCommunicationException(@Nullable String message, @Nullable Throwable cause) {
|
||||
super(message, cause);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
package org.openhab.binding.openweathermap.internal.connection;
|
||||
|
||||
import org.eclipse.jdt.annotation.NonNullByDefault;
|
||||
import org.eclipse.jdt.annotation.Nullable;
|
||||
|
||||
/**
|
||||
* The {@link OpenWeatherMapConfigurationException} is a configuration exception for the connections to OpenWeatherMap
|
||||
@@ -37,7 +38,7 @@ public class OpenWeatherMapConfigurationException extends IllegalArgumentExcepti
|
||||
*
|
||||
* @param message Detail message
|
||||
*/
|
||||
public OpenWeatherMapConfigurationException(String message) {
|
||||
public OpenWeatherMapConfigurationException(@Nullable String message) {
|
||||
super(message);
|
||||
}
|
||||
|
||||
@@ -46,7 +47,7 @@ public class OpenWeatherMapConfigurationException extends IllegalArgumentExcepti
|
||||
*
|
||||
* @param cause The cause
|
||||
*/
|
||||
public OpenWeatherMapConfigurationException(Throwable cause) {
|
||||
public OpenWeatherMapConfigurationException(@Nullable Throwable cause) {
|
||||
super(cause);
|
||||
}
|
||||
|
||||
@@ -56,7 +57,7 @@ public class OpenWeatherMapConfigurationException extends IllegalArgumentExcepti
|
||||
* @param message Detail message
|
||||
* @param cause The cause
|
||||
*/
|
||||
public OpenWeatherMapConfigurationException(String message, Throwable cause) {
|
||||
public OpenWeatherMapConfigurationException(@Nullable String message, @Nullable Throwable cause) {
|
||||
super(message, cause);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -278,7 +278,10 @@ public class OpenWeatherMapConnection {
|
||||
.collect(joining("&", url + "?", ""));
|
||||
}
|
||||
|
||||
private String encodeParam(String value) {
|
||||
private String encodeParam(@Nullable String value) {
|
||||
if (value == null) {
|
||||
return "";
|
||||
}
|
||||
try {
|
||||
return URLEncoder.encode(value, StandardCharsets.UTF_8.name());
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
|
||||
Reference in New Issue
Block a user