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/09 13:35:05 UTC

svn commit: r675134 - in /myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra: conversation/ conversation/spring/ frameworkAdapter/ frameworkAdapter/basic/ frameworkAdapter/springBasic/ lib/ lib/jsf/ requestParameterProvider/

Author: skitching
Date: Wed Jul  9 04:35:05 2008
New Revision: 675134

URL: http://svn.apache.org/viewvc?rev=675134&view=rev
Log:
Checkstyle fixes.

Modified:
    myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/ConversationRequestParameterProvider.java
    myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/spring/ScopedBeanTargetSource.java
    myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/spring/SpringSingleConversationScope.java
    myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/spring/_SpringUtils.java
    myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/frameworkAdapter/FrameworkAdapter.java
    myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/frameworkAdapter/basic/BasicFrameworkAdapter.java
    myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/frameworkAdapter/springBasic/SpringBasicFrameworkAdapter.java
    myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/lib/_ReentrantLock.java
    myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/lib/jsf/ConfigUtils.java
    myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/requestParameterProvider/RequestParameterProviderManager.java

Modified: myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/ConversationRequestParameterProvider.java
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/ConversationRequestParameterProvider.java?rev=675134&r1=675133&r2=675134&view=diff
==============================================================================
--- myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/ConversationRequestParameterProvider.java (original)
+++ myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/ConversationRequestParameterProvider.java Wed Jul  9 04:35:05 2008
@@ -39,7 +39,7 @@
             ConversationManager.CONVERSATION_CONTEXT_PARAM
         };
 
-    private final static ThreadLocal inSeparationMode = new ThreadLocal();
+    private final static ThreadLocal inSeparationModeThreadLocal = new ThreadLocal();
 
     /**
      * Update a threadlocal flag indicating whether URLs written to the
@@ -58,7 +58,7 @@
     {
         // TODO: consider using a request-scope variable rather than a
         // ThreadLocal; less damage if the flag is not reset..
-        inSeparationMode.set(separationMode ? Boolean.TRUE : Boolean.FALSE);
+        inSeparationModeThreadLocal.set(separationMode ? Boolean.TRUE : Boolean.FALSE);
     }
 
     /**
@@ -67,7 +67,7 @@
      */
     public static boolean isInSeparationMode()
     {
-        return Boolean.TRUE.equals(inSeparationMode.get());
+        return Boolean.TRUE.equals(inSeparationModeThreadLocal.get());
     }
 
     public String getFieldValue(String field)

Modified: myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/spring/ScopedBeanTargetSource.java
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/spring/ScopedBeanTargetSource.java?rev=675134&r1=675133&r2=675134&view=diff
==============================================================================
--- myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/spring/ScopedBeanTargetSource.java (original)
+++ myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/spring/ScopedBeanTargetSource.java Wed Jul  9 04:35:05 2008
@@ -43,7 +43,8 @@
  * 
  * @since 1.1
  */
