cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ilgro...@apache.org
Subject svn commit: r1155368 [5/6] - in /cocoon/cocoon3/trunk: cocoon-all/src/main/groovy/ cocoon-archetype-block/src/main/resources/META-INF/ cocoon-archetype-block/src/main/resources/archetype-resources/ cocoon-archetype-block/src/main/resources/archetype-re...
Date Tue, 09 Aug 2011 13:56:43 GMT
Modified: cocoon/cocoon3/trunk/cocoon-stringtemplate/pom.xml
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-stringtemplate/pom.xml?rev=1155368&r1=1155367&r2=1155368&view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-stringtemplate/pom.xml (original)
+++ cocoon/cocoon3/trunk/cocoon-stringtemplate/pom.xml Tue Aug  9 13:56:40 2011
@@ -66,6 +66,29 @@
             <groupId>org.apache.commons</groupId>
             <artifactId>commons-lang3</artifactId>
         </dependency>
+        
+        <!-- Logging -->
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>ch.qos.logback</groupId>
+            <artifactId>logback-core</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>ch.qos.logback</groupId>
+            <artifactId>logback-classic</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>commons-logging</groupId>
+            <artifactId>commons-logging</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>jcl-over-slf4j</artifactId>
+        </dependency>
      
         <!-- Test dependencies -->     
         <dependency>

