You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by sk...@apache.org on 2008/07/04 00:17:37 UTC

svn commit: r673850 - in /myfaces/orchestra/branches/prepare_core12/src/main/java/org/apache/myfaces/orchestra: conversation/ conversation/jsf/components/facelets/ frameworkAdapter/ lib/jsf/

Author: skitching
Date: Thu Jul  3 15:17:36 2008
New Revision: 673850

URL: http://svn.apache.org/viewvc?rev=673850&view=rev
Log:
Tabs to spaces only

Modified:
    myfaces/orchestra/branches/prepare_core12/src/main/java/org/apache/myfaces/orchestra/conversation/Conversation.java
    myfaces/orchestra/branches/prepare_core12/src/main/java/org/apache/myfaces/orchestra/conversation/ConversationManager.java
    myfaces/orchestra/branches/prepare_core12/src/main/java/org/apache/myfaces/orchestra/conversation/jsf/components/facelets/ConverterTagHandler.java
    myfaces/orchestra/branches/prepare_core12/src/main/java/org/apache/myfaces/orchestra/frameworkAdapter/FrameworkAdapter.java
    myfaces/orchestra/branches/prepare_core12/src/main/java/org/apache/myfaces/orchestra/lib/jsf/SerializableConverter.java
    myfaces/orchestra/branches/prepare_core12/src/main/java/org/apache/myfaces/orchestra/lib/jsf/_FacesContextWrapper.java

Modified: myfaces/orchestra/branches/prepare_core12/src/main/java/org/apache/myfaces/orchestra/conversation/Conversation.java
URL: http://svn.apache.org/viewvc/myfaces/orchestra/branches/prepare_core12/src/main/java/org/apache/myfaces/orchestra/conversation/Conversation.java?rev=673850&r1=673849&r2=673850&view=diff
==============================================================================
--- myfaces/orchestra/branches/prepare_core12/src/main/java/org/apache/myfaces/orchestra/conversation/Conversation.java (original)
+++ myfaces/orchestra/branches/prepare_core12/src/main/java/org/apache/myfaces/orchestra/conversation/Conversation.java Thu Jul  3 15:17:36 2008
@@ -471,7 +471,7 @@
     {
         synchronized(conversationContext)
         {
-        	return beans;
+            return beans;
         }
     }
     
@@ -485,7 +485,7 @@
     {
         synchronized(conversationContext)
         {
-        	this.beans = beans;
+            this.beans = beans;
         }
     }
 }

Modified: myfaces/orchestra/branches/prepare_core12/src/main/java/org/apache/myfaces/orchestra/conversation/ConversationManager.java
URL: http://svn.apache.org/viewvc/myfaces/orchestra/branches/prepare_core12/src/main/java/org/apache/myfaces/orchestra/conversation/ConversationManager.java?rev=673850&r1=673849&r2=673850&view=diff
==============================================================================
--- myfaces/orchestra/branches/prepare_core12/src/main/java/org/apache/myfaces/orchestra/conversation/ConversationManager.java (original)
+++ myfaces/orchestra/branches/prepare_core12/src/main/java/org/apache/myfaces/orchestra/conversation/ConversationManager.java Thu Jul  3 15:17:36 2008
@@ -265,7 +265,7 @@
      * Make the specific context the current context for the current HTTP session.
      * <p>
      * Methods like getCurrentConversationContext will then return the specified
-	 * context object.
+     * context object.
      * 
      * @since 1.2
      */