-public class ScopedBeanTargetSource extends AbstractBeanFactoryBasedTargetSource {
+public class ScopedBeanTargetSource extends AbstractBeanFactoryBasedTargetSource
+{
     private AbstractSpringOrchestraScope scope;
     private String conversationName;
     private String targetBeanName;
@@ -54,8 +55,8 @@
             String conversationName,
             String targetBeanName,
             ObjectFactory objectFactory,
-            BeanFactory beanFactory) {
-
+            BeanFactory beanFactory)
+    {
         this.scope = scope;
         this.conversationName = conversationName;
         this.targetBeanName = targetBeanName;
@@ -65,7 +66,8 @@
         super.setBeanFactory(beanFactory);
     }
 
-    public Object getTarget() throws Exception {
+    public Object getTarget() throws Exception
+    {
         final Log log = LogFactory.getLog(ScopedBeanTargetSource.class);
         log.debug("getRealBean for " + targetBeanName);
         return scope.getRealBean(conversationName, targetBeanName, objectFactory);

Modified: myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/spring/SpringSingleConversationScope.java
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/spring/SpringSingleConversationScope.java?rev=675134&r1=675133&r2=675134&view=diff
==============================================================================
--- myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/spring/SpringSingleConversationScope.java (original)
+++ myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/spring/SpringSingleConversationScope.java Wed Jul  9 04:35:05 2008
@@ -37,7 +37,8 @@
     // for now. Might be able to implement cleaner with Orchestra 2.
     public final static String CONVERSATION_NAME="_oamo_single_conversation"; // NON-NLS
 
-    public String getConversationNameForBean(String beanName) {
+    public String getConversationNameForBean(String beanName)
+    {
         return CONVERSATION_NAME;
     }
 

Modified: myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/spring/_SpringUtils.java
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/spring/_SpringUtils.java?rev=675134&r1=675133&r2=675134&view=diff
==============================================================================
--- myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/spring/_SpringUtils.java (original)
+++ myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/spring/_SpringUtils.java Wed Jul  9 04:35:05 2008
@@ -159,7 +159,8 @@
         pf.setTargetSource(scopedTargetSource);
 
         Class beanType = beanFactory.getType(targetBeanName);
-        if (beanType == null) {
+        if (beanType == null)
+        {
             throw new IllegalStateException("Cannot create scoped proxy for bean '" + targetBeanName +
                     "': Target type could not be determined at the time of proxy creation.");
         }

Modified: myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/frameworkAdapter/FrameworkAdapter.java
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/frameworkAdapter/FrameworkAdapter.java?rev=675134&r1=675133&r2=675134&view=diff
==============================================================================
--- myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/frameworkAdapter/FrameworkAdapter.java (original)
+++ myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/frameworkAdapter/FrameworkAdapter.java Wed Jul  9 04:35:05 2008
@@ -36,7 +36,7 @@
  */
 public abstract class FrameworkAdapter
 {
-    private final static ThreadLocal instance = new ThreadLocal();
+    private final static ThreadLocal instanceThreadLocal = new ThreadLocal();
 
     private ConversationMessager conversationMessager;
     private boolean prepared = false;
@@ -52,7 +52,7 @@
     {
         if (frameworkAdapter == null)
         {
-            instance.remove();
+            instanceThreadLocal.remove();
             return;
         }
             
@@ -64,7 +64,7 @@
             }
         }
 
-        instance.set(frameworkAdapter);
+        instanceThreadLocal.set(frameworkAdapter);
     }
 
     /**
@@ -74,7 +74,7 @@
      */
     public static FrameworkAdapter getCurrentInstance()
     {
-        return (FrameworkAdapter) instance.get();
+        return (FrameworkAdapter) instanceThreadLocal.get();
     }
 
     /**

Modified: myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/frameworkAdapter/basic/BasicFrameworkAdapter.java
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/frameworkAdapter/basic/BasicFrameworkAdapter.java?rev=675134&r1=675133&r2=675134&view=diff
==============================================================================
--- myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/frameworkAdapter/basic/BasicFrameworkAdapter.java (original)
+++ myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/frameworkAdapter/basic/BasicFrameworkAdapter.java Wed Jul  9 04:35:05 2008
@@ -60,8 +60,8 @@
 {
     private final static String ISE_MESSAGE="No request/response data available"; // NON-NLS
 
-    private final static ThreadLocal httpServletRequest = new ThreadLocal();
-    private final static ThreadLocal httpServletResponse = new ThreadLocal();
+    private final static ThreadLocal httpServletRequestThreadLocal = new ThreadLocal();
+    private final static ThreadLocal httpServletResponseThreadLocal = new ThreadLocal();
 
     private final Log log = LogFactory.getLog(BasicFrameworkAdapter.class);
 
@@ -100,12 +100,12 @@
 
     private HttpServletRequest getRequest()
     {
-        return (HttpServletRequest) httpServletRequest.get();
+        return (HttpServletRequest) httpServletRequestThreadLocal.get();
     }
 
     private HttpServletResponse getResponse()
     {
-        return (HttpServletResponse) httpServletResponse.get();
+        return (HttpServletResponse) httpServletResponseThreadLocal.get();
     }
 
     public void beginRequest(ServletRequest req, ServletResponse rsp)
@@ -113,11 +113,11 @@
         log.debug("Beginning request");
         if (req instanceof HttpServletRequest)
         {
-            httpServletRequest.set(req);
+            httpServletRequestThreadLocal.set(req);
         }
         if (rsp instanceof HttpServletResponse)
         {
-            httpServletResponse.set(rsp);
+            httpServletResponseThreadLocal.set(rsp);
         }
 
         FrameworkAdapter.setCurrentInstance(this);
@@ -127,8 +127,8 @@
     {
         log.debug("Ending request");
         FrameworkAdapter.setCurrentInstance(null);
-        httpServletRequest.set(null);
-        httpServletResponse.set(null);
+        httpServletRequestThreadLocal.set(null);
+        httpServletResponseThreadLocal.set(null);
     }
 
     public String getInitParameter(String key)
@@ -269,10 +269,16 @@
         Object obj;
 
         obj = getRequestAttribute(name);
-        if (obj != null) return obj;
+        if (obj != null)
+        {
+            return obj;
+        }
 
         obj = getSessionAttribute(name);
-        if (obj != null) return obj;
+        if (obj != null)
+        {
+            return obj;
+        }
 
         // TODO: look up application-scoped objects.
 

Modified: myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/frameworkAdapter/springBasic/SpringBasicFrameworkAdapter.java
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/frameworkAdapter/springBasic/SpringBasicFrameworkAdapter.java?rev=675134&r1=675133&r2=675134&view=diff
==============================================================================
--- myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/frameworkAdapter/springBasic/SpringBasicFrameworkAdapter.java (original)
+++ myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/frameworkAdapter/springBasic/SpringBasicFrameworkAdapter.java Wed Jul  9 04:35:05 2008
@@ -29,17 +29,19 @@
  *
  * @see BasicFrameworkAdapter
  */
-public class SpringBasicFrameworkAdapter extends BasicFrameworkAdapter {
-
+public class SpringBasicFrameworkAdapter extends BasicFrameworkAdapter
+{
     private final ServletContext context;
 
-    public SpringBasicFrameworkAdapter(ServletContext context, String conversationMessagerClass) {
+    public SpringBasicFrameworkAdapter(ServletContext context, String conversationMessagerClass)
+    {
         super(context, conversationMessagerClass);
 
         this.context = context;
     }
 
-    public Object getBean(String name) {
+    public Object getBean(String name)
+    {
         ApplicationContext appContext = WebApplicationContextUtils.getRequiredWebApplicationContext(context);
         return appContext.getBean(name);
     }

Modified: myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/lib/_ReentrantLock.java
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/lib/_ReentrantLock.java?rev=675134&r1=675133&r2=675134&view=diff
==============================================================================
--- myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/lib/_ReentrantLock.java (original)
+++ myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/lib/_ReentrantLock.java Wed Jul  9 04:35:05 2008
@@ -38,7 +38,8 @@
  * 
  * @since 1.1
  */
-public class _ReentrantLock implements java.io.Serializable {
+public class _ReentrantLock implements java.io.Serializable
+{
     private static final long serialVersionUID = 7373984872572414699L;
     private static final long WAIT_WARN_MILLIS = 30L * 1000L; // 30 seconds
 

Modified: myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/lib/jsf/ConfigUtils.java
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/lib/jsf/ConfigUtils.java?rev=675134&r1=675133&r2=675134&view=diff
==============================================================================
--- myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/lib/jsf/ConfigUtils.java (original)
+++ myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/lib/jsf/ConfigUtils.java Wed Jul  9 04:35:05 2008
@@ -36,9 +36,13 @@
     {
         List rhl = (List) reqScope.get(RH_KEY);
         if (rhl != null)
+        {
             return rhl;
+        }
         else
+        {
             return Collections.EMPTY_LIST;
+        }
     }
 
     /**

Modified: myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/requestParameterProvider/RequestParameterProviderManager.java
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/requestParameterProvider/RequestParameterProviderManager.java?rev=675134&r1=675133&r2=675134&view=diff
==============================================================================
--- myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/requestParameterProvider/RequestParameterProviderManager.java (original)
+++ myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/requestParameterProvider/RequestParameterProviderManager.java Wed Jul  9 04:35:05 2008
@@ -78,14 +78,15 @@
 
     public static RequestParameterProviderManager getInstance()
     {
+        FrameworkAdapter fa = FrameworkAdapter.getCurrentInstance();
         RequestParameterProviderManager manager =
-            (RequestParameterProviderManager) FrameworkAdapter.getCurrentInstance().getSessionAttribute(PARAMETER_PROVIDER_MANAGER_KEY);
+            (RequestParameterProviderManager) fa.getSessionAttribute(PARAMETER_PROVIDER_MANAGER_KEY);
 
         if (manager == null)
         {
             // TODO: remove this factory code. Not IOC-friendly.
             manager = new RequestParameterProviderManager();
-            FrameworkAdapter.getCurrentInstance().setSessionAttribute(PARAMETER_PROVIDER_MANAGER_KEY, manager);
+            fa.setSessionAttribute(PARAMETER_PROVIDER_MANAGER_KEY, manager);
         }
 
         return manager;
@@ -122,7 +123,10 @@
     {
         if (!isResponseIntercepted())
         {
-            throw new IllegalStateException("RequestParameterServletFilter not called. Please configure the filter " + RequestParameterServletFilter.class.getName() + " in your web.xml to cover your faces requests.");
+            throw new IllegalStateException(
+                "RequestParameterServletFilter not called. Please configure the filter "
+                    + RequestParameterServletFilter.class.getName()
+                    + " in your web.xml to cover your faces requests.");
         }
 
         if (url == null)