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

Update deps #138

Merged
merged 3 commits into from
Jan 3, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
16 changes: 3 additions & 13 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@
<revision>1.35</revision>
<changelist>-SNAPSHOT</changelist>
<java.level>8</java.level>
<jenkins.version>2.235.5</jenkins.version>
<jenkins.version>2.289.1</jenkins.version>
</properties>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.jenkins.tools.bom</groupId>
<artifactId>bom-2.235.x</artifactId>
<version>918.vae501d2cdc99</version>
<artifactId>bom-2.289.x</artifactId>
<version>1075.v14bef33e5d7b</version>
<scope>import</scope>
<type>pom</type>
</dependency>
Expand All @@ -56,16 +56,9 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
<version>1.4.7</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jenkins-ci.modules</groupId>
<artifactId>instance-identity</artifactId>
<version>2.2</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand Down Expand Up @@ -157,7 +150,4 @@
<url>https://repo.jenkins-ci.org/public/</url>
</pluginRepository>
</pluginRepositories>
<build>
<defaultGoal>clean hpi:run</defaultGoal>
</build>
Comment on lines -160 to -162
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nonstandard. Introduced in #44.

</project>
6 changes: 3 additions & 3 deletions src/main/java/hudson/tasks/MailSender.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@
import org.acegisecurity.userdetails.UsernameNotFoundException;
import org.jenkinsci.plugins.displayurlapi.DisplayURLProvider;