Modified: myfaces/orchestra/branches/prepare_core12/src/main/java/org/apache/myfaces/orchestra/conversation/jsf/components/facelets/ConverterTagHandler.java
URL: http://svn.apache.org/viewvc/myfaces/orchestra/branches/prepare_core12/src/main/java/org/apache/myfaces/orchestra/conversation/jsf/components/facelets/ConverterTagHandler.java?rev=673850&r1=673849&r2=673850&view=diff
==============================================================================
--- myfaces/orchestra/branches/prepare_core12/src/main/java/org/apache/myfaces/orchestra/conversation/jsf/components/facelets/ConverterTagHandler.java (original)
+++ myfaces/orchestra/branches/prepare_core12/src/main/java/org/apache/myfaces/orchestra/conversation/jsf/components/facelets/ConverterTagHandler.java Thu Jul  3 15:17:36 2008
@@ -37,51 +37,51 @@
 
 public class ConverterTagHandler extends TagHandler
 {
-	private final TagAttribute beanName;
-	private final TagAttribute useWrapper;
+    private final TagAttribute beanName;
+    private final TagAttribute useWrapper;
 
-	public ConverterTagHandler(TagConfig config)
-	{
-		super(config);
-		beanName = getRequiredAttribute("beanName"); // NON-NLS
-		useWrapper = getAttribute("useWrapper"); // NON-NLS
-	}
-
-	public void apply(FaceletContext faceletContext, UIComponent parent) throws IOException, FacesException, FaceletException, ELException
-	{
-		if (parent.getParent() == null)
-		{
-			if (parent instanceof EditableValueHolder)
-			{
-				Converter converter = createConverter(beanName.getValue());
-
-				if (useWrapper == null || !"false".equals(useWrapper.getValue()) &&
-					!(converter instanceof SerializableConverter))
-				{
-					// Needed to check if it is already of the specified type in case the
-					// managed-bean framework has been configured to auto-wrap Converter
-					// instances already (eg via a Spring BeanPostProcessor or equivalent).
-					// This isn't the case, so wrap it now.
-					converter = new SerializableConverter(beanName.getValue(), converter);
-				}
-
-				((EditableValueHolder) parent).setConverter(converter);
-			}
-			else
-			{
-				throw new FacesException("parent is not an EditableValueHolder");
-			}
-		}
-	}
-
-	/**
-	 * Override this method in order to customise the bean instance.
-	 */
-	protected static Converter createConverter(String beanName)
-	{
-		FacesContext facesContext = FacesContext.getCurrentInstance();
-		Application application = facesContext.getApplication();
-		Object converter = application.getVariableResolver().resolveVariable(facesContext, beanName);
-		return (Converter) converter;
-	}
+    public ConverterTagHandler(TagConfig config)
+    {
+        super(config);
+        beanName = getRequiredAttribute("beanName"); // NON-NLS
+        useWrapper = getAttribute("useWrapper"); // NON-NLS
+    }
+
+    public void apply(FaceletContext faceletContext, UIComponent parent) throws IOException, FacesException, FaceletException, ELException
+    {
+        if (parent.getParent() == null)
+        {
+            if (parent instanceof EditableValueHolder)
+            {
+                Converter converter = createConverter(beanName.getValue());
+
+                if (useWrapper == null || !"false".equals(useWrapper.getValue()) &&
+                    !(converter instanceof SerializableConverter))
+                {
+                    // Needed to check if it is already of the specified type in case the
+                    // managed-bean framework has been configured to auto-wrap Converter
+                    // instances already (eg via a Spring BeanPostProcessor or equivalent).
+                    // This isn't the case, so wrap it now.
+                    converter = new SerializableConverter(beanName.getValue(), converter);
+                }
+
+                ((EditableValueHolder) parent).setConverter(converter);
+            }
+            else
+            {
+                throw new FacesException("parent is not an EditableValueHolder");
+            }
+        }
+    }
+
+    /**
+     * Override this method in order to customise the bean instance.
+     */
+    protected static Converter createConverter(String beanName)
+    {
+        FacesContext facesContext = FacesContext.getCurrentInstance();
+        Application application = facesContext.getApplication();
+        Object converter = application.getVariableResolver().resolveVariable(facesContext, beanName);
+        return (Converter) converter;
+    }
 }

