myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lu4...@apache.org
Subject svn commit: r1200044 [7/7] - in /myfaces/core/trunk/shared/src/main/java/org/apache/myfaces/shared: application/ component/ config/ context/flash/ renderkit/ renderkit/html/ renderkit/html/util/ resource/ taglib/ test/ util/ util/el/ util/servlet/ view...
Date Wed, 09 Nov 2011 23:44:04 GMT
Modified: myfaces/core/trunk/shared/src/main/java/org/apache/myfaces/shared/util/el/ActionsMap.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/shared/src/main/java/org/apache/myfaces/shared/util/el/ActionsMap.java?rev=1200044&r1=1200043&r2=1200044&view=diff
==============================================================================
--- myfaces/core/trunk/shared/src/main/java/org/apache/myfaces/shared/util/el/ActionsMap.java
(original)
+++ myfaces/core/trunk/shared/src/main/java/org/apache/myfaces/shared/util/el/ActionsMap.java
Wed Nov  9 23:44:02 2011
@@ -45,15 +45,18 @@ import java.util.Set;
  * JSF page :
  * <h:selectBooleanCheckbox value="#{inboxFace.removeEmailUnid[email.unid]}"/>
  */
-public abstract class ActionsMap implements Map {
+public abstract class ActionsMap implements Map
+{
 
     private Set keys;
 
-    public ActionsMap(){
+    public ActionsMap()
+    {
         // NoOp
     }
 
-    public ActionsMap(Set keys){
+    public ActionsMap(Set keys)
+    {
         this.keys = keys;
     }
 
@@ -62,19 +65,23 @@ public abstract class ActionsMap impleme
      */
     public abstract void performAction(String command);
 
-    public int size() {
+    public int size()
+    {
         return keys.size();
     }
 
-    public boolean isEmpty() {
+    public boolean isEmpty()
+    {
         return keys.isEmpty();
     }
 
-    public boolean containsKey(Object key) {
+    public boolean containsKey(Object key)
+    {
         return keys.contains( key );
     }
 
-    public boolean containsValue(Object value) {
+    public boolean containsValue(Object value)
+    {
         if( ! (value instanceof Boolean) )
         {
             return false;
@@ -82,11 +89,13 @@ public abstract class ActionsMap impleme
         return ((Boolean)value).booleanValue();
     }
 
-    public Object get( Object key) {
+    public Object get( Object key)
+    {
         return Boolean.FALSE;
     }
 
-    public Boolean put(String key, Boolean value) {
+    public Boolean put(String key, Boolean value)
+    {
         if( value!=null && value.booleanValue() )
         {
             performAction(key);
@@ -94,7 +103,8 @@ public abstract class ActionsMap impleme
         return Boolean.FALSE;
     }
 
-    public Object remove(Object key) {
+    public Object remove(Object key)
+    {
         if( keys.remove( key ) )
         {
             return Boolean.FALSE;
@@ -102,7 +112,8 @@ public abstract class ActionsMap impleme
         return null;
     }
 
-    public void putAll(Map map) {
+    public void putAll(Map map)
+    {
         Iterator it = map.entrySet().iterator();
 
         while (it.hasNext())
@@ -116,19 +127,23 @@ public abstract class ActionsMap impleme
         }
     }
 
-    public void clear() {
+    public void clear()
+    {
         keys.clear();
     }
 
-    public Set keySet() {
+    public Set keySet()
+    {
         return keys;
     }
 
-    public Collection values() {
+    public Collection values()
+    {
         return Collections.nCopies(keys.size(), Boolean.FALSE);
     }
 
-    public Set entrySet() {
+    public Set entrySet()
+    {
         Set set = new HashSet( keys.size() );
 
         Iterator it = keys.iterator();
@@ -142,25 +157,31 @@ public abstract class ActionsMap impleme
         return set;
     }
 
-    private class CommandEntry implements Entry{
+    private class CommandEntry implements Entry
+    {
 
         private final String command;
         private boolean commandPerformed = false;
 
-        public CommandEntry(String command){
+        public CommandEntry(String command)
+        {
             this.command = command;
         }
 
-        public Object getKey() {
+        public Object getKey()
+        {
             return command;
         }
 
-        public Object getValue() {
+        public Object getValue()
+        {
             return Boolean.valueOf(commandPerformed);
         }
 
-        public Object setValue(Object performCommand) {
-            if( (performCommand instanceof Boolean) && ((Boolean)performCommand).booleanValue()
){
+        public Object setValue(Object performCommand)
+        {
+            if( (performCommand instanceof Boolean) && ((Boolean)performCommand).booleanValue()
)
+            {
                 performAction( command );
                 commandPerformed = true;
             }

Modified: myfaces/core/trunk/shared/src/main/java/org/apache/myfaces/shared/util/el/GenericMap.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/shared/src/main/java/org/apache/myfaces/shared/util/el/GenericMap.java?rev=1200044&r1=1200043&r2=1200044&view=diff
==============================================================================
--- myfaces/core/trunk/shared/src/main/java/org/apache/myfaces/shared/util/el/GenericMap.java
(original)
+++ myfaces/core/trunk/shared/src/main/java/org/apache/myfaces/shared/util/el/GenericMap.java
Wed Nov  9 23:44:02 2011
@@ -18,67 +18,80 @@
  */
 package org.apache.myfaces.shared.util.el;
 
+import java.util.Collection;
 import java.util.Map;
 import java.util.Set;
-import java.util.Collection;
 
 /**
  * @author Sylvain Vieujot (latest modification by $Author$)
  * @version $Revision$ $Date$
  *
  */
-public abstract class GenericMap implements Map {
+public abstract class GenericMap implements Map
+{
 
     /**
      * This method should return the result of the test.
      */
     protected abstract Object getValue(Object key);
 
-    public int size() {
+    public int size()
+    {
         return 1;
     }
 
-    public boolean isEmpty() {
+    public boolean isEmpty()
+    {
         return false;
     }
 
-    public boolean containsKey(Object key) {
+    public boolean containsKey(Object key)
+    {
         return true;
     }
 
-    public boolean containsValue(Object value) {
+    public boolean containsValue(Object value)
+    {
         return value instanceof Boolean;
     }
 
-    public Object get(Object key) {
+    public Object get(Object key)
+    {
         return getValue(key);
     }
 
-    public Object put(Object key, Object value) {
+    public Object put(Object key, Object value)
+    {
         return null;
     }
 
-    public Object remove(Object key) {
+    public Object remove(Object key)
+    {
         return null;
     }
 
-    public void putAll(Map m) {
+    public void putAll(Map m)
+    {
         // NoOp
     }
 
-    public void clear() {
+    public void clear()
+    {
         // NoOp
     }
 
-    public Set keySet() {
+    public Set keySet()
+    {
         return null;
     }
 
-    public Collection values() {
+    public Collection values()
+    {
         return null;
     }
 
-    public Set entrySet() {
+    public Set entrySet()
+    {
         return null;
     }
 }

Modified: myfaces/core/trunk/shared/src/main/java/org/apache/myfaces/shared/util/el/StringMap.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/shared/src/main/java/org/apache/myfaces/shared/util/el/StringMap.java?rev=1200044&r1=1200043&r2=1200044&view=diff
==============================================================================
--- myfaces/core/trunk/shared/src/main/java/org/apache/myfaces/shared/util/el/StringMap.java
(original)
+++ myfaces/core/trunk/shared/src/main/java/org/apache/myfaces/shared/util/el/StringMap.java
Wed Nov  9 23:44:02 2011
@@ -18,7 +18,6 @@
  */
 package org.apache.myfaces.shared.util.el;
 
-import org.apache.myfaces.shared.util.el.GenericMap;
 
 /**
  * You can use this class to perform tests.
@@ -28,18 +27,21 @@ import org.apache.myfaces.shared.util.el
  * @version $Revision$ $Date$
  *
  */
-public abstract class StringMap extends GenericMap {
+public abstract class StringMap extends GenericMap
+{
 
     /**
      * This method should return the result of the test.
      */
     public abstract String getString(String testKey);
 
-    public Object getValue(Object testKey){
+    public Object getValue(Object testKey)
+    {
         return getString( (String) testKey );
     }
 
-    public Object get(Object key) {
+    public Object get(Object key)
+    {
         if( ! (key instanceof String) )
         {
             return null;

Modified: myfaces/core/trunk/shared/src/main/java/org/apache/myfaces/shared/util/el/TestsMap.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/shared/src/main/java/org/apache/myfaces/shared/util/el/TestsMap.java?rev=1200044&r1=1200043&r2=1200044&view=diff
==============================================================================
--- myfaces/core/trunk/shared/src/main/java/org/apache/myfaces/shared/util/el/TestsMap.java
(original)
+++ myfaces/core/trunk/shared/src/main/java/org/apache/myfaces/shared/util/el/TestsMap.java
Wed Nov  9 23:44:02 2011
@@ -18,7 +18,6 @@
  */
 package org.apache.myfaces.shared.util.el;
 
-import org.apache.myfaces.shared.util.el.GenericMap;
 
 /**
  * You can use this class to perform tests.
@@ -27,18 +26,21 @@ import org.apache.myfaces.shared.util.el
  * @author Sylvain Vieujot (latest modification by $Author$)
  * @version $Revision$ $Date$
  */
-public abstract class TestsMap extends GenericMap {
+public abstract class TestsMap extends GenericMap
+{
 
     /**
      * This method should return the result of the test.
      */
     public abstract boolean getTest(String testKey);
 
-    protected Object getValue(Object testKey){
+    protected Object getValue(Object testKey)
+    {
         return Boolean.valueOf(getTest( (String) testKey ));
     }
 
-    public Object get(Object key) {
+    public Object get(Object key)
+    {
         if( ! (key instanceof String) )
         {
             return null;
@@ -46,7 +48,8 @@ public abstract class TestsMap extends G
         return Boolean.valueOf(getTest( (String)key ));
     }
 
-    public Boolean put(String key, Boolean value) {
+    public Boolean put(String key, Boolean value)
+    {
         return Boolean.FALSE;
     }
 }

Modified: myfaces/core/trunk/shared/src/main/java/org/apache/myfaces/shared/util/servlet/SourceCodeServlet.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/shared/src/main/java/org/apache/myfaces/shared/util/servlet/SourceCodeServlet.java?rev=1200044&r1=1200043&r2=1200044&view=diff
==============================================================================
--- myfaces/core/trunk/shared/src/main/java/org/apache/myfaces/shared/util/servlet/SourceCodeServlet.java
(original)
+++ myfaces/core/trunk/shared/src/main/java/org/apache/myfaces/shared/util/servlet/SourceCodeServlet.java
Wed Nov  9 23:44:02 2011
@@ -18,15 +18,16 @@
  */
 package org.apache.myfaces.shared.util.servlet;
 
+import java.io.BufferedInputStream;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+
 import javax.servlet.ServletException;
 import javax.servlet.ServletOutputStream;
 import javax.servlet.http.HttpServlet;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
-import java.io.BufferedInputStream;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
 
 public class SourceCodeServlet extends HttpServlet 
 {
@@ -61,7 +62,8 @@ public class SourceCodeServlet extends H
                 out.print((char)ch);
             }
         }
-        finally {
+        finally
+        {
             if (in != null)
             {
                 in.close();  // very important

Modified: myfaces/core/trunk/shared/src/main/java/org/apache/myfaces/shared/view/JspViewDeclarationLanguageBase.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/shared/src/main/java/org/apache/myfaces/shared/view/JspViewDeclarationLanguageBase.java?rev=1200044&r1=1200043&r2=1200044&view=diff
==============================================================================
--- myfaces/core/trunk/shared/src/main/java/org/apache/myfaces/shared/view/JspViewDeclarationLanguageBase.java
(original)
+++ myfaces/core/trunk/shared/src/main/java/org/apache/myfaces/shared/view/JspViewDeclarationLanguageBase.java
Wed Nov  9 23:44:02 2011
@@ -22,7 +22,6 @@ import java.beans.BeanInfo;
 import java.io.IOException;
 import java.io.StringWriter;
 import java.io.Writer;
-import java.net.MalformedURLException;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
@@ -153,7 +152,8 @@ public abstract class JspViewDeclaration
       // handle character encoding as of section 2.5.2.2 of JSF 1.1
       if(null != externalContext.getSession(false))
       {
-        externalContext.getSessionMap().put(ViewHandler.CHARACTER_ENCODING_KEY, externalContext.getResponseCharacterEncoding());
+        externalContext.getSessionMap().put(ViewHandler.CHARACTER_ENCODING_KEY, 
+                externalContext.getResponseCharacterEncoding());
       }
   
       // render the view in this method (since JSF 1.2)
@@ -163,7 +163,8 @@ public abstract class JspViewDeclaration
       ResponseWriter responseWriter = context.getResponseWriter();
       if (responseWriter == null)
       {
-          responseWriter = renderKit.createResponseWriter(externalContext.getResponseOutputWriter(),
null, externalContext.getRequestCharacterEncoding());
+          responseWriter = renderKit.createResponseWriter(externalContext.getResponseOutputWriter(),

+                  null, externalContext.getRequestCharacterEncoding());
           context.setResponseWriter(responseWriter);
       }
       
@@ -233,7 +234,8 @@ public abstract class JspViewDeclaration
       // afterViewTagResponse is null if the current request is a partial request
       if (afterViewTagResponse != null)
       {
-          afterViewTagResponse.flushToWriter(externalContext.getResponseOutputWriter(), externalContext.getResponseCharacterEncoding());
+          afterViewTagResponse.flushToWriter(externalContext.getResponseOutputWriter(), 
+                  externalContext.getResponseCharacterEncoding());
       }
   
       //TODO sobryan: Is this right?
@@ -323,7 +325,8 @@ public abstract class JspViewDeclaration
     }
   }
   
-  protected void writePartialBuffer(StringBuffer contentBuffer, int beginIndex, int endIndex,
Writer writer) throws IOException
+  protected void writePartialBuffer(StringBuffer contentBuffer, int beginIndex, 
+          int endIndex, Writer writer) throws IOException
   {
     int index = beginIndex;
     int bufferSize = 2048;

Modified: myfaces/core/trunk/shared/src/main/java/org/apache/myfaces/shared/webapp/webxml/WebXml.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/shared/src/main/java/org/apache/myfaces/shared/webapp/webxml/WebXml.java?rev=1200044&r1=1200043&r2=1200044&view=diff
==============================================================================
--- myfaces/core/trunk/shared/src/main/java/org/apache/myfaces/shared/webapp/webxml/WebXml.java
(original)
+++ myfaces/core/trunk/shared/src/main/java/org/apache/myfaces/shared/webapp/webxml/WebXml.java
Wed Nov  9 23:44:02 2011
@@ -144,9 +144,10 @@ public class WebXml
                     for (Iterator it2 = urlPatterns.iterator(); it2.hasNext(); )
                     {
                         String urlpattern = (String)it2.next();
-                        tempFacesServletMappings.add(new org.apache.myfaces.shared.webapp.webxml.ServletMapping(servletName,
-                                                                                        
                    servletClass,
-                                                                                        
                    urlpattern));
+                        tempFacesServletMappings.add(
+                                new org.apache.myfaces.shared.webapp.webxml.ServletMapping(servletName,
+                                                                                        
  servletClass,
+                                                                                        
  urlpattern));
                         if (log.isLoggable(Level.FINEST))
                         {
                             log.finest("adding mapping for servlet + " + servletName + "
urlpattern = " + urlpattern);
@@ -247,9 +248,11 @@ public class WebXml
 
     protected boolean isOld(ExternalContext context)
     {
-        if (refreshPeriod > 0) {
+        if (refreshPeriod > 0)
+        {
             long ttl = this.parsingTime + refreshPeriod;
-            if (System.currentTimeMillis() > ttl) {
+            if (System.currentTimeMillis() > ttl)
+            {
                 long lastModified = WebXmlParser.getWebXmlLastModified(context);
                 return lastModified == 0 || lastModified > ttl;
             }
@@ -287,7 +290,8 @@ public class WebXml
 
     public static void update(ExternalContext context)
     {
-        if (getWebXml(context).isOld(context)){
+        if (getWebXml(context).isOld(context))
+        {
             WebXml.init(context);
         }
     }

Modified: myfaces/core/trunk/shared/src/main/java/org/apache/myfaces/shared/webapp/webxml/WebXmlParser.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/shared/src/main/java/org/apache/myfaces/shared/webapp/webxml/WebXmlParser.java?rev=1200044&r1=1200043&r2=1200044&view=diff
==============================================================================
--- myfaces/core/trunk/shared/src/main/java/org/apache/myfaces/shared/webapp/webxml/WebXmlParser.java
(original)
+++ myfaces/core/trunk/shared/src/main/java/org/apache/myfaces/shared/webapp/webxml/WebXmlParser.java
Wed Nov  9 23:44:02 2011
@@ -120,13 +120,16 @@ public class WebXmlParser
 
     public static long getWebXmlLastModified(ExternalContext context)
     {
-        try {
+        try
+        {
             URL url = context.getResource(WEB_XML_PATH);
             if (url != null)
             {
                 return url.openConnection().getLastModified();
             }
-        } catch (IOException e) {
+        }
+        catch (IOException e)
+        {
             log.log(Level.SEVERE, "Could not find web.xml in path " + WEB_XML_PATH);
         }
         return 0L;
@@ -255,7 +258,8 @@ public class WebXmlParser
                 {
                     servletClass = org.apache.myfaces.shared.util.xml.XmlUtils.getElementText((Element)n).trim();
                 }
-                else if (n.getNodeName().equals("description") || n.getNodeName().equals("load-on-startup")
|| n.getNodeName().equals("init-param"))
+                else if (n.getNodeName().equals("description") || n.getNodeName().equals("load-on-startup")

+                        || n.getNodeName().equals("init-param"))
                 {
                     //ignore
                 }
@@ -263,7 +267,8 @@ public class WebXmlParser
                 {
                     if (log.isLoggable(Level.FINE))
                     {
-                        log.fine("Ignored element '" + n.getNodeName() + "' as child of '"
+ servletElem.getNodeName() + "'.");
+                        log.fine("Ignored element '" + n.getNodeName() + "' as child of '"
+ 
+                                servletElem.getNodeName() + "'.");
                     }
                 }
             }
@@ -301,7 +306,8 @@ public class WebXmlParser
                 {
                     if (log.isLoggable(Level.FINE))
                     {
-                        log.fine("Ignored element '" + n.getNodeName() + "' as child of '"
+ servletMappingElem.getNodeName() + "'.");
+                        log.fine("Ignored element '" + n.getNodeName() + "' as child of '"
+ 
+                                servletMappingElem.getNodeName() + "'.");
                     }
                 }
             }
@@ -343,7 +349,8 @@ public class WebXmlParser
                 {
                     if (log.isLoggable(Level.FINE))
                     {
-                        log.fine("Ignored element '" + n.getNodeName() + "' as child of '"
+ filterElem.getNodeName() + "'.");
+                        log.fine("Ignored element '" + n.getNodeName() + "' as child of '"
+ 
+                                filterElem.getNodeName() + "'.");
                     }
                 }
             }
@@ -385,7 +392,8 @@ public class WebXmlParser
                 {
                     if (log.isLoggable(Level.FINE))
                     {
-                        log.fine("Ignored element '" + n.getNodeName() + "' as child of '"
+ filterMappingElem.getNodeName() + "'.");
+                        log.fine("Ignored element '" + n.getNodeName() + "' as child of '"
+ 
+                                filterMappingElem.getNodeName() + "'.");
                     }
                 }
             }



Mime
View raw message