Skip to content
This repository has been archived by the owner on Jul 17, 2024. It is now read-only.

Commit

Permalink
Format repository with Spotless (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
basil committed May 16, 2024
1 parent d4bbc7f commit 3184073
Show file tree
Hide file tree
Showing 64 changed files with 302 additions and 339 deletions.
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
<gitHubRepo>jenkinsci/jenkins-servlet-api</gitHubRepo>
<!-- TODO fix violations -->
<spotbugs.skip>true</spotbugs.skip>
<spotless.check.skip>false</spotless.check.skip>
</properties>

<dependencies>
Expand Down
19 changes: 9 additions & 10 deletions src/main/java/javax/servlet/AsyncContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public interface AsyncContext {
/**
* Checks if this AsyncContext was initialized with the original or application-wrapped request and response
* objects.
*
*
* <p>
* This information may be used by filters invoked in the <i>outbound</i> direction, after a request was put into
* asynchronous mode, to determine whether any request and/or response wrappers that they added during their
Expand All @@ -117,7 +117,7 @@ public interface AsyncContext {

/**
* Dispatches the request and response objects of this AsyncContext to the servlet container.
*
*
* <p>
* If the asynchronous cycle was started with {@link ServletRequest#startAsync(ServletRequest, ServletResponse)},
* and the request passed is an instance of HttpServletRequest, then the dispatch is to the URI returned by
Expand All @@ -126,14 +126,14 @@ public interface AsyncContext {
*
* <p>
* The following sequence illustrates how this will work:
*
*
* <pre>
* {@code
* // REQUEST dispatch to /url/A
* AsyncContext ac = request.startAsync();
* ...
* ac.dispatch(); // ASYNC dispatch to /url/A
*
*
* // REQUEST to /url/A
* // FORWARD dispatch to /url/B
* request.getRequestDispatcher("/url/B").forward(request,response);
Expand All @@ -142,7 +142,7 @@ public interface AsyncContext {
* ac = request.startAsync();
* ...
* ac.dispatch(); // ASYNC dispatch to /url/A
*
*
* // REQUEST to /url/A
* // FORWARD dispatch to /url/B
* request.getRequestDispatcher("/url/B").forward(request,response);
Expand All @@ -169,7 +169,7 @@ public interface AsyncContext {
* Control over the request and response is delegated to the dispatch target, and the response will be closed when
* the dispatch target has completed execution, unless {@link ServletRequest#startAsync()} or
* {@link ServletRequest#startAsync(ServletRequest, ServletResponse)} are called.
*
*
* <p>
* Any errors or exceptions that may occur during the execution of this method must be caught and handled by the
* container, as follows:
Expand Down Expand Up @@ -313,7 +313,7 @@ public interface AsyncContext {
* {@link AsyncListener} is notified.
*
* @param listener the AsyncListener to be registered
*
*
* @throws IllegalStateException if this method is called after the container-initiated dispatch, during which one
* of the {@link ServletRequest#startAsync} methods was called, has returned to the
* container
Expand Down Expand Up @@ -363,7 +363,7 @@ public interface AsyncContext {
* <p>
* This method supports resource injection if the given <code>clazz</code> represents a Managed Bean. See the Jakarta EE
* platform and CDI specifications for additional details about Managed Beans and resource injection.
*
*
* <p>
* This method supports any annotations applicable to AsyncListener.
*
Expand All @@ -386,7 +386,7 @@ public interface AsyncContext {
* <p>
* The timeout will expire if neither the {@link #complete} method nor any of the dispatch methods are called. A
* timeout value of zero or less indicates no timeout.
*
*
* <p>
* If {@link #setTimeout} is not called, then the container's default timeout, which is available via a call to
* {@link #getTimeout}, will apply.
Expand Down Expand Up @@ -415,5 +415,4 @@ public interface AsyncContext {
* @return the timeout in milliseconds
*/
long getTimeout();

}
1 change: 0 additions & 1 deletion src/main/java/javax/servlet/AsyncEvent.java
Original file line number Diff line number Diff line change
Expand Up @@ -126,5 +126,4 @@ public ServletResponse getSuppliedResponse() {
public Throwable getThrowable() {
return throwable;
}

}
11 changes: 5 additions & 6 deletions src/main/java/javax/servlet/AsyncListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public interface AsyncListener extends EventListener {

/**
* Notifies this AsyncListener that an asynchronous operation has been completed.
*
*
* <p>
* The {@link AsyncContext} corresponding to the asynchronous operation that has been completed may be obtained by
* calling {@link AsyncEvent#getAsyncContext getAsyncContext} on the given <code>event</code>.
Expand All @@ -49,7 +49,7 @@ public interface AsyncListener extends EventListener {

/**
* Notifies this AsyncListener that an asynchronous operation has timed out.
*
*
* <p>
* The {@link AsyncContext} corresponding to the asynchronous operation that has timed out may be obtained by
* calling {@link AsyncEvent#getAsyncContext getAsyncContext} on the given <code>event</code>.
Expand All @@ -68,11 +68,11 @@ public interface AsyncListener extends EventListener {

/**
* Notifies this AsyncListener that an asynchronous operation has failed to complete.
*
*
* <p>
* The {@link AsyncContext} corresponding to the asynchronous operation that failed to complete may be obtained by
* calling {@link AsyncEvent#getAsyncContext getAsyncContext} on the given <code>event</code>.
*
*
* <p>
* In addition, if this AsyncListener had been registered via a call to
* {@link AsyncContext#addListener(AsyncListener, ServletRequest, ServletResponse)}, the supplied ServletRequest and
Expand All @@ -92,7 +92,7 @@ public interface AsyncListener extends EventListener {
* <p>
* The {@link AsyncContext} corresponding to the asynchronous operation that is being reinitialized may be obtained
* by calling {@link AsyncEvent#getAsyncContext getAsyncContext} on the given <code>event</code>.
*
*
* <p>
* In addition, if this AsyncListener had been registered via a call to
* {@link AsyncContext#addListener(AsyncListener, ServletRequest, ServletResponse)}, the supplied ServletRequest and
Expand All @@ -109,5 +109,4 @@ public interface AsyncListener extends EventListener {
* @throws IOException if an I/O related error has occurred during the processing of the given AsyncEvent
*/
void onStartAsync(AsyncEvent event) throws IOException;

}
6 changes: 5 additions & 1 deletion src/main/java/javax/servlet/DispatcherType.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,9 @@
* @since Servlet 3.0
*/
public enum DispatcherType {
FORWARD, INCLUDE, REQUEST, ASYNC, ERROR
FORWARD,
INCLUDE,
REQUEST,
ASYNC,
ERROR
}
12 changes: 5 additions & 7 deletions src/main/java/javax/servlet/Filter.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
* A filter is an object that performs filtering tasks on either the request to a resource (a servlet or static
* content), or on the response from a resource, or both.
* </p>
*
*
* <p>
* Filters perform filtering in the <code>doFilter</code> method. Every Filter has access to a FilterConfig object from
* which it can obtain its initialization parameters, and a reference to the ServletContext which it can use, for
Expand Down Expand Up @@ -61,21 +61,20 @@ public interface Filter {
* The servlet container calls the init method exactly once after instantiating the filter. The init method must
* complete successfully before the filter is asked to do any filtering work.
* </p>
*
*
* <p>
* The web container cannot place the filter into service if the init method either
* </p>
* <ol>
* <li>Throws a ServletException
* <li>Does not return within a time period defined by the web container
* </ol>
*
*
* @param filterConfig a <code>FilterConfig</code> object containing the filter's configuration and initialization
* parameters
* @throws ServletException if an exception has occurred that interferes with the filter's normal operation
*/
default void init(FilterConfig filterConfig) throws ServletException {
}
default void init(FilterConfig filterConfig) throws ServletException {}

/**
* The <code>doFilter</code> method of the Filter is called by the container each time a request/response pair is
Expand Down Expand Up @@ -128,6 +127,5 @@ void doFilter(ServletRequest request, ServletResponse response, FilterChain chai
* memory.
* </p>
*/
default void destroy() {
}
default void destroy() {}
}
1 change: 0 additions & 1 deletion src/main/java/javax/servlet/FilterChain.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,4 @@ public interface FilterChain {
* @throws ServletException if an exception has occurred that interferes with the filterChain's normal operation
*/
void doFilter(ServletRequest request, ServletResponse response) throws IOException, ServletException;

}
3 changes: 1 addition & 2 deletions src/main/java/javax/servlet/FilterConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public interface FilterConfig {
* Returns a reference to the {@link ServletContext} in which the caller is executing.
*
* @return a {@link ServletContext} object, used by the caller to interact with its servlet container
*
*
* @see ServletContext
*/
ServletContext getServletContext();
Expand All @@ -63,5 +63,4 @@ public interface FilterConfig {
* initialization parameters
*/
Enumeration<String> getInitParameterNames();

}
14 changes: 6 additions & 8 deletions src/main/java/javax/servlet/FilterRegistration.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public interface FilterRegistration extends Registration {
*
* <p>
* Filter mappings are matched in the order in which they were added.
*
*
* <p>
* Depending on the value of the <code>isMatchAfter</code> parameter, the given filter mapping will be considered after
* or before any <i>declared</i> filter mappings of the ServletContext from which this FilterRegistration was
Expand All @@ -53,8 +53,8 @@ public interface FilterRegistration extends Registration {
* @throws IllegalStateException if the ServletContext from which this FilterRegistration was obtained has
* already been initialized
*/
void addMappingForServletNames(EnumSet<DispatcherType> dispatcherTypes, boolean isMatchAfter,
String... servletNames);
void addMappingForServletNames(
EnumSet<DispatcherType> dispatcherTypes, boolean isMatchAfter, String... servletNames);

/**
* Gets the currently available servlet name mappings of the Filter represented by this
Expand All @@ -75,7 +75,7 @@ void addMappingForServletNames(EnumSet<DispatcherType> dispatcherTypes, boolean
*
* <p>
* Filter mappings are matched in the order in which they were added.
*
*
* <p>
* Depending on the value of the <code>isMatchAfter</code> parameter, the given filter mapping will be considered after
* or before any <i>declared</i> filter mappings of the ServletContext from which this FilterRegistration was
Expand All @@ -95,8 +95,7 @@ void addMappingForServletNames(EnumSet<DispatcherType> dispatcherTypes, boolean
* @throws IllegalStateException if the ServletContext from which this FilterRegistration was obtained has
* already been initialized
*/
void addMappingForUrlPatterns(EnumSet<DispatcherType> dispatcherTypes, boolean isMatchAfter,
String... urlPatterns);
void addMappingForUrlPatterns(EnumSet<DispatcherType> dispatcherTypes, boolean isMatchAfter, String... urlPatterns);

/**
* Gets the currently available URL pattern mappings of the Filter represented by this
Expand All @@ -115,6 +114,5 @@ void addMappingForUrlPatterns(EnumSet<DispatcherType> dispatcherTypes, boolean i
* Interface through which a {@link Filter} registered via one of the <code>addFilter</code> methods on
* {@link ServletContext} may be further configured.
*/
interface Dynamic extends FilterRegistration, Registration.Dynamic {
}
interface Dynamic extends FilterRegistration, Registration.Dynamic {}
}
17 changes: 7 additions & 10 deletions src/main/java/javax/servlet/GenericFilter.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
* To write a generic filter, you need only override the abstract <code>doFilter</code> method.
*
* @author Various
*
*
* @since Servlet 4.0
*/
public abstract class GenericFilter implements Filter, FilterConfig, java.io.Serializable {
Expand All @@ -59,8 +59,7 @@ public abstract class GenericFilter implements Filter, FilterConfig, java.io.Ser
*
* @since Servlet 4.0
*/
public GenericFilter() {
}
public GenericFilter() {}

/**
* <p>
Expand Down Expand Up @@ -157,15 +156,15 @@ public ServletContext getServletContext() {
* Called by the servlet container to indicate to a filter that it is being placed into service. See
* {@link Filter#init}.
* </p>
*
*
* <p>
* This implementation stores the {@link FilterConfig} object it receives from the servlet container for later use.
* When overriding this form of the method, call <code>super.init(config)</code>.
*
*
* @param config the <code>FilterConfig</code> object that contains configuration information for this filter
*
* @exception ServletException if an exception occurs that interrupts the servlet's normal operation
*
*
* @see UnavailableException
*
* @since Servlet 4.0
Expand All @@ -185,14 +184,12 @@ public void init(FilterConfig config) throws ServletException {
* Instead of overriding {@link #init(FilterConfig)}, simply override this method and it will be called by
* <code>GenericFilter.init(FilterConfig config)</code>. The <code>FilterConfig</code> object can still be retrieved
* via {@link #getFilterConfig}.
*
*
* @exception ServletException if an exception occurs that interrupts the servlet's normal operation
*
* @since Servlet 4.0
*/
public void init() throws ServletException {

}
public void init() throws ServletException {}

/**
* <p>
Expand Down
18 changes: 7 additions & 11 deletions src/main/java/javax/servlet/GenericServlet.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Copyright (c) 1997-2018 Oracle and/or its affiliates and others.
* All rights reserved.
* Copyright 2004 The Apache Software Foundation
* Copyright 2004 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -57,18 +57,16 @@ public abstract class GenericServlet implements Servlet, ServletConfig, java.io.
* Does nothing. All of the servlet initialization is done by one of the <code>init</code> methods.
*
*/
public GenericServlet() {
}
public GenericServlet() {}

/**
* Called by the servlet container to indicate to a servlet that the servlet is being taken out of service. See
* {@link Servlet#destroy}.
*
*
*
*/
@Override
public void destroy() {
}
public void destroy() {}

/**
* Returns a <code>String</code> containing the value of the named initialization parameter, or <code>null</code> if
Expand Down Expand Up @@ -171,7 +169,7 @@ public String getServletInfo() {
* @param config the <code>ServletConfig</code> object that contains configuration information for this servlet
*
* @exception ServletException if an exception occurs that interrupts the servlet's normal operation
*
*
* @see UnavailableException
*/
@Override
Expand All @@ -190,9 +188,7 @@ public void init(ServletConfig config) throws ServletException {
*
* @exception ServletException if an exception occurs that interrupts the servlet's normal operation
*/
public void init() throws ServletException {

}
public void init() throws ServletException {}

/**
* Writes the specified message to a servlet log file, prepended by the servlet's name. See
Expand All @@ -219,7 +215,7 @@ public void log(String message, Throwable t) {

/**
* Called by the servlet container to allow the servlet to respond to a request. See {@link Servlet#service}.
*
*
* <p>
* This method is declared abstract so subclasses, such as <code>HttpServlet</code>, must override it.
*
Expand Down
1 change: 0 additions & 1 deletion src/main/java/javax/servlet/ReadListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,4 @@ public interface ReadListener extends EventListener {
* @param t the throwable to indicate why the read operation failed
*/
void onError(Throwable t);

}
2 changes: 1 addition & 1 deletion src/main/java/javax/servlet/RequestDispatcher.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public interface RequestDispatcher {
/**
* The name of the request attribute under which the original {@link javax.servlet.http.HttpServletMapping} is made
* available to the target of a {@link #forward(ServletRequest,ServletResponse) forward}
*
*
* @since 4.0
*/
String FORWARD_MAPPING = "javax.servlet.forward.mapping";
Expand Down
Loading

0 comments on commit 3184073

Please sign in to comment.