tiles-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apetre...@apache.org
Subject svn commit: r527536 [2/4] - in /tiles/framework/trunk: ./ tiles-api/ tiles-api/src/main/java/org/apache/tiles/ tiles-api/src/main/java/org/apache/tiles/access/ tiles-api/src/main/java/org/apache/tiles/mgmt/ tiles-api/src/main/java/org/apache/tiles/web/...
Date Wed, 11 Apr 2007 15:44:59 GMT
Modified: tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/context/servlet/ServletParamMap.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/context/servlet/ServletParamMap.java?view=diff&rev=527536&r1=527535&r2=527536
==============================================================================
--- tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/context/servlet/ServletParamMap.java (original)
+++ tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/context/servlet/ServletParamMap.java Wed Apr 11 08:44:51 2007
@@ -17,16 +17,21 @@
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
- *
  */
 package org.apache.tiles.context.servlet;
 
-
-import org.apache.tiles.context.MapEntry;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Enumeration;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
 
 import javax.servlet.http.HttpServletRequest;
-import java.util.*;
 
+import org.apache.tiles.context.MapEntry;
 
 /**
  * <p>Private implementation of <code>Map</code> for servlet parameter

Modified: tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/context/servlet/ServletParamValuesMap.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/context/servlet/ServletParamValuesMap.java?view=diff&rev=527536&r1=527535&r2=527536
==============================================================================
--- tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/context/servlet/ServletParamValuesMap.java (original)
+++ tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/context/servlet/ServletParamValuesMap.java Wed Apr 11 08:44:51 2007
@@ -17,7 +17,6 @@
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
- *
  */
 package org.apache.tiles.context.servlet;
 
@@ -203,4 +202,4 @@
     }
 
 
-}
\ No newline at end of file
+}

Modified: tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/context/servlet/ServletRequestScopeMap.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/context/servlet/ServletRequestScopeMap.java?view=diff&rev=527536&r1=527535&r2=527536
==============================================================================
--- tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/context/servlet/ServletRequestScopeMap.java (original)
+++ tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/context/servlet/ServletRequestScopeMap.java Wed Apr 11 08:44:51 2007
@@ -17,16 +17,21 @@
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
- *
  */
 package org.apache.tiles.context.servlet;
 
-
-import org.apache.tiles.context.MapEntry;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Enumeration;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
 
 import javax.servlet.ServletRequest;
-import java.util.*;
 
+import org.apache.tiles.context.MapEntry;
 
 /**
  * <p>Private implementation of <code>Map</code> for servlet request
@@ -211,4 +216,4 @@
     }
 
 
-}
\ No newline at end of file
+}

Modified: tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/context/servlet/ServletSessionScopeMap.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/context/servlet/ServletSessionScopeMap.java?view=diff&rev=527536&r1=527535&r2=527536
==============================================================================
--- tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/context/servlet/ServletSessionScopeMap.java (original)
+++ tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/context/servlet/ServletSessionScopeMap.java Wed Apr 11 08:44:51 2007
@@ -17,16 +17,21 @@
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
- *
  */
 package org.apache.tiles.context.servlet;
 
-
-import org.apache.tiles.context.MapEntry;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Enumeration;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
 
 import javax.servlet.http.HttpSession;
-import java.util.*;
 
+import org.apache.tiles.context.MapEntry;
 
 /**
  * <p>Private implementation of <code>Map</code> for HTTP session
@@ -211,4 +216,4 @@
     }
 
 
-}
\ No newline at end of file
+}

Modified: tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/context/servlet/ServletTilesApplicationContext.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/context/servlet/ServletTilesApplicationContext.java?view=diff&rev=527536&r1=527535&r2=527536
==============================================================================
--- tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/context/servlet/ServletTilesApplicationContext.java (original)
+++ tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/context/servlet/ServletTilesApplicationContext.java Wed Apr 11 08:44:51 2007
@@ -17,7 +17,6 @@
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
- *
  */
 package org.apache.tiles.context.servlet;
 
@@ -61,9 +60,9 @@
 
 
     /**
-     * Creates a new instance of ServletTilesApplicationContext
+     * Creates a new instance of ServletTilesApplicationContext.
      *
-     * @param servletContext The servlet context to use. 
+     * @param servletContext The servlet context to use.
      */
     public ServletTilesApplicationContext(ServletContext servletContext) {
         initialize(servletContext);

Modified: tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/context/servlet/ServletTilesContextFactory.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/context/servlet/ServletTilesContextFactory.java?view=diff&rev=527536&r1=527535&r2=527536
==============================================================================
--- tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/context/servlet/ServletTilesContextFactory.java (original)
+++ tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/context/servlet/ServletTilesContextFactory.java Wed Apr 11 08:44:51 2007
@@ -17,7 +17,6 @@
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
- *
  */
 
 package org.apache.tiles.context.servlet;
@@ -25,8 +24,6 @@
 import org.apache.tiles.TilesApplicationContext;
 import org.apache.tiles.context.TilesContextFactory;
 import org.apache.tiles.context.TilesRequestContext;
-import org.apache.tiles.context.servlet.ServletTilesApplicationContext;
-import org.apache.tiles.context.servlet.ServletTilesRequestContext;
 
 import javax.servlet.ServletContext;
 import javax.servlet.http.HttpServletRequest;
@@ -64,7 +61,7 @@
                     (HttpServletResponse) requestItems[1]);
             }
         }
-        
+
         return null;
     }
 

Modified: tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/context/servlet/ServletTilesRequestContext.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/context/servlet/ServletTilesRequestContext.java?view=diff&rev=527536&r1=527535&r2=527536
==============================================================================
--- tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/context/servlet/ServletTilesRequestContext.java (original)
+++ tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/context/servlet/ServletTilesRequestContext.java Wed Apr 11 08:44:51 2007
@@ -17,28 +17,30 @@
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
- *
  */
 package org.apache.tiles.context.servlet;
 
-import org.apache.tiles.context.TilesRequestContext;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import javax.servlet.*;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
 import java.util.Locale;
 import java.util.Map;
 
+import javax.servlet.RequestDispatcher;
+import javax.servlet.ServletContext;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.tiles.context.TilesRequestContext;
+
 /**
  * Servlet-bsed implementation of the TilesApplicationContext interface.
  *
  * @version $Rev$ $Date$
  */
 public class ServletTilesRequestContext extends ServletTilesApplicationContext implements TilesRequestContext {
-    
+
     /**
      * The logging object.
      */
@@ -96,7 +98,7 @@
 
 
     /**
-     * Creates a new instance of ServletTilesRequestContext
+     * Creates a new instance of ServletTilesRequestContext.
      *
      * @param servletContext The servlet context.
      * @param request The request object.
@@ -177,11 +179,11 @@
 
     /** {@inheritDoc} */
     public void dispatch(String path) throws IOException {
-    	if (response.isCommitted()) {
-    		include(path);
-    	} else {
-    		forward(path);
-    	}
+        if (response.isCommitted()) {
+            include(path);
+        } else {
+            forward(path);
+        }
     }
 
     /**
@@ -190,25 +192,27 @@
      * @param path The path to forward to.
      * @throws IOException If something goes wrong during the operation.
      */
-    private void forward( String path ) throws IOException {
+    private void forward(String path) throws IOException {
         RequestDispatcher rd = request.getRequestDispatcher(path);
         try {
             rd.forward(request, response);
         } catch (ServletException ex) {
             LOG.error("Servlet Exception while including path", ex);
-            throw new IOException("Error including path '"+path+"'. " + ex.getMessage());
+            throw new IOException("Error including path '" + path + "'. "
+                    + ex.getMessage());
         }
-	}
+    }
 
 
     /** {@inheritDoc} */
-	public void include(String path) throws IOException{
+    public void include(String path) throws IOException {
         RequestDispatcher rd = request.getRequestDispatcher(path);
         try {
             rd.include(request, response);
         } catch (ServletException ex) {
             LOG.error("Servlet Exception while including path", ex);
-            throw new IOException("Error including path '"+path+"'. " + ex.getMessage());
+            throw new IOException("Error including path '" + path + "'. "
+                    + ex.getMessage());
         }
     }
 

Modified: tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/definition/Definition.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/definition/Definition.java?view=diff&rev=527536&r1=527535&r2=527536
==============================================================================
--- tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/definition/Definition.java (original)
+++ tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/definition/Definition.java Wed Apr 11 08:44:51 2007
@@ -17,7 +17,6 @@
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
- *
  */
 
 package org.apache.tiles.definition;
@@ -87,10 +86,10 @@
         this.template = template;
         this.attributes = attributes;
     }
-    
+
     /**
      * Checks whether the <code>key</code> attribute has been set.
-     * 
+     *
      * @param key The attribute key to check.
      * @return <code>true</code> if the attribute has a value.
      */

Modified: tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/definition/Definitions.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/definition/Definitions.java?view=diff&rev=527536&r1=527535&r2=527536
==============================================================================
--- tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/definition/Definitions.java (original)
+++ tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/definition/Definitions.java Wed Apr 11 08:44:51 2007
@@ -17,7 +17,6 @@
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
- *
  */
 
 package org.apache.tiles.definition;
@@ -80,14 +79,14 @@
     /**
      * Resolves configuration inheritance properties.
      *
-     * @throws NoSuchDefinitionException If parent definitions are not found. 
+     * @throws NoSuchDefinitionException If parent definitions are not found.
      */
     public void resolveInheritances() throws NoSuchDefinitionException;
 
     /**
      * Resolves locale-specific configuration inheritance properties.
      *
-     * @param locale The locale object to use. 
+     * @param locale The locale object to use.
      * @throws NoSuchDefinitionException If parent definitions are not found.
      */
     public void resolveInheritances(Locale locale) throws NoSuchDefinitionException;
@@ -98,9 +97,9 @@
     public void reset();
 
     /**
-     * Returns base definitions collection;
+     * Returns base definitions collection.
      *
-     * @return A map of the type "definition name -> definition". 
+     * @return A map of the type "definition name -> definition".
      */
     public Map<String, Definition> getBaseDefinitions();
 }