Modified: myfaces/orchestra/branches/prepare_core12/src/main/java/org/apache/myfaces/orchestra/frameworkAdapter/FrameworkAdapter.java
URL: http://svn.apache.org/viewvc/myfaces/orchestra/branches/prepare_core12/src/main/java/org/apache/myfaces/orchestra/frameworkAdapter/FrameworkAdapter.java?rev=673850&r1=673849&r2=673850&view=diff
==============================================================================
--- myfaces/orchestra/branches/prepare_core12/src/main/java/org/apache/myfaces/orchestra/frameworkAdapter/FrameworkAdapter.java (original)
+++ myfaces/orchestra/branches/prepare_core12/src/main/java/org/apache/myfaces/orchestra/frameworkAdapter/FrameworkAdapter.java Thu Jul  3 15:17:36 2008
@@ -231,6 +231,6 @@
      */
     public String getCurrentViewId()
     {
-    	return "defaultView";
+        return "defaultView";
     }
 }

Modified: myfaces/orchestra/branches/prepare_core12/src/main/java/org/apache/myfaces/orchestra/lib/jsf/SerializableConverter.java
URL: http://svn.apache.org/viewvc/myfaces/orchestra/branches/prepare_core12/src/main/java/org/apache/myfaces/orchestra/lib/jsf/SerializableConverter.java?rev=673850&r1=673849&r2=673850&view=diff
==============================================================================
--- myfaces/orchestra/branches/prepare_core12/src/main/java/org/apache/myfaces/orchestra/lib/jsf/SerializableConverter.java (original)
+++ myfaces/orchestra/branches/prepare_core12/src/main/java/org/apache/myfaces/orchestra/lib/jsf/SerializableConverter.java Thu Jul  3 15:17:36 2008
@@ -152,7 +152,7 @@
             
             if (converterState != null)
             {
-            	// see method restoreState
+                // see method restoreState
                 ((StateHolder) converter).restoreState(context, converterState);
 
                 // state no longer needed
@@ -188,23 +188,23 @@
 
         if (state.length == 2)
         {
-        	// Ok, the converter must be a StateHolder...
-        	//
-	    	// Ideally here we would just call getConverter() to obtain a converter
-        	// instance, then invoke its restoreState method immediately. However
-        	// there is a problem with that; in most cases the Converter instance
-        	// will be in view-controller scope, which means that the proxy created
-        	// for it needs to look up the bean that is the controller for the current
-        	// view and then map the bean into the same conversation as that bean.
-        	// Unfortunately looking up the controller for the current view requires
-        	// knowing the current viewId; that is available on the UIViewRoot object
-        	// - but the UIViewRoot doesn't exist yet as we are currently part-way
-        	// through the restore-view phase.
-	        //
-	        // The solution is ugly but effective: avoid calling getConverter here and
-        	// instead save the state data for later; on the first call to getConverter
-        	// do the state restoring then.
-	        converterState = (Object[]) state[1];
+            // Ok, the converter must be a StateHolder...
+            //
+            // Ideally here we would just call getConverter() to obtain a converter
+            // instance, then invoke its restoreState method immediately. However
+            // there is a problem with that; in most cases the Converter instance
+            // will be in view-controller scope, which means that the proxy created
+            // for it needs to look up the bean that is the controller for the current
+            // view and then map the bean into the same conversation as that bean.
+            // Unfortunately looking up the controller for the current view requires
+            // knowing the current viewId; that is available on the UIViewRoot object
+            // - but the UIViewRoot doesn't exist yet as we are currently part-way
+            // through the restore-view phase.
+            //
+            // The solution is ugly but effective: avoid calling getConverter here and
+            // instead save the state data for later; on the first call to getConverter
+            // do the state restoring then.
+            converterState = (Object[]) state[1];
         }
     }
 

