You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@turbine.apache.org by lu...@apache.org on 2011/02/02 18:01:47 UTC

svn commit: r1066529 - in /turbine/core/trunk/src/java/org/apache/turbine/modules/actions: AccessController.java DefaultAction.java InitContextsAction.java LoginUser.java LogoutUser.java VelocityAction.java VelocitySecureAction.java

Author: ludwig
Date: Wed Feb  2 17:01:46 2011
New Revision: 1066529

URL: http://svn.apache.org/viewvc?rev=1066529&view=rev
Log:
Removed all warnings from package org.apache.turbine.modules.actions

Modified:
    turbine/core/trunk/src/java/org/apache/turbine/modules/actions/AccessController.java
    turbine/core/trunk/src/java/org/apache/turbine/modules/actions/DefaultAction.java
    turbine/core/trunk/src/java/org/apache/turbine/modules/actions/InitContextsAction.java
    turbine/core/trunk/src/java/org/apache/turbine/modules/actions/LoginUser.java
    turbine/core/trunk/src/java/org/apache/turbine/modules/actions/LogoutUser.java
    turbine/core/trunk/src/java/org/apache/turbine/modules/actions/VelocityAction.java
    turbine/core/trunk/src/java/org/apache/turbine/modules/actions/VelocitySecureAction.java

Modified: turbine/core/trunk/src/java/org/apache/turbine/modules/actions/AccessController.java
URL: http://svn.apache.org/viewvc/turbine/core/trunk/src/java/org/apache/turbine/modules/actions/AccessController.java?rev=1066529&r1=1066528&r2=1066529&view=diff
==============================================================================
--- turbine/core/trunk/src/java/org/apache/turbine/modules/actions/AccessController.java (original)
+++ turbine/core/trunk/src/java/org/apache/turbine/modules/actions/AccessController.java Wed Feb  2 17:01:46 2011
@@ -83,6 +83,8 @@ public class AccessController
      * @param data Turbine information.
      * @exception TurbineSecurityException problem with the security service.
      */
+    @Deprecated
+    @Override
     public void doPerform(RunData data)
             throws TurbineSecurityException
     {
@@ -119,10 +121,11 @@ public class AccessController
      * @param data Turbine information.
      * @exception TurbineSecurityException problem with the security service.
      */
+    @Override
     public void doPerform(PipelineData pipelineData)
     	throws TurbineSecurityException
     {
-        RunData data = (RunData) getRunData(pipelineData);
+        RunData data = getRunData(pipelineData);
         doPerform(data);
     }
 }

Modified: turbine/core/trunk/src/java/org/apache/turbine/modules/actions/DefaultAction.java
URL: http://svn.apache.org/viewvc/turbine/core/trunk/src/java/org/apache/turbine/modules/actions/DefaultAction.java?rev=1066529&r1=1066528&r2=1066529&view=diff
==============================================================================
--- turbine/core/trunk/src/java/org/apache/turbine/modules/actions/DefaultAction.java (original)
+++ turbine/core/trunk/src/java/org/apache/turbine/modules/actions/DefaultAction.java Wed Feb  2 17:01:46 2011
@@ -42,6 +42,8 @@ public class DefaultAction extends Actio
      * @param data Turbine information.
      * @throws Exception a generic exception.
      */