Modified: tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/definition/DefinitionsFactory.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/definition/DefinitionsFactory.java?view=diff&rev=527536&r1=527535&r2=527536
==============================================================================
--- tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/definition/DefinitionsFactory.java (original)
+++ tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/definition/DefinitionsFactory.java Wed Apr 11 08:44:51 2007
@@ -17,13 +17,11 @@
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
- *
  */
 
 package org.apache.tiles.definition;
 
 import org.apache.tiles.context.TilesRequestContext;
-import org.apache.tiles.locale.LocaleResolver;
 import org.apache.tiles.TilesException;
 
 import java.util.Map;
@@ -51,29 +49,28 @@
      */
     public static final String DEFINITIONS_IMPL_PROPERTY =
         "org.apache.tiles.definition.Definitions";
-    
+
     /**
      * Property name that specifies the implementation of
-     * {@link LocaleResolver}.
+     * {@link org.apache.tiles.locale.LocaleResolver}.
      */
     public static final String LOCALE_RESOLVER_IMPL_PROPERTY =
         "org.apache.tiles.locale.LocaleResolver";
 
     /**
-     * Initializes the DefinitionsFactory and its subcomponents.
-     * <p/>
+     * Initializes the DefinitionsFactory and its subcomponents. <p/>
      * Implementations may support configuration properties to be passed in via
      * the params Map.
      *
      * @param params The Map of configuration properties.
-     * @throws DefinitionsFactoryException if an initialization error occurs.
-     * @throws TilesException If a generic Tiles exception occurs.
+     * @throws TilesException If a Tiles exception, such as an initialization
+     * error, occurs.
      */
-    public void init(Map<String, String> params) throws DefinitionsFactoryException, TilesException;
+    public void init(Map<String, String> params) throws TilesException;
 
     /**
      * Returns a Definition object that matches the given name and
-     * Tiles context
+     * Tiles context.
      *
      * @param name         The name of the Definition to return.
      * @param tilesContext The Tiles context to use to resolve the definition.
@@ -103,7 +100,7 @@
     /**
      * Creates and returns a {@link Definitions} set by reading
      * configuration data from the applied sources.
-     * 
+     *
      * @return The read definitions.
      * @throws DefinitionsFactoryException if an error occurs reading the
      *                                     sources.

Modified: tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/definition/DefinitionsFactoryException.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/definition/DefinitionsFactoryException.java?view=diff&rev=527536&r1=527535&r2=527536
==============================================================================
--- tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/definition/DefinitionsFactoryException.java (original)
+++ tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/definition/DefinitionsFactoryException.java Wed Apr 11 08:44:51 2007
@@ -17,7 +17,6 @@
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
- *
  */
 
 

Modified: tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/definition/DefinitionsImpl.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/definition/DefinitionsImpl.java?view=diff&rev=527536&r1=527535&r2=527536
==============================================================================
--- tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/definition/DefinitionsImpl.java (original)
+++ tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/definition/DefinitionsImpl.java Wed Apr 11 08:44:51 2007
@@ -17,7 +17,6 @@
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
- *
  */
 
 package org.apache.tiles.definition;
