Skip to content

Commit

Permalink
Polishing
Browse files Browse the repository at this point in the history
  • Loading branch information
jhoeller committed Dec 23, 2016
1 parent 3295a4e commit ef5c797
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,7 @@ public int compare(DeferredImportSelectorHolder o1, DeferredImportSelectorHolder

private final ConditionEvaluator conditionEvaluator;

private final Map<ConfigurationClass, ConfigurationClass> configurationClasses =
new LinkedHashMap<>();
private final Map<ConfigurationClass, ConfigurationClass> configurationClasses = new LinkedHashMap<>();

private final Map<String, ConfigurationClass> knownSuperclasses = new HashMap<>();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,8 @@

package org.springframework.web.bind.support;

import java.io.IOException;
import java.util.List;
import javax.servlet.MultipartConfigElement;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
Expand All @@ -30,7 +28,6 @@
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.servlet.ServletContextHandler;
import org.eclipse.jetty.servlet.ServletHolder;

import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
Expand Down Expand Up @@ -67,7 +64,6 @@ public class WebRequestDataBinderIntegrationTests {

@BeforeClass
public static void startJettyServer() throws Exception {

// Let server pick its own random, available port.
jettyServer = new Server(0);

Expand Down Expand Up @@ -101,7 +97,6 @@ public static void stopJettyServer() throws Exception {

@Test
public void partsBinding() {

PartsBean bean = new PartsBean();
partsServlet.setBean(bean);

Expand All @@ -118,7 +113,6 @@ public void partsBinding() {

@Test
public void partListBinding() {

PartListBean bean = new PartListBean();
partListServlet.setBean(bean);

Expand All @@ -141,14 +135,10 @@ private abstract static class AbstractStandardMultipartServlet<T> extends HttpSe
private T bean;

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

public void service(HttpServletRequest request, HttpServletResponse response) {
WebRequestDataBinder binder = new WebRequestDataBinder(bean);
ServletWebRequest webRequest = new ServletWebRequest(request, response);

binder.bind(webRequest);

response.setStatus(HttpServletResponse.SC_OK);
}

Expand All @@ -157,6 +147,7 @@ public void setBean(T bean) {
}
}


private static class PartsBean {

public Part firstPart;
Expand All @@ -182,10 +173,12 @@ public void setSecondPart(Part secondPart) {
}
}


@SuppressWarnings("serial")
private static class PartsServlet extends AbstractStandardMultipartServlet<PartsBean> {
}


private static class PartListBean {

public List<Part> partList;
Expand All @@ -200,6 +193,7 @@ public void setPartList(List<Part> partList) {
}
}


@SuppressWarnings("serial")
private static class PartListServlet extends AbstractStandardMultipartServlet<PartListBean> {
}
Expand Down

0 comments on commit ef5c797

Please sign in to comment.