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

Add at-since annotations up to 2.279 #5276

Merged
merged 1 commit into from
Feb 23, 2021
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/src/main/java/hudson/Util.java
Original file line number Diff line number Diff line change
Expand Up @@ -1474,7 +1474,7 @@ public static boolean isOverridden(@NonNull Class<?> base, @NonNull Class<?> der
* @throws IllegalArgumentException When {@code derived} does not derive from {@code base}, or when {@code base}
* does not contain the specified method.
* @throws AbstractMethodError If the derived class doesn't override the given method.
* @since TODO
* @since 2.259
*/
public static <T> T ifOverridden(Supplier<T> supplier, @NonNull Class<?> base, @NonNull Class<?> derived, @NonNull String methodName, @NonNull Class<?>... types) {
if (isOverridden(base, derived, methodName, types)) {
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/hudson/WebAppMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public class WebAppMain implements ServletContextListener {
* Written for the requirements of JENKINS-50669
* @return int This returns DEFAULT_RING_BUFFER_SIZE
* @see <a href="https://issues.jenkins-ci.org/browse/JENKINS-50669">JENKINS-50669</a>
* @since TODO
* @since 2.259
*/
public static int getDefaultRingBufferSize() {
return RingBufferLogHandler.getDefaultRingBufferSize();
Expand Down
4 changes: 2 additions & 2 deletions core/src/main/java/hudson/cli/CLICommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ public Channel checkChannel() throws AbortException {
*
* <p>
* If the transport doesn't do authentication, this method returns {@link jenkins.model.Jenkins#ANONYMOUS2}.
* @since TODO
* @since 2.266
*/
public Authentication getTransportAuthentication2() {
Authentication a = transportAuth;
Expand All @@ -348,7 +348,7 @@ public org.acegisecurity.Authentication getTransportAuthentication() {
}

/**
* @since TODO
* @since 2.266
*/
public void setTransportAuth2(Authentication transportAuth) {
this.transportAuth = transportAuth;
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/hudson/model/AdministrativeMonitor.java
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ public boolean isEnabled() {
*
* This will be used to determine which icon will be used in the navigation bar.
*
* @since TODO
* @since 2.267
*/
public boolean isSecurity() {
return false;
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/hudson/model/Fingerprint.java
Original file line number Diff line number Diff line change
Expand Up @@ -773,7 +773,7 @@ public static RangeSet fromString(String list, boolean skipError) {
/**
* Converter Implementation for RangeSet.
*
* @since TODO
* @since 2.253
*/
public static final class ConverterImpl implements Converter {
private final Converter collectionConv; // used to convert ArrayList in it
Expand Down
6 changes: 3 additions & 3 deletions core/src/main/java/hudson/model/Items.java
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ public static List<TopLevelItemDescriptor> all(ItemGroup c) {
* Returns all the registered {@link TopLevelItemDescriptor}s that the specified security principal is allowed to
* create within the specified item group.
*
* @since TODO
* @since 2.266
*/
public static List<TopLevelItemDescriptor> all2(Authentication a, ItemGroup c) {
List<TopLevelItemDescriptor> result = new ArrayList<>();
Expand Down Expand Up @@ -488,7 +488,7 @@ public static <T extends Item> Iterable<T> allItems(ItemGroup root, Class<T> typ
* @param type the type.
* @param <T> the type.
* @return An {@link Iterable} for all items.
* @since TODO
* @since 2.266
*/
public static <T extends Item> Iterable<T> allItems2(Authentication authentication, ItemGroup root, Class<T> type) {
return allItems2(authentication, root, type, t -> true);
Expand Down Expand Up @@ -516,7 +516,7 @@ public static <T extends Item> Iterable<T> allItems(org.acegisecurity.Authentica
* @param <T> the type.
* @param pred the predicate.
* @return An {@link Iterable} for all items.
* @since TODO
* @since 2.266
*/
public static <T extends Item> Iterable<T> allItems2(Authentication authentication, ItemGroup root, Class<T> type, Predicate<T> pred) {
return new AllItemsIterable<>(root, authentication, type, pred);
Expand Down
6 changes: 3 additions & 3 deletions core/src/main/java/hudson/model/Queue.java
Original file line number Diff line number Diff line change
Expand Up @@ -1985,7 +1985,7 @@ default Collection<? extends SubTask> getSubTasks() {
* based on whether this {@link Authentication} is allowed to use them.
*
* @return by default, {@link ACL#SYSTEM2}
* @since TODO
* @since 2.266
* @see QueueItemAuthenticator
* @see Tasks#getDefaultAuthenticationOf(Queue.Task)
*/
Expand Down Expand Up @@ -2019,7 +2019,7 @@ default Collection<? extends SubTask> getSubTasks() {
* older versions of Jenkins may not have this method implemented. Called private method _getDefaultAuthenticationOf(Task) on {@link Tasks}
* to avoid {@link AbstractMethodError}.
*
* @since TODO
* @since 2.266
* @see QueueItemAuthenticator
* @see Tasks#getDefaultAuthenticationOf(Queue.Task, Queue.Item)
*/
Expand Down Expand Up @@ -2330,7 +2330,7 @@ public HttpResponse doCancelQueue() {
* return the identity of the user who queued the task, or {@link ACL#SYSTEM2} to bypass the access control
* and run as the super user.
*
* @since TODO
* @since 2.266
*/
@NonNull
public Authentication authenticate2() {
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/hudson/model/Result.java
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ private Result(@NonNull String name, @NonNull BallColor color, /*@java.annotatio
* @param r2
* a result (may be {@code null})
* @return the worst result (may be {@code null})
* @since TODO
* @since 2.257
*/
public static Result combine(Result r1, Result r2) {
if (r1 == null) {
Expand Down
4 changes: 2 additions & 2 deletions core/src/main/java/hudson/model/UpdateSite.java
Original file line number Diff line number Diff line change
Expand Up @@ -1513,7 +1513,7 @@ public Set<Warning> getWarnings() {

/**
* Checks whether a plugin has a desired category
* @since TODO
* @since 2.272
*/
public boolean hasCategory(String category) {
if (categories == null) {
Expand All @@ -1525,7 +1525,7 @@ public boolean hasCategory(String category) {

/**
* Get categories stream for further search.
* @since TODO
* @since 2.272
*/
public Stream<String> getCategoriesStream() {
return categories != null ? Arrays.stream(categories) : Stream.empty();
Expand Down
6 changes: 3 additions & 3 deletions core/src/main/java/hudson/model/User.java
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ public <T extends UserProperty> T getProperty(Class<T> clazz) {
* logged in.
*
* @throws UsernameNotFoundException If this user is not a valid user in the backend {@link SecurityRealm}.
* @since TODO
* @since 2.266
*/
public @NonNull Authentication impersonate2() throws UsernameNotFoundException {
return this.impersonate(this.getUserDetailsForImpersonation2());
Expand All @@ -388,7 +388,7 @@ public <T extends UserProperty> T getProperty(Class<T> clazz) {
*
* @return userDetails for the user, in case he's not found but seems legitimate, we provide a userDetails with minimum access
* @throws UsernameNotFoundException If this user is not a valid user in the backend {@link SecurityRealm}.
* @since TODO
* @since 2.266
*/
public @NonNull UserDetails getUserDetailsForImpersonation2() throws UsernameNotFoundException {
ImpersonatingUserDetailsService2 userDetailsService = new ImpersonatingUserDetailsService2(
Expand Down Expand Up @@ -596,7 +596,7 @@ public void doSubmitDescription(StaplerRequest req, StaplerResponse rsp) throws
*
* @param a the supplied {@link Authentication} .
* @return a {@link User} object for the supplied {@link Authentication} or {@code null}
* @since TODO
* @since 2.266
*/
public static @CheckForNull User get2(@CheckForNull Authentication a) {
if (a == null || a instanceof AnonymousAuthenticationToken)
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/hudson/model/queue/Tasks.java
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public static org.acegisecurity.Authentication getDefaultAuthenticationOf(Task t
* in case some {@link QueueItemAuthenticator#authenticate2(hudson.model.Queue.Item)} takes (for example) actions into consideration.
* @param t a task
* @return an authentication as specified by some {@link QueueItemAuthenticator#authenticate2(hudson.model.Queue.Task)}; else {@link Task#getDefaultAuthentication2()}
* @since TODO
* @since 2.266
*/
public static @NonNull Authentication getAuthenticationOf2(@NonNull Task t) {
for (QueueItemAuthenticator qia : QueueItemAuthenticatorProvider.authenticators()) {
Expand Down
20 changes: 10 additions & 10 deletions core/src/main/java/hudson/security/ACL.java
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ public final boolean hasAnyPermission(@NonNull Permission... permissions) {
* <p>
* Note that {@link #SYSTEM2} can be passed in as the authentication parameter,
* in which case you should probably just assume it has every permission.
* @since TODO
* @since 2.266
*/
public boolean hasPermission2(@NonNull Authentication a, @NonNull Permission permission) {
if (Util.isOverridden(ACL.class, getClass(), "hasPermission", org.acegisecurity.Authentication.class, Permission.class)) {
Expand All @@ -192,7 +192,7 @@ public boolean hasPermission(@NonNull org.acegisecurity.Authentication a, @NonNu
* Creates a simple {@link ACL} implementation based on a “single-abstract-method” easily implemented via lambda syntax.
* @param impl the implementation of {@link ACL#hasPermission2(Authentication, Permission)}
* @return an adapter to that lambda
* @since TODO
* @since 2.266
*/
public static ACL lambda2(final BiFunction<Authentication, Permission, Boolean> impl) {
return new ACL() {
Expand Down Expand Up @@ -249,7 +249,7 @@ public final void checkCreatePermission(@NonNull ItemGroup c,
* @param d the descriptor of the item to be created.
* @return false
* if the user doesn't have the permission.
* @since TODO
* @since 2.266
*/
public boolean hasCreatePermission2(@NonNull Authentication a, @NonNull ItemGroup c,
@NonNull TopLevelItemDescriptor d) {
Expand Down Expand Up @@ -302,7 +302,7 @@ public final void checkCreatePermission(@NonNull ViewGroup c,
* @param d the descriptor of the view to be created.
* @return false
* if the user doesn't have the permission.
* @since TODO
* @since 2.266
*/
public boolean hasCreatePermission2(@NonNull Authentication a, @NonNull ViewGroup c,
@NonNull ViewDescriptor d) {
Expand Down Expand Up @@ -368,7 +368,7 @@ public String toString() {
* <p>
* This is used when Hudson is performing computation for itself, instead
* of acting on behalf of an user, such as doing builds.
* @since TODO
* @since 2.266
*/
public static final Authentication SYSTEM2 = new UsernamePasswordAuthenticationToken(SYSTEM_USERNAME,"SYSTEM");

Expand All @@ -390,7 +390,7 @@ public String toString() {
* <p>
* We need to create a new {@link SecurityContext} instead of {@link SecurityContext#setAuthentication(Authentication)}
* because the same {@link SecurityContext} object is reused for all the concurrent requests from the same session.
* @since TODO
* @since 2.266
* @deprecated use try with resources and {@link #as2(Authentication)}
*/
@Deprecated
Expand All @@ -413,7 +413,7 @@ public String toString() {
* Safer variant of {@link #impersonate2(Authentication)} that does not require a finally-block.
* @param auth authentication, such as {@link #SYSTEM2}
* @param body an action to run with this alternate authentication in effect
* @since TODO
* @since 2.266
* @deprecated use try with resources and {@link #as2(Authentication)}
*/
@Deprecated
Expand All @@ -439,7 +439,7 @@ public static void impersonate(@NonNull org.acegisecurity.Authentication auth, @
* Safer variant of {@link #impersonate2(Authentication)} that does not require a finally-block.
* @param auth authentication, such as {@link #SYSTEM2}
* @param body an action to run with this alternate authentication in effect (try {@link NotReallyRoleSensitiveCallable})
* @since TODO
* @since 2.266
* @deprecated use try with resources and {@link #as2(Authentication)}
*/
@Deprecated
Expand Down Expand Up @@ -474,7 +474,7 @@ public static <V,T extends Exception> V impersonate(org.acegisecurity.Authentica
* </pre>
* @param auth the new authentication.
* @return the previous authentication context
* @since TODO
* @since 2.266
*/
@NonNull
public static ACLContext as2(@NonNull Authentication auth) {
Expand Down Expand Up @@ -518,7 +518,7 @@ public static ACLContext as(@CheckForNull User user) {
* Checks if the given authentication is anonymous by checking its class.
* @see Jenkins#ANONYMOUS2
* @see AnonymousAuthenticationToken
* @since TODO
* @since 2.266
*/
public static boolean isAnonymous2(@NonNull Authentication authentication) {
//TODO use AuthenticationTrustResolver instead to be consistent through the application
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/hudson/security/ACLContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public class ACLContext implements AutoCloseable {
/**
* Accessor for the previous context.
* @return the previous context.
* @since TODO
* @since 2.266
*/
@NonNull
public SecurityContext getPreviousContext2() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public SecurityComponents createSecurityComponents() {
* <p>
* If the user name and the password pair doesn't match, throw {@link AuthenticationException} to reject the login
* attempt.
* @since TODO
* @since 2.266
*/
protected UserDetails authenticate2(String username, String password) throws AuthenticationException {
if (Util.isOverridden(AbstractPasswordBasedSecurityRealm.class, getClass(), "authenticate", String.class, String.class)) {
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/hudson/security/AccessControlled.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ default boolean hasAnyPermission(@NonNull Permission... permission) {

/**
* Convenient short-cut for {@code getACL().hasPermission2(a, permission)}
* @since TODO
* @since 2.266
*/
default boolean hasPermission2(@NonNull Authentication a, @NonNull Permission permission) {
if (a.equals(ACL.SYSTEM2)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
/**
* {@link AccessDeniedException} with more information.
* @author Kohsuke Kawaguchi
* @since TODO
* @since 2.266
*/
public class AccessDeniedException3 extends AccessDeniedException {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,7 @@ static Details fromPlainPassword(String rawPassword) {
}

/**
* @since TODO
* @since 2.266
*/
public Collection<? extends GrantedAuthority> getAuthorities2() {
// TODO
Expand Down
20 changes: 10 additions & 10 deletions core/src/main/java/hudson/security/SecurityRealm.java
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ public boolean canLogOut() {
* This parameter allows you to redirect people to different pages depending on who they are.
* @return
* never null.
* @since TODO
* @since 2.266
* @see #doLogout(StaplerRequest, StaplerResponse)
*/
protected String getPostLogOutUrl2(StaplerRequest req, Authentication auth) {
Expand Down Expand Up @@ -395,7 +395,7 @@ public boolean allowsSignup() {
* If the security realm cannot even tell if the user exists or not.
* @return
* never null.
* @since TODO
* @since 2.266
*/
public UserDetails loadUserByUsername2(String username) throws UsernameNotFoundException {
if (Util.isOverridden(SecurityRealm.class, getClass(), "loadUserByUsername", String.class)) {
Expand Down Expand Up @@ -436,7 +436,7 @@ public org.acegisecurity.userdetails.UserDetails loadUserByUsername(String usern
* may still return {@code null}
* @throws UserMayOrMayNotExistException2 if no conclusive result could be determined regarding the group existence.
* @throws UsernameNotFoundException if the group does not exist.
* @since TODO
* @since 2.266
*/
public GroupDetails loadGroupByGroupname2(String groupname, boolean fetchMembers)
throws UsernameNotFoundException {
Expand Down Expand Up @@ -727,7 +727,7 @@ public SecurityRealm newInstance(StaplerRequest req, JSONObject formData) throws
*/
public static final class SecurityComponents {
/**
* @since TODO
* @since 2.266
*/
public final AuthenticationManager manager2;
/**
Expand All @@ -736,7 +736,7 @@ public static final class SecurityComponents {
@Deprecated
public final org.acegisecurity.AuthenticationManager manager;
/**
* @since TODO
* @since 2.266
*/
public final UserDetailsService userDetails2;
/**
Expand All @@ -745,7 +745,7 @@ public static final class SecurityComponents {
@Deprecated
public final org.acegisecurity.userdetails.UserDetailsService userDetails;
/**
* @since TODO
* @since 2.266
*/
public final RememberMeServices rememberMe2;
/**
Expand All @@ -761,7 +761,7 @@ public SecurityComponents() {
}

/**
* @since TODO
* @since 2.266
*/
public SecurityComponents(AuthenticationManager manager) {
// we use UserDetailsServiceProxy here just as an implementation that fails all the time,
Expand All @@ -778,7 +778,7 @@ public SecurityComponents(org.acegisecurity.AuthenticationManager manager) {
}

/**
* @since TODO
* @since 2.266
*/
public SecurityComponents(AuthenticationManager manager, UserDetailsService userDetails) {
this(manager,userDetails,createRememberMeService(userDetails));
Expand All @@ -793,7 +793,7 @@ public SecurityComponents(org.acegisecurity.AuthenticationManager manager, org.a
}

/**
* @since TODO
* @since 2.266
*/
public SecurityComponents(AuthenticationManager manager, UserDetailsService userDetails, RememberMeServices rememberMe) {
assert manager!=null && userDetails!=null && rememberMe!=null;
Expand Down Expand Up @@ -843,7 +843,7 @@ public static DescriptorExtensionList<SecurityRealm,Descriptor<SecurityRealm>> a
/**
* {@link GrantedAuthority} that represents the built-in "authenticated" role, which is granted to
* anyone non-anonymous.
* @since TODO
* @since 2.266
*/
public static final GrantedAuthority AUTHENTICATED_AUTHORITY2 = new SimpleGrantedAuthority("authenticated");

Expand Down
Loading