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 #238

Merged
merged 1 commit into from
Jan 7, 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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package hudson.plugins.ansicolor;

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

/**
Expand All @@ -25,7 +25,7 @@ public enum AnsiAttrType {
String attributes;

public interface Emitter {
void emitHtml(@Nonnull String html);
void emitHtml(@NonNull String html);

/**
* Emit invisible ANSI sequence
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import java.util.logging.Logger;
import jenkins.util.JenkinsJVM;

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

/**
* {@link ConsoleLogFilter} that adds a {@link SimpleHtmlNote} to each line.
Expand Down Expand Up @@ -81,7 +81,7 @@ public OutputStream decorateLogger(AbstractBuild build, final OutputStream logge

return new AnsiHtmlOutputStream(logger, colorMap, new AnsiAttributeElement.Emitter() {
@Override
public void emitHtml(@Nonnull String html) {
public void emitHtml(@NonNull String html) {
try {
byte[] pregenerated = notes.get(html);
if (pregenerated != null) {
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/hudson/plugins/ansicolor/AnsiColorStep.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import org.jenkinsci.plugins.workflow.steps.*;
import org.kohsuke.stapler.DataBoundConstructor;

import javax.annotation.Nonnull;
import edu.umd.cs.findbugs.annotations.NonNull;
import java.io.IOException;
import java.util.*;
import java.util.logging.Level;
Expand Down Expand Up @@ -85,7 +85,7 @@ public boolean start() throws Exception {
@Extension(optional = true)
public static class StepDescriptorImpl extends StepDescriptor {

@Nonnull
@NonNull
@Override
public String getDisplayName() {
return Messages.DisplayName();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
import java.util.Collections;
import java.util.List;
import java.util.Stack;
import javax.annotation.Nonnull;
import edu.umd.cs.findbugs.annotations.NonNull;

/**
* Filters an output stream of ANSI escape sequences and emits appropriate HTML elements instead.
Expand Down Expand Up @@ -73,7 +73,7 @@ private enum State {
* underlying stream.
*/
/*package*/ AnsiHtmlOutputStream(final OutputStream os, final AnsiColorMap colorMap,
final AnsiAttributeElement.Emitter emitter, @Nonnull List<AnsiAttributeElement> tagsToOpen) {
final AnsiAttributeElement.Emitter emitter, @NonNull List<AnsiAttributeElement> tagsToOpen) {
super(os);
this.logOutput = os;
this.colorMap = colorMap;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@
import org.jenkinsci.plugins.workflow.flow.FlowExecutionOwner;
import org.jenkinsci.plugins.workflow.graph.FlowNode;

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.Collections;
import java.util.List;
Expand All @@ -65,7 +65,7 @@ final class ColorConsoleAnnotator extends ConsoleAnnotator<Object> {
@CheckForNull
private String colorMapName;

@Nonnull
@NonNull
private List<AnsiAttributeElement> openTags = Collections.emptyList();

private long lineNo;
Expand All @@ -77,7 +77,7 @@ private ColorConsoleAnnotator(String defaultColorMapName, LineIdentifier lineIde
}

@Override
public ConsoleAnnotator<Object> annotate(@Nonnull Object context, @Nonnull MarkupText text) {
public ConsoleAnnotator<Object> annotate(@NonNull Object context, @NonNull MarkupText text) {
lineNo++;
Run<?, ?> run = runOf(context);
if (run == null) {
Expand Down Expand Up @@ -116,7 +116,7 @@ class EmitterImpl implements AnsiAttributeElement.Emitter {
int lastPoint = -1; // multiple HTML tags may be emitted for one control sequence

@Override
public void emitHtml(@Nonnull String html) {
public void emitHtml(@NonNull String html) {
final int inCount = getIncomingCount();
LOGGER.log(Level.FINEST, "emitting {0} @{1}/{2}", new Object[]{html, inCount, s.length()});
text.addMarkup(inCount, html);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import hudson.util.VersionNumber;
import jenkins.model.Jenkins;

import javax.annotation.Nonnull;
import edu.umd.cs.findbugs.annotations.NonNull;
import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
Expand Down Expand Up @@ -114,7 +114,7 @@ private int[] calculateBeginLength(byte[] buf, int startInBuff, int eolPos, bool
public static class Listener extends RunListener<Run<?, ?>> {

@Override
public void onCompleted(Run<?, ?> run, @Nonnull TaskListener listener) {
public void onCompleted(Run<?, ?> run, @NonNull TaskListener listener) {
super.onCompleted(run, listener);
final List<ColorizedAction.Command> commands = Arrays.asList(ColorizedAction.Command.START, ColorizedAction.Command.STOP);
final Map<String, ColorizedAction> actions = run.getActions(ColorizedAction.class).stream()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import hudson.console.ConsoleNote;
import org.junit.Test;

import javax.annotation.Nonnull;
import edu.umd.cs.findbugs.annotations.NonNull;
import java.io.ByteArrayOutputStream;
import java.io.IOException;

Expand Down Expand Up @@ -616,7 +616,7 @@ private void assertThatAnnotateIs(AnsiColorMap colorMap, String ansi, String htm
private String annotate(String text, AnsiColorMap colorMap) throws IOException {
final ByteArrayOutputStream bos = new ByteArrayOutputStream();
AnsiHtmlOutputStream ansi = new AnsiHtmlOutputStream(bos, colorMap, new AnsiAttributeElement.Emitter() {
public void emitHtml(@Nonnull String html) {
public void emitHtml(@NonNull String html) {
try {
bos.write(html.getBytes(UTF_8));
} catch (IOException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

import org.jenkinsci.plugins.workflow.steps.DynamicContext;

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;

/**
* Fake masker pretending to be a kubernetes-plugin component
*/
public class SecretsMasker extends DynamicContext.Typed<String> {
@Nonnull
@NonNull
@Override
protected Class<String> type() {
return String.class;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
import org.jenkinsci.plugins.workflow.flow.FlowExecutionOwner;
import org.jenkinsci.plugins.workflow.log.TaskListenerDecorator;

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

/**
* Fake decorator pretending to be a logstash-plugin component
*/
public class GlobalDecorator implements TaskListenerDecorator.Factory {
@CheckForNull
@Override
public TaskListenerDecorator of(@Nonnull FlowExecutionOwner owner) {
public TaskListenerDecorator of(@NonNull FlowExecutionOwner owner) {
return null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
import org.jenkinsci.plugins.workflow.flow.FlowExecutionOwner;
import org.jenkinsci.plugins.workflow.log.TaskListenerDecorator;

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

/**
* Fake decorator pretending to be a timestamper-plugin component
*/
public class GlobalDecorator implements TaskListenerDecorator.Factory {
@CheckForNull
@Override
public TaskListenerDecorator of(@Nonnull FlowExecutionOwner owner) {
public TaskListenerDecorator of(@NonNull FlowExecutionOwner owner) {
return null;
}
}