import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;
import edu.umd.cs.findbugs.annotations.CheckForNull;
import edu.umd.cs.findbugs.annotations.NonNull;
import javax.mail.Address;
import javax.mail.MessagingException;
import javax.mail.Transport;
Expand Down Expand Up @@ -460,7 +460,7 @@ String getCulpritsOfEmailList(AbstractProject upstreamProject, AbstractBuild<?,
/** If set, send to unauthorized users. Unauthorized users are users where {@link User#impersonate()} fails with a security-related exception. */
static /* not final */ boolean SEND_TO_UNAUTHORIZED_USERS = Boolean.getBoolean(MailSender.class.getName() + ".SEND_TO_UNAUTHORIZED_USERS");

@Nonnull
@NonNull
String getUserEmailList(TaskListener listener, AbstractBuild<?, ?> build) throws AddressException, UnsupportedEncodingException {
Set<User> users = build.getCulprits();
StringBuilder userEmails = new StringBuilder();
Expand Down
7 changes: 3 additions & 4 deletions src/main/java/hudson/tasks/Mailer.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
*/
package hudson.tasks;

import edu.umd.cs.findbugs.annotations.CheckForNull;
import edu.umd.cs.findbugs.annotations.NonNull;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import hudson.Util;
Expand Down Expand Up @@ -62,8 +63,6 @@
import java.util.logging.Logger;
import java.util.regex.Pattern;
import java.util.regex.Matcher;
import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;
import javax.mail.Address;
import javax.mail.Authenticator;
import javax.mail.Message;
Expand Down Expand Up @@ -215,8 +214,8 @@ public static InternetAddress StringToAddress(String strAddress, String charset)
* @throws UnsupportedEncodingException Unsupported encoding
* @since TODO
*/
public static @Nonnull InternetAddress stringToAddress(@Nonnull String strAddress,
@Nonnull String charset) throws AddressException, UnsupportedEncodingException {
public static @NonNull InternetAddress stringToAddress(@NonNull String strAddress,
@NonNull String charset) throws AddressException, UnsupportedEncodingException {
Matcher m = ADDRESS_PATTERN.matcher(strAddress);
if(!m.matches()) {
return new InternetAddress(strAddress);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
import org.apache.commons.lang.StringUtils;
import org.jenkinsci.main.modules.instance_identity.InstanceIdentity;

import javax.annotation.Nonnull;
import edu.umd.cs.findbugs.annotations.NonNull;
import javax.mail.Address;
import javax.mail.BodyPart;
import javax.mail.Message;
Expand Down Expand Up @@ -94,12 +94,12 @@ public MimeMessageBuilder() {
}
}

public MimeMessageBuilder setCharset(@Nonnull String charset) {
public MimeMessageBuilder setCharset(@NonNull String charset) {
this.charset = charset;
return this;
}

public MimeMessageBuilder setMimeType(@Nonnull String mimeType) {
public MimeMessageBuilder setMimeType(@NonNull String mimeType) {
this.mimeType = mimeType;
return this;
}
Expand All @@ -109,17 +109,17 @@ public MimeMessageBuilder setListener(TaskListener listener) {
return this;
}

public MimeMessageBuilder setDefaultSuffix(@Nonnull String defaultSuffix) {
public MimeMessageBuilder setDefaultSuffix(@NonNull String defaultSuffix) {
this.defaultSuffix = defaultSuffix;
return this;
}

public MimeMessageBuilder setFrom(@Nonnull String from) {
public MimeMessageBuilder setFrom(@NonNull String from) {
this.from = from;
return this;
}

public MimeMessageBuilder setReplyTo(@Nonnull String replyTo) {
public MimeMessageBuilder setReplyTo(@NonNull String replyTo) {
try {
final List<InternetAddress> addresses = toNormalizedAddresses(replyTo);
// Done after to leave the current value untouched if there is a parsing error.
Expand All @@ -131,7 +131,7 @@ public MimeMessageBuilder setReplyTo(@Nonnull String replyTo) {
return this;
}

public MimeMessageBuilder addReplyTo(@Nonnull String replyTo) {
public MimeMessageBuilder addReplyTo(@NonNull String replyTo) {
try {
this.replyTo.addAll(toNormalizedAddresses(replyTo));
} catch(UnsupportedEncodingException e) {
Expand All @@ -141,12 +141,12 @@ public MimeMessageBuilder addReplyTo(@Nonnull String replyTo) {
}


public MimeMessageBuilder setSubject(@Nonnull String subject) {
public MimeMessageBuilder setSubject(@NonNull String subject) {
this.subject = subject;
return this;
}

public MimeMessageBuilder setBody(@Nonnull String body) {
public MimeMessageBuilder setBody(@NonNull String body) {
this.body = body;
return this;
}
Expand All @@ -156,7 +156,7 @@ public MimeMessageBuilder setRecipientFilter(AddressFilter recipientFilter) {
return this;
}

public MimeMessageBuilder addRecipients(@Nonnull String recipients) throws UnsupportedEncodingException {
public MimeMessageBuilder addRecipients(@NonNull String recipients) throws UnsupportedEncodingException {
addRecipients(recipients, Message.RecipientType.TO);
return this;
}
Expand All @@ -168,7 +168,7 @@ public MimeMessageBuilder addRecipients(@Nonnull String recipients) throws Unsup
* @return the constructed message with the given recipients
* @throws UnsupportedEncodingException in case of encoding problems
*/
public MimeMessageBuilder addRecipients(@Nonnull String recipients, @Nonnull Message.RecipientType recipientType) throws UnsupportedEncodingException {
public MimeMessageBuilder addRecipients(@NonNull String recipients, @NonNull Message.RecipientType recipientType) throws UnsupportedEncodingException {
StringTokenizer tokens = new StringTokenizer(recipients, " \t\n\r\f,");
while (tokens.hasMoreTokens()) {
String addressToken = tokens.nextToken();
Expand Down Expand Up @@ -239,7 +239,7 @@ private static Address[] toAddressArray(Collection<InternetAddress> c) {
return addresses;
}

public static void setInReplyTo(@Nonnull MimeMessage msg, @Nonnull String inReplyTo) throws MessagingException {
public static void setInReplyTo(@NonNull MimeMessage msg, @NonNull String inReplyTo) throws MessagingException {
msg.setHeader("In-Reply-To", inReplyTo);
msg.setHeader("References", inReplyTo);
}
Expand Down