Skip to content

Commit

Permalink
Enable AvoidStarImport Checkstyle check (#5420)
Browse files Browse the repository at this point in the history
  • Loading branch information
basil authored Apr 28, 2021
1 parent f637867 commit 95e8549
Show file tree
Hide file tree
Showing 143 changed files with 640 additions and 179 deletions.
3 changes: 2 additions & 1 deletion cli/src/main/java/hudson/cli/CLI.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@
import java.util.logging.Handler;
import java.util.logging.Level;
import java.util.logging.Logger;
import static java.util.logging.Level.*;
import static java.util.logging.Level.FINE;
import static java.util.logging.Level.parse;
import jakarta.websocket.ClientEndpointConfig;
import jakarta.websocket.Endpoint;
import jakarta.websocket.EndpointConfig;
Expand Down
4 changes: 3 additions & 1 deletion cli/src/test/java/hudson/util/QuotedStringTokenizerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@

import java.util.Arrays;

import static org.junit.jupiter.api.Assertions.*;
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;

/**
* @author Kohsuke Kawaguchi
Expand Down
4 changes: 3 additions & 1 deletion core/src/main/java/hudson/Extension.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import static java.lang.annotation.ElementType.*;
import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
import static jenkins.YesNoMaybe.MAYBE;

Expand Down
7 changes: 6 additions & 1 deletion core/src/main/java/hudson/Functions.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,12 @@
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import hudson.model.Computer;
import hudson.model.Slave;
import hudson.security.*;
import hudson.security.ACL;
import hudson.security.AccessControlled;
import hudson.security.AuthorizationStrategy;
import hudson.security.GlobalSecurityConfiguration;
import hudson.security.Permission;
import hudson.security.SecurityRealm;

import java.util.function.Predicate;
import jenkins.util.SystemProperties;
Expand Down
9 changes: 7 additions & 2 deletions core/src/main/java/hudson/PluginManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,13 @@
import java.util.logging.Logger;
import java.util.stream.Collectors;

import static hudson.init.InitMilestone.*;
import static java.util.logging.Level.*;
import static hudson.init.InitMilestone.COMPLETED;
import static hudson.init.InitMilestone.PLUGINS_LISTED;
import static hudson.init.InitMilestone.PLUGINS_PREPARED;
import static hudson.init.InitMilestone.PLUGINS_STARTED;
import static java.util.logging.Level.FINE;
import static java.util.logging.Level.INFO;
import static java.util.logging.Level.WARNING;
import static java.util.stream.Collectors.toList;

import org.springframework.security.core.Authentication;
Expand Down
4 changes: 2 additions & 2 deletions core/src/main/java/hudson/RelativePath.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import static java.lang.annotation.ElementType.*;
import static java.lang.annotation.RetentionPolicy.*;
import static java.lang.annotation.ElementType.PARAMETER;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

/**
* Used in conjunction with {@link QueryParameter} to refer to
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/hudson/ResponseHeaderFilter.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
*/
package hudson;

import java.util.*;
import java.util.Enumeration;

import javax.servlet.Filter;
import javax.servlet.FilterChain;
Expand Down
29 changes: 27 additions & 2 deletions core/src/main/java/hudson/Util.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,19 @@
import org.kohsuke.accmod.Restricted;
import org.kohsuke.accmod.restrictions.NoExternalUse;

import java.io.*;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.Closeable;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.PrintStream;
import java.io.Reader;
import java.io.StringReader;
import java.io.Writer;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.net.InetAddress;
Expand Down Expand Up @@ -76,7 +88,20 @@
import java.time.LocalDate;
import java.time.ZoneId;
import java.time.temporal.ChronoUnit;
import java.util.*;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Date;
import java.util.EnumSet;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.MissingResourceException;
import java.util.Properties;
import java.util.ResourceBundle;
import java.util.Set;
import java.util.SimpleTimeZone;
import java.util.StringTokenizer;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.function.Supplier;
Expand Down
4 changes: 3 additions & 1 deletion core/src/main/java/hudson/WebAppMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,9 @@
import java.util.logging.Handler;
import java.util.logging.LogRecord;

import static java.util.logging.Level.*;
import static java.util.logging.Level.FINE;
import static java.util.logging.Level.SEVERE;
import static java.util.logging.Level.WARNING;

/**
* Entry point when Hudson is used as a webapp.
Expand Down
8 changes: 7 additions & 1 deletion core/src/main/java/hudson/console/ModelHyperlinkNote.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
package hudson.console;

import hudson.Extension;
import hudson.model.*;
import hudson.model.Computer;
import hudson.model.Item;
import hudson.model.Label;
import hudson.model.ModelObject;
import hudson.model.Node;
import hudson.model.Run;
import hudson.model.User;
import jenkins.model.Jenkins;
import org.jenkinsci.Symbol;

Expand Down
3 changes: 2 additions & 1 deletion core/src/main/java/hudson/init/Terminator.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import static hudson.init.TermMilestone.*;
import static hudson.init.TermMilestone.COMPLETED;
import static hudson.init.TermMilestone.STARTED;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/hudson/init/impl/GroovyInitScript.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import jenkins.util.groovy.GroovyHookScript;


import static hudson.init.InitMilestone.*;
import static hudson.init.InitMilestone.JOB_CONFIG_ADAPTED;

/**
* Run the initialization script, if it exists.
Expand Down
5 changes: 4 additions & 1 deletion core/src/main/java/hudson/lifecycle/UnixLifecycle.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@
import java.util.logging.Level;
import java.util.logging.Logger;

import static hudson.util.jna.GNUCLibrary.*;
import static hudson.util.jna.GNUCLibrary.FD_CLOEXEC;
import static hudson.util.jna.GNUCLibrary.F_GETFD;
import static hudson.util.jna.GNUCLibrary.F_SETFD;
import static hudson.util.jna.GNUCLibrary.LIBC;

import hudson.Platform;
import jenkins.model.Jenkins;
Expand Down
27 changes: 24 additions & 3 deletions core/src/main/java/hudson/logging/LogRecorder.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@
import hudson.FilePath;
import hudson.Util;
import hudson.XmlFile;
import hudson.model.*;
import hudson.model.AbstractModelObject;
import hudson.model.AutoCompletionCandidates;
import hudson.model.Computer;
import hudson.model.Saveable;
import hudson.model.TaskListener;
import hudson.util.HttpResponses;
import jenkins.util.MemoryReductionUtil;
import jenkins.model.Jenkins;
Expand All @@ -44,15 +48,32 @@
import jenkins.security.MasterToSlaveCallable;
import net.sf.json.JSONObject;
import org.apache.commons.lang.StringUtils;
import org.kohsuke.stapler.*;
import org.kohsuke.stapler.DataBoundConstructor;
import org.kohsuke.stapler.HttpResponse;
import org.kohsuke.stapler.QueryParameter;
import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.StaplerResponse;
import org.kohsuke.stapler.interceptor.RequirePOST;

import javax.servlet.ServletException;
import java.io.File;
import java.io.IOException;
import java.io.Serializable;
import java.text.Collator;
import java.util.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
import java.util.SortedSet;
import java.util.TreeMap;
import java.util.TreeSet;
import java.util.logging.Level;
import java.util.logging.LogManager;
import java.util.logging.LogRecord;
Expand Down
5 changes: 4 additions & 1 deletion core/src/main/java/hudson/model/AbstractBuild.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,10 @@
import hudson.tasks.Builder;
import hudson.tasks.Fingerprinter.FingerprintAction;
import hudson.tasks.Publisher;
import hudson.util.*;
import hudson.util.AdaptedIterator;
import hudson.util.HttpResponses;
import hudson.util.Iterators;
import hudson.util.VariableResolver;
import jenkins.model.Jenkins;
import org.kohsuke.stapler.HttpResponse;
import org.kohsuke.stapler.Stapler;
Expand Down
6 changes: 5 additions & 1 deletion core/src/main/java/hudson/model/AbstractCIBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@
import org.kohsuke.stapler.StaplerFallback;
import org.kohsuke.stapler.StaplerProxy;

import java.util.*;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.logging.Level;
import java.util.logging.Logger;
import edu.umd.cs.findbugs.annotations.CheckForNull;
Expand Down
3 changes: 2 additions & 1 deletion core/src/main/java/hudson/model/AbstractProject.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@
import hudson.scm.NullSCM;
import hudson.scm.PollingResult;

import static hudson.scm.PollingResult.*;
import static hudson.scm.PollingResult.BUILD_NOW;
import static hudson.scm.PollingResult.NO_CHANGES;
import hudson.scm.SCM;
import hudson.scm.SCMRevisionState;
import hudson.scm.SCMS;
Expand Down
8 changes: 7 additions & 1 deletion core/src/main/java/hudson/model/Api.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,13 @@
import org.kohsuke.stapler.QueryParameter;
import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.StaplerResponse;
import org.kohsuke.stapler.export.*;
import org.kohsuke.stapler.export.Exported;
import org.kohsuke.stapler.export.Flavor;
import org.kohsuke.stapler.export.Model;
import org.kohsuke.stapler.export.ModelBuilder;
import org.kohsuke.stapler.export.NamedPathPruner;
import org.kohsuke.stapler.export.SchemaGenerator;
import org.kohsuke.stapler.export.TreePruner;
import org.kohsuke.stapler.export.TreePruner.ByDepth;

import javax.servlet.ServletException;
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/hudson/model/BallColor.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
import org.jvnet.localizer.Localizable;
import org.kohsuke.stapler.Stapler;

import java.awt.*;
import java.awt.Color;
import java.util.Locale;

/**
Expand Down
12 changes: 10 additions & 2 deletions core/src/main/java/hudson/model/Computer.java
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,15 @@
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.*;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
Expand All @@ -121,7 +129,7 @@
import edu.umd.cs.findbugs.annotations.NonNull;
import edu.umd.cs.findbugs.annotations.Nullable;

import static javax.servlet.http.HttpServletResponse.*;
import static javax.servlet.http.HttpServletResponse.SC_BAD_REQUEST;

/**
* Represents the running state of a remote computer that holds {@link Executor}s.
Expand Down
12 changes: 10 additions & 2 deletions core/src/main/java/hudson/model/Descriptor.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,22 @@
import jenkins.util.io.OnMaster;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import org.kohsuke.stapler.*;
import org.kohsuke.stapler.Ancestor;
import org.kohsuke.stapler.BindInterceptor;
import org.kohsuke.stapler.Facet;
import org.kohsuke.stapler.HttpResponse;
import org.kohsuke.stapler.QueryParameter;
import org.kohsuke.stapler.Stapler;
import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.StaplerResponse;
import org.kohsuke.stapler.WebApp;
import org.kohsuke.stapler.jelly.JellyCompatibleFacet;
import org.kohsuke.stapler.lang.Klass;
import org.springframework.util.StringUtils;
import org.jvnet.tiger_types.Types;
import org.apache.commons.io.IOUtils;

import static hudson.util.QuotedStringTokenizer.*;
import static hudson.util.QuotedStringTokenizer.quote;
import static javax.servlet.http.HttpServletResponse.SC_NOT_FOUND;

import javax.servlet.ServletException;
Expand Down
7 changes: 5 additions & 2 deletions core/src/main/java/hudson/model/Executor.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,14 @@
import java.util.logging.Level;
import java.util.logging.Logger;

import static hudson.model.queue.Executables.*;
import static hudson.model.queue.Executables.getParentOf;
import hudson.security.ACLContext;
import hudson.security.AccessControlled;
import java.util.Collection;
import static java.util.logging.Level.*;
import static java.util.logging.Level.FINE;
import static java.util.logging.Level.FINER;
import static java.util.logging.Level.SEVERE;
import static java.util.logging.Level.WARNING;
import edu.umd.cs.findbugs.annotations.CheckForNull;
import edu.umd.cs.findbugs.annotations.NonNull;
import jenkins.model.queue.AsynchronousExecution;
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/hudson/model/HealthReport.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
import org.kohsuke.stapler.export.Exported;
import org.kohsuke.stapler.export.ExportedBean;

import java.io.*;
import java.io.Serializable;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
Expand Down
10 changes: 9 additions & 1 deletion core/src/main/java/hudson/model/ListView.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,15 @@
import hudson.views.ViewJobFilter;

import java.io.IOException;
import java.util.*;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;
import java.util.SortedSet;
import java.util.TreeSet;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.regex.Pattern;
Expand Down
3 changes: 2 additions & 1 deletion core/src/main/java/hudson/model/LoadStatistics.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@
import org.kohsuke.stapler.export.ExportedBean;
import org.kohsuke.stapler.export.Exported;

import java.awt.*;
import java.awt.BasicStroke;
import java.awt.Color;
import java.io.IOException;
import java.io.Serializable;
import java.lang.reflect.Method;
Expand Down
Loading

0 comments on commit 95e8549

Please sign in to comment.