diff --git a/src/main/java/org/jenkinsci/plugins/prometheus/DiskUsageCollector.java b/src/main/java/org/jenkinsci/plugins/prometheus/DiskUsageCollector.java index d5ce11669..2060d8c92 100644 --- a/src/main/java/org/jenkinsci/plugins/prometheus/DiskUsageCollector.java +++ b/src/main/java/org/jenkinsci/plugins/prometheus/DiskUsageCollector.java @@ -1,7 +1,8 @@ package org.jenkinsci.plugins.prometheus; import com.cloudbees.simplediskusage.DiskItem; -import com.cloudbees.simplediskusage.JobDiskItem; +import com.cloudbees.simplediskusage.JobDiskItem; +import edu.umd.cs.findbugs.annotations.NonNull; import io.prometheus.client.Collector; import jenkins.model.Jenkins; import org.jenkinsci.plugins.prometheus.collectors.CollectorFactory; @@ -11,21 +12,20 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.annotation.Nonnull; import java.io.File; import java.io.IOException; import java.nio.file.FileStore; import java.nio.file.Files; import java.util.*; import java.util.stream.Collectors; -import java.util.stream.Stream; - +import java.util.stream.Stream; + public class DiskUsageCollector extends Collector { private static final Logger LOGGER = LoggerFactory.getLogger(DiskUsageCollector.class); @Override - @Nonnull + @NonNull public List collect() { if (!PrometheusConfiguration.get().getCollectDiskUsage()) { @@ -44,7 +44,7 @@ public List collect() { } } - @Nonnull + @NonNull private static List collectDiskUsage() throws IOException { final com.cloudbees.simplediskusage.QuickDiskUsagePlugin diskUsagePlugin = Jenkins.get() .getPlugin(com.cloudbees.simplediskusage.QuickDiskUsagePlugin.class); diff --git a/src/main/java/org/jenkinsci/plugins/prometheus/config/PrometheusConfiguration.java b/src/main/java/org/jenkinsci/plugins/prometheus/config/PrometheusConfiguration.java index 2723b55fa..f00f46131 100644 --- a/src/main/java/org/jenkinsci/plugins/prometheus/config/PrometheusConfiguration.java +++ b/src/main/java/org/jenkinsci/plugins/prometheus/config/PrometheusConfiguration.java @@ -14,7 +14,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.annotation.CheckForNull; +import edu.umd.cs.findbugs.annotations.CheckForNull; import java.util.Arrays; import java.util.List; import java.util.Map;