You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by ta...@apache.org on 2018/12/25 21:43:33 UTC
[myfaces] branch master updated (1395b8b -> 6ef7de9)
This is an automated email from the ASF dual-hosted git repository.
tandraschko pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/myfaces.git.
from 1395b8b refactored
new af8a4fd removed TODO, it's ok, the code isn't the same and the benefit would be minimal
new 6ef7de9 refacoted
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../annotation/AllAnnotationLifecycleProvider.java | 4 +--
.../ResourceAnnotationLifecycleProvider.java | 1 -
.../renderkit/html/HtmlAjaxBehaviorRenderer.java | 8 ++---
.../renderkit/html/HtmlCommandScriptRenderer.java | 6 +---
.../html/base/HtmlCheckboxRendererBase.java | 41 +++++++++-------------
.../view/facelets/tag/TagAttributesImpl.java | 3 --
.../view/facelets/tag/ui/CompositionHandler.java | 4 +--
.../view/facelets/tag/ui/DecorateHandler.java | 4 +--
8 files changed, 23 insertions(+), 48 deletions(-)
[myfaces] 02/02: refacoted
Posted by ta...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
tandraschko pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/myfaces.git
commit 6ef7de9e6c94c3c7d5edd344534d578a70601c3c
Author: Thomas Andraschko <ta...@apache.org>
AuthorDate: Tue Dec 25 22:42:38 2018 +0100
refacoted
---
.../annotation/AllAnnotationLifecycleProvider.java | 4 +--
.../ResourceAnnotationLifecycleProvider.java | 1 -
.../renderkit/html/HtmlAjaxBehaviorRenderer.java | 8 ++---
.../renderkit/html/HtmlCommandScriptRenderer.java | 6 +---
.../html/base/HtmlCheckboxRendererBase.java | 41 +++++++++-------------
.../view/facelets/tag/TagAttributesImpl.java | 3 --
6 files changed, 20 insertions(+), 43 deletions(-)
diff --git a/impl/src/main/java/org/apache/myfaces/config/annotation/AllAnnotationLifecycleProvider.java b/impl/src/main/java/org/apache/myfaces/config/annotation/AllAnnotationLifecycleProvider.java
index 80f5499..711e1c9 100644
--- a/impl/src/main/java/org/apache/myfaces/config/annotation/AllAnnotationLifecycleProvider.java
+++ b/impl/src/main/java/org/apache/myfaces/config/annotation/AllAnnotationLifecycleProvider.java
@@ -25,12 +25,10 @@ import javax.ejb.EJB;
import javax.persistence.PersistenceContext;
import javax.persistence.PersistenceUnit;
-
import java.lang.reflect.Method;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Field;
-// TODO @EJBs
public class AllAnnotationLifecycleProvider extends ResourceAnnotationLifecycleProvider
{
@@ -54,7 +52,7 @@ public class AllAnnotationLifecycleProvider extends ResourceAnnotationLifecycleP
EJB annotation = method.getAnnotation(EJB.class);
lookupMethodResource(context, instance, method, annotation.name());
}
- // TODO where i find WebServiceRef?
+ // not implemented since 1.x, let's ignore it for now
/*if (method.isAnnotationPresent(WebServiceRef.class)) {
WebServiceRef annotation =
(WebServiceRef) method.getAnnotation(WebServiceRef.class);
diff --git a/impl/src/main/java/org/apache/myfaces/config/annotation/ResourceAnnotationLifecycleProvider.java b/impl/src/main/java/org/apache/myfaces/config/annotation/ResourceAnnotationLifecycleProvider.java
index 2900367..0d879c4 100644
--- a/impl/src/main/java/org/apache/myfaces/config/annotation/ResourceAnnotationLifecycleProvider.java
+++ b/impl/src/main/java/org/apache/myfaces/config/annotation/ResourceAnnotationLifecycleProvider.java
@@ -29,7 +29,6 @@ import java.util.Map;
import java.util.WeakHashMap;
import org.apache.myfaces.util.ClassUtils;
-// TODO @Resources
public class ResourceAnnotationLifecycleProvider extends NoInjectionAnnotationLifecycleProvider
{
/**
diff --git a/impl/src/main/java/org/apache/myfaces/renderkit/html/HtmlAjaxBehaviorRenderer.java b/impl/src/main/java/org/apache/myfaces/renderkit/html/HtmlAjaxBehaviorRenderer.java
index 2a334ef..c9b3605 100644
--- a/impl/src/main/java/org/apache/myfaces/renderkit/html/HtmlAjaxBehaviorRenderer.java
+++ b/impl/src/main/java/org/apache/myfaces/renderkit/html/HtmlAjaxBehaviorRenderer.java
@@ -344,11 +344,7 @@ public class HtmlAjaxBehaviorRenderer extends ClientBehaviorRenderer
private void append(StringBuilder paramBuffer, List<String> parameterList, ClientBehaviorContext.Parameter param)
{
- //TODO we may need a proper type handling in this part
- //lets leave it for now as it is
- //quotes etc.. should be transferred directly
- //and the rest is up to the toString properly implemented
- //ANS: Both name and value should be quoted
+ // Both name and value should be quoted
paramBuffer.setLength(0);
paramBuffer.append('\'');
paramBuffer.append(param.getName());
@@ -399,10 +395,10 @@ public class HtmlAjaxBehaviorRenderer extends ClientBehaviorRenderer
{
dataHolder = Collections.emptyList();
}
+
int executeSize = dataHolder.size();
if (executeSize > 0)
{
-
retVal.append(target);
retVal.append(':');
retVal.append('\'');
diff --git a/impl/src/main/java/org/apache/myfaces/renderkit/html/HtmlCommandScriptRenderer.java b/impl/src/main/java/org/apache/myfaces/renderkit/html/HtmlCommandScriptRenderer.java
index e264a74..e4fe970 100644
--- a/impl/src/main/java/org/apache/myfaces/renderkit/html/HtmlCommandScriptRenderer.java
+++ b/impl/src/main/java/org/apache/myfaces/renderkit/html/HtmlCommandScriptRenderer.java
@@ -378,11 +378,7 @@ public class HtmlCommandScriptRenderer extends HtmlRenderer
private void append(StringBuilder paramBuffer, List<String> parameterList, String paramName, Object paramValue)
{
- //TODO we may need a proper type handling in this part
- //lets leave it for now as it is
- //quotes etc.. should be transferred directly
- //and the rest is up to the toString properly implemented
- //ANS: Both name and value should be quoted
+ //Both name and value should be quoted
paramBuffer.setLength(0);
paramBuffer.append('\'');
paramBuffer.append(paramName);
diff --git a/impl/src/main/java/org/apache/myfaces/renderkit/html/base/HtmlCheckboxRendererBase.java b/impl/src/main/java/org/apache/myfaces/renderkit/html/base/HtmlCheckboxRendererBase.java
index 19dec9f..13b9f28 100644
--- a/impl/src/main/java/org/apache/myfaces/renderkit/html/base/HtmlCheckboxRendererBase.java
+++ b/impl/src/main/java/org/apache/myfaces/renderkit/html/base/HtmlCheckboxRendererBase.java
@@ -84,15 +84,12 @@ public class HtmlCheckboxRendererBase extends HtmlRenderer
}
else
{
- throw new IllegalArgumentException("Unsupported component class "
- + uiComponent.getClass().getName());
+ throw new IllegalArgumentException("Unsupported component class " + uiComponent.getClass().getName());
}
}
- public void renderCheckboxList(FacesContext facesContext,
- UISelectMany selectMany) throws IOException
+ public void renderCheckboxList(FacesContext facesContext, UISelectMany selectMany) throws IOException
{
-
String layout = getLayout(selectMany);
boolean pageDirectionLayout = false; //Default to lineDirection
if (layout != null)
@@ -115,8 +112,7 @@ public class HtmlCheckboxRendererBase extends HtmlRenderer
ResponseWriter writer = facesContext.getResponseWriter();
writer.startElement(HTML.TABLE_ELEM, selectMany);
- HtmlRendererUtils.renderHTMLAttributes(writer, selectMany,
- HTML.SELECT_TABLE_PASSTHROUGH_ATTRIBUTES);
+ HtmlRendererUtils.renderHTMLAttributes(writer, selectMany, HTML.SELECT_TABLE_PASSTHROUGH_ATTRIBUTES);
Map<String, List<ClientBehavior>> behaviors = null;
if (selectMany instanceof ClientBehaviorHolder)
@@ -140,21 +136,18 @@ public class HtmlCheckboxRendererBase extends HtmlRenderer
Converter converter = getConverter(facesContext, selectMany);
- Set lookupSet = RendererUtils.getSubmittedValuesAsSet(
- facesContext, selectMany, converter, selectMany);
+ Set lookupSet = RendererUtils.getSubmittedValuesAsSet(facesContext, selectMany, converter, selectMany);
boolean useSubmittedValues = lookupSet != null;
if (!useSubmittedValues)
{
- lookupSet = RendererUtils.getSelectedValuesAsSet(
- facesContext, selectMany, converter, selectMany);
+ lookupSet = RendererUtils.getSelectedValuesAsSet(facesContext, selectMany, converter, selectMany);
}
int itemNum = 0;
- List<SelectItem> selectItemList = RendererUtils.getSelectItemList(
- selectMany, facesContext);
+ List<SelectItem> selectItemList = RendererUtils.getSelectItemList(selectMany, facesContext);
for (int i = 0; i < selectItemList.size(); i++)
{
@@ -263,8 +256,10 @@ public class HtmlCheckboxRendererBase extends HtmlRenderer
// AND this selectItem is the "no selection option"
// AND there are currently selected items
// AND this item (the "no selection option") is not selected
- if (HtmlRendererUtils.isHideNoSelectionOption(uiComponent) && selectItem.isNoSelectionOption()
- && !lookupSet.isEmpty() && !checked)
+ if (HtmlRendererUtils.isHideNoSelectionOption(uiComponent)
+ && selectItem.isNoSelectionOption()
+ && !lookupSet.isEmpty()
+ && !checked)
{
// do not render this selectItem
return itemNum;
@@ -479,11 +474,10 @@ public class HtmlCheckboxRendererBase extends HtmlRenderer
}
else
{
- throw new IllegalArgumentException("Unsupported component class "
- + component.getClass().getName());
+ throw new IllegalArgumentException("Unsupported component class " + component.getClass().getName());
}
- if (component instanceof ClientBehaviorHolder &&
- !HtmlRendererUtils.isDisabled(component))
+
+ if (component instanceof ClientBehaviorHolder && !HtmlRendererUtils.isDisabled(component))
{
HtmlRendererUtils.decodeClientBehaviors(facesContext, component);
}
@@ -500,13 +494,11 @@ public class HtmlCheckboxRendererBase extends HtmlRenderer
}
else if (component instanceof UISelectMany)
{
- return RendererUtils.getConvertedUISelectManyValue(facesContext,
- (UISelectMany) component, submittedValue);
+ return RendererUtils.getConvertedUISelectManyValue(facesContext, (UISelectMany) component, submittedValue);
}
else
{
- throw new IllegalArgumentException("Unsupported component class "
- + component.getClass().getName());
+ throw new IllegalArgumentException("Unsupported component class " + component.getClass().getName());
}
}
@@ -520,8 +512,7 @@ public class HtmlCheckboxRendererBase extends HtmlRenderer
{
if (component instanceof UISelectMany)
{
- return HtmlRendererUtils.findUISelectManyConverterFailsafe(facesContext,
- (UISelectMany) component);
+ return HtmlRendererUtils.findUISelectManyConverterFailsafe(facesContext, (UISelectMany) component);
}
else if (component instanceof UISelectOne)
{
diff --git a/impl/src/main/java/org/apache/myfaces/view/facelets/tag/TagAttributesImpl.java b/impl/src/main/java/org/apache/myfaces/view/facelets/tag/TagAttributesImpl.java
index d198cc0..a02897b 100644
--- a/impl/src/main/java/org/apache/myfaces/view/facelets/tag/TagAttributesImpl.java
+++ b/impl/src/main/java/org/apache/myfaces/view/facelets/tag/TagAttributesImpl.java
@@ -48,9 +48,6 @@ public final class TagAttributesImpl extends TagAttributes
private final String[] _namespaces;
private final List<TagAttribute[]> _nsattrs;
- /**
- *
- */
public TagAttributesImpl(TagAttribute[] attrs)
{
_attributes = attrs;
[myfaces] 01/02: removed TODO, it's ok,
the code isn't the same and the benefit would be minimal
Posted by ta...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
tandraschko pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/myfaces.git
commit af8a4fd62ba1129eec7d5fbfe5fcc962e99e1eae
Author: Thomas Andraschko <ta...@apache.org>
AuthorDate: Tue Dec 25 22:23:45 2018 +0100
removed TODO, it's ok, the code isn't the same and the benefit would be minimal
---
.../org/apache/myfaces/view/facelets/tag/ui/CompositionHandler.java | 4 ++--
.../java/org/apache/myfaces/view/facelets/tag/ui/DecorateHandler.java | 4 +---
2 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/impl/src/main/java/org/apache/myfaces/view/facelets/tag/ui/CompositionHandler.java b/impl/src/main/java/org/apache/myfaces/view/facelets/tag/ui/CompositionHandler.java
index 2981e59..4e68784 100644
--- a/impl/src/main/java/org/apache/myfaces/view/facelets/tag/ui/CompositionHandler.java
+++ b/impl/src/main/java/org/apache/myfaces/view/facelets/tag/ui/CompositionHandler.java
@@ -42,7 +42,7 @@ import org.apache.myfaces.view.facelets.TemplateClient;
import org.apache.myfaces.view.facelets.tag.TagHandlerUtils;
/**
- * TODO: REFACTOR - This class could easily use a common parent with DecoratorHandler
+ *
*
* @author Jacob Hookom
* @version $Id$
@@ -74,7 +74,7 @@ public final class CompositionHandler extends TagHandler implements TemplateClie
_template = getAttribute("template");
if (_template != null)
{
- _handlers = new HashMap<String, DefineHandler>();
+ _handlers = new HashMap<>();
for (DefineHandler handler : TagHandlerUtils.findNextByType(nextHandler, DefineHandler.class))
{
_handlers.put(handler.getName(), handler);
diff --git a/impl/src/main/java/org/apache/myfaces/view/facelets/tag/ui/DecorateHandler.java b/impl/src/main/java/org/apache/myfaces/view/facelets/tag/ui/DecorateHandler.java
index d41c554..c7e6537 100644
--- a/impl/src/main/java/org/apache/myfaces/view/facelets/tag/ui/DecorateHandler.java
+++ b/impl/src/main/java/org/apache/myfaces/view/facelets/tag/ui/DecorateHandler.java
@@ -52,9 +52,7 @@ import org.apache.myfaces.view.facelets.tag.jsf.ComponentSupport;
*
* The sum of it all is that you can take any element in the document and decorate
* it with some external logic as provided by the template.
- *
- * TODO: REFACTOR - This class could easily use a common parent with CompositionHandler
- *
+ *
* @author Jacob Hookom
* @version $Id$
*/