Modified: cocoon/cocoon3/trunk/cocoon-stringtemplate/src/main/java/org/apache/cocoon/stringtemplate/ControllerContextAwareStringTemplateGenerator.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-stringtemplate/src/main/java/org/apache/cocoon/stringtemplate/ControllerContextAwareStringTemplateGenerator.java?rev=1155368&r1=1155367&r2=1155368&view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-stringtemplate/src/main/java/org/apache/cocoon/stringtemplate/ControllerContextAwareStringTemplateGenerator.java
(original)
+++ cocoon/cocoon3/trunk/cocoon-stringtemplate/src/main/java/org/apache/cocoon/stringtemplate/ControllerContextAwareStringTemplateGenerator.java
Tue Aug  9 13:56:40 2011
@@ -21,13 +21,16 @@ import java.util.Map;
 import java.util.Map.Entry;
 import org.apache.cocoon.servlet.controller.ControllerContextHelper;
 import org.apache.commons.lang3.StringEscapeUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.stringtemplate.v4.ST;
 
 public class ControllerContextAwareStringTemplateGenerator extends StringTemplateGenerator
{
 
-    private static final Log LOG = LogFactory.getLog(
+    /**
+     * Logger.
+     */
+    private static final Logger LOG = LoggerFactory.getLogger(
             ControllerContextAwareStringTemplateGenerator.class);
 
     public ControllerContextAwareStringTemplateGenerator() {

Modified: cocoon/cocoon3/trunk/cocoon-stringtemplate/src/main/java/org/apache/cocoon/stringtemplate/StringTemplateGenerator.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-stringtemplate/src/main/java/org/apache/cocoon/stringtemplate/StringTemplateGenerator.java?rev=1155368&r1=1155367&r2=1155368&view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-stringtemplate/src/main/java/org/apache/cocoon/stringtemplate/StringTemplateGenerator.java
(original)
+++ cocoon/cocoon3/trunk/cocoon-stringtemplate/src/main/java/org/apache/cocoon/stringtemplate/StringTemplateGenerator.java
Tue Aug  9 13:56:40 2011
@@ -37,16 +37,19 @@ import org.apache.cocoon.sax.AbstractSAX
 import org.apache.cocoon.sax.util.XMLUtils;
 import org.apache.commons.io.IOUtils;
 import org.apache.commons.lang3.StringEscapeUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.stringtemplate.v4.ST;
 import org.xml.sax.InputSource;
 
 public class StringTemplateGenerator extends AbstractSAXProducer
         implements Starter, CachingPipelineComponent {
 
-    private static final Log LOG =
-            LogFactory.getLog(StringTemplateGenerator.class);
+    /**
+     * Logger.
+     */
+    private static final Logger LOG =
+            LoggerFactory.getLogger(StringTemplateGenerator.class);
 
     protected Map<String, Object> parameters = new HashMap<String, Object>();
 

Modified: cocoon/cocoon3/trunk/cocoon-stringtemplate/src/main/java/org/apache/cocoon/stringtemplate/StringTemplateTransformer.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-stringtemplate/src/main/java/org/apache/cocoon/stringtemplate/StringTemplateTransformer.java?rev=1155368&r1=1155367&r2=1155368&view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-stringtemplate/src/main/java/org/apache/cocoon/stringtemplate/StringTemplateTransformer.java
(original)
+++ cocoon/cocoon3/trunk/cocoon-stringtemplate/src/main/java/org/apache/cocoon/stringtemplate/StringTemplateTransformer.java
Tue Aug  9 13:56:40 2011
@@ -21,8 +21,8 @@ import java.util.Map.Entry;
 
 import org.apache.cocoon.sax.AbstractSAXTransformer;
 import org.apache.commons.lang3.StringEscapeUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.stringtemplate.v4.ST;
 import org.xml.sax.Attributes;
 import org.xml.sax.SAXException;
@@ -30,7 +30,11 @@ import org.xml.sax.helpers.AttributesImp
 
 public class StringTemplateTransformer extends AbstractSAXTransformer {
 
-    private static final Log LOG = LogFactory.getLog(StringTemplateTransformer.class);
+    /**
+     * Logger.
+     */
+    private static final Logger LOG =
+            LoggerFactory.getLogger(StringTemplateTransformer.class);
 
     private final transient Map<String, Object> parameters;
     private final transient StringBuilder accumulator;

Modified: cocoon/cocoon3/trunk/cocoon-util/pom.xml
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-util/pom.xml?rev=1155368&r1=1155367&r2=1155368&view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-util/pom.xml (original)
+++ cocoon/cocoon3/trunk/cocoon-util/pom.xml Tue Aug  9 13:56:40 2011
@@ -20,42 +20,50 @@
 <!-- $Id$ -->
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
 
-  <modelVersion>4.0.0</modelVersion>
-  <packaging>jar</packaging>
+    <modelVersion>4.0.0</modelVersion>
+    <packaging>jar</packaging>
 
-  <parent>
-    <groupId>org.apache.cocoon.parent</groupId>
-    <artifactId>cocoon-parent</artifactId>
-    <version>3.0.0-beta-1-SNAPSHOT</version>
-    <relativePath>../parent</relativePath>
-  </parent>
+    <parent>
+        <groupId>org.apache.cocoon.parent</groupId>
+        <artifactId>cocoon-parent</artifactId>
+        <version>3.0.0-beta-1-SNAPSHOT</version>
+        <relativePath>../parent</relativePath>
+    </parent>
   
-  <groupId>org.apache.cocoon.util</groupId>
-  <artifactId>cocoon-util</artifactId>
+    <groupId>org.apache.cocoon.util</groupId>
+    <artifactId>cocoon-util</artifactId>
   
-  <name>Apache Cocoon 3: Utilities</name>
-  <description>Utility classes without any third-party dependencies.</description>
+    <name>Apache Cocoon 3: Utilities</name>
+    <description>Utility classes without any third-party dependencies.</description>
 
-  <dependencies>
-    <dependency>
-      <groupId>commons-logging</groupId>
-      <artifactId>commons-logging</artifactId>
-      <exclusions>
-        <exclusion>
-          <artifactId>logkit</artifactId>
-          <groupId>logkit</groupId>
-        </exclusion>
-        <exclusion>
-          <artifactId>avalon-framework</artifactId>
-          <groupId>avalon-framework</groupId>
-        </exclusion>
-      </exclusions>
-    </dependency>
+    <dependencies>
+        <!-- Logging -->
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>ch.qos.logback</groupId>
+            <artifactId>logback-core</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>ch.qos.logback</groupId>
+            <artifactId>logback-classic</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>commons-logging</groupId>
+            <artifactId>commons-logging</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>jcl-over-slf4j</artifactId>
+        </dependency>
 
-    <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-      <scope>test</scope>
-    </dependency>   
-  </dependencies>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <scope>test</scope>
+        </dependency>   
+    </dependencies>
 </project>

Modified: cocoon/cocoon3/trunk/cocoon-wicket/src/main/java/org/apache/cocoon/wicket/sitemap/WicketReader.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-wicket/src/main/java/org/apache/cocoon/wicket/sitemap/WicketReader.java?rev=1155368&r1=1155367&r2=1155368&view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-wicket/src/main/java/org/apache/cocoon/wicket/sitemap/WicketReader.java
(original)
+++ cocoon/cocoon3/trunk/cocoon-wicket/src/main/java/org/apache/cocoon/wicket/sitemap/WicketReader.java
Tue Aug  9 13:56:40 2011
@@ -23,12 +23,11 @@ import java.io.OutputStreamWriter;
 import java.io.PrintWriter;
 import java.net.MalformedURLException;
 import java.net.URL;
+import java.util.Collections;
 import java.util.Enumeration;
 import java.util.Locale;
 import java.util.Map;
 import java.util.Set;
-import java.util.Vector;
-
 import javax.servlet.FilterConfig;
 import javax.servlet.RequestDispatcher;
 import javax.servlet.Servlet;
@@ -38,7 +37,6 @@ import javax.servlet.ServletOutputStream
 import javax.servlet.http.Cookie;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
-
 import org.apache.cocoon.pipeline.ProcessingException;
 import org.apache.cocoon.pipeline.SetupException;
 import org.apache.cocoon.pipeline.component.Finisher;
@@ -59,13 +57,18 @@ public class WicketReader implements Sta
     private static WicketFilter wicketFilter;
 
     private String basePath;
+
     private OutputStream cocoonOutputStream;
+
     private HttpServletRequest request;
+
     private HttpServletResponse response;
+
     private ServletContext servletContext;
 
     public void execute() {
-        if ("GET".equalsIgnoreCase(this.request.getMethod()) || "POST".equalsIgnoreCase(this.request.getMethod()))
{
+        if ("GET".equalsIgnoreCase(this.request.getMethod()) || "POST".
+                equalsIgnoreCase(this.request.getMethod())) {
             try {
                 wicketFilter.doGet(this.request, this.response);
             } catch (ServletException e) {
@@ -85,11 +88,16 @@ public class WicketReader implements Sta
         return null;
     }
 
-    public void setConfiguration(Map<String, ? extends Object> configuration) {
+    @Override
+    public void setConfiguration(
+            final Map<String, ? extends Object> configuration) {
+
         String basePath = (String) configuration.get("base-path");
         if (basePath == null || "".equals(basePath)) {
-            throw new SetupException("The parameter 'base-path' has to be set. "
-                    + "This is the path where Wicket will be mounted to your URI space.");
+            throw new SetupException(
+                    "The parameter 'base-path' has to be set. "
+                    + "This is the path where Wicket will be mounted to your "
+                    + "URI space.");
         }
         if (basePath.charAt(0) != '/') {
             basePath = "/" + basePath;
@@ -100,104 +108,126 @@ public class WicketReader implements Sta
         this.basePath = basePath;
     }
 
-    public void setOutputStream(OutputStream outputStream) {
+    @Override
+    public void setOutputStream(final OutputStream outputStream) {
         this.cocoonOutputStream = outputStream;
-        this.response = new CocoonWicketHttpServletResponse(this.response, this.cocoonOutputStream);
+        this.response = new CocoonWicketHttpServletResponse(this.response,
+                this.cocoonOutputStream);
     }
 
-    public void setup(Map<String, Object> parameters) {
+    @Override
+    public void setup(final Map<String, Object> parameters) {
         this.request = HttpContextHelper.getRequest(parameters);
         this.response = HttpContextHelper.getResponse(parameters);
-        this.servletContext = new CocoonWicketServletContext(HttpContextHelper.getServletContext(parameters),
+        this.servletContext = new CocoonWicketServletContext(
+                HttpContextHelper.getServletContext(parameters),
                 this.basePath);
         this.initWicketFilter();
     }
 
-    private synchronized void initWicketFilter() {
-        if (wicketFilter != null) {
-            return;
-        }
+    private void initWicketFilter() {
+        synchronized (this) {
+            if (wicketFilter != null) {
+                return;
+            }
 
-        wicketFilter = new WicketFilter();
-        try {
-            wicketFilter.init(new FilterConfig() {
+            wicketFilter = new WicketFilter();
+            try {
+                wicketFilter.init(new FilterConfig() {
 
-                public String getFilterName() {
-                    return WICKET_FILTER_NAME;
-                }
+                    public String getFilterName() {
+                        return WICKET_FILTER_NAME;
+                    }
 
-                public String getInitParameter(String name) {
-                    if ("applicationFactoryClassName".equals(name)) {
-                        return SpringWebApplicationFactory.class.getName();
+                    @Override
+                    public String getInitParameter(final String name) {
+                        if ("applicationFactoryClassName".equals(name)) {
+                            return SpringWebApplicationFactory.class.getName();
+                        }
+                        return null;
                     }
-                    return null;
-                }
 
-                public Enumeration<String> getInitParameterNames() {
-                    Vector<String> paramNames = new Vector<String>();
-                    paramNames.add("applicationFactoryClassName");
-                    return paramNames.elements();
-                }
+                    public Enumeration<String> getInitParameterNames() {
+                        return Collections.enumeration(
+                                Collections.singleton(
+                                "applicationFactoryClassName"));
+                    }
 
-                public ServletContext getServletContext() {
-                    return WicketReader.this.servletContext;
-                }
-            });
-        } catch (ServletException e) {
-            throw new SetupException("Can't initialize Wicket.", e);
+                    public ServletContext getServletContext() {
+                        return WicketReader.this.servletContext;
+                    }
+                });
+            } catch (ServletException e) {
+                throw new SetupException("Can't initialize Wicket.", e);
+            }
         }
     }
 
-    private static class CocoonWicketHttpServletResponse implements HttpServletResponse {
+    private static class CocoonWicketHttpServletResponse
+            implements HttpServletResponse {
 
         private final OutputStream cocoonOutputStream;
+
         private PrintWriter printWriter;
+
         private final HttpServletResponse response;
 
-        public CocoonWicketHttpServletResponse(HttpServletResponse response, OutputStream
cocoonOutputStream) {
+        public CocoonWicketHttpServletResponse(
+                final HttpServletResponse response, final OutputStream cocoonOS) {
+
             this.response = response;
-            this.cocoonOutputStream = cocoonOutputStream;
+            this.cocoonOutputStream = cocoonOS;
         }
 
-        public void addCookie(Cookie cookie) {
+        @Override
+        public void addCookie(final Cookie cookie) {
             this.response.addCookie(cookie);
         }
 
-        public void addDateHeader(String name, long date) {
+        @Override
+        public void addDateHeader(final String name, final long date) {
             this.response.addDateHeader(name, date);
         }
 
-        public void addHeader(String name, String value) {
+        @Override
+        public void addHeader(final String name, final String value) {
             this.response.addHeader(name, value);
         }
 
-        public void addIntHeader(String name, int value) {
+        @Override
+        public void addIntHeader(final String name, final int value) {
             this.response.addIntHeader(name, value);
         }
 
-        public boolean containsHeader(String name) {
+        @Override
+        public boolean containsHeader(final String name) {
             return this.response.containsHeader(name);
         }
 
         @Deprecated
-        public String encodeRedirectUrl(String url) {
+        @Override
+        public String encodeRedirectUrl(final String url) {
             return this.response.encodeRedirectUrl(url);
         }
 
-        public String encodeRedirectURL(String url) {
+        @Override
+        public String encodeRedirectURL(final String url) {
             return this.response.encodeRedirectURL(url);
         }
 
         @Deprecated
-        public String encodeUrl(String url) {
+        @Override
+        public String encodeUrl(final String url) {
             return this.response.encodeUrl(url);
         }
 
-        public String encodeURL(String url) {
+        @Override
+        public String encodeURL(final String url) {
             return this.response.encodeURL(url);
         }
 
-        public void flushBuffer() throws IOException {
+        public void flushBuffer()
+                throws IOException {
             this.response.flushBuffer();
         }
 
@@ -217,33 +247,34 @@ public class WicketReader implements Sta
             return this.response.getLocale();
         }
 
-        public ServletOutputStream getOutputStream() throws IOException {
+        public ServletOutputStream getOutputStream()
+                throws IOException {
+
             return new ServletOutputStream() {
 
                 @Override
-                public void write(int b) throws IOException {
-                    CocoonWicketHttpServletResponse.this.cocoonOutputStream.write(b);
+                public void write(final int b)
+                        throws IOException {
+
+                    CocoonWicketHttpServletResponse.this.cocoonOutputStream.
+                            write(b);
                 }
             };
         }
 
-        public PrintWriter getWriter() throws IOException {
+        public PrintWriter getWriter()
+                throws IOException {
             if (this.printWriter == null) {
-                this.printWriter = new PrintWriter(new OutputStreamWriter(this.cocoonOutputStream),
true) {
-                    @Override
-                    public PrintWriter append(char c) {
-                        return super.append(c);
-                    }
+                this.printWriter = new PrintWriter(new OutputStreamWriter(
+                        this.cocoonOutputStream), true) {
 
                     @Override
-                    public PrintWriter append(CharSequence csq) {
-                        return super.append(csq);
-                    }
+                    public void write(final char[] buf, final int off,
+                            final int len) {
 
-                    @Override
-                    public void write(char[] buf, int off, int len) {
                         super.write(buf, off, len);
-                        // flush the print-writer because otherwise it never happens at all
+                        // flush the print-writer because otherwise it never 
+                        // happens at all
                         super.flush();
                     }
                 };
@@ -264,59 +295,78 @@ public class WicketReader implements Sta
             this.response.resetBuffer();
         }
 
-        public void sendError(int sc) throws IOException {
+        @Override
+        public void sendError(final int sc)
+                throws IOException {
+
             this.response.sendError(sc);
         }
 
-        public void sendError(int sc, String msg) throws IOException {
+        @Override
+        public void sendError(final int sc, final String msg)
+                throws IOException {
+
             this.response.sendError(sc, msg);
         }
 
-        public void sendRedirect(String location) throws IOException {
+        @Override
+        public void sendRedirect(final String location)
+                throws IOException {
+
             this.response.sendRedirect(location);
         }
 
-        public void setBufferSize(int size) {
+        @Override
+        public void setBufferSize(final int size) {
             this.response.setBufferSize(size);
         }
 
-        public void setCharacterEncoding(String charset) {
+        @Override
+        public void setCharacterEncoding(final String charset) {
             this.response.setCharacterEncoding(charset);
         }
 
-        public void setContentLength(int len) {
+        @Override
+        public void setContentLength(final int len) {
             this.response.setContentLength(len);
         }
 
-        public void setContentType(String type) {
+        @Override
+        public void setContentType(final String type) {
             this.response.setContentType(type);
         }
 
-        public void setDateHeader(String name, long date) {
+        @Override
+        public void setDateHeader(final String name, final long date) {
             if ("Last-Modified".equals(name)) {
                 ResponseHeaderCollector.setLastModified(date);
             }
             this.response.setDateHeader(name, date);
         }
 
-        public void setHeader(String name, String value) {
+        @Override
+        public void setHeader(final String name, final String value) {
             this.response.setHeader(name, value);
         }
 
-        public void setIntHeader(String name, int value) {
+        @Override
+        public void setIntHeader(final String name, final int value) {
             this.response.setIntHeader(name, value);
         }
 
-        public void setLocale(Locale loc) {
+        @Override
+        public void setLocale(final Locale loc) {
             this.response.setLocale(loc);
         }
 
-        public void setStatus(int sc) {
+        @Override
+        public void setStatus(final int sc) {
             this.response.setStatus(sc);
         }
 
+        @Override
         @Deprecated
-        public void setStatus(int sc, String sm) {
+        public void setStatus(final int sc, final String sm) {
             this.response.setStatus(sc, sm);
         }
     }
@@ -324,31 +374,36 @@ public class WicketReader implements Sta
     private static class CocoonWicketServletContext implements ServletContext {
 
         private final String basePath;
+
         private final ServletContext servletContext;
 
-        public CocoonWicketServletContext(ServletContext servletContext, String basPath)
{
+        public CocoonWicketServletContext(final ServletContext servletContext,
+                final String basPath) {
+
             this.servletContext = servletContext;
             this.basePath = basPath;
         }
 
-        public Object getAttribute(String name) {
+        @Override
+        public Object getAttribute(final String name) {
             return this.servletContext.getAttribute(name);
         }
 
-        @SuppressWarnings("unchecked")
+        @Override
         public Enumeration<String> getAttributeNames() {
             return this.servletContext.getAttributeNames();
         }
 
-        public ServletContext getContext(String uripath) {
+        @Override
+        public ServletContext getContext(final String uripath) {
             return this.servletContext.getContext(uripath);
         }
 
-        public String getInitParameter(String name) {
+        @Override
+        public String getInitParameter(final String name) {
             return this.servletContext.getInitParameter(name);
         }
 
-        @SuppressWarnings("unchecked")
         public Enumeration<String> getInitParameterNames() {
             return this.servletContext.getInitParameterNames();
         }
@@ -357,7 +412,8 @@ public class WicketReader implements Sta
             return this.servletContext.getMajorVersion();
         }
 
-        public String getMimeType(String file) {
+        @Override
+        public String getMimeType(final String file) {
             return this.servletContext.getMimeType(file);
         }
 
@@ -365,33 +421,43 @@ public class WicketReader implements Sta
             return this.servletContext.getMinorVersion();
         }
 
-        public RequestDispatcher getNamedDispatcher(String name) {
+        @Override
+        public RequestDispatcher getNamedDispatcher(final String name) {
             return this.servletContext.getNamedDispatcher(name);
         }
 
-        public String getRealPath(String path) {
+        @Override
+        public String getRealPath(final String path) {
             return this.servletContext.getRealPath(path);
         }
 
-        public RequestDispatcher getRequestDispatcher(String path) {
+        @Override
+        public RequestDispatcher getRequestDispatcher(final String path) {
             return this.servletContext.getRequestDispatcher(path);
         }
 
-        public URL getResource(String path) throws MalformedURLException {
+        @Override
+        public URL getResource(final String path)
+                throws MalformedURLException {
+
             return this.servletContext.getResource(path);
         }
 
-        public InputStream getResourceAsStream(String path) {
+        @Override
+        public InputStream getResourceAsStream(final String path) {
             if ("/WEB-INF/web.xml".equals(path)) {
-                String filterDefinition = "<web-app><filter-mapping><filter-name>"
+ WICKET_FILTER_NAME
-                        + "</filter-name><url-pattern>" + this.basePath + "/*</url-pattern></filter-mapping></web-app>";
+                final String filterDefinition =
+                        "<web-app><filter-mapping><filter-name>"
+                        + WICKET_FILTER_NAME
+                        + "</filter-name><url-pattern>" + this.basePath
+                        + "/*</url-pattern></filter-mapping></web-app>";
                 return IOUtils.toInputStream(filterDefinition);
             }
             return this.servletContext.getResourceAsStream(path);
         }
 
-        @SuppressWarnings("unchecked")
-        public Set<String> getResourcePaths(String path) {
+        @Override
+        public Set<String> getResourcePaths(final String path) {
             return this.servletContext.getResourcePaths(path);
         }
 
@@ -400,7 +466,9 @@ public class WicketReader implements Sta
         }
 
         @Deprecated
-        public Servlet getServlet(String name) throws ServletException {
+        public Servlet getServlet(final String name)
+                throws ServletException {
+
             return this.servletContext.getServlet(name);
         }
 
@@ -415,30 +483,37 @@ public class WicketReader implements Sta
         }
 
         @Deprecated
-        @SuppressWarnings("unchecked")
         public Enumeration<Servlet> getServlets() {
             return this.servletContext.getServlets();
         }
 
         @Deprecated
-        public void log(Exception exception, String msg) {
+        public void log(final Exception exception, final String msg) {
             this.servletContext.log(exception, msg);
         }
 
-        public void log(String msg) {
+        @Override
+        public void log(final String msg) {
             this.servletContext.log(msg);
         }
 
-        public void log(String message, Throwable throwable) {
+        @Override
+        public void log(final String message, final Throwable throwable) {
             this.servletContext.log(message, throwable);
         }
 
-        public void removeAttribute(String name) {
+        @Override
+        public void removeAttribute(final String name) {
             this.servletContext.removeAttribute(name);
         }
 
-        public void setAttribute(String name, Object object) {
+        @Override
+        public void setAttribute(final String name, final Object object) {
             this.servletContext.setAttribute(name, object);
         }
+
+        public String getContextPath() {
+            return this.servletContext.getContextPath();
+        }
     }
 }



Mime
View raw message