@@ -51,7 +50,7 @@
     private Map<Locale, Map<String, Definition>> localeSpecificDefinitions;
 
     /**
-     * Creates a new instance of DefinitionsImpl
+     * Creates a new instance of DefinitionsImpl.
      */
     public DefinitionsImpl() {
         baseDefinitions = new HashMap<String, Definition>();
@@ -74,9 +73,11 @@
      * resolves inheritance attraibutes.
      *
      * @param defsMap The new definitions to add.
-     * @throws NoSuchDefinitionException
+     * @throws NoSuchDefinitionException If something goes wrong during
+     * addition.
      */
-    public void addDefinitions(Map<String, Definition> defsMap) throws NoSuchDefinitionException {
+    public void addDefinitions(Map<String, Definition> defsMap)
+            throws NoSuchDefinitionException {
         this.baseDefinitions.putAll(defsMap);
         resolveAttributeDependencies(null);
         resolveInheritances();
@@ -126,7 +127,7 @@
     /**
      * Resolve extended instances.
      *
-     * @throws NoSuchDefinitionException If a parent definition is not found. 
+     * @throws NoSuchDefinitionException If a parent definition is not found.
      */
     public void resolveInheritances() throws NoSuchDefinitionException {
         for (Definition definition : baseDefinitions.values()) {
@@ -137,7 +138,7 @@
     /**
      * Resolve locale-specific extended instances.
      *
-     * @param locale The locale to use. 
+     * @param locale The locale to use.
      * @throws NoSuchDefinitionException If a parent definition is not found.
      */
     public void resolveInheritances(Locale locale) throws NoSuchDefinitionException {
@@ -160,9 +161,9 @@
     }
 
     /**
-     * Returns base definitions collection;
+     * Returns base definitions collection.
      *
-     * @return The base (i.e. not depending on any locale) definitions map. 
+     * @return The base (i.e. not depending on any locale) definitions map.
      */
     public Map<String, Definition> getBaseDefinitions() {
         return baseDefinitions;
@@ -175,14 +176,12 @@
      * @return <code>true</code> if the attribute is a definition.
      */
     protected boolean isDefinitionType(Attribute attr) {
-        boolean explicit = (attr.getType() != null &&
-            (attr.getType().equalsIgnoreCase("definition") ||
-                attr.getType().equalsIgnoreCase("instance")));
-
-        boolean implicit =
-            attr.getType() == null &&
-                attr.getValue() != null &&
-                baseDefinitions.containsKey(attr.getValue().toString());
+        boolean explicit = (attr.getType() != null && (attr.getType()
+                .equalsIgnoreCase("definition") || attr.getType()
+                .equalsIgnoreCase("instance")));
+
+        boolean implicit = attr.getType() == null && attr.getValue() != null
+                && baseDefinitions.containsKey(attr.getValue().toString());
 
         return explicit || implicit;
 
@@ -191,7 +190,7 @@
     /**
      * Resolves attribute dependencies for the given locale. If the locale is
      * <code>null</code>, it resolves base attribute dependencies.
-     * 
+     *
      * @param locale The locale to use.
      */
     protected void resolveAttributeDependencies(Locale locale) {
@@ -245,7 +244,7 @@
      * template.
      * Also copy attributes setted in parent, and not set in child
      * If instance doesn't extend anything, do nothing.
-     * 
+     *
      * @param definition The definition to resolve
      * @param locale The locale to use.
      * @throws NoSuchDefinitionException If an inheritance can not be solved.
@@ -253,13 +252,15 @@
     protected void resolveInheritance(Definition definition,
                                       Locale locale) throws NoSuchDefinitionException {
         // Already done, or not needed ?
-        if (definition.isIsVisited() || !definition.isExtending())
+        if (definition.isIsVisited() || !definition.isExtending()) {
             return;
+        }
 
-        if (log.isDebugEnabled())
+        if (log.isDebugEnabled()) {
             log.debug("Resolve definition for child name='"
                 + definition.getName()
                 + "' extends='" + definition.getExtends() + "'.");
+        }
 
         // Set as visited to avoid endless recurisvity.
         definition.setIsVisited(true);
@@ -300,14 +301,17 @@
                 .iterator();
         while (parentAttributes.hasNext()) {
             String name = parentAttributes.next();
-            if (!child.getAttributes().containsKey(name))
+            if (!child.getAttributes().containsKey(name)) {
                 child.put(name, parent.getAttribute(name));
+            }
         }
         // Set template and role if not setted
-        if (child.getTemplate() == null)
+        if (child.getTemplate() == null) {
             child.setTemplate(parent.getTemplate());
-        if (child.getRole() == null)
+        }
+        if (child.getRole() == null) {
             child.setRole(parent.getRole());
+        }
         if (child.getPreparer() == null) {
             child.setPreparer(parent.getPreparer());
         }

Modified: tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/definition/DefinitionsReader.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/definition/DefinitionsReader.java?view=diff&rev=527536&r1=527535&r2=527536
==============================================================================
--- tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/definition/DefinitionsReader.java (original)
+++ tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/definition/DefinitionsReader.java Wed Apr 11 08:44:51 2007
@@ -17,7 +17,6 @@
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
- *
  */
 
 package org.apache.tiles.definition;

Modified: tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/definition/FactoryNotFoundException.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/definition/FactoryNotFoundException.java?view=diff&rev=527536&r1=527535&r2=527536
==============================================================================
--- tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/definition/FactoryNotFoundException.java (original)
+++ tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/definition/FactoryNotFoundException.java Wed Apr 11 08:44:51 2007
@@ -17,7 +17,6 @@
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
- *
  */
 
 

Modified: tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/definition/NoSuchDefinitionException.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/definition/NoSuchDefinitionException.java?view=diff&rev=527536&r1=527535&r2=527536
==============================================================================
--- tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/definition/NoSuchDefinitionException.java (original)
+++ tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/definition/NoSuchDefinitionException.java Wed Apr 11 08:44:51 2007
@@ -17,7 +17,6 @@
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
- *
  */
 
 

Modified: tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/definition/ReloadableDefinitionsFactory.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/definition/ReloadableDefinitionsFactory.java?view=diff&rev=527536&r1=527535&r2=527536
==============================================================================
--- tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/definition/ReloadableDefinitionsFactory.java (original)
+++ tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/definition/ReloadableDefinitionsFactory.java Wed Apr 11 08:44:51 2007
@@ -17,7 +17,6 @@
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
- *
  */
 
 
@@ -34,13 +33,13 @@
      * Indicates whether the DefinitionsFactory is out of date and needs to be
      * reloaded.
      *
-     * @return <code>true</code> if the definitions need to be refreshed. 
+     * @return <code>true</code> if the definitions need to be refreshed.
      */
     public boolean refreshRequired();
-    
+
     /**
      * Refreshes the stored definitions, reloading them.
-     * 
+     *
      * @throws DefinitionsFactoryException If something goes wrong during
      * refresh.
      */

Modified: tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/definition/UrlDefinitionsFactory.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/definition/UrlDefinitionsFactory.java?view=diff&rev=527536&r1=527535&r2=527536
==============================================================================
--- tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/definition/UrlDefinitionsFactory.java (original)
+++ tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/definition/UrlDefinitionsFactory.java Wed Apr 11 08:44:51 2007
@@ -17,7 +17,6 @@
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
- *
  */
 package org.apache.tiles.definition;
 
@@ -84,14 +83,14 @@
      * The definitions holder object.
      */
     private Definitions definitions;
-    
+
     /**
      * The locale resolver object.
      */
     private LocaleResolver localeResolver;
 
     /**
-     * Creates a new instance of UrlDefinitionsFactory
+     * Creates a new instance of UrlDefinitionsFactory.
      */
     public UrlDefinitionsFactory() {
         sources = new ArrayList<Object>();
@@ -118,7 +117,7 @@
             reader = new DigesterDefinitionsReader();
         }
         reader.init(params);
-        
+
         String resolverClassName = params
                 .get(DefinitionsFactory.LOCALE_RESOLVER_IMPL_PROPERTY);
         if (resolverClassName != null) {
@@ -147,7 +146,7 @@
 
     /**
      * Returns a Definition object that matches the given name and
-     * Tiles context
+     * Tiles context.
      *
      * @param name         The name of the Definition to return.
      * @param tilesContext The Tiles context to use to resolve the definition.
@@ -220,16 +219,16 @@
         if (isContextProcessed(tilesContext)) {
             return;
         }
-        
+
         if (locale == null) {
-        	return;
+            return;
         }
 
         processedLocales.add(locale);
         List<String> postfixes = calculatePostfixes(locale);
         Map<String, Definition> localeDefsMap = new HashMap<String, Definition>();
         for (Object postfix : postfixes) {
-        	// For each postfix, all the sources must be loaded.
+            // For each postfix, all the sources must be loaded.
             for (Object source : sources) {
                 URL url = (URL) source;
                 String path = url.toExternalForm();
@@ -241,23 +240,26 @@
                     connection.connect();
                     lastModifiedDates.put(newUrl.toExternalForm(),
                         connection.getLastModified());
-                    
+
                     // Definition must be collected, starting from the base
                     // source up to the last localized file.
                     Map<String, Definition> defsMap = reader
                             .read(connection.getInputStream());
                     if (defsMap != null) {
-                    	localeDefsMap.putAll(defsMap);
+                        localeDefsMap.putAll(defsMap);
                     }
                 } catch (FileNotFoundException e) {
                     // File not found. continue.
+                    if (LOG.isDebugEnabled()) {
+                        LOG.debug("File " + newPath + " not found, continue");
+                    }
                 } catch (IOException e) {
                     throw new DefinitionsFactoryException(
                         "I/O error processing configuration.");
                 }
             }
         }
-        
+
         // At the end of definitions loading, they can be assigned to
         // Definitions implementation, to allow inheritance resolution.
         definitions.addDefinitions(localeDefsMap, localeResolver
@@ -307,7 +309,7 @@
         return processedLocales.contains(localeResolver
                 .resolveLocale(tilesContext));
     }
-    
+
     /**
      * Creates a new instance of <code>Definitions</code>. Override this method
      * to provide your custom instance of Definitions.
@@ -374,17 +376,20 @@
         temp.append('_');
         temp.append(language);
 
-        if (languageLength > 0)
+        if (languageLength > 0) {
             result.add(temp.toString());
+        }
 
-        if (countryLength + variantLength == 0)
+        if (countryLength + variantLength == 0) {
             return result;
+        }
 
         temp.append('_');
         temp.append(country);
 
-        if (countryLength > 0)
+        if (countryLength > 0) {
             result.add(temp.toString());
+        }
 
         if (variantLength == 0) {
             return result;
@@ -411,7 +416,7 @@
     /**
      * Indicates whether the DefinitionsFactory is out of date and needs to be
      * reloaded.
-     * 
+     *
      * @return If the factory needs refresh.
      */
     public boolean refreshRequired() {

Modified: tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/definition/digester/DigesterDefinitionsReader.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/definition/digester/DigesterDefinitionsReader.java?view=diff&rev=527536&r1=527535&r2=527536
==============================================================================
--- tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/definition/digester/DigesterDefinitionsReader.java (original)
+++ tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/definition/digester/DigesterDefinitionsReader.java Wed Apr 11 08:44:51 2007
@@ -17,7 +17,6 @@
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
- *
  */
 
 package org.apache.tiles.definition.digester;
@@ -63,6 +62,72 @@
      */
     public static final String PARSER_VALIDATE_PARAMETER_NAME =
         "definitions-parser-validate";
+
+    // Digester rules constants for tag interception.
+
+    /**
+     * Intercepts a &lt;definition&gt; tag.
+     */
+    private static final String DEFINITION_TAG = "tiles-definitions/definition";
+
+    /**
+     * Intercepts a &lt;put-attribute&gt; tag.
+     */
+    private static final String PUT_TAG = DEFINITION_TAG + "/put-attribute";
+
+    /**
+     * Intercepts a &lt;put-list-attribute&gt; tag.
+     */
+    private static final String LIST_TAG = "put-list-attribute";
+
+    /**
+     * Intercepts a &lt;put-list-attribute&gt; tag inside a %lt;definition&gt;
+     * tag.
+     */
+    private static final String DEF_LIST_TAG = DEFINITION_TAG + "/" + LIST_TAG;
+
+    /**
+     * Intercepts a &lt;add-attribute&gt; tag.
+     */
+    private static final String ADD_LIST_ELE_TAG = "*/add-attribute";
+
+    /**
+     * Intercepts a &lt;add-list-attribute&gt; tag.
+     */
+    private static final String NESTED_LIST = "*/add-list-attribute";
+
+    /**
+     * Intercepts a &lt;item&gt; tag.
+     */
+    private static final String ADD_WILDCARD = "*/item";
+
+    /**
+     * Intercepts a &lt;bean&gt; tag.
+     */
+    private static final String BEAN_TAG = "*/bean";
+
+    // Handler class names.
+
+    /**
+     * The package name.
+     */
+    private static final String PACKAGE_NAME = "org.apache.tiles";
+
+    /**
+     * The handler to create definitions.
+     */
+    private static final String DEFINITION_HANDLER_CLASS = PACKAGE_NAME + ".definition.Definition";
+
+    /**
+     * The handler to create attributes.
+     */
+    private static final String PUT_ATTRIBUTE_HANDLER_CLASS = PACKAGE_NAME + ".Attribute";
+
+    /**
+     * The handler to create list attributes.
+     */
+    private static final String LIST_HANDLER_CLASS = PACKAGE_NAME + ".context.ListAttribute";
+
     /**
      * <code>Digester</code> object used to read Definition data
      * from the source.
@@ -71,7 +136,7 @@
     /**
      * Stores Definition objects.
      */
-    Map<String, Definition> definitions;
+    private Map<String, Definition> definitions;
     /**
      * Should we use a validating XML parser to read the configuration file.
      * Default is <code>false</code>.
@@ -82,7 +147,7 @@
      * the versions of the configuration file DTDs we know about.  There
      * <strong>MUST</strong> be an even number of Strings in this list!
      */
-    protected String registrations[] = {
+    protected String[] registrations = {
         "-//Apache Software Foundation//DTD Tiles Configuration 2.0//EN",
         "/org/apache/tiles/resources/tiles-config_2_0.dtd"
     };
@@ -93,7 +158,7 @@
     private boolean inited = false;
 
     /**
-     * Creates a new instance of DigesterDefinitionsReader
+     * Creates a new instance of DigesterDefinitionsReader.
      */
     public DigesterDefinitionsReader() {
         digester = new Digester();
@@ -194,74 +259,54 @@
 
 
     /**
-     * Init digester for Tiles syntax with first element = tiles-definitions
+     * Init digester for Tiles syntax with first element = tiles-definitions.
      *
      * @param digester Digester instance to use.
      */
     private void initDigesterForTilesDefinitionsSyntax(Digester digester) {
-        // Common constants
-        String PACKAGE_NAME = "org.apache.tiles";
-        String DEFINITION_TAG = "tiles-definitions/definition";
-        String definitionHandlerClass = PACKAGE_NAME + ".definition.Definition";
-
-        String PUT_TAG = DEFINITION_TAG + "/put-attribute";
-        String putAttributeHandlerClass = PACKAGE_NAME + ".Attribute";
-
-        //String LIST_TAG = DEFINITION_TAG + "/putList";
-        // List tag value
-        String LIST_TAG = "put-list-attribute";
-        String DEF_LIST_TAG = DEFINITION_TAG + "/" + LIST_TAG;
-
-        String listHandlerClass = PACKAGE_NAME + ".context.ListAttribute";
-        // Tag value for adding an element in a list
-        String ADD_LIST_ELE_TAG = "*/add-attribute";
-
         // syntax rules
-        digester.addObjectCreate(DEFINITION_TAG, definitionHandlerClass);
+        digester.addObjectCreate(DEFINITION_TAG, DEFINITION_HANDLER_CLASS);
         digester.addSetProperties(DEFINITION_TAG);
-        digester.addSetNext(DEFINITION_TAG, "addDefinition", definitionHandlerClass);
+        digester.addSetNext(DEFINITION_TAG, "addDefinition", DEFINITION_HANDLER_CLASS);
         // put / putAttribute rules
         // Rules for a same pattern are called in order, but rule.end() are called
         // in reverse order.
         // SetNext and CallMethod use rule.end() method. So, placing SetNext in
         // first position ensure it will be called last (sic).
-        digester.addObjectCreate(PUT_TAG, putAttributeHandlerClass);
+        digester.addObjectCreate(PUT_TAG, PUT_ATTRIBUTE_HANDLER_CLASS);
         digester.addSetProperties(PUT_TAG);
-        digester.addSetNext(PUT_TAG, "addAttribute", putAttributeHandlerClass);
+        digester.addSetNext(PUT_TAG, "addAttribute", PUT_ATTRIBUTE_HANDLER_CLASS);
         digester.addCallMethod(PUT_TAG, "setBody", 0);
         // TileDefinition level list rules
         // This is rules for lists nested in a definition
-        digester.addObjectCreate(DEF_LIST_TAG, listHandlerClass);
+        digester.addObjectCreate(DEF_LIST_TAG, LIST_HANDLER_CLASS);
         digester.addSetProperties(DEF_LIST_TAG);
-        digester.addSetNext(DEF_LIST_TAG, "addAttribute", putAttributeHandlerClass);
+        digester.addSetNext(DEF_LIST_TAG, "addAttribute", PUT_ATTRIBUTE_HANDLER_CLASS);
         // list elements rules
         // We use Attribute class to avoid rewriting a new class.
         // Name part can't be used in listElement attribute.
-        digester.addObjectCreate(ADD_LIST_ELE_TAG, putAttributeHandlerClass);
+        digester.addObjectCreate(ADD_LIST_ELE_TAG, PUT_ATTRIBUTE_HANDLER_CLASS);
         digester.addSetProperties(ADD_LIST_ELE_TAG);
-        digester.addSetNext(ADD_LIST_ELE_TAG, "add", putAttributeHandlerClass);
+        digester.addSetNext(ADD_LIST_ELE_TAG, "add", PUT_ATTRIBUTE_HANDLER_CLASS);
         digester.addCallMethod(ADD_LIST_ELE_TAG, "setBody", 0);
 
         // nested list elements rules
         // Create a list handler, and add it to parent list
-        String NESTED_LIST = "*/add-list-attribute";
-        digester.addObjectCreate(NESTED_LIST, listHandlerClass);
+        digester.addObjectCreate(NESTED_LIST, LIST_HANDLER_CLASS);
         digester.addSetProperties(NESTED_LIST);
-        digester.addSetNext(NESTED_LIST, "add", putAttributeHandlerClass);
+        digester.addSetNext(NESTED_LIST, "add", PUT_ATTRIBUTE_HANDLER_CLASS);
 
         // item elements rules
         // We use Attribute class to avoid rewriting a new class.
         // Name part can't be used in listElement attribute.
         //String ADD_WILDCARD = LIST_TAG + "/addItem";
         // non String ADD_WILDCARD = LIST_TAG + "/addx*";
-        String ADD_WILDCARD = "*/item";
         String menuItemDefaultClass = "org.apache.tiles.beans.SimpleMenuItem";
         digester.addObjectCreate(ADD_WILDCARD, menuItemDefaultClass, "classtype");
         digester.addSetNext(ADD_WILDCARD, "add", "java.lang.Object");
         digester.addSetProperties(ADD_WILDCARD);
 
         // bean elements rules
-        String BEAN_TAG = "*/bean";
         String beanDefaultClass = "org.apache.tiles.beans.SimpleMenuItem";
         digester.addObjectCreate(BEAN_TAG, beanDefaultClass, "classtype");
         digester.addSetProperties(BEAN_TAG);

Modified: tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/definition/util/DefinitionsFactoryUtil.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/definition/util/DefinitionsFactoryUtil.java?view=diff&rev=527536&r1=527535&r2=527536
==============================================================================
--- tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/definition/util/DefinitionsFactoryUtil.java (original)
+++ tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/definition/util/DefinitionsFactoryUtil.java Wed Apr 11 08:44:51 2007
@@ -17,7 +17,6 @@
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
- *
  */
 
 package org.apache.tiles.definition.util;
@@ -34,7 +33,7 @@
  *
  * @version $Rev$ $Date$
  */
-public class DefinitionsFactoryUtil {
+public final class DefinitionsFactoryUtil {
 
     /**
      * Private constructor to avoid instatiation.

Modified: tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/factory/KeyedDefinitionsFactoryTilesContainerFactory.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/factory/KeyedDefinitionsFactoryTilesContainerFactory.java?view=diff&rev=527536&r1=527535&r2=527536
==============================================================================
--- tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/factory/KeyedDefinitionsFactoryTilesContainerFactory.java (original)
+++ tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/factory/KeyedDefinitionsFactoryTilesContainerFactory.java Wed Apr 11 08:44:51 2007
@@ -17,7 +17,6 @@
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
- *
  */
 package org.apache.tiles.factory;
 
@@ -41,15 +40,15 @@
  * @version $Rev$ $Date$
  */
 public class KeyedDefinitionsFactoryTilesContainerFactory extends
-		TilesContainerFactory {
-    
+        TilesContainerFactory {
+
     /**
      * The name of the initialization parameter that will contain a
      * comma-separated list of keys to use.
      */
     public static final String CONTAINER_KEYS_INIT_PARAM =
         "org.apache.tiles.CONTAINER.keys";
-    
+
     /**
      * Init parameter name that contains the class name for the key extractor.
      */
@@ -73,7 +72,7 @@
         initializeContainer(context, container);
         return container;
     }
-    
+
     // FIXME Probably we should create some sort of "FactoryUtils" to create
     // factories dynamically depending on a configuration.
     // I think this method does not belong here.
@@ -97,9 +96,11 @@
     /** {@inheritDoc} */
     @Override
     protected void storeContainerDependencies(Object context,
-            Map<String, String> initParameters, Map<String, String> configuration, BasicTilesContainer container) throws TilesException {
+            Map<String, String> initParameters,
+            Map<String, String> configuration, BasicTilesContainer container)
+            throws TilesException {
         super.storeContainerDependencies(context, initParameters, configuration, container);
-        
+
         String keyExtractorClassName = configuration.get(
                 KEY_EXTRACTOR_CLASS_INIT_PARAM);
         if (keyExtractorClassName != null
@@ -107,14 +108,14 @@
             ((KeyedDefinitionsFactoryTilesContainer) container).setKeyExtractor(
                     (KeyExtractor) ClassUtil.instantiate(keyExtractorClassName));
         }
-        
+
         String keysString = initParameters.get(CONTAINER_KEYS_INIT_PARAM);
         if (keysString != null
                 && container instanceof KeyedDefinitionsFactoryTilesContainer) {
             String[] keys = keysString.split(",");
             Map<String, String> config = new HashMap<String, String>(defaultConfiguration);
             config.putAll(getInitParameterMap(context));
-            for (int i=0; i < keys.length; i++) {
+            for (int i = 0; i < keys.length; i++) {
                 Map<String, String> initParams = new HashMap<String, String>();
                 String param = initParameters.get(
                         BasicTilesContainer.DEFINITIONS_CONFIG + "@" + keys[i]);

Modified: tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/factory/TilesContainerFactory.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/factory/TilesContainerFactory.java?view=diff&rev=527536&r1=527535&r2=527536
==============================================================================
--- tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/factory/TilesContainerFactory.java (original)
+++ tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/factory/TilesContainerFactory.java Wed Apr 11 08:44:51 2007
@@ -17,7 +17,6 @@
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
- *
  */
 package org.apache.tiles.factory;
 
@@ -129,7 +128,7 @@
      * 'org.apache.tiles.CONTAINER_FACTORY' is discovered this class will be
      * instantiated and returned. Otherwise, the factory will attempt to utilize
      * one of it's internal factories.
-     * 
+     *
      * @param context the executing applications context. Typically a
      * ServletContext or PortletContext
      * @param defaults Default configuration parameters values, used if the
@@ -225,7 +224,7 @@
                                        BasicTilesContainer container)
         throws TilesException {
         Map <String, String> initParameterMap;
-        
+
         initParameterMap = getInitParameterMap(context);
         Map<String, String> configuration = new HashMap<String, String>(defaultConfiguration);
         configuration.putAll(initParameterMap);
@@ -235,7 +234,7 @@
 
     /**
      * Stores container dependencies, that is called before
-     * {@link TilesContainer#init(Map)}
+     * {@link TilesContainer#init(Map)}.
      *
      * @param context The (application) context object to use.
      * @param initParameters The initialization parameters.
@@ -321,15 +320,15 @@
                 contextClass.getMethod("getInitParameter", String.class);
             value = getInitParameterMethod.invoke(context, parameterName);
         } catch (Exception e) {
-            throw new TilesException("Unrecognized context.  Is this context" +
-                " a ServletContext, PortletContext, or similar?", e);
+            throw new TilesException("Unrecognized context.  Is this context"
+                    + " a ServletContext, PortletContext, or similar?", e);
         }
         return value == null ? null : value.toString();
     }
 
     /**
      * Returns a map containing parameters name-value entries.
-     * 
+     *
      * @param context The (application) context object to use.
      * @return The initialization parameters map.
      * @throws TilesException If the context object has not been recognized.
@@ -350,9 +349,9 @@
                 initParameters.put(key, (String) method.invoke(context, key));
             }
         } catch (Exception e) {
-            throw new TilesException("Unable to retrieve init parameters." +
-                " Is this context a ServletContext, PortletContext," +
-                " or similar object?", e);
+            throw new TilesException("Unable to retrieve init parameters."
+                    + " Is this context a ServletContext, PortletContext,"
+                    + " or similar object?", e);
         }
         return initParameters;
     }

Modified: tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/filter/TilesFilter.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/filter/TilesFilter.java?view=diff&rev=527536&r1=527535&r2=527536
==============================================================================
--- tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/filter/TilesFilter.java (original)
+++ tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/filter/TilesFilter.java Wed Apr 11 08:44:51 2007
@@ -17,20 +17,27 @@
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
- *
  */
 
 package org.apache.tiles.filter;
 
+import java.io.IOException;
+import java.util.Enumeration;
+
+import javax.servlet.Filter;
+import javax.servlet.FilterChain;
+import javax.servlet.FilterConfig;
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletContext;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.tiles.definition.util.DefinitionsFactoryUtil;
 import org.apache.tiles.servlet.TilesServlet;
 
-import javax.servlet.*;
-import java.io.IOException;
-import java.util.Enumeration;
-
 /**
  * Processes Reloadable Tiles Definitions.
  *
@@ -77,7 +84,7 @@
 
     /**
      * Returns the filter configuration object for this filter.
-     * 
+     *
      * @return The filter configuration.
      */
     public FilterConfig getFilterConfig() {
@@ -97,7 +104,7 @@
     }
 
     /**
-     * Destroy method for this filter
+     * Destroy method for this filter.
      */
     public void destroy
         () {
@@ -109,7 +116,7 @@
         this.filterConfig = filterConfig;
         super.init(createServletConfig());
 
-        if (debug) {
+        if (DEBUG) {
             log("TilesDecorationFilter:Initializing filter");
         }
     }
@@ -120,10 +127,10 @@
     }
 
     /**
-     * A debug flag.
+     * A DEBUG flag.
      */
     // FIXME Is it really used?
-    private static final boolean debug = true;
+    private static final boolean DEBUG = true;
 
     /**
      * Creates a servlet configuration object from the filter configuration

Modified: tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/impl/BasicTilesContainer.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/impl/BasicTilesContainer.java?view=diff&rev=527536&r1=527535&r2=527536
==============================================================================
--- tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/impl/BasicTilesContainer.java (original)
+++ tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/impl/BasicTilesContainer.java Wed Apr 11 08:44:51 2007
@@ -17,7 +17,6 @@
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
- *
  */
 package org.apache.tiles.impl;
 
@@ -85,7 +84,7 @@
     private TilesApplicationContext context;
 
     /**
-     * The definitions factory. 
+     * The definitions factory.
      */
     private DefinitionsFactory definitionsFactory;
 
@@ -108,7 +107,7 @@
      * Initialize the Container with the given configuration.
      *
      * @param initParameters application context for this container
-     * @throws TilesException
+     * @throws TilesException If something goes wrong during initialization.
      */
     public void init(Map<String, String> initParameters) throws TilesException {
         checkInit();
@@ -120,21 +119,21 @@
         //Everything is now initialized.  We will populate
         // our definitions
         initializeDefinitionsFactory(definitionsFactory, getResourceString(),
-        		initParameters);
+                initParameters);
     }
 
     /** {@inheritDoc} */
-	public AttributeContext startContext(Object... requestItems) {
+    public AttributeContext startContext(Object... requestItems) {
         TilesRequestContext tilesContext = getRequestContext(requestItems);
-		return startContext(tilesContext);
-	}
+        return startContext(tilesContext);
+    }
 
     /** {@inheritDoc} */
     public void endContext(Object... requestItems) {
         TilesRequestContext tilesContext = getRequestContext(requestItems);
         endContext(tilesContext);
     }
-    
+
     /**
      * Starts an attribute context inside the container.
      *
@@ -169,22 +168,22 @@
             throw new IllegalStateException("Container allready initialized");
         }
     }
-    
+
     /**
      * Initializes a definitions factory.
      *
-     * @param definitionsFactory The factory to initializes. 
+     * @param definitionsFactory The factory to initialize.
      * @param resourceString The string containing a comma-separated-list of
      * resources.
      * @param initParameters A map containing the initialization parameters.
      * @throws TilesException If something goes wrong.
      */
     protected void initializeDefinitionsFactory(
-    		DefinitionsFactory definitionsFactory, String resourceString,
-    		Map<String, String> initParameters) throws TilesException {
+            DefinitionsFactory definitionsFactory, String resourceString,
+            Map<String, String> initParameters) throws TilesException {
         List<String> resources = getResourceNames(resourceString);
         definitionsFactory.init(initParameters);
-        
+
         try {
             for (String resource : resources) {
                 URL resourceUrl = context.getResource(resource);
@@ -207,7 +206,7 @@
     }
 
     /**
-     * Standard Getter
+     * Returns the Tiles application context used by this container.
      *
      * @return the application context for this container.
      */
@@ -299,7 +298,7 @@
     }
 
     /**
-     * Standard Getter
+     * Returns the preparer factory used by this container.
      *
      * @return return the preparerInstance factory used by this container.
      */
@@ -377,7 +376,7 @@
     /**
      * Renders the specified definition.
      *
-     * @param request The request context. 
+     * @param request The request context.
      * @param definitionName The name of the definition to render.
      * @throws TilesException If something goes wrong during rendering.
      */
@@ -399,8 +398,8 @@
         }
 
         if (!isPermitted(request, definition.getRole())) {
-            LOG.info("Access to definition '" + definitionName +
-                "' denied.  User not in role '" + definition.getRole());
+            LOG.info("Access to definition '" + definitionName
+                    + "' denied.  User not in role '" + definition.getRole());
             return;
         }
 
@@ -417,8 +416,8 @@
             String dispatchPath = definition.getTemplate();
 
             if (LOG.isDebugEnabled()) {
-                LOG.debug("Dispatching to definition path '" +
-                    definition.getTemplate() + " '");
+                LOG.debug("Dispatching to definition path '"
+                        + definition.getTemplate() + " '");
             }
             request.dispatch(dispatchPath);
 
@@ -469,8 +468,8 @@
      * @return <code>true</code> if the attribute is a definition.
      */
     private boolean isDefinition(Attribute attr, Object... requestItems) {
-        return Attribute.DEFINITION.equals(attr.getType()) ||
-            isValidDefinition(attr.getValue().toString(), requestItems);
+        return Attribute.DEFINITION.equals(attr.getType())
+                || isValidDefinition(attr.getValue().toString(), requestItems);
     }
 
     /**
@@ -513,7 +512,8 @@
      * @throws DefinitionsFactoryException If the definitions factory throws an
      * exception.
      */
-    protected Definition getDefinition(String definitionName, TilesRequestContext request) throws DefinitionsFactoryException {
+    protected Definition getDefinition(String definitionName,
+            TilesRequestContext request) throws DefinitionsFactoryException {
         Definition definition =
             definitionsFactory.getDefinition(definitionName, request);
         return definition;
@@ -606,8 +606,7 @@
         try {
             Definition definition = getDefinition(definitionName, context);
             return definition != null;
-        }
-        catch (NoSuchDefinitionException nsde) {
+        } catch (NoSuchDefinitionException nsde) {
             return false;
         } catch (DefinitionsFactoryException e) {
             // TODO, is this the right thing to do?

Modified: tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/impl/KeyedDefinitionsFactoryTilesContainer.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/impl/KeyedDefinitionsFactoryTilesContainer.java?view=diff&rev=527536&r1=527535&r2=527536
==============================================================================
--- tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/impl/KeyedDefinitionsFactoryTilesContainer.java (original)
+++ tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/impl/KeyedDefinitionsFactoryTilesContainer.java Wed Apr 11 08:44:51 2007
@@ -17,7 +17,6 @@
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
- *
  */
 
 package org.apache.tiles.impl;
@@ -38,31 +37,31 @@
  * @version $Rev$ $Date$
  */
 public class KeyedDefinitionsFactoryTilesContainer extends BasicTilesContainer {
-    
+
     /**
      * Name of the attribute inside the request that will be used to get the key
      * of the definitions factory to be used.
      */
     public static final String DEFINITIONS_FACTORY_KEY_ATTRIBUTE_NAME =
         "org.apache.tiles.DEFINITIONS_FACTORY.key";
-	
-	/**
-	 * Maps definition factories to their keys.
-	 */
-	protected Map<String, DefinitionsFactory> key2definitionsFactory;
-    
+
+    /**
+     * Maps definition factories to their keys.
+     */
+    protected Map<String, DefinitionsFactory> key2definitionsFactory;
+
     /**
      * The key extractor object.
      */
     protected KeyExtractor keyExtractor;
 
-	/**
-	 * Constructor.
-	 */
-	public KeyedDefinitionsFactoryTilesContainer() {
-		key2definitionsFactory = new HashMap<String, DefinitionsFactory>();
-	}
-    
+    /**
+     * Constructor.
+     */
+    public KeyedDefinitionsFactoryTilesContainer() {
+        key2definitionsFactory = new HashMap<String, DefinitionsFactory>();
+    }
+
     /**
      * It represents an object able to return a key from a request. Each key
      * maps a different {@link DefinitionsFactory}.
@@ -77,13 +76,13 @@
          */
         public String getDefinitionsFactoryKey(TilesRequestContext request);
     }
-    
+
     /**
      * This is the default factory key. Takes the key from the request-scoped
      * attribute <code>DEFINITIONS_FACTORY_KEY_ATTRIBUTE_NAME</code>.
      */
     protected class DefaultKeyExtractor implements KeyExtractor {
-        
+
         /**
          * Returns the definitions factory key.
          *
@@ -97,33 +96,34 @@
                 retValue = (String) requestScope.get(
                         DEFINITIONS_FACTORY_KEY_ATTRIBUTE_NAME);
             }
-            
+
             return retValue;
         }
     }
 
-	/**
-     * Standard Getter
+    /**
+     * Returns a definition factory given its key.
      *
      * @return the definitions factory used by this container. If the key is not
      * valid, the default factory will be returned.
      * @param key The key of the needed definitions factory.
      */
     public DefinitionsFactory getDefinitionsFactory(String key) {
-    	DefinitionsFactory retValue = null;
-    	
-    	if (key != null) {
-    		retValue = key2definitionsFactory.get(key);
-    	}
-    	if (retValue == null) {
-    		retValue = getDefinitionsFactory();
-    	}
-    	
-    	return retValue;
+        DefinitionsFactory retValue = null;
+
+        if (key != null) {
+            retValue = key2definitionsFactory.get(key);
+        }
+        if (retValue == null) {
+            retValue = getDefinitionsFactory();
+        }
+
+        return retValue;
     }
 
     /**
-     * Standard Getter
+     * Returns the proper definition factory for the given key, i.e. if the key
+     * is not present, <code>null</code> will be returned.
      *
      * @return the definitions factory used by this container. If the key is not
      * valid, <code>null</code> will be returned.
@@ -131,11 +131,11 @@
      */
     public DefinitionsFactory getProperDefinitionsFactory(String key) {
         DefinitionsFactory retValue = null;
-        
+
         if (key != null) {
             retValue = key2definitionsFactory.get(key);
         }
-        
+
         return retValue;
     }
 
@@ -143,7 +143,7 @@
      * Set the definitions factory. This method first ensures
      * that the container has not yet been initialized.
      *
-     * @param key The key under which the definitions factory is catalogued. 
+     * @param key The key under which the definitions factory is catalogued.
      * @param definitionsFactory the definitions factory for this instance.
      * @param initParameters The init parameters to configure the definitions
      * factory.
@@ -151,17 +151,17 @@
      * the definitions factory.
      */
     public void setDefinitionsFactory(String key,
-    		DefinitionsFactory definitionsFactory,
-    		Map<String, String> initParameters) throws TilesException {
-    	if (key != null) {
-	        key2definitionsFactory.put(key, definitionsFactory);
+            DefinitionsFactory definitionsFactory,
+            Map<String, String> initParameters) throws TilesException {
+        if (key != null) {
+            key2definitionsFactory.put(key, definitionsFactory);
             initializeDefinitionsFactory(definitionsFactory,
                     getResourceString(initParameters), initParameters);
-    	} else {
-    		setDefinitionsFactory(definitionsFactory);
-    	}
+        } else {
+            setDefinitionsFactory(definitionsFactory);
+        }
     }
-    
+
     /**
      * Sets the key extractor to use.
      *
@@ -190,7 +190,7 @@
         }
         return retValue;
     }
-    
+
     /**
      * Returns the definitions factory key.
      *
@@ -198,7 +198,6 @@
      * @return The needed factory key.
      */
     protected String getDefinitionsFactoryKey(TilesRequestContext request) {
-        
         if (keyExtractor == null) {
             keyExtractor = new DefaultKeyExtractor();
         }

Modified: tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/impl/mgmt/CachingKeyedDefinitionsFactoryTilesContainer.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/impl/mgmt/CachingKeyedDefinitionsFactoryTilesContainer.java?view=diff&rev=527536&r1=527535&r2=527536
==============================================================================
--- tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/impl/mgmt/CachingKeyedDefinitionsFactoryTilesContainer.java (original)
+++ tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/impl/mgmt/CachingKeyedDefinitionsFactoryTilesContainer.java Wed Apr 11 08:44:51 2007
@@ -17,7 +17,6 @@
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
- *
  */
 
 package org.apache.tiles.impl.mgmt;
@@ -56,7 +55,7 @@
      * The default definition manager, when no key is identified.
      */
     private DefinitionManager mgr = new DefinitionManager();
-    
+
     /**
      * Maps a key to its definition manager.
      */
@@ -113,7 +112,7 @@
         DefinitionManager mgr = getOrCreateDefinitionManager(key);
         mgr.setFactory(definitionsFactory);
     }
-    
+
     /**
      * Registers a custom definition.
      *
@@ -144,10 +143,10 @@
             mgr = new DefinitionManager(DEFINITIONS_ATTRIBUTE_NAME_BASE + key);
             key2definitionManager.put(key, mgr);
         }
-        
+
         return mgr;
     }
-    
+
     /**
      * Returns a definition manager if found.
      *
@@ -156,14 +155,14 @@
      */
     protected DefinitionManager getProperDefinitionManager(String key) {
         DefinitionManager mgr = null;
-        
+
         if (key != null) {
             mgr = key2definitionManager.get(key);
         }
         if (mgr == null) {
             mgr = this.mgr;
         }
-        
+
         return mgr;
     }
 }

Modified: tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/impl/mgmt/CachingTilesContainer.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/impl/mgmt/CachingTilesContainer.java?view=diff&rev=527536&r1=527535&r2=527536
==============================================================================
--- tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/impl/mgmt/CachingTilesContainer.java (original)
+++ tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/impl/mgmt/CachingTilesContainer.java Wed Apr 11 08:44:51 2007
@@ -17,7 +17,6 @@
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
- *
  */
 package org.apache.tiles.impl.mgmt;
 
@@ -76,7 +75,7 @@
         super.setDefinitionsFactory(definitionsFactory);
         mgr.setFactory(definitionsFactory);
     }
-    
+
     /**
      * Registers a custom definition.
      *

Modified: tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/impl/mgmt/DefinitionManager.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/impl/mgmt/DefinitionManager.java?view=diff&rev=527536&r1=527535&r2=527536
==============================================================================
--- tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/impl/mgmt/DefinitionManager.java (original)
+++ tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/impl/mgmt/DefinitionManager.java Wed Apr 11 08:44:51 2007
@@ -17,7 +17,6 @@
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
- *
  */
 package org.apache.tiles.impl.mgmt;
 
@@ -58,7 +57,7 @@
      * The definitions factory to use to get main definitions.
      */
     private DefinitionsFactory factory;
-    
+
     /**
      * The name of the attribute in which storing custom definitions.
      */
@@ -134,12 +133,12 @@
         throws DefinitionsFactoryException {
         validate(definition);
 
-        if(definition.isExtending()) {
+        if (definition.isExtending()) {
             this.resolveInheritance(definition, request);
         }
 
-        for(Attribute attr : definition.getAttributes().values()) {
-            if(isDefinition(attr, request)) {
+        for (Attribute attr : definition.getAttributes().values()) {
+            if (isDefinition(attr, request)) {
                 Definition d = getDefinition(attr.getValue().toString(), request);
                 attr.setAttributes(d.getAttributes());
             }
@@ -160,8 +159,8 @@
     private boolean isDefinition(Attribute attribute,
             TilesRequestContext request) throws DefinitionsFactoryException {
         boolean explicit =  Attribute.DEFINITION.equals(attribute.getType());
-        boolean implicit =  attribute.getType() == null  &&
-                            (getDefinition((String)attribute.getValue(), request) != null);
+        boolean implicit = attribute.getType() == null
+                && (getDefinition((String) attribute.getValue(), request) != null);
         return explicit || implicit;
     }
 
@@ -189,7 +188,7 @@
      * template.
      * Also copy attributes setted in parent, and not set in child
      * If instance doesn't extend anything, do nothing.
-     * 
+     *
      * @param definition The definition that needs to have its inheritances
      * resolved.
      * @param request The current request.
@@ -199,13 +198,15 @@
             TilesRequestContext request)
         throws DefinitionsFactoryException  {
         // Already done, or not needed ?
-        if (definition.isIsVisited() || !definition.isExtending())
+        if (definition.isIsVisited() || !definition.isExtending()) {
             return;
+        }
 
-        if (LOG.isDebugEnabled())
+        if (LOG.isDebugEnabled()) {
             LOG.debug("Resolve definition for child name='"
                 + definition.getName()
                 + "' extends='" + definition.getExtends() + "'.");
+        }
 
         // Set as visited to avoid endless recurisvity.
         definition.setIsVisited(true);
@@ -246,23 +247,25 @@
     protected void overload(Definition parent,
                             Definition child) {
         // Iterate on each parent's attribute and add it if not defined in child.
-        for(Map.Entry<String, Attribute> entry : parent.getAttributes().entrySet()) {
+        for (Map.Entry<String, Attribute> entry : parent.getAttributes().entrySet()) {
             if (!child.hasAttributeValue(entry.getKey())) {
                 child.putAttribute(entry.getKey(), new Attribute(entry.getValue()));
             }
         }
 
-        if (child.getTemplate() == null)
+        if (child.getTemplate() == null) {
             child.setTemplate(parent.getTemplate());
+        }
 
-        if (child.getRole() == null)
+        if (child.getRole() == null) {
             child.setRole(parent.getRole());
+        }
 
         if (child.getPreparer() == null) {
             child.setPreparer(parent.getPreparer());
         }
     }
-    
+
     /**
      * Returns the map with custom definitions for the current request.
      *
@@ -275,7 +278,7 @@
         return (Map<String, Definition>) request.getRequestScope()
                 .get(definitionsAttributeName);
     }
-    
+
     /**
      * Returns a map of type "definition name -> definition" and, if it has not
      * been defined before, creates one.

Modified: tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/listener/TilesListener.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/listener/TilesListener.java?view=diff&rev=527536&r1=527535&r2=527536
==============================================================================
--- tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/listener/TilesListener.java (original)
+++ tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/listener/TilesListener.java Wed Apr 11 08:44:51 2007
@@ -17,7 +17,6 @@
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
- *
  */
 package org.apache.tiles.listener;
 
@@ -50,7 +49,7 @@
      * Initialize the TilesContainer and place it
      * into service.
      *
-     * @param event
+     * @param event The intercepted event.
      */
     public void contextInitialized(ServletContextEvent event) {
         ServletContext servletContext = event.getServletContext();

Modified: tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/locale/LocaleResolver.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/locale/LocaleResolver.java?view=diff&rev=527536&r1=527535&r2=527536
==============================================================================
--- tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/locale/LocaleResolver.java (original)
+++ tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/locale/LocaleResolver.java Wed Apr 11 08:44:51 2007
@@ -17,7 +17,6 @@
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
- *
  */
 package org.apache.tiles.locale;
 
@@ -34,7 +33,7 @@
  * @version $Rev$ $Date$
  */
 public interface LocaleResolver {
-    
+
     /**
      * Initializes the <code>LocaleResolver</code> object. <p/> This method
      * must be called before the {@link #resolveLocale(TilesRequestContext)}

Modified: tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/locale/impl/DefaultLocaleResolver.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/locale/impl/DefaultLocaleResolver.java?view=diff&rev=527536&r1=527535&r2=527536
==============================================================================
--- tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/locale/impl/DefaultLocaleResolver.java (original)
+++ tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/locale/impl/DefaultLocaleResolver.java Wed Apr 11 08:44:51 2007
@@ -17,7 +17,6 @@
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
- *
  */
 package org.apache.tiles.locale.impl;
 
@@ -55,7 +54,7 @@
         if (retValue == null) {
             retValue = request.getRequestLocale();
         }
-        
+
         return retValue;
     }
 }

Modified: tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/preparer/BasicPreparerFactory.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/preparer/BasicPreparerFactory.java?view=diff&rev=527536&r1=527535&r2=527536
==============================================================================
--- tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/preparer/BasicPreparerFactory.java (original)
+++ tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/preparer/BasicPreparerFactory.java Wed Apr 11 08:44:51 2007
@@ -17,7 +17,6 @@
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
- *
  */
 package org.apache.tiles.preparer;
 

Modified: tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/preparer/NoSuchPreparerException.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/preparer/NoSuchPreparerException.java?view=diff&rev=527536&r1=527535&r2=527536
==============================================================================
--- tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/preparer/NoSuchPreparerException.java (original)
+++ tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/preparer/NoSuchPreparerException.java Wed Apr 11 08:44:51 2007
@@ -17,7 +17,6 @@
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
- *
  */
 package org.apache.tiles.preparer;
 

Modified: tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/preparer/PreparerException.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/preparer/PreparerException.java?view=diff&rev=527536&r1=527535&r2=527536
==============================================================================
--- tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/preparer/PreparerException.java (original)
+++ tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/preparer/PreparerException.java Wed Apr 11 08:44:51 2007
@@ -17,7 +17,6 @@
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
- *
  */
 package org.apache.tiles.preparer;
 

Modified: tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/preparer/PreparerFactory.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/preparer/PreparerFactory.java?view=diff&rev=527536&r1=527535&r2=527536
==============================================================================
--- tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/preparer/PreparerFactory.java (original)
+++ tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/preparer/PreparerFactory.java Wed Apr 11 08:44:51 2007
@@ -17,7 +17,6 @@
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
- *
  */
 package org.apache.tiles.preparer;
 

Modified: tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/preparer/ViewPreparer.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/preparer/ViewPreparer.java?view=diff&rev=527536&r1=527535&r2=527536
==============================================================================
--- tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/preparer/ViewPreparer.java (original)
+++ tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/preparer/ViewPreparer.java Wed Apr 11 08:44:51 2007
@@ -17,7 +17,6 @@
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
- *
  */
 package org.apache.tiles.preparer;
 
@@ -40,7 +39,7 @@
  * <ul>
  * <li>&lt;insert&gt;</li>
  * <li>&lt;definition&gt;</li>
- * <li>
+ * </ul>>
  *
  * @version $Rev$ $Date$
  */

Modified: tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/preparer/ViewPreparerSupport.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/preparer/ViewPreparerSupport.java?view=diff&rev=527536&r1=527535&r2=527536
==============================================================================
--- tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/preparer/ViewPreparerSupport.java (original)
+++ tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/preparer/ViewPreparerSupport.java Wed Apr 11 08:44:51 2007
@@ -17,7 +17,6 @@
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
- *
  */
 package org.apache.tiles.preparer;
 

Modified: tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/servlet/ServletContextAdapter.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/servlet/ServletContextAdapter.java?view=diff&rev=527536&r1=527535&r2=527536
==============================================================================
--- tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/servlet/ServletContextAdapter.java (original)
+++ tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/servlet/ServletContextAdapter.java Wed Apr 11 08:44:51 2007
@@ -17,23 +17,26 @@
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
- *
  */
 package org.apache.tiles.servlet;
 
-import javax.servlet.*;
-
+import java.io.InputStream;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.Enumeration;
 import java.util.Hashtable;
 import java.util.Set;
-import java.util.Enumeration;
-import java.net.URL;
-import java.net.MalformedURLException;
-import java.io.InputStream;
+
+import javax.servlet.RequestDispatcher;
+import javax.servlet.Servlet;
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletContext;
+import javax.servlet.ServletException;
 
 /**
  * Adapts a servlet config and a servlet context to become a unique servlet
  * context.
- * 
+ *
  * @version $Rev$ $Date$
  */
 @SuppressWarnings("deprecation")
@@ -236,7 +239,7 @@
 
         /** {@inheritDoc} */
         public Object nextElement() {
-            if(first.hasMoreElements()) {
+            if (first.hasMoreElements()) {
                 return first.nextElement();
             }
 

Modified: tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/servlet/TilesServlet.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/servlet/TilesServlet.java?view=diff&rev=527536&r1=527535&r2=527536
==============================================================================
--- tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/servlet/TilesServlet.java (original)
+++ tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/servlet/TilesServlet.java Wed Apr 11 08:44:51 2007
@@ -17,7 +17,6 @@
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
- *
  */
 package org.apache.tiles.servlet;
 
@@ -57,7 +56,7 @@
     /**
      * Creates an servlet context event starting for the servlet configuration
      * object.
-     * 
+     *
      * @return The servlet context event.
      */
     private ServletContextEvent createEvent() {

Modified: tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/util/ClassUtil.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/util/ClassUtil.java?view=diff&rev=527536&r1=527535&r2=527536
==============================================================================
--- tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/util/ClassUtil.java (original)
+++ tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/util/ClassUtil.java Wed Apr 11 08:44:51 2007
@@ -17,7 +17,6 @@
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
- *
  */
 package org.apache.tiles.util;
 
@@ -29,7 +28,13 @@
  *
  * @version $Rev$ $Date$
  */
-public class ClassUtil {
+public final class ClassUtil {
+
+    /**
+     * Constructor, private to avoid instantiation.
+     */
+    private ClassUtil() {
+    }
 
     /**
      * Returns an instance of the given class name, by calling the default
@@ -64,7 +69,7 @@
             Class<?> namedClass = Class.forName(className);
             return namedClass.newInstance();
         } catch (ClassNotFoundException e) {
-            if(returnNull) {
+            if (returnNull) {
                 return null;
             }
             throw new TilesException("Unable to resolve factory class: '" + className + "'");

Modified: tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/context/enhanced/EnhancedTilesApplicationContextTest.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/context/enhanced/EnhancedTilesApplicationContextTest.java?view=diff&rev=527536&r1=527535&r2=527536
==============================================================================
--- tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/context/enhanced/EnhancedTilesApplicationContextTest.java (original)
+++ tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/context/enhanced/EnhancedTilesApplicationContextTest.java Wed Apr 11 08:44:51 2007
@@ -10,14 +10,13 @@
  * with the License.  You may obtain a copy of the License at
  *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
- *
  */
 package org.apache.tiles.context.enhanced;
 
@@ -39,6 +38,11 @@
 public class EnhancedTilesApplicationContextTest extends TestCase {
 
     /**
+     * Number of properties container inside the test.properties file.
+     */
+    private static final int TEST_PROPERTIES_SIZE = 4;
+
+    /**
      * The root Tiles application context.
      */
     private TilesApplicationContext root;
@@ -71,10 +75,10 @@
             EasyMock.replay(root);
             Thread.currentThread().setContextClassLoader(new MockClassLoader());
 
-            assertEquals(4, context.getResources("test.properties").size());
+            assertEquals(TEST_PROPERTIES_SIZE, context.getResources(
+                    "test.properties").size());
             EasyMock.verify(root);
-        }
-        finally {
+        } finally {
             Thread.currentThread().setContextClassLoader(original);
         }
     }

Modified: tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/context/portlet/PortletTilesRequestContextTest.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/context/portlet/PortletTilesRequestContextTest.java?view=diff&rev=527536&r1=527535&r2=527536
==============================================================================
--- tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/context/portlet/PortletTilesRequestContextTest.java (original)
+++ tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/context/portlet/PortletTilesRequestContextTest.java Wed Apr 11 08:44:51 2007
@@ -17,7 +17,6 @@
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
- *
  */
 
 package org.apache.tiles.context.portlet;
@@ -28,7 +27,6 @@
 //import org.apache.shale.test.mock.MockPortletRequest;
 //import org.apache.shale.test.mock.MockPortletResponse;
 //import org.apache.shale.test.mock.MockPortletSession;
-import org.apache.tiles.TilesApplicationContext;
 import org.apache.tiles.context.TilesRequestContext;
 
 import junit.framework.TestCase;

Modified: tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/context/servlet/ServletTilesRequestContextTest.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/context/servlet/ServletTilesRequestContextTest.java?view=diff&rev=527536&r1=527535&r2=527536
==============================================================================
--- tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/context/servlet/ServletTilesRequestContextTest.java (original)
+++ tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/context/servlet/ServletTilesRequestContextTest.java Wed Apr 11 08:44:51 2007
@@ -17,7 +17,6 @@
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
- *
  */
 
 package org.apache.tiles.context.servlet;



Mime
View raw message