You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by st...@apache.org on 2011/10/24 18:30:35 UTC
svn commit: r1188206 - in
/myfaces/core/trunk/api/src/main/java/javax/faces/application:
Application.java ApplicationWrapper.java FacesMessage.java
NavigationCase.java ProjectStage.java StateManager.java
Author: struberg
Date: Mon Oct 24 16:30:34 2011
New Revision: 1188206
URL: http://svn.apache.org/viewvc?rev=1188206&view=rev
Log:
MYFACES-3368 fix checkstyle
Modified:
myfaces/core/trunk/api/src/main/java/javax/faces/application/Application.java
myfaces/core/trunk/api/src/main/java/javax/faces/application/ApplicationWrapper.java
myfaces/core/trunk/api/src/main/java/javax/faces/application/FacesMessage.java
myfaces/core/trunk/api/src/main/java/javax/faces/application/NavigationCase.java
myfaces/core/trunk/api/src/main/java/javax/faces/application/ProjectStage.java
myfaces/core/trunk/api/src/main/java/javax/faces/application/StateManager.java
Modified: myfaces/core/trunk/api/src/main/java/javax/faces/application/Application.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/api/src/main/java/javax/faces/application/Application.java?rev=1188206&r1=1188205&r2=1188206&view=diff
==============================================================================
--- myfaces/core/trunk/api/src/main/java/javax/faces/application/Application.java (original)
+++ myfaces/core/trunk/api/src/main/java/javax/faces/application/Application.java Mon Oct 24 16:30:34 2011
@@ -548,7 +548,8 @@ public abstract class Application
* <li>The <code>processAction()</code> method must first call <code>FacesContext.renderResponse()</code>in order to
* bypass any intervening lifecycle phases, once the method returns.</li>
*
- * <li>The <code>processAction()</code> method must next determine the logical outcome of this event, as follows:</li>
+ * <li>The <code>processAction()</code> method must next determine the logical
+ * outcome of this event, as follows:</li>
*
* <ul>
* <li>If the originating component has a non-<code>null action</code> property, retrieve the <code>
@@ -840,7 +841,8 @@ public abstract class Application
* <li>The <code>ResourceHandler</code> implementation is declared in the application configuration resources by
* giving the fully qualified class name as the value of the <code><resource-handler></code> element within the
* <code>application</code> element.</li>
- * <li>RELEASE_PENDING(edburns) It can also be declared via an annotation as specified in [287-ConfigAnnotations].</li>
+ * <li>RELEASE_PENDING(edburns) It can also be declared via an annotation as
+ * specified in [287-ConfigAnnotations].</li>
* </ul>
*
* <p>
Modified: myfaces/core/trunk/api/src/main/java/javax/faces/application/ApplicationWrapper.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/api/src/main/java/javax/faces/application/ApplicationWrapper.java?rev=1188206&r1=1188205&r2=1188206&view=diff
==============================================================================
--- myfaces/core/trunk/api/src/main/java/javax/faces/application/ApplicationWrapper.java (original)
+++ myfaces/core/trunk/api/src/main/java/javax/faces/application/ApplicationWrapper.java Mon Oct 24 16:30:34 2011
@@ -324,7 +324,8 @@ public abstract class ApplicationWrapper
public abstract Application getWrapped();
@Override
- public void publishEvent(FacesContext facesContext, Class<? extends SystemEvent> systemEventClass, Class<?> sourceBaseType, Object source)
+ public void publishEvent(FacesContext facesContext, Class<? extends SystemEvent> systemEventClass,
+ Class<?> sourceBaseType, Object source)
{
getWrapped().publishEvent(facesContext, systemEventClass, sourceBaseType, source);
}
Modified: myfaces/core/trunk/api/src/main/java/javax/faces/application/FacesMessage.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/api/src/main/java/javax/faces/application/FacesMessage.java?rev=1188206&r1=1188205&r2=1188206&view=diff
==============================================================================
--- myfaces/core/trunk/api/src/main/java/javax/faces/application/FacesMessage.java (original)
+++ myfaces/core/trunk/api/src/main/java/javax/faces/application/FacesMessage.java Mon Oct 24 16:30:34 2011
@@ -22,7 +22,11 @@ import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
/**
*see Javadoc of <a href="http://java.sun.com/javaee/javaserverfaces/1.2/docs/api/index.html">JSF Specification</a>
@@ -33,11 +37,11 @@ import java.util.*;
* </p>
*
*<ui>The implementation must take the following steps when creating FacesMessage instances given a messageId: <li>Call
- * {@link Application.getMessageBundle()}. If <code>non-null</code>, locate the named <code>ResourceBundle</code>, using
+ * {@link Application#getMessageBundle()}. If <code>non-null</code>, locate the named <code>ResourceBundle</code>, using
* the <code>Locale</code> from the current {@linkUIViewRoot} and see if it has a value for the argument
* <code>messageId</code>. If it does, treat the value as the <code>summary</code> of the {@link FacesMessage}. If it
- * does not, or if {@link Application.getMessageBundle()} returned null, look in the ResourceBundle named by the value
- * of the constant {@link FACES_MESSAGES} and see if it has a value for the argument messageId. If it does, treat the
+ * does not, or if {@link Application#getMessageBundle()} returned null, look in the ResourceBundle named by the value
+ * of the constant {@link #FACES_MESSAGES} and see if it has a value for the argument messageId. If it does, treat the
* value as the summary of the <code>FacesMessage</code>. If it does not, there is no initialization information for the
* <code>FacesMessage</code> instance.</li> <li>In all cases, if a <code>ResourceBundle</code> hit is found for the
* <code>{messageId}</code>, look for further hits under the key <code>{messageId}_detail</code>. Use this value, if
@@ -92,14 +96,14 @@ public class FacesMessage implements Ser
static
{
- Map<String, FacesMessage.Severity> map = new HashMap<String, FacesMessage.Severity>(7);
+ Map<String, FacesMessage.Severity> map = new HashMap<String, Severity>(7);
map.put(SEVERITY_INFO.toString(), SEVERITY_INFO);
map.put(SEVERITY_WARN.toString(), SEVERITY_WARN);
map.put(SEVERITY_ERROR.toString(), SEVERITY_ERROR);
map.put(SEVERITY_FATAL.toString(), SEVERITY_FATAL);
VALUES_MAP = Collections.unmodifiableMap(map);
- List<FacesMessage.Severity> severityList = new ArrayList<FacesMessage.Severity>(map.values());
+ List<FacesMessage.Severity> severityList = new ArrayList<Severity>(map.values());
Collections.sort(severityList); // the JSF spec requires it to be sorted
VALUES = Collections.unmodifiableList(severityList);
}
Modified: myfaces/core/trunk/api/src/main/java/javax/faces/application/NavigationCase.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/api/src/main/java/javax/faces/application/NavigationCase.java?rev=1188206&r1=1188205&r2=1188206&view=diff
==============================================================================
--- myfaces/core/trunk/api/src/main/java/javax/faces/application/NavigationCase.java (original)
+++ myfaces/core/trunk/api/src/main/java/javax/faces/application/NavigationCase.java Mon Oct 24 16:30:34 2011
@@ -100,7 +100,8 @@ public class NavigationCase
public URL getActionURL(FacesContext context) throws MalformedURLException
{
ExternalContext externalContext = context.getExternalContext();
- return new URL(externalContext.getRequestScheme(), externalContext.getRequestServerName(), externalContext.getRequestServerPort(),
+ return new URL(externalContext.getRequestScheme(), externalContext.getRequestServerName(),
+ externalContext.getRequestServerPort(),
context.getApplication().getViewHandler().getActionURL(context, getToViewId(context)));
}
@@ -137,14 +138,16 @@ public class NavigationCase
return new URL(externalContext.getRequestScheme(),
externalContext.getRequestServerName(),
externalContext.getRequestServerPort(),
- context.getApplication().getViewHandler().getBookmarkableURL(context, getToViewId(context), getParameters(), isIncludeViewParams()));
+ context.getApplication().getViewHandler().getBookmarkableURL(context, getToViewId(context),
+ getParameters(), isIncludeViewParams()));
}
public URL getResourceURL(FacesContext context) throws MalformedURLException
{
ExternalContext externalContext = context.getExternalContext();
- return new URL(externalContext.getRequestScheme(), externalContext.getRequestServerName(), externalContext.getRequestServerPort(),
- context.getApplication().getViewHandler().getResourceURL(context, getToViewId(context)));
+ return new URL(externalContext.getRequestScheme(), externalContext.getRequestServerName(),
+ externalContext.getRequestServerPort(),
+ context.getApplication().getViewHandler().getResourceURL(context, getToViewId(context)));
}
public URL getRedirectURL(FacesContext context) throws MalformedURLException
@@ -153,7 +156,8 @@ public class NavigationCase
return new URL(externalContext.getRequestScheme(),
externalContext.getRequestServerName(),
externalContext.getRequestServerPort(),
- context.getApplication().getViewHandler().getRedirectURL(context, getToViewId(context), getParameters(), isIncludeViewParams()));
+ context.getApplication().getViewHandler().getRedirectURL(context, getToViewId(context),
+ getParameters(), isIncludeViewParams()));
}
public Map<String,List<String>> getParameters()
Modified: myfaces/core/trunk/api/src/main/java/javax/faces/application/ProjectStage.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/api/src/main/java/javax/faces/application/ProjectStage.java?rev=1188206&r1=1188205&r2=1188206&view=diff
==============================================================================
--- myfaces/core/trunk/api/src/main/java/javax/faces/application/ProjectStage.java (original)
+++ myfaces/core/trunk/api/src/main/java/javax/faces/application/ProjectStage.java Mon Oct 24 16:30:34 2011
@@ -18,8 +18,6 @@
*/
package javax.faces.application;
-import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFWebConfigParam;
-
/**
* @author Simon Lessard (latest modification by $Author$)
* @version $Revision$ $Date$
Modified: myfaces/core/trunk/api/src/main/java/javax/faces/application/StateManager.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/api/src/main/java/javax/faces/application/StateManager.java?rev=1188206&r1=1188205&r2=1188206&view=diff
==============================================================================
--- myfaces/core/trunk/api/src/main/java/javax/faces/application/StateManager.java (original)
+++ myfaces/core/trunk/api/src/main/java/javax/faces/application/StateManager.java Mon Oct 24 16:30:34 2011
@@ -76,14 +76,17 @@ public abstract class StateManager
* token is embedded in the data rendered to the user.
* </p>
*/
- @JSFWebConfigParam(defaultValue="server", expectedValues="server,client", since="1.1", group="state", tags="performance",
- desc="Define the state method to be used. There are two different options defined by the specification: 'client' and 'server' state.")
+ @JSFWebConfigParam(defaultValue="server", expectedValues="server,client",
+ since="1.1", group="state", tags="performance",
+ desc="Define the state method to be used. There are two different options "
+ + "defined by the specification: 'client' and 'server' state.")
public static final String STATE_SAVING_METHOD_PARAM_NAME = "javax.faces.STATE_SAVING_METHOD";
public static final String STATE_SAVING_METHOD_CLIENT = "client";
public static final String STATE_SAVING_METHOD_SERVER = "server";
/**
- * Indicate the viewId(s) separated by commas that should be saved and restored fully, without use Partial State Saving (PSS).
+ * Indicate the viewId(s) separated by commas that should be saved and restored fully,
+ * without use Partial State Saving (PSS).
*/
@JSFWebConfigParam(since="2.0", group="state")
public static final String FULL_STATE_SAVING_VIEW_IDS_PARAM_NAME = "javax.faces.FULL_STATE_SAVING_VIEW_IDS";
@@ -96,7 +99,8 @@ public abstract class StateManager
* state of the view.</p>
* <p>If the webapp faces-config file version is 2.0 or upper the default value is true, otherwise is false.</p>
*/
- @JSFWebConfigParam(expectedValues="true,false", since="2.0", defaultValue="true (false with 1.2 webapps)", tags="performance", group="state")
+ @JSFWebConfigParam(expectedValues="true,false", since="2.0", defaultValue="true (false with 1.2 webapps)",
+ tags="performance", group="state")
public static final String PARTIAL_STATE_SAVING_PARAM_NAME = "javax.faces.PARTIAL_STATE_SAVING";
private Boolean _savingStateInClient = null;
@@ -139,7 +143,9 @@ public abstract class StateManager
{
StateManager.SerializedView serializedView = saveSerializedView(context);
if (serializedView == null)
+ {
return null;
+ }
Object[] structureAndState = new Object[2];
structureAndState[0] = serializedView.getStructure();
@@ -221,10 +227,14 @@ public abstract class StateManager
public void writeState(FacesContext context, Object state) throws IOException
{
if (!(state instanceof Object[]))
+ {
return;
+ }
Object[] structureAndState = (Object[]) state;
if (structureAndState.length < 2)
+ {
return;
+ }
writeState(context, new StateManager.SerializedView(structureAndState[0], structureAndState[1]));
}
@@ -264,9 +274,14 @@ public abstract class StateManager
public boolean isSavingStateInClient(FacesContext context)
{
if (context == null)
+ {
throw new NullPointerException("context");
+ }
if (_savingStateInClient != null)
+ {
return _savingStateInClient.booleanValue();
+ }
+
String stateSavingMethod = context.getExternalContext().getInitParameter(STATE_SAVING_METHOD_PARAM_NAME);
if (stateSavingMethod == null)
{