Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EOL JSR 305 #458

Merged
merged 1 commit into from Apr 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -57,7 +57,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.annotation.CheckForNull;
import edu.umd.cs.findbugs.annotations.CheckForNull;
import javax.servlet.ServletException;
import java.io.IOException;
import java.net.URLDecoder;
Expand Down
Expand Up @@ -71,8 +71,8 @@

import jenkins.model.Jenkins;

import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;
import edu.umd.cs.findbugs.annotations.CheckForNull;
import edu.umd.cs.findbugs.annotations.NonNull;

/**
* Main Plugin entrance.
Expand Down Expand Up @@ -189,7 +189,7 @@ public List<GerritServer> getServers() {
*
* @return the list of GerritServers
*/
@Nonnull
@NonNull
//CS IGNORE MethodName FOR NEXT 1 LINES. REASON: Static equivalent marker.
public static List<GerritServer> getServers_() {
PluginImpl plugin = getInstance();
Expand Down Expand Up @@ -219,7 +219,7 @@ public List<String> getServerNames() {
*
* @return the list of server names.
*/
@Nonnull
@NonNull
//CS IGNORE MethodName FOR NEXT 1 LINES. REASON: Static equivalent marker.
public static List<String> getServerNames_() {
PluginImpl plugin = getInstance();
Expand Down Expand Up @@ -473,7 +473,7 @@ protected XmlFile getConfigFile() {
*
* @return gerritEventManager
*/
@Nonnull
@NonNull
public GerritHandler getHandler() {
if (gerritEventManager == null) {
throw new IllegalStateException("Plugin is not started yet, or it is stopped already");
Expand Down Expand Up @@ -523,7 +523,7 @@ public List<Job> getConfiguredJobs(String serverName) {
* @param serverName the name of the Gerrit server.
* @return the list of jobs configured with this server.
*/
@Nonnull
@NonNull
//CS IGNORE MethodName FOR NEXT 1 LINES. REASON: Static equivalent marker.
public static List<Job> getConfiguredJobs_(String serverName) {
PluginImpl plugin = getInstance();
Expand Down
Expand Up @@ -40,7 +40,7 @@
import org.kohsuke.accmod.Restricted;
import org.kohsuke.accmod.restrictions.NoExternalUse;

import javax.annotation.Nonnull;
import edu.umd.cs.findbugs.annotations.NonNull;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
Expand Down Expand Up @@ -72,7 +72,7 @@ protected PluginImpl instance(Mapping mapping, ConfigurationContext configuratio
}

@Override
@Nonnull
@NonNull
public String getName() {
return PluginImpl.SYMBOL_NAME;
}
Expand Down
Expand Up @@ -6,15 +6,15 @@
import hudson.model.InvisibleAction;
import hudson.model.Run;

import javax.annotation.Nonnull;
import edu.umd.cs.findbugs.annotations.NonNull;
import java.util.ArrayList;
import java.util.List;

/**
* Adds Action that stores the data about dependency jobs.
*/
public class GerritDependencyAction extends InvisibleAction implements EnvironmentContributingAction {
@Nonnull
@NonNull
private final List<String> deps;

/**
Expand All @@ -37,7 +37,7 @@ public GerritDependencyAction(List<Run> runs) {
* @param env Environment variables should be added to this map.
*/
@SuppressWarnings("unused")
public void buildEnvironment(@Nonnull Run<?, ?> run, @Nonnull EnvVars env) {
public void buildEnvironment(@NonNull Run<?, ?> run, @NonNull EnvVars env) {
fillEnv(env);
}

Expand Down
Expand Up @@ -31,7 +31,7 @@
import com.sonymobile.tools.gerrit.gerritevents.dto.events.RefUpdated;
import hudson.model.ModelObject;

import javax.annotation.Nonnull;
import edu.umd.cs.findbugs.annotations.NonNull;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
Expand Down Expand Up @@ -178,19 +178,19 @@ public void clear() {
}

@Override
@Nonnull
@NonNull
public Set<GerritTriggeredEvent> keySet() {
return internal.keySet();
}

@Override
@Nonnull
@NonNull
public Collection<List<BuildMemory.MemoryImprint.Entry>> values() {
return internal.values();
}

@Override
@Nonnull
@NonNull
public Set<Entry<GerritTriggeredEvent, List<BuildMemory.MemoryImprint.Entry>>> entrySet() {
return internal.entrySet();
}
Expand Down
Expand Up @@ -46,8 +46,8 @@
import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.StaplerResponse;

import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;
import edu.umd.cs.findbugs.annotations.CheckForNull;
import edu.umd.cs.findbugs.annotations.NonNull;
import java.io.IOException;
import java.util.Date;
import java.util.List;
Expand Down Expand Up @@ -115,7 +115,7 @@ private String makeRelativeUrl(String context, String name) {
*
* @return the permission
*/
@Nonnull
@NonNull
public static Permission getRequiredPermission() {
return Jenkins.ADMINISTER;
}
Expand Down
Expand Up @@ -34,7 +34,7 @@
import org.kohsuke.accmod.Restricted;
import org.kohsuke.accmod.restrictions.NoExternalUse;

import javax.annotation.CheckForNull;
import edu.umd.cs.findbugs.annotations.CheckForNull;
import java.util.Comparator;
import java.util.LinkedHashSet;
import java.util.Set;
Expand Down
Expand Up @@ -52,9 +52,9 @@

import jenkins.model.Jenkins;

import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import edu.umd.cs.findbugs.annotations.CheckForNull;
import edu.umd.cs.findbugs.annotations.NonNull;
import edu.umd.cs.findbugs.annotations.Nullable;

/**
* The Big RunListener in charge of coordinating build results and reporting back to Gerrit.
Expand Down Expand Up @@ -98,7 +98,7 @@ public static ToGerritRunListener getInstance() {
* @param r the build.
* @param customUrl the URL.
*/
public void setBuildCustomUrl(@Nonnull Run r, @Nonnull String customUrl) {
public void setBuildCustomUrl(@NonNull Run r, @NonNull String customUrl) {
GerritCause cause = getCause(r);
if (cause != null) {
cleanUpGerritCauses(cause, r);
Expand All @@ -112,7 +112,7 @@ public void setBuildCustomUrl(@Nonnull Run r, @Nonnull String customUrl) {
* @param r the build that caused the failure.
* @param unsuccessfulMessage the unsuccessful message
*/
public void setBuildUnsuccessfulMessage(@Nonnull Run r, @Nonnull String unsuccessfulMessage) {
public void setBuildUnsuccessfulMessage(@NonNull Run r, @NonNull String unsuccessfulMessage) {
GerritCause cause = getCause(r);
if (cause != null) {
cleanUpGerritCauses(cause, r);
Expand All @@ -121,7 +121,7 @@ public void setBuildUnsuccessfulMessage(@Nonnull Run r, @Nonnull String unsucces
}

@Override
public synchronized void onCompleted(@Nonnull Run r, @Nonnull TaskListener listener) {
public synchronized void onCompleted(@NonNull Run r, @NonNull TaskListener listener) {
GerritCause cause = getCause(r);
logger.debug("Completed. Build: {} Cause: {}", r, cause);
if (cause != null) {
Expand Down Expand Up @@ -170,7 +170,7 @@ public synchronized void onCompleted(@Nonnull Run r, @Nonnull TaskListener liste
* @return the report.
* @see com.sonyericsson.hudson.plugins.gerrit.trigger.diagnostics.Diagnostics
*/
@Nonnull
@NonNull
public synchronized BuildMemoryReport report() {
return memory.report();
}
Expand Down Expand Up @@ -454,8 +454,8 @@ private GerritCause getCause(Run build) {
* @throws IOException if an error occurs while reading the workspace
* @throws InterruptedException if an error occurs while reading the workspace
*/
@Nonnull
protected FilePath[] getMatchingWorkspaceFiles(@Nullable FilePath ws, @Nonnull String filepath)
@NonNull
protected FilePath[] getMatchingWorkspaceFiles(@Nullable FilePath ws, @NonNull String filepath)
throws IOException, InterruptedException {
if (ws == null) {
return new FilePath[0];
Expand Down Expand Up @@ -492,7 +492,7 @@ protected String getExpandedContent(FilePath path, EnvVars envVars) throws IOExc
* @throws InterruptedException If interrupted while working with the {@link FilePath} or {@link EnvVars Environment}
*/
private String obtainUnsuccessfulMessage(@Nullable GerritTriggeredEvent event,
@Nonnull Run build,
@NonNull Run build,
@Nullable TaskListener listener)
throws IOException, InterruptedException {
Job project = build.getParent();
Expand Down
Expand Up @@ -40,8 +40,8 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;
import edu.umd.cs.findbugs.annotations.CheckForNull;
import edu.umd.cs.findbugs.annotations.NonNull;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Comparator;
Expand Down Expand Up @@ -302,7 +302,7 @@ public synchronized void updateTriggerContext(GerritCause cause, Run r) {
* @param entryToUpdate the entry to update.
* @param imprint the information for the update.
*/
private synchronized void updateTriggerContext(@Nonnull Entry entryToUpdate, @Nonnull MemoryImprint imprint) {
private synchronized void updateTriggerContext(@NonNull Entry entryToUpdate, @NonNull MemoryImprint imprint) {
Run build = entryToUpdate.getBuild();
if (build != null) {
GerritCause cause = (GerritCause)build.getCause(GerritCause.class);
Expand Down Expand Up @@ -337,7 +337,7 @@ private synchronized void updateTriggerContext(@Nonnull Entry entryToUpdate, @No
* @param project the project.
* @return true if so.
*/
public synchronized boolean isTriggered(@Nonnull GerritTriggeredEvent event, @Nonnull Job project) {
public synchronized boolean isTriggered(@NonNull GerritTriggeredEvent event, @NonNull Job project) {
MemoryImprint pb = memory.get(event);
if (pb == null) {
return false;
Expand All @@ -359,7 +359,7 @@ public synchronized boolean isTriggered(@Nonnull GerritTriggeredEvent event, @No
* @param project the project.
* @return true if so.
*/
public synchronized boolean isBuilding(GerritTriggeredEvent event, @Nonnull Job project) {
public synchronized boolean isBuilding(GerritTriggeredEvent event, @NonNull Job project) {
MemoryImprint pb = memory.get(event);
if (pb == null) {
return false;
Expand Down Expand Up @@ -480,7 +480,7 @@ public synchronized void removeProject(Job project) {
*
* @return the report
*/
@Nonnull
@NonNull
public synchronized BuildMemoryReport report() {
BuildMemoryReport report = new BuildMemoryReport();
for (Map.Entry<GerritTriggeredEvent, MemoryImprint> entry : memory.entrySet()) {
Expand Down Expand Up @@ -685,7 +685,7 @@ public synchronized String getStatusReport() {
* @param project the project.
* @return the entry or null if nothing is found.
*/
private Entry getEntry(@Nonnull Job project) {
private Entry getEntry(@NonNull Job project) {
for (Entry entry : list) {
if (entry != null && project.equals(entry.getProject())) {
return entry;
Expand Down
Expand Up @@ -49,8 +49,8 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;
import edu.umd.cs.findbugs.annotations.CheckForNull;
import edu.umd.cs.findbugs.annotations.NonNull;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
Expand Down Expand Up @@ -79,7 +79,7 @@ public final class EventListener implements GerritEventListener {
*
* @param job the job to handle.
*/
EventListener(@Nonnull Job job) {
EventListener(@NonNull Job job) {
this(job.getFullName());
}

Expand All @@ -88,7 +88,7 @@ public final class EventListener implements GerritEventListener {
*
* @param fullName the job to handle full name.
*/
EventListener(@Nonnull String fullName) {
EventListener(@NonNull String fullName) {
this.job = fullName;
}

Expand Down
Expand Up @@ -36,7 +36,7 @@
import com.sonyericsson.hudson.plugins.gerrit.trigger.version.GerritVersionChecker;
import com.sonyericsson.hudson.plugins.gerrit.trigger.version.GerritVersionNumber;

import javax.annotation.CheckForNull;
import edu.umd.cs.findbugs.annotations.CheckForNull;

/**
* Every instance of this class is a connection listener to a specific Gerrit server.
Expand Down