+    @Deprecated
+    @Override
     public void doPerform(RunData data)
             throws Exception
     {
@@ -54,10 +56,11 @@ public class DefaultAction extends Actio
      * @param data Turbine information.
      * @throws Exception a generic exception.
      */
+    @Override
     public void doPerform(PipelineData pipelineData)
             throws Exception
     {
-        RunData data = (RunData) getRunData(pipelineData);
+        RunData data = getRunData(pipelineData);
         doPerform(data);
     }
 

Modified: turbine/core/trunk/src/java/org/apache/turbine/modules/actions/InitContextsAction.java
URL: http://svn.apache.org/viewvc/turbine/core/trunk/src/java/org/apache/turbine/modules/actions/InitContextsAction.java?rev=1066529&r1=1066528&r2=1066529&view=diff
==============================================================================
--- turbine/core/trunk/src/java/org/apache/turbine/modules/actions/InitContextsAction.java (original)
+++ turbine/core/trunk/src/java/org/apache/turbine/modules/actions/InitContextsAction.java Wed Feb  2 17:01:46 2011
@@ -52,6 +52,9 @@ public class InitContextsAction
      * @param data The RunData object for the current request.
      * @exception NamingException could not create InitialContext
      */
+    @SuppressWarnings("unchecked")
+    @Deprecated
+    @Override
     public void doPerform(RunData data)
             throws NamingException
     {
@@ -64,18 +67,18 @@ public class InitContextsAction
         // used by the InitialContext class to create a new context
         // instance.
 
-        Hashtable contextPropsList = new Hashtable();
-        for (Iterator contextKeys = conf.getKeys("context.");
+        Hashtable<String, Properties> contextPropsList = new Hashtable<String, Properties>();
+        for (Iterator<String> contextKeys = conf.getKeys("context.");
                 contextKeys.hasNext();)
         {
-            String key = (String) contextKeys.next();
+            String key = contextKeys.next();
             int start = key.indexOf(".") + 1;
             int end = key.indexOf(".", start);
             String contextName = key.substring(start, end);
             Properties contextProps = null;
             if (contextPropsList.containsKey(contextName))
             {
-                contextProps = (Properties) contextPropsList.get(contextName);
+                contextProps = contextPropsList.get(contextName);
             }
             else
             {
@@ -85,11 +88,11 @@ public class InitContextsAction
                              conf.getString(key));
             contextPropsList.put(contextName, contextProps);
         }
-        for (Iterator contextPropsKeys = contextPropsList.keySet().iterator();
+        for (Iterator<String> contextPropsKeys = contextPropsList.keySet().iterator();
                 contextPropsKeys.hasNext();)
         {
-            String key = (String) contextPropsKeys.next();
-            Properties contextProps = (Properties) contextPropsList.get(key);
+            String key = contextPropsKeys.next();
+            Properties contextProps = contextPropsList.get(key);
             InitialContext context = new InitialContext(contextProps);
             data.getJNDIContexts().put(key, context);
         }
@@ -103,10 +106,11 @@ public class InitContextsAction
      * @param pipelineData The PipelineRunData object for the current request.
      * @exception NamingException could not create InitialContext
      */
+    @Override
     public void doPerform(PipelineData pipelineData)
     throws NamingException
     {
-        RunData data = (RunData) getRunData(pipelineData);
+        RunData data = getRunData(pipelineData);
         doPerform(data);
     }
 

Modified: turbine/core/trunk/src/java/org/apache/turbine/modules/actions/LoginUser.java
URL: http://svn.apache.org/viewvc/turbine/core/trunk/src/java/org/apache/turbine/modules/actions/LoginUser.java?rev=1066529&r1=1066528&r2=1066529&view=diff
==============================================================================
--- turbine/core/trunk/src/java/org/apache/turbine/modules/actions/LoginUser.java (original)
+++ turbine/core/trunk/src/java/org/apache/turbine/modules/actions/LoginUser.java Wed Feb  2 17:01:46 2011
@@ -48,6 +48,7 @@ import org.apache.turbine.util.security.
  * @author <a href="mailto:peter@courcoux.biz">Peter Courcoux</a>
  * @version $Id$
  */
+@Deprecated
 public class LoginUser
         extends Action
 {
@@ -72,6 +73,7 @@ public class LoginUser
      * @exception TurbineSecurityException could not get instance of the
      *            anonymous user
      */
+    @Override
     public void doPerform(RunData data)
             throws TurbineSecurityException
     {
@@ -155,10 +157,11 @@ public class LoginUser
      * @exception TurbineSecurityException could not get instance of the
      *            anonymous user
      */
+    @Override
     public void doPerform(PipelineData pipelineData)
             throws TurbineSecurityException
     {
-        RunData data = (RunData) getRunData(pipelineData);
+        RunData data = getRunData(pipelineData);
         doPerform(data);
     }
 

Modified: turbine/core/trunk/src/java/org/apache/turbine/modules/actions/LogoutUser.java
URL: http://svn.apache.org/viewvc/turbine/core/trunk/src/java/org/apache/turbine/modules/actions/LogoutUser.java?rev=1066529&r1=1066528&r2=1066529&view=diff
==============================================================================
--- turbine/core/trunk/src/java/org/apache/turbine/modules/actions/LogoutUser.java (original)
+++ turbine/core/trunk/src/java/org/apache/turbine/modules/actions/LogoutUser.java Wed Feb  2 17:01:46 2011
@@ -62,6 +62,8 @@ public class LogoutUser
      * @exception TurbineSecurityException a problem occured in the security
      *            service.
      */
+    @Deprecated
+    @Override
     public void doPerform(RunData data)
             throws TurbineSecurityException
     {
@@ -129,10 +131,11 @@ public class LogoutUser
      * @exception TurbineSecurityException a problem occured in the security
      *            service.
      */
+    @Override
     public void doPerform(PipelineData pipelineData)
             throws TurbineSecurityException
     {
-        RunData data = (RunData) getRunData(pipelineData);
+        RunData data = getRunData(pipelineData);
         doPerform(data);
     }
 }

Modified: turbine/core/trunk/src/java/org/apache/turbine/modules/actions/VelocityAction.java
URL: http://svn.apache.org/viewvc/turbine/core/trunk/src/java/org/apache/turbine/modules/actions/VelocityAction.java?rev=1066529&r1=1066528&r2=1066529&view=diff
==============================================================================
--- turbine/core/trunk/src/java/org/apache/turbine/modules/actions/VelocityAction.java (original)
+++ turbine/core/trunk/src/java/org/apache/turbine/modules/actions/VelocityAction.java Wed Feb  2 17:01:46 2011
@@ -27,10 +27,9 @@ import org.apache.turbine.util.velocity.
 import org.apache.velocity.context.Context;
 
 /**
- * This class provides a convenience methods for Velocity Actions
- * to use. Since this class is abstract, it should only be extended
- * and not used directly.
- *
+ * This class provides a convenience methods for Velocity Actions to use. Since
+ * this class is abstract, it should only be extended and not used directly.
+ * 
  * @author <a href="mailto:jon@latchkey.com">Jon S. Stevens</a>
  * @author <a href="mailto:jvanzyl@periapt.com">Jason van Zyl</a>
  * @author <a href="mailto:peter@courcoux.biz">Peter Courcoux</a>
@@ -38,179 +37,175 @@ import org.apache.velocity.context.Conte
  */
 public abstract class VelocityAction extends VelocityActionEvent
 {
-  /**
-   * You SHOULD NOT override this method and implement it in your
-   * action.
-   * @deprecated Use PipelineData version instead.
-   * @param data Turbine information.
-   * @throws Exception a generic exception.
-   */
-  public void doPerform(RunData data)
-      throws Exception
-  {
-    doPerform(data, getContext(data));
-  }
-
-  /**
-   * You SHOULD NOT override this method and implement it in your
-   * action.
-   *
-   * @param data Turbine information.
-   * @throws Exception a generic exception.
-   */
-  public void doPerform(PipelineData pipelineData)
-      throws Exception
-  {
-      doPerform(pipelineData, getContext(pipelineData));
-  }
-
-
-  /**
-   * Initialize the module.
-   *
-   * @throws Exception a generic exception.
-   */
-    public void initialize()
-        throws Exception
+    /**
+     * You SHOULD NOT override this method and implement it in your action.
+     * 
+     * @deprecated Use PipelineData version instead.
+     * @param data Turbine information.
+     * @throws Exception a generic exception.
+     */
+    @Override
+    @Deprecated
+    public void doPerform(RunData data) throws Exception
+    {
+        doPerform(data, getContext(data));
+    }
+
+    /**
+     * You SHOULD NOT override this method and implement it in your action.
+     * 
+     * @param data Turbine information.
+     * @throws Exception a generic exception.
+     */
+    @Override
+    public void doPerform(PipelineData pipelineData) throws Exception
+    {
+        doPerform(pipelineData, getContext(pipelineData));
+    }
+
+    /**
+     * Initialize the module.
+     * 
+     * @throws Exception a generic exception.
+     */
+    @Override
+    public void initialize() throws Exception
     {
         initialized = true;
     }
 
-  /**
-   * You SHOULD override this method and implement it in your
-   * action.
-   * @deprecated Use PipelineData version instead.
-   * @param data Turbine information.
-   * @param context Context for web pages.
-   * @throws Exception a generic exception.
-   */
-  public abstract void doPerform(RunData data,
-                   Context context)
-      throws Exception;
-
-  /**
-   * You SHOULD override this method and implement it in your
-   * action.
-   *
-   * This should become abstract when the RunData version is
-   * removed. For compatibility reasons this method will default
-   * to using the RunData method unles it is overidden, which it
-   * should be.
-   *
-   * @param data Turbine information.
-   * @param context Context for web pages.
-   * @throws Exception a generic exception.
-   */
-  public void doPerform(PipelineData pipelineData,
-                   Context context)
-      throws Exception
-  {
-      RunData data = (RunData) getRunData(pipelineData);
-      doPerform(data, context);
-  }
-
-
-  /**
-   * Sets up the context and then calls super.perform(); thus,
-   * subclasses don't have to worry about getting a context
-   * themselves!  If a subclass throws an exception then depending
-   * on whether action.event.bubbleexception is true, then it bubbles
-   * it farther up, or traps it there.
-   *
-   * @deprecated Use PipelineData version instead.
-   * @param data Turbine information.
-   * @throws Exception a generic exception.
-   */
-  protected void perform(RunData data)
-      throws Exception
-  {
-    try {
-      super.perform(data);
-    }
-    catch (Exception e){
-      if(bubbleUpException){
-      throw e;
-      }
-
-    }
-  }
-
-  /**
-   * Sets up the context and then calls super.perform(); thus,
-   * subclasses don't have to worry about getting a context
-   * themselves!  If a subclass throws an exception then depending
-   * on whether action.event.bubbleexception is true, then it bubbles
-   * it farther up, or traps it there.
-   *
-   * @param data Turbine information.
-   * @throws Exception a generic exception.
-   */
-  protected void perform(PipelineData pipelineData)
-      throws Exception
-  {
-    try {
-      super.perform(pipelineData);
-    }
-    catch (Exception e){
-      if(bubbleUpException){
-      throw e;
-      }
-
-    }
-  }
-
-
-
-  /**
-   * This method is used when you want to short circuit an Action
-   * and change the template that will be executed next.
-   *
-   * @deprecated Use PipelineData version instead.
-   * @param data Turbine information.
-   * @param template The template that will be executed next.
-   */
-  public void setTemplate(RunData data,
-              String template)
-  {
-    TemplateScreen.setTemplate(data, template);
-  }
-
-  /**
-   * This method is used when you want to short circuit an Action
-   * and change the template that will be executed next.
-   *
-   * @param data Turbine information.
-   * @param template The template that will be executed next.
-   */
-  public void setTemplate(PipelineData pipelineData,
-              String template)
-  {
-      TemplateScreen.setTemplate(pipelineData, template);
-  }
-
-
-
-  /**
-   * Return the Context needed by Velocity.
-   *
-   * @deprecated Use PipelineData version instead.
-   * @param data Turbine information.
-   * @return Context, a context for web pages.
-   */
-  protected Context getContext(RunData data)
-  {
-    return TurbineVelocity.getContext(data);
-  }
-
-  /**
-   * Return the Context needed by Velocity.
-   *
-   * @param data Turbine information.
-   * @return Context, a context for web pages.
-   */
-  protected Context getContext(PipelineData pipelineData)
-  {
-      return TurbineVelocity.getContext(pipelineData);
-  }
+    /**
+     * You SHOULD override this method and implement it in your action.
+     * 
+     * @deprecated Use PipelineData version instead.
+     * @param data Turbine information.
+     * @param context Context for web pages.
+     * @throws Exception a generic exception.
+     */
+    @Deprecated
+    public abstract void doPerform(RunData data, Context context)
+            throws Exception;
+
+    /**
+     * You SHOULD override this method and implement it in your action.
+     * 
+     * This should become abstract when the RunData version is removed. For
+     * compatibility reasons this method will default to using the RunData
+     * method unles it is overidden, which it should be.
+     * 
+     * @param data Turbine information.
+     * @param context Context for web pages.
+     * @throws Exception a generic exception.
+     */
+    public void doPerform(PipelineData pipelineData, Context context)
+            throws Exception
+    {
+        RunData data = getRunData(pipelineData);
+        doPerform(data, context);
+    }
+
+    /**
+     * Sets up the context and then calls super.perform(); thus, subclasses
+     * don't have to worry about getting a context themselves! If a subclass
+     * throws an exception then depending on whether
+     * action.event.bubbleexception is true, then it bubbles it farther up, or
+     * traps it there.
+     * 
+     * @deprecated Use PipelineData version instead.
+     * @param data Turbine information.
+     * @throws Exception a generic exception.
+     */
+    @Deprecated
+    @Override
+    protected void perform(RunData data) throws Exception
+    {
+        try
+        {
+            super.perform(data);
+        } catch (Exception e)
+        {
+            if (bubbleUpException)
+            {
+                throw e;
+            }
+
+        }
+    }
+
+    /**
+     * Sets up the context and then calls super.perform(); thus, subclasses
+     * don't have to worry about getting a context themselves! If a subclass
+     * throws an exception then depending on whether
+     * action.event.bubbleexception is true, then it bubbles it farther up, or
+     * traps it there.
+     * 
+     * @param data Turbine information.
+     * @throws Exception a generic exception.
+     */
+    @Override
+    protected void perform(PipelineData pipelineData) throws Exception
+    {
+        try
+        {
+            super.perform(pipelineData);
+        } catch (Exception e)
+        {
+            if (bubbleUpException)
+            {
+                throw e;
+            }
+
+        }
+    }
+
+    /**
+     * This method is used when you want to short circuit an Action and change
+     * the template that will be executed next.
+     * 
+     * @deprecated Use PipelineData version instead.
+     * @param data Turbine information.
+     * @param template The template that will be executed next.
+     */
+    @Deprecated
+    public void setTemplate(RunData data, String template)
+    {
+        TemplateScreen.setTemplate(data, template);
+    }
+
+    /**
+     * This method is used when you want to short circuit an Action and change
+     * the template that will be executed next.
+     * 
+     * @param data Turbine information.
+     * @param template The template that will be executed next.
+     */
+    public void setTemplate(PipelineData pipelineData, String template)
+    {
+        TemplateScreen.setTemplate(pipelineData, template);
+    }
+
+    /**
+     * Return the Context needed by Velocity.
+     * 
+     * @deprecated Use PipelineData version instead.
+     * @param data Turbine information.
+     * @return Context, a context for web pages.
+     */
+    @Deprecated
+    protected Context getContext(RunData data)
+    {
+        return TurbineVelocity.getContext(data);
+    }
+
+    /**
+     * Return the Context needed by Velocity.
+     * 
+     * @param data Turbine information.
+     * @return Context, a context for web pages.
+     */
+    protected Context getContext(PipelineData pipelineData)
+    {
+        return TurbineVelocity.getContext(pipelineData);
+    }
 
 }

Modified: turbine/core/trunk/src/java/org/apache/turbine/modules/actions/VelocitySecureAction.java
URL: http://svn.apache.org/viewvc/turbine/core/trunk/src/java/org/apache/turbine/modules/actions/VelocitySecureAction.java?rev=1066529&r1=1066528&r2=1066529&view=diff
==============================================================================
--- turbine/core/trunk/src/java/org/apache/turbine/modules/actions/VelocitySecureAction.java (original)
+++ turbine/core/trunk/src/java/org/apache/turbine/modules/actions/VelocitySecureAction.java Wed Feb  2 17:01:46 2011
@@ -51,6 +51,8 @@ public abstract class VelocitySecureActi
      * @param context Context for web pages.
      * @throws Exception a generic exception.
      */
+    @Deprecated
+    @Override
     public abstract void doPerform(RunData data, Context context)
             throws Exception;
 
@@ -61,10 +63,11 @@ public abstract class VelocitySecureActi
      * @param context Context for web pages.
      * @throws Exception a generic exception.
      */
+    @Override
     public void doPerform(PipelineData pipelineData, Context context)
             throws Exception
     {
-        RunData data = (RunData) getRunData(pipelineData);
+        RunData data = getRunData(pipelineData);
         doPerform(data, context);
     }
 
@@ -77,6 +80,8 @@ public abstract class VelocitySecureActi
      * @param data Turbine information.
      * @throws Exception a generic exception.
      */
+    @Deprecated
+    @Override
     protected void perform(RunData data) throws Exception
     {
         if (isAuthorized(data))
@@ -92,6 +97,7 @@ public abstract class VelocitySecureActi
      * @param data Turbine information.
      * @throws Exception a generic exception.
      */
+    @Override
     protected void perform(PipelineData pipelineData) throws Exception
     {
         if (isAuthorized(pipelineData))
@@ -113,6 +119,7 @@ public abstract class VelocitySecureActi
      * @return True if the user is authorized to access the screen.
      * @throws Exception a generic exception.
      */
+    @Deprecated
     protected abstract boolean isAuthorized(RunData data)
             throws Exception;
 
@@ -128,7 +135,7 @@ public abstract class VelocitySecureActi
     protected boolean isAuthorized(PipelineData pipelineData)
             throws Exception
     {
-        RunData data = (RunData) getRunData(pipelineData);
+        RunData data = getRunData(pipelineData);
         return isAuthorized(data);
     }