You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by bo...@apache.org on 2007/12/04 22:03:00 UTC
svn commit: r601085 - in
/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago:
component/ComponentUtil.java util/UpdateModelValuesCallback.java
Author: bommel
Date: Tue Dec 4 13:02:59 2007
New Revision: 601085
URL: http://svn.apache.org/viewvc?rev=601085&view=rev
Log:
checkstyle
Modified:
myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/ComponentUtil.java
myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/util/UpdateModelValuesCallback.java
Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/ComponentUtil.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/ComponentUtil.java?rev=601085&r1=601084&r2=601085&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/ComponentUtil.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/ComponentUtil.java Tue Dec 4 13:02:59 2007
@@ -165,6 +165,7 @@
view.getAttributes().remove(UIPage.COMPONENT_TYPE);
}
}
+ @SuppressWarnings(value = "unchecked")
public static UIPage findPage(FacesContext context, UIComponent component) {
javax.faces.component.UIViewRoot view = context.getViewRoot();
if (view != null) {
@@ -191,21 +192,15 @@
public static void addStyles(UIComponent component, String[] styles) {
UIPage uiPage = ComponentUtil.findPage(component);
- for (String style : styles) {
- uiPage.getStyleFiles().add(style);
- }
+ uiPage.getStyleFiles().addAll(Arrays.asList(styles));
}
public static void addScripts(UIComponent component, String[] scripts) {
UIPage uiPage = ComponentUtil.findPage(component);
- for (String script : scripts) {
- uiPage.getScriptFiles().add(script);
- }
+ uiPage.getScriptFiles().addAll(Arrays.asList(scripts));
}
public static void addOnloadCommands(UIComponent component, String[] cmds) {
UIPage uiPage = ComponentUtil.findPage(component);
- for (String cmd : cmds) {
- uiPage.getOnloadScripts().add(cmd);
- }
+ uiPage.getOnloadScripts().addAll(Arrays.asList(cmds));
}
public static UIPage findPage(FacesContext facesContext) {
@@ -462,7 +457,7 @@
return ((Character) character);
} else if (character instanceof String) {
String asString = ((String) character);
- return asString.length() > 0 ? Character.valueOf(asString.charAt(0)) : null;
+ return asString.length() > 0 ? asString.charAt(0) : null;
} else {
LOG.warn("Unknown type '" + character.getClass().getName()
+ "' for integer attribute: " + name + " comp: " + component);
@@ -1252,7 +1247,9 @@
}
}
- private static void prepareOnUIForm(FacesContext facesContext, List<UIComponent> list, String clientId, Callback callback) {
+ @SuppressWarnings(value = "unchecked")
+ private static void prepareOnUIForm(FacesContext facesContext, List<UIComponent> list, String clientId,
+ Callback callback) {
UIComponent currentComponent = list.remove(0);
if (!(currentComponent instanceof UIForm)) {
throw new IllegalStateException(currentComponent.getClass().getName());
@@ -1264,7 +1261,7 @@
}
}
UIForm uiForm = (UIForm) currentComponent;
- facesContext.getExternalContext().getRequestMap().put(UIForm.SUBMITTED_MARKER, Boolean.valueOf(uiForm.isSubmitted()));
+ facesContext.getExternalContext().getRequestMap().put(UIForm.SUBMITTED_MARKER, uiForm.isSubmitted());
invokeOrPrepare(facesContext, list, clientId, callback);
}
Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/util/UpdateModelValuesCallback.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/util/UpdateModelValuesCallback.java?rev=601085&r1=601084&r2=601085&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/util/UpdateModelValuesCallback.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/util/UpdateModelValuesCallback.java Tue Dec 4 13:02:59 2007
@@ -27,8 +27,8 @@
public class UpdateModelValuesCallback implements Callback {
public void execute(FacesContext facesContext, UIComponent component) {
- if (facesContext.getExternalContext().getRequestMap().get(UIForm.SUBMITTED_MARKER) == null ||
- ((Boolean) facesContext.getExternalContext().getRequestMap().get(UIForm.SUBMITTED_MARKER))) {
+ if (facesContext.getExternalContext().getRequestMap().get(UIForm.SUBMITTED_MARKER) == null
+ || ((Boolean) facesContext.getExternalContext().getRequestMap().get(UIForm.SUBMITTED_MARKER))) {
component.processUpdates(facesContext);
} else {
// if we're not the submitted form, only process subforms.