Commit 78435a6e authored by Florian Schäfer's avatar Florian Schäfer

Remove @Nonnull annotations to keep Ant build from breaking

parent 662b89af
......@@ -29,7 +29,7 @@ dependencies {
testImplementation "org.junit.jupiter:junit-jupiter-api:${versions.junit}"
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:${versions.junit}"
testImplementation "org.junit.vintage:junit-vintage-engine:${versions.junit}"
implementation "com.github.spotbugs:spotbugs-annotations:${versions.spotbugs}"
testImplementation "com.github.spotbugs:spotbugs-annotations:${versions.spotbugs}"
testImplementation("org.openstreetmap.josm:josm-unittest:"){changing=true}
}
task copyToLib(type: Sync) {
......
......@@ -8,8 +8,6 @@ import java.util.Objects;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import javax.annotation.Nonnull;
import org.openstreetmap.josm.tools.Logging;
public class ApiUrl {
......@@ -31,8 +29,7 @@ public class ApiUrl {
* @throws IllegalArgumentException
* when the returned URL would be malformed
*/
@Nonnull
public static URL url(@Nonnull final String part1, @Nonnull final String part2, @Nonnull final String... moreParts) {
public static URL url(final String part1, final String part2, final String... moreParts) {
return url(
Stream.concat(Stream.of(part1, part2), Arrays.stream(moreParts))
.filter(Objects::nonNull)
......@@ -49,9 +46,9 @@ public class ApiUrl {
* @return the resulting URL
* @throws IllegalArgumentException
* when the URL parsed from the parameter would be malformed
*
*/
@Nonnull
public static URL url(@Nonnull final String url) {
public static URL url(final String url) {
try {
return new URL(url);
} catch (MalformedURLException e) {
......
......@@ -3,10 +3,8 @@ package org.wikipedia.api;
import java.net.URL;
import javax.annotation.Nonnull;
public class InvalidApiQueryException extends Exception {
public InvalidApiQueryException(@Nonnull final URL url) {
public InvalidApiQueryException(final URL url) {
super("The API query to the following URL is invalid: " + url);
}
}
......@@ -4,8 +4,6 @@ package org.wikipedia.api.wikidata_action;
import java.net.URL;
import java.util.Collection;
import javax.annotation.Nonnull;
import org.openstreetmap.josm.tools.Utils;
import org.wikipedia.api.ApiUrl;
import org.wikipedia.tools.RegexUtil;
......@@ -17,8 +15,7 @@ public class WikidataActionApiUrl {
// Private constructor to avoid instantiation
}
@Nonnull
public static URL checkEntityExistsUrl(@Nonnull final Collection<String> qIds) {
public static URL checkEntityExistsUrl(final Collection<String> qIds) {
if (qIds.size() < 1) {
throw new IllegalArgumentException("You must supply at least one Q-ID to construct a checkEntityExists URL.");
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment