Skip to content

Commit

Permalink
Format java files in o.e.equinox.http.servlet.tests
Browse files Browse the repository at this point in the history
This was achieved by running:
eclipse -consolelog -nosplash -application org.eclipse.jdt.core.JavaCodeFormatter \
  -config .settings/org.eclipse.jdt.core.prefs . -data `mktemp -d`

Signed-off-by: Torbjörn SVENSSON <[email protected]>
  • Loading branch information
Torbjorn-Svensson committed Nov 6, 2023
1 parent b317d7e commit c5b7df1
Show file tree
Hide file tree
Showing 92 changed files with 1,240 additions and 1,279 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public abstract class AbstractTestResource {
public void activate(ComponentContext componentContext) throws ServletException, NamespaceException {
HttpService service = getHttpService();
String alias = getAlias();
service.registerResources(alias, getName() , null);
service.registerResources(alias, getName(), null);
}

protected final String createDefaultAlias() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ public void deactivate() {
}

@Override
protected final void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
protected final void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
try (PrintWriter writer = response.getWriter()) {
handleDoGet(request, writer);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,10 @@ public void destroy() {
}

@Override
public void doFilter(
ServletRequest request, ServletResponse response,
FilterChain chain)
throws IOException, ServletException {
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
throws IOException, ServletException {

CharResponseWrapper charResponseWrapper = new CharResponseWrapper(
(HttpServletResponse) response);
CharResponseWrapper charResponseWrapper = new CharResponseWrapper((HttpServletResponse) response);

chain.doFilter(request, charResponseWrapper);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ public class AbstractWhiteboardTestServlet extends HttpServlet {
private static final long serialVersionUID = 1L;

@Override
protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
protected void service(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
try (PrintWriter writer = response.getWriter()) {
handleDoGet(request, writer);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
public class TestErrorPage1 extends AbstractTestServlet {
private static final long serialVersionUID = 1L;
private final Collection<ServiceRegistration<?>> registrations = new ArrayList<>();

@Override
public void activate(ComponentContext componentContext) {
Dictionary<String, String> servletProps = new Hashtable<>();
Expand All @@ -47,7 +48,7 @@ public void activate(ComponentContext componentContext) {
registrations.add(componentContext.getBundleContext().registerService(Servlet.class, this, servletProps));
Dictionary<String, Object> errorProps = new Hashtable<>();
errorProps.put(HttpWhiteboardConstants.HTTP_WHITEBOARD_SERVLET_NAME, "E1");
errorProps.put(HttpWhiteboardConstants.HTTP_WHITEBOARD_SERVLET_ERROR_PAGE, new String[] {"403", "404"});
errorProps.put(HttpWhiteboardConstants.HTTP_WHITEBOARD_SERVLET_ERROR_PAGE, new String[] { "403", "404" });
registrations.add(componentContext.getBundleContext().registerService(Servlet.class, errorServlet, errorProps));
}

Expand All @@ -59,8 +60,7 @@ public void deactivate() {
}

@Override
protected void service(HttpServletRequest request, HttpServletResponse response)
throws IOException {
protected void service(HttpServletRequest request, HttpServletResponse response) throws IOException {

response.sendError(403);
}
Expand All @@ -69,9 +69,7 @@ protected void service(HttpServletRequest request, HttpServletResponse response)
private static final long serialVersionUID = 1L;

@Override
protected void service(
HttpServletRequest request, HttpServletResponse response)
throws IOException {
protected void service(HttpServletRequest request, HttpServletResponse response) throws IOException {

if (response.isCommitted()) {
System.out.println("Problem?");
Expand All @@ -81,8 +79,8 @@ protected void service(

PrintWriter writer = response.getWriter();

String requestURI = (String)request.getAttribute(RequestDispatcher.ERROR_REQUEST_URI);
Integer status = (Integer)request.getAttribute(RequestDispatcher.ERROR_STATUS_CODE);
String requestURI = (String) request.getAttribute(RequestDispatcher.ERROR_REQUEST_URI);
Integer status = (Integer) request.getAttribute(RequestDispatcher.ERROR_STATUS_CODE);

writer.print(status + " ERROR : " + requestURI);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
public class TestErrorPage2 extends AbstractTestServlet {
private static final long serialVersionUID = 1L;
private final Collection<ServiceRegistration<?>> registrations = new ArrayList<>();

@Override
public void activate(ComponentContext componentContext) {
Dictionary<String, String> servletProps = new Hashtable<>();
Expand All @@ -50,7 +51,8 @@ public void activate(ComponentContext componentContext) {
registrations.add(componentContext.getBundleContext().registerService(Servlet.class, this, servletProps));
Dictionary<String, Object> errorProps = new Hashtable<>();
errorProps.put(HttpWhiteboardConstants.HTTP_WHITEBOARD_SERVLET_NAME, "E1");
errorProps.put(HttpWhiteboardConstants.HTTP_WHITEBOARD_SERVLET_ERROR_PAGE, new String[] {MyException.class.getName()});
errorProps.put(HttpWhiteboardConstants.HTTP_WHITEBOARD_SERVLET_ERROR_PAGE,
new String[] { MyException.class.getName() });
registrations.add(componentContext.getBundleContext().registerService(Servlet.class, errorServlet, errorProps));
}

Expand All @@ -62,8 +64,7 @@ public void deactivate() {
}

@Override
protected void service(HttpServletRequest request, HttpServletResponse response)
throws ServletException {
protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException {

throw new MyException();
}
Expand All @@ -73,9 +74,7 @@ protected void service(HttpServletRequest request, HttpServletResponse response)
private static final long serialVersionUID = 1L;

@Override
protected void service(
HttpServletRequest request, HttpServletResponse response)
throws IOException {
protected void service(HttpServletRequest request, HttpServletResponse response) throws IOException {

if (response.isCommitted()) {
System.out.println("Problem?");
Expand All @@ -85,8 +84,8 @@ protected void service(

PrintWriter writer = response.getWriter();

String requestURI = (String)request.getAttribute(RequestDispatcher.ERROR_REQUEST_URI);
String exception = (String)request.getAttribute(RequestDispatcher.ERROR_EXCEPTION_TYPE);
String requestURI = (String) request.getAttribute(RequestDispatcher.ERROR_REQUEST_URI);
String exception = (String) request.getAttribute(RequestDispatcher.ERROR_EXCEPTION_TYPE);

writer.print(exception + " ERROR : " + requestURI);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
public class TestErrorPage3 extends AbstractTestServlet {
private static final long serialVersionUID = 1L;
private final Collection<ServiceRegistration<?>> registrations = new ArrayList<>();

@Override
public void activate(ComponentContext componentContext) {
Dictionary<String, String> servletProps = new Hashtable<>();
Expand All @@ -59,8 +60,7 @@ public void deactivate() {
}

@Override
protected void service(HttpServletRequest request, HttpServletResponse response)
throws IOException {
protected void service(HttpServletRequest request, HttpServletResponse response) throws IOException {

response.sendError(400);
}
Expand All @@ -69,9 +69,7 @@ protected void service(HttpServletRequest request, HttpServletResponse response)
private static final long serialVersionUID = 1L;

@Override
protected void service(
HttpServletRequest request, HttpServletResponse response)
throws IOException {
protected void service(HttpServletRequest request, HttpServletResponse response) throws IOException {

if (response.isCommitted()) {
System.out.println("Problem?");
Expand All @@ -81,8 +79,8 @@ protected void service(

PrintWriter writer = response.getWriter();

String requestURI = (String)request.getAttribute(RequestDispatcher.ERROR_REQUEST_URI);
Integer status = (Integer)request.getAttribute(RequestDispatcher.ERROR_STATUS_CODE);
String requestURI = (String) request.getAttribute(RequestDispatcher.ERROR_REQUEST_URI);
Integer status = (Integer) request.getAttribute(RequestDispatcher.ERROR_STATUS_CODE);

writer.print(status + " ERROR : " + requestURI);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
public class TestErrorPage4 extends AbstractTestServlet {
private static final long serialVersionUID = 1L;
private final Collection<ServiceRegistration<?>> registrations = new ArrayList<>();

@Override
public void activate(ComponentContext componentContext) {
Dictionary<String, String> servletProps = new Hashtable<>();
Expand All @@ -59,8 +60,7 @@ public void deactivate() {
}

@Override
protected void service(HttpServletRequest request, HttpServletResponse response)
throws IOException {
protected void service(HttpServletRequest request, HttpServletResponse response) throws IOException {

response.setStatus(401);

Expand All @@ -71,9 +71,7 @@ protected void service(HttpServletRequest request, HttpServletResponse response)
private static final long serialVersionUID = 1L;

@Override
protected void service(
HttpServletRequest request, HttpServletResponse response)
throws IOException {
protected void service(HttpServletRequest request, HttpServletResponse response) throws IOException {

if (response.isCommitted()) {
System.out.println("Problem?");
Expand All @@ -83,8 +81,8 @@ protected void service(

PrintWriter writer = response.getWriter();

String requestURI = (String)request.getAttribute(RequestDispatcher.ERROR_REQUEST_URI);
Integer status = (Integer)request.getAttribute(RequestDispatcher.ERROR_STATUS_CODE);
String requestURI = (String) request.getAttribute(RequestDispatcher.ERROR_REQUEST_URI);
Integer status = (Integer) request.getAttribute(RequestDispatcher.ERROR_STATUS_CODE);

writer.print(status + " ERROR : " + requestURI);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ public class TestFilter1 extends AbstractTestServlet {

@Override
public void activate(ComponentContext componentContext) throws ServletException, NamespaceException {
ExtendedHttpService service = (ExtendedHttpService)getHttpService();
ExtendedHttpService service = (ExtendedHttpService) getHttpService();
service.registerServlet(regexAlias(), this, null, null);
service.registerFilter(regexAlias(), f1, new Hashtable<>(), null);
}

@Override
public void deactivate() {
ExtendedHttpService service = (ExtendedHttpService)getHttpService();
ExtendedHttpService service = (ExtendedHttpService) getHttpService();
service.unregister(regexAlias());
service.unregisterFilter(f1);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
public class TestFilter10 extends AbstractTestServlet {
private static final long serialVersionUID = 1L;
private final Collection<ServiceRegistration<?>> registrations = new ArrayList<>();

@Override
public void activate(ComponentContext componentContext) {
Dictionary<String, String> servletProps = new Hashtable<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
public class TestFilter12 extends AbstractTestServlet {
private static final long serialVersionUID = 1L;
private final Collection<ServiceRegistration<?>> registrations = new ArrayList<>();

@Override
public void activate(ComponentContext componentContext) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
public class TestFilter13 extends AbstractTestServlet {
private static final long serialVersionUID = 1L;
private final Collection<ServiceRegistration<?>> registrations = new ArrayList<>();

@Override
public void activate(ComponentContext componentContext) {
Dictionary<String, String> servletProps = new Hashtable<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ public class TestFilter2 extends AbstractTestServlet {

@Override
public void activate(ComponentContext componentContext) throws ServletException, NamespaceException {
ExtendedHttpService service = (ExtendedHttpService)getHttpService();
ExtendedHttpService service = (ExtendedHttpService) getHttpService();
service.registerServlet(regexAlias(), this, null, null);
service.registerFilter(regexAlias(), f1, new Hashtable<>(), null);
service.registerFilter(regexAlias(), f2, new Hashtable<>(), null);
}

@Override
public void deactivate() {
ExtendedHttpService service = (ExtendedHttpService)getHttpService();
ExtendedHttpService service = (ExtendedHttpService) getHttpService();
service.unregister(regexAlias());
service.unregisterFilter(f1);
service.unregisterFilter(f2);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public class TestFilter3 extends AbstractTestServlet {

@Override
public void activate(ComponentContext componentContext) throws ServletException, NamespaceException {
ExtendedHttpService service = (ExtendedHttpService)getHttpService();
ExtendedHttpService service = (ExtendedHttpService) getHttpService();
service.registerServlet(regexAlias(), this, null, null);
service.registerFilter(regexAlias(), f1, new Hashtable<>(), null);
service.registerFilter(regexAlias(), f2, new Hashtable<>(), null);
Expand All @@ -45,7 +45,7 @@ public void activate(ComponentContext componentContext) throws ServletException,

@Override
public void deactivate() {
ExtendedHttpService service = (ExtendedHttpService)getHttpService();
ExtendedHttpService service = (ExtendedHttpService) getHttpService();
service.unregister(regexAlias());
service.unregisterFilter(f1);
service.unregisterFilter(f2);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public class TestFilter4 extends AbstractTestServlet {

@Override
public void activate(ComponentContext componentContext) throws ServletException, NamespaceException {
ExtendedHttpService service = (ExtendedHttpService)getHttpService();
ExtendedHttpService service = (ExtendedHttpService) getHttpService();
service.registerServlet(regexAlias(), this, null, null);
service.registerFilter(regexAlias(), f1, new Hashtable<>(), null);
service.registerFilter(regexAlias(), f2, new Hashtable<>(), null);
Expand All @@ -47,7 +47,7 @@ public void activate(ComponentContext componentContext) throws ServletException,

@Override
public void deactivate() {
ExtendedHttpService service = (ExtendedHttpService)getHttpService();
ExtendedHttpService service = (ExtendedHttpService) getHttpService();
service.unregister(regexAlias());
service.unregisterFilter(f1);
service.unregisterFilter(f2);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ public class TestFilter5 extends AbstractTestServlet {

@Override
public void activate(ComponentContext componentContext) throws ServletException, NamespaceException {
ExtendedHttpService service = (ExtendedHttpService)getHttpService();
ExtendedHttpService service = (ExtendedHttpService) getHttpService();
service.registerServlet(extensionAlias(), this, null, null);
service.registerFilter(extensionAlias(), f1, new Hashtable<>(), null);
}

@Override
public void deactivate() {
ExtendedHttpService service = (ExtendedHttpService)getHttpService();
ExtendedHttpService service = (ExtendedHttpService) getHttpService();
service.unregister(extensionAlias());
service.unregisterFilter(f1);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ public class TestFilter6 extends AbstractTestServlet {

@Override
public void activate(ComponentContext componentContext) throws ServletException, NamespaceException {
ExtendedHttpService service = (ExtendedHttpService)getHttpService();
ExtendedHttpService service = (ExtendedHttpService) getHttpService();
service.registerServlet(extensionAlias(), this, null, null);
service.registerFilter(extensionAlias(), f1, new Hashtable<>(), null);
service.registerFilter(extensionAlias(), f2, new Hashtable<>(), null);
}

@Override
public void deactivate() {
ExtendedHttpService service = (ExtendedHttpService)getHttpService();
ExtendedHttpService service = (ExtendedHttpService) getHttpService();
service.unregister(extensionAlias());
service.unregisterFilter(f1);
service.unregisterFilter(f2);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public class TestFilter7 extends AbstractTestServlet {

@Override
public void activate(ComponentContext componentContext) throws ServletException, NamespaceException {
ExtendedHttpService service = (ExtendedHttpService)getHttpService();
ExtendedHttpService service = (ExtendedHttpService) getHttpService();
service.registerServlet(extensionAlias(), this, null, null);
service.registerFilter(extensionAlias(), f1, new Hashtable<>(), null);
service.registerFilter(extensionAlias(), f2, new Hashtable<>(), null);
Expand All @@ -45,7 +45,7 @@ public void activate(ComponentContext componentContext) throws ServletException,

@Override
public void deactivate() {
ExtendedHttpService service = (ExtendedHttpService)getHttpService();
ExtendedHttpService service = (ExtendedHttpService) getHttpService();
service.unregister(extensionAlias());
service.unregisterFilter(f1);
service.unregisterFilter(f2);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public class TestFilter8 extends AbstractTestServlet {

@Override
public void activate(ComponentContext componentContext) throws ServletException, NamespaceException {
ExtendedHttpService service = (ExtendedHttpService)getHttpService();
ExtendedHttpService service = (ExtendedHttpService) getHttpService();
service.registerServlet(extensionAlias(), this, null, null);
service.registerFilter(extensionAlias(), f1, new Hashtable<>(), null);
service.registerFilter(extensionAlias(), f2, new Hashtable<>(), null);
Expand All @@ -47,7 +47,7 @@ public void activate(ComponentContext componentContext) throws ServletException,

@Override
public void deactivate() {
ExtendedHttpService service = (ExtendedHttpService)getHttpService();
ExtendedHttpService service = (ExtendedHttpService) getHttpService();
service.unregister(extensionAlias());
service.unregisterFilter(f1);
service.unregisterFilter(f2);
Expand Down
Loading

0 comments on commit c5b7df1

Please sign in to comment.