Modified: myfaces/orchestra/branches/prepare_core12/src/main/java/org/apache/myfaces/orchestra/lib/jsf/_FacesContextWrapper.java
URL: http://svn.apache.org/viewvc/myfaces/orchestra/branches/prepare_core12/src/main/java/org/apache/myfaces/orchestra/lib/jsf/_FacesContextWrapper.java?rev=673850&r1=673849&r2=673850&view=diff
==============================================================================
--- myfaces/orchestra/branches/prepare_core12/src/main/java/org/apache/myfaces/orchestra/lib/jsf/_FacesContextWrapper.java (original)
+++ myfaces/orchestra/branches/prepare_core12/src/main/java/org/apache/myfaces/orchestra/lib/jsf/_FacesContextWrapper.java Thu Jul  3 15:17:36 2008
@@ -224,39 +224,39 @@
      */
     public final ELContext getELContext()
     {
-    	// Here, we cannot call getELContext on FacesContext as it does not
-    	// exist for JSF1.1; the solution is to use reflection instead. This
-    	// method will never be called unless we are in a JSF1.2 environment
-    	// so the target method will always exist when this is called.
-    	try
-    	{
-    		if (methodGetELContext == null)
-    		{
-    			// Performance optimisation: find method, and cache it for later.
-    			methodGetELContext = FacesContext.class.getDeclaredMethod("getELContext", (Class[]) null);
-    		}
-    		return (ELContext) methodGetELContext.invoke(_facesContext, (Object[]) null);
-    	}
-    	catch(NoSuchMethodException e)
-    	{
-    		// should never happen
-    		Log log = LogFactory.getLog(this.getClass());
-    		log.error("JSF1.2 method invoked in non-JSF-1.2 environment", e);
-    		throw new IllegalStateException("JSF1.2 method invoked in non-JSF-1.2 environment");
-    	}
-    	catch(InvocationTargetException e)
-    	{
-    		// should never happen
-    		Log log = LogFactory.getLog(this.getClass());
-    		log.error("Method getELContext on wrapped instance threw exception", e);
-    		throw new IllegalStateException("Method getELContext on wrapped instance threw exception");
-    	}
-    	catch(IllegalAccessException e)
-    	{
-    		// should never happen
-    		Log log = LogFactory.getLog(this.getClass());
-    		log.error("Method getElContext on wrapped instance is not accessable", e);
-    		throw new IllegalStateException("Method getElContext on wrapped instance is not accessable");
-    	}
+        // Here, we cannot call getELContext on FacesContext as it does not
+        // exist for JSF1.1; the solution is to use reflection instead. This
+        // method will never be called unless we are in a JSF1.2 environment
+        // so the target method will always exist when this is called.
+        try
+        {
+            if (methodGetELContext == null)
+            {
+                // Performance optimisation: find method, and cache it for later.
+                methodGetELContext = FacesContext.class.getDeclaredMethod("getELContext", (Class[]) null);
+            }
+            return (ELContext) methodGetELContext.invoke(_facesContext, (Object[]) null);
+        }
+        catch(NoSuchMethodException e)
+        {
+            // should never happen
+            Log log = LogFactory.getLog(this.getClass());
+            log.error("JSF1.2 method invoked in non-JSF-1.2 environment", e);
+            throw new IllegalStateException("JSF1.2 method invoked in non-JSF-1.2 environment");
+        }
+        catch(InvocationTargetException e)
+        {
+            // should never happen
+            Log log = LogFactory.getLog(this.getClass());
+            log.error("Method getELContext on wrapped instance threw exception", e);
+            throw new IllegalStateException("Method getELContext on wrapped instance threw exception");
+        }
+        catch(IllegalAccessException e)
+        {
+            // should never happen
+            Log log = LogFactory.getLog(this.getClass());
+            log.error("Method getElContext on wrapped instance is not accessable", e);
+            throw new IllegalStateException("Method getElContext on wrapped instance is not accessable");
+        }
     }
 }