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

Kill jsr-305 #4604

Merged
merged 18 commits into from
Apr 6, 2020
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,4 @@ push-build.sh
war/node_modules/
war/yarn-error.log
.java-version
.checkstyle
6 changes: 3 additions & 3 deletions core/src/main/java/hudson/AboutJenkins.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import hudson.security.Permission;
import java.net.URL;

import javax.annotation.Nonnull;
import edu.umd.cs.findbugs.annotations.NonNull;
import jenkins.model.Jenkins;
import org.jenkinsci.Symbol;
import org.kohsuke.accmod.Restricted;
Expand Down Expand Up @@ -41,13 +41,13 @@ public URL getLicensesURL() {
return AboutJenkins.class.getResource("/META-INF/licenses.xml");
}

@Nonnull
@NonNull
@Override
public Permission getRequiredPermission() {
return Jenkins.READ;
}

@Nonnull
@NonNull
@Override
public Category getCategory() {
return Category.STATUS;
Expand Down
4 changes: 2 additions & 2 deletions core/src/main/java/hudson/ClassicPluginStrategy.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
import org.apache.tools.zip.ZipOutputStream;
import org.jenkinsci.bytecode.Transformer;

import javax.annotation.Nonnull;
import edu.umd.cs.findbugs.annotations.NonNull;
import java.io.Closeable;
import java.io.File;
import java.io.FileNotFoundException;
Expand Down Expand Up @@ -273,7 +273,7 @@ private void fix(Attributes atts, List<PluginWrapper.Dependency> optionalDepende
* @see DetachedPluginsUtil#getImpliedDependencies(String, String)
*/
@Deprecated // since TODO
@Nonnull
@NonNull
public static List<PluginWrapper.Dependency> getImpliedDependencies(String pluginName, String jenkinsVersion) {
return DetachedPluginsUtil.getImpliedDependencies(pluginName, jenkinsVersion);
}
Expand Down
6 changes: 3 additions & 3 deletions core/src/main/java/hudson/DescriptorExtensionList.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.concurrent.CopyOnWriteArrayList;
import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;
import edu.umd.cs.findbugs.annotations.CheckForNull;
import edu.umd.cs.findbugs.annotations.NonNull;

import net.sf.json.JSONException;
import org.kohsuke.stapler.Stapler;
Expand Down Expand Up @@ -158,7 +158,7 @@ public T newInstanceFromRadioList(JSONObject config) throws FormException {
* @throws FormException Data submission error
*/
@CheckForNull
public T newInstanceFromRadioList(@Nonnull JSONObject parent, @Nonnull String name) throws FormException {
public T newInstanceFromRadioList(@NonNull JSONObject parent, @NonNull String name) throws FormException {
try {
return newInstanceFromRadioList(parent.getJSONObject(name));
} catch (JSONException ex) {
Expand Down
18 changes: 9 additions & 9 deletions core/src/main/java/hudson/EnvVars.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@
import java.util.TreeSet;
import java.util.UUID;
import java.util.logging.Logger;
import javax.annotation.Nonnull;
import javax.annotation.CheckForNull;
import edu.umd.cs.findbugs.annotations.NonNull;
import edu.umd.cs.findbugs.annotations.CheckForNull;

/**
* Environment variables.
Expand Down Expand Up @@ -101,14 +101,14 @@ public class EnvVars extends TreeMap<String,String> {
* @since 2.144
* @param platform the platform to set.
*/
public void setPlatform(@Nonnull Platform platform) {
public void setPlatform(@NonNull Platform platform) {
this.platform = platform;
}
public EnvVars() {
super(CaseInsensitiveComparator.INSTANCE);
}

public EnvVars(@Nonnull Map<String,String> m) {
public EnvVars(@NonNull Map<String,String> m) {
this();
putAll(m);

Expand All @@ -121,7 +121,7 @@ public EnvVars(@Nonnull Map<String,String> m) {
}

@SuppressWarnings("CopyConstructorMissesField") // does not set #platform, see its Javadoc
public EnvVars(@Nonnull EnvVars m) {
public EnvVars(@NonNull EnvVars m) {
// this constructor is so that in future we can get rid of the downcasting.
this((Map)m);
}
Expand Down Expand Up @@ -231,15 +231,15 @@ protected Iterable<? extends String> getEdges(String n) {

private final Comparator<? super String> comparator;

@Nonnull
@NonNull
private final EnvVars target;
@Nonnull
@NonNull
private final Map<String,String> overrides;

private Map<String, Set<String>> refereeSetMap;
private List<String> orderedVariableNames;

public OverrideOrderCalculator(@Nonnull EnvVars target, @Nonnull Map<String,String> overrides) {
public OverrideOrderCalculator(@NonNull EnvVars target, @NonNull Map<String,String> overrides) {
comparator = target.comparator();
this.target = target;
this.overrides = overrides;
Expand Down Expand Up @@ -348,7 +348,7 @@ public void scan() {
* See {@link #override(String, String)}.
* @return {@code this}
*/
public EnvVars overrideExpandingAll(@Nonnull Map<String,String> all) {
public EnvVars overrideExpandingAll(@NonNull Map<String,String> all) {
for (String key : new OverrideOrderCalculator(this, all).getOrderedVariableNames()) {
override(key, expand(all.get(key)));
}
Expand Down
16 changes: 8 additions & 8 deletions core/src/main/java/hudson/ExtensionList.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;
import edu.umd.cs.findbugs.annotations.CheckForNull;
import edu.umd.cs.findbugs.annotations.NonNull;
import jenkins.util.io.OnMaster;

/**
Expand Down Expand Up @@ -137,15 +137,15 @@ protected ExtensionList(Jenkins jenkins, Class<T> extensionType, CopyOnWriteArra
* Add a listener to the extension list.
* @param listener The listener.
*/
public void addListener(@Nonnull ExtensionListListener listener) {
public void addListener(@NonNull ExtensionListListener listener) {
listeners.add(listener);
}

/**
* Looks for the extension instance of the given type (subclasses excluded),
* or return null.
*/
public @CheckForNull <U extends T> U get(@Nonnull Class<U> type) {
public @CheckForNull <U extends T> U get(@NonNull Class<U> type) {
for (T ext : this)
if(ext.getClass()==type)
return type.cast(ext);
Expand All @@ -158,7 +158,7 @@ public void addListener(@Nonnull ExtensionListListener listener) {
*
* Meant to simplify call inside @Extension annotated class to retrieve their own instance.
*/
public @Nonnull <U extends T> U getInstance(@Nonnull Class<U> type) throws IllegalStateException {
public @NonNull <U extends T> U getInstance(@NonNull Class<U> type) throws IllegalStateException {
for (T ext : this)
if(ext.getClass()==type)
return type.cast(ext);
Expand All @@ -167,7 +167,7 @@ public void addListener(@Nonnull ExtensionListListener listener) {
}

@Override
public @Nonnull Iterator<T> iterator() {
public @NonNull Iterator<T> iterator() {
// we need to intercept mutation, so for now don't allow Iterator.remove
return new AdaptedIterator<ExtensionComponent<T>,T>(Iterators.readOnly(ensureLoaded().iterator())) {
protected T adapt(ExtensionComponent<T> item) {
Expand Down Expand Up @@ -429,7 +429,7 @@ public static <T> ExtensionList<T> create(Jenkins jenkins, Class<T> type) {
* @return some list
* @since 1.572
*/
public static @Nonnull <T> ExtensionList<T> lookup(Class<T> type) {
public static @NonNull <T> ExtensionList<T> lookup(Class<T> type) {
Jenkins j = Jenkins.getInstanceOrNull();
return j == null ? create((Jenkins) null, type) : j.getExtensionList(type);
}
Expand All @@ -445,7 +445,7 @@ public static <T> ExtensionList<T> create(Jenkins jenkins, Class<T> type) {
*
* @since 2.87
*/
public static @Nonnull <U> U lookupSingleton(Class<U> type) {
public static @NonNull <U> U lookupSingleton(Class<U> type) {
ExtensionList<U> all = lookup(type);
if (all.size() != 1) {
throw new IllegalStateException("Expected 1 instance of " + type.getName() + " but got " + all.size());
Expand Down
Loading