diff options
author | Leif Åstrand <leif@vaadin.com> | 2012-09-27 15:59:39 +0300 |
---|---|---|
committer | Leif Åstrand <leif@vaadin.com> | 2012-09-27 15:59:39 +0300 |
commit | cf1f89072dcd820248474a36cfc2f60e5f3f9a1b (patch) | |
tree | cbe0cde8462785ab04b46f62bb4a3d447f2c5c79 /server/src/com | |
parent | ed2d516f04fd156814cc43c55d36f567e2611ba2 (diff) | |
download | vaadin-framework-cf1f89072dcd820248474a36cfc2f60e5f3f9a1b.tar.gz vaadin-framework-cf1f89072dcd820248474a36cfc2f60e5f3f9a1b.zip |
Global code cleanup
Diffstat (limited to 'server/src/com')
17 files changed, 58 insertions, 80 deletions
diff --git a/server/src/com/vaadin/server/AbstractCommunicationManager.java b/server/src/com/vaadin/server/AbstractCommunicationManager.java index 3d334e11a5..b4f7ad4207 100644 --- a/server/src/com/vaadin/server/AbstractCommunicationManager.java +++ b/server/src/com/vaadin/server/AbstractCommunicationManager.java @@ -593,8 +593,7 @@ public abstract class AbstractCommunicationManager implements Serializable { if (!handleVariables(request, response, callback, session, uI)) { // var inconsistency; the client is probably out-of-sync - SystemMessages ci = response.getService() - .getSystemMessages(); + SystemMessages ci = response.getService().getSystemMessages(); String msg = ci.getOutOfSyncMessage(); String cap = ci.getOutOfSyncCaption(); if (msg != null || cap != null) { @@ -2614,8 +2613,7 @@ public abstract class AbstractCommunicationManager implements Serializable { .substring(ApplicationConstants.CONNECTOR_RESOURCE_PREFIX .length() + 2); - final String mimetype = response.getService().getMimeType( - resourceName); + final String mimetype = response.getService().getMimeType(resourceName); // Security check: avoid accidentally serving from the UI of the // classpath instead of relative to the context class diff --git a/server/src/com/vaadin/server/AddonContext.java b/server/src/com/vaadin/server/AddonContext.java index 0e147e4fcd..4773b4cebe 100644 --- a/server/src/com/vaadin/server/AddonContext.java +++ b/server/src/com/vaadin/server/AddonContext.java @@ -54,17 +54,15 @@ public class AddonContext implements Serializable { */ public AddonContext(VaadinService vaadinService) { this.vaadinService = vaadinService; - vaadinService - .addSessionInitListener(new SessionInitListener() { - @Override - public void sessionInit( - SessionInitEvent event) - throws ServiceException { - for (BootstrapListener l : bootstrapListeners) { - event.getSession().addBootstrapListener(l); - } - } - }); + vaadinService.addSessionInitListener(new SessionInitListener() { + @Override + public void sessionInit(SessionInitEvent event) + throws ServiceException { + for (BootstrapListener l : bootstrapListeners) { + event.getSession().addBootstrapListener(l); + } + } + }); vaadinService.setAddonContext(this); } diff --git a/server/src/com/vaadin/server/ConnectorResourceHandler.java b/server/src/com/vaadin/server/ConnectorResourceHandler.java index 1edd497d7c..cf002f8fe0 100644 --- a/server/src/com/vaadin/server/ConnectorResourceHandler.java +++ b/server/src/com/vaadin/server/ConnectorResourceHandler.java @@ -24,9 +24,8 @@ public class ConnectorResourceHandler implements RequestHandler { } @Override - public boolean handleRequest(VaadinSession session, - VaadinRequest request, VaadinResponse response) - throws IOException { + public boolean handleRequest(VaadinSession session, VaadinRequest request, + VaadinResponse response) throws IOException { String requestPath = request.getRequestPathInfo(); if (requestPath == null) { return false; diff --git a/server/src/com/vaadin/server/DefaultUIProvider.java b/server/src/com/vaadin/server/DefaultUIProvider.java index 4c44bec058..7efb6dea64 100644 --- a/server/src/com/vaadin/server/DefaultUIProvider.java +++ b/server/src/com/vaadin/server/DefaultUIProvider.java @@ -31,8 +31,7 @@ public class DefaultUIProvider extends UIProvider { if (uiClassNameObj instanceof String) { String uiClassName = uiClassNameObj.toString(); - ClassLoader classLoader = request.getService() - .getClassLoader(); + ClassLoader classLoader = request.getService().getClassLoader(); if (classLoader == null) { classLoader = getClass().getClassLoader(); } diff --git a/server/src/com/vaadin/server/GAEVaadinServlet.java b/server/src/com/vaadin/server/GAEVaadinServlet.java index 2849dc73a0..6ef107eabe 100644 --- a/server/src/com/vaadin/server/GAEVaadinServlet.java +++ b/server/src/com/vaadin/server/GAEVaadinServlet.java @@ -133,8 +133,8 @@ public class GAEVaadinServlet extends VaadinServlet { private static final String PROPERTY_APPENGINE_EXPIRES = "_expires"; protected void sendDeadlineExceededNotification( - VaadinServletRequest request, - VaadinServletResponse response) throws IOException { + VaadinServletRequest request, VaadinServletResponse response) + throws IOException { criticalNotification( request, response, @@ -144,8 +144,8 @@ public class GAEVaadinServlet extends VaadinServlet { } protected void sendNotSerializableNotification( - VaadinServletRequest request, - VaadinServletResponse response) throws IOException { + VaadinServletRequest request, VaadinServletResponse response) + throws IOException { criticalNotification( request, response, @@ -155,8 +155,7 @@ public class GAEVaadinServlet extends VaadinServlet { + "?restartApplication"); } - protected void sendCriticalErrorNotification( - VaadinServletRequest request, + protected void sendCriticalErrorNotification(VaadinServletRequest request, VaadinServletResponse response) throws IOException { criticalNotification( request, @@ -341,8 +340,7 @@ public class GAEVaadinServlet extends VaadinServlet { // will create new context if the above did not try { - return getService().findVaadinSession( - createVaadinRequest(request)); + return getService().findVaadinSession(createVaadinRequest(request)); } catch (Exception e) { throw new ServletException(e); } diff --git a/server/src/com/vaadin/server/GlobalResourceHandler.java b/server/src/com/vaadin/server/GlobalResourceHandler.java index a7fff8ae64..5b2082cd5a 100644 --- a/server/src/com/vaadin/server/GlobalResourceHandler.java +++ b/server/src/com/vaadin/server/GlobalResourceHandler.java @@ -65,9 +65,8 @@ public class GlobalResourceHandler implements RequestHandler { ""); @Override - public boolean handleRequest(VaadinSession session, - VaadinRequest request, VaadinResponse response) - throws IOException { + public boolean handleRequest(VaadinSession session, VaadinRequest request, + VaadinResponse response) throws IOException { String pathInfo = request.getRequestPathInfo(); if (pathInfo == null) { return false; diff --git a/server/src/com/vaadin/server/LegacyVaadinPortlet.java b/server/src/com/vaadin/server/LegacyVaadinPortlet.java index 067cd6266f..a49bea29c4 100644 --- a/server/src/com/vaadin/server/LegacyVaadinPortlet.java +++ b/server/src/com/vaadin/server/LegacyVaadinPortlet.java @@ -48,21 +48,19 @@ public class LegacyVaadinPortlet extends VaadinPortlet { public void init(PortletConfig portletConfig) throws PortletException { super.init(portletConfig); - getService().addSessionInitListener( - new SessionInitListener() { - @Override - public void sessionInit( - SessionInitEvent event) - throws ServiceException { - try { - onVaadinSessionStarted(VaadinPortletRequest - .cast(event.getRequest()), - (VaadinPortletSession) event.getSession()); - } catch (PortletException e) { - throw new ServiceException(e); - } - } - }); + getService().addSessionInitListener(new SessionInitListener() { + @Override + public void sessionInit(SessionInitEvent event) + throws ServiceException { + try { + onVaadinSessionStarted( + VaadinPortletRequest.cast(event.getRequest()), + (VaadinPortletSession) event.getSession()); + } catch (PortletException e) { + throw new ServiceException(e); + } + } + }); } protected Class<? extends LegacyApplication> getApplicationClass() diff --git a/server/src/com/vaadin/server/LegacyVaadinServlet.java b/server/src/com/vaadin/server/LegacyVaadinServlet.java index 097ab02a6a..6e6bd17bbb 100644 --- a/server/src/com/vaadin/server/LegacyVaadinServlet.java +++ b/server/src/com/vaadin/server/LegacyVaadinServlet.java @@ -49,27 +49,24 @@ public class LegacyVaadinServlet extends VaadinServlet { public void init(ServletConfig servletConfig) throws ServletException { super.init(servletConfig); - getService().addSessionInitListener( - new SessionInitListener() { - @Override - public void sessionInit( - SessionInitEvent event) - throws ServiceException { - try { - onVaadinSessionStarted(event.getRequest(), - event.getSession()); - } catch (ServletException e) { - throw new ServiceException(e); - } - } - }); + getService().addSessionInitListener(new SessionInitListener() { + @Override + public void sessionInit(SessionInitEvent event) + throws ServiceException { + try { + onVaadinSessionStarted(event.getRequest(), + event.getSession()); + } catch (ServletException e) { + throw new ServiceException(e); + } + } + }); } protected Class<? extends LegacyApplication> getApplicationClass() throws ClassNotFoundException { try { - return ServletPortletHelper - .getLegacyApplicationClass(getService()); + return ServletPortletHelper.getLegacyApplicationClass(getService()); } catch (ServiceException e) { throw new RuntimeException(e); } diff --git a/server/src/com/vaadin/server/SessionInitListener.java b/server/src/com/vaadin/server/SessionInitListener.java index b34cf9b095..be86f80a05 100644 --- a/server/src/com/vaadin/server/SessionInitListener.java +++ b/server/src/com/vaadin/server/SessionInitListener.java @@ -46,6 +46,5 @@ public interface SessionInitListener extends Serializable { * @throws ServiceException * a problem occurs when processing the event */ - public void sessionInit(SessionInitEvent event) - throws ServiceException; + public void sessionInit(SessionInitEvent event) throws ServiceException; } diff --git a/server/src/com/vaadin/server/UnsupportedBrowserHandler.java b/server/src/com/vaadin/server/UnsupportedBrowserHandler.java index 8525dc29ca..5c93eabf67 100644 --- a/server/src/com/vaadin/server/UnsupportedBrowserHandler.java +++ b/server/src/com/vaadin/server/UnsupportedBrowserHandler.java @@ -34,9 +34,8 @@ public class UnsupportedBrowserHandler implements RequestHandler { public static final String FORCE_LOAD_COOKIE = "vaadinforceload=1"; @Override - public boolean handleRequest(VaadinSession session, - VaadinRequest request, VaadinResponse response) - throws IOException { + public boolean handleRequest(VaadinSession session, VaadinRequest request, + VaadinResponse response) throws IOException { if (request.getBrowserDetails() != null) { // Check if the browser is supported diff --git a/server/src/com/vaadin/server/VaadinPortlet.java b/server/src/com/vaadin/server/VaadinPortlet.java index cdf7030f98..4ca88fb71c 100644 --- a/server/src/com/vaadin/server/VaadinPortlet.java +++ b/server/src/com/vaadin/server/VaadinPortlet.java @@ -362,8 +362,7 @@ public class VaadinPortlet extends GenericPortlet implements Constants { VaadinPortletResponse vaadinResponse = new VaadinPortletResponse( response, getService()); - getService().setCurrentInstances(vaadinRequest, - vaadinResponse); + getService().setCurrentInstances(vaadinRequest, vaadinResponse); RequestType requestType = getRequestType(vaadinRequest); diff --git a/server/src/com/vaadin/server/VaadinPortletResponse.java b/server/src/com/vaadin/server/VaadinPortletResponse.java index c59af2f2b0..d9fe828bff 100644 --- a/server/src/com/vaadin/server/VaadinPortletResponse.java +++ b/server/src/com/vaadin/server/VaadinPortletResponse.java @@ -29,7 +29,6 @@ import javax.portlet.MimeResponse; import javax.portlet.PortletResponse; import javax.portlet.ResourceResponse; - /** * Wrapper for {@link PortletResponse} and its subclasses. * diff --git a/server/src/com/vaadin/server/VaadinServlet.java b/server/src/com/vaadin/server/VaadinServlet.java index 633cffab2a..b8b7bb936d 100644 --- a/server/src/com/vaadin/server/VaadinServlet.java +++ b/server/src/com/vaadin/server/VaadinServlet.java @@ -822,8 +822,8 @@ public class VaadinServlet extends HttpServlet implements Constants { * cache timeout can be configured by setting the resourceCacheTime * parameter in web.xml */ - int resourceCacheTime = getService() - .getDeploymentConfiguration().getResourceCacheTime(); + int resourceCacheTime = getService().getDeploymentConfiguration() + .getResourceCacheTime(); response.setHeader("Cache-Control", "max-age= " + String.valueOf(resourceCacheTime)); } @@ -850,8 +850,7 @@ public class VaadinServlet extends HttpServlet implements Constants { filename = filename.substring(1); } - resourceUrl = getService().getClassLoader().getResource( - filename); + resourceUrl = getService().getClassLoader().getResource(filename); } return resourceUrl; } diff --git a/server/src/com/vaadin/server/VaadinServletRequest.java b/server/src/com/vaadin/server/VaadinServletRequest.java index 6526766b0f..10627a1338 100644 --- a/server/src/com/vaadin/server/VaadinServletRequest.java +++ b/server/src/com/vaadin/server/VaadinServletRequest.java @@ -20,7 +20,6 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequestWrapper; import javax.servlet.http.HttpSession; - /** * Wrapper for {@link HttpServletRequest}. * diff --git a/server/src/com/vaadin/server/VaadinServletResponse.java b/server/src/com/vaadin/server/VaadinServletResponse.java index 72d1207ac5..ea7da7cfb5 100644 --- a/server/src/com/vaadin/server/VaadinServletResponse.java +++ b/server/src/com/vaadin/server/VaadinServletResponse.java @@ -19,7 +19,6 @@ package com.vaadin.server; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponseWrapper; - /** * Wrapper for {@link HttpServletResponse}. * diff --git a/server/src/com/vaadin/server/VaadinServletSession.java b/server/src/com/vaadin/server/VaadinServletSession.java index fba0707812..6d2658f8b8 100644 --- a/server/src/com/vaadin/server/VaadinServletSession.java +++ b/server/src/com/vaadin/server/VaadinServletSession.java @@ -24,7 +24,6 @@ import javax.servlet.http.HttpSession; import javax.servlet.http.HttpSessionBindingEvent; import javax.servlet.http.HttpSessionBindingListener; - /** * Web application context for Vaadin applications. * diff --git a/server/src/com/vaadin/ui/Panel.java b/server/src/com/vaadin/ui/Panel.java index 70598f5c14..f73cd5128e 100644 --- a/server/src/com/vaadin/ui/Panel.java +++ b/server/src/com/vaadin/ui/Panel.java @@ -112,9 +112,9 @@ public class Panel extends AbstractComponentContainer implements Scrollable, /** * Sets the caption of the panel. * - * Note that the caption is interpreted as HTML and therefore care - * should be taken not to enable HTML injection and XSS attacks using panel - * captions. This behavior may change in future versions. + * Note that the caption is interpreted as HTML and therefore care should be + * taken not to enable HTML injection and XSS attacks using panel captions. + * This behavior may change in future versions. * * @see AbstractComponent#setCaption(String) */ |