Uploaded image for project: 'MyFaces Core'
  1. MyFaces Core
  2. MYFACES-4000

Some MyFaces JSF 2.2 API signatures do not match the Java EE 7 API

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.2.8
    • 2.2.9
    • JSR-344
    • None

    Description

      There are several MyFaces 2.2 API classes in which their signatures do not fully match what is specified in Java EE 7 JSF API. For reference, the comparison is based from Oracle's Java EE 7 API at: http://docs.oracle.com/javaee/7/api/index.html

      The issues we found are noted below. They are broken down by package.

      package javax.faces.application

      In class:
      javax.faces.application.ApplicationWrapper (http://docs.oracle.com/javaee/7/api/javax/faces/application/ApplicationWrapper.html)

      The following methods have been deprecated and should have the @Deprecated annotation however they are missing in the current MyFaces API:

      • createComponent(ValueBinding componentBinding, FacesContext context, String componentType)
      • createMethodBinding(String ref, Class<?>[] params)
      • evaluateExpressionGet(FacesContext context, String expression, Class<? extends T> expectedType)
      • getPropertyResolver()
      • getVariableResolver()
      • setPropertyResolver(PropertyResolver resolver)
      • setVariableResolver(VariableResolver resolver)

      In class:
      javax.faces.application.StateManager (http://docs.oracle.com/javaee/7/api/javax/faces/application/StateManager.html)

      The following methods have been deprecated and should have the @Deprecated annotation:

      • saveView(FacesContext context)
      • restoreView(FacesContext context, String viewId, String renderKitId)

      package javax.faces.bean

      The following classes have the @Documented annotation specified when they should not:

      • javax.faces.bean.ApplicationScoped
      • javax.faces.bean.CustomScoped
      • javax.faces.bean.ManagedBean
      • javax.faces.bean.ManagedProperty
      • javax.faces.bean.ManagedProperty
      • javax.faces.bean.NoneScoped
      • javax.faces.bean.ReferencedBean
      • javax.faces.bean.RequestScoped
      • javax.faces.bean.SessionScoped
      • javax.faces.bean.ViewScoped

      In class:
      javax.faces.bean.ManagedProperty (http://docs.oracle.com/javaee/7/api/javax/faces/bean/ManagedProperty.html)

      The @Type annotation specifies both FIELD and METHOD element types, however, it should only be TYPE. For example:
      @Target(ElementType.FIELD)

      In class:
      javax.faces.bean.CustomScoped (http://docs.oracle.com/javaee/7/api/javax/faces/bean/CustomScoped.html)

      The value() method specifies a default value of "", however the API documentation does not state that this method has a default value.

      package javax.faces.component

      In class:
      javax.faces.component.UIComponent (http://docs.oracle.com/javaee/7/api/javax/faces/component/UIComponent.html)

      MyFaces currently lists the getPassThroughAttributes(boolean create) method as abstract, however the API documentation does not state that. I propose that this method return an empty Map. Something like this:

      public Map<String,Object> getPassThroughAttributes(boolean create)
      {
         return Collections.emptyMap();
      }
      

      In class:
      javax.faces.component.UIViewAction (http://docs.oracle.com/javaee/7/api/javax/faces/component/UIViewAction.html)

      The following two methods are not listed in the API documentation and should be removed:

      • setValue(java.lang.Object)
      • getValue()

      The following four methods are deprecated and need to have the @Deprecated annotation added:

      • getAction()
      • getActionListener()
      • setAction(javax.faces.el.MethodBinding)
      • setActionListener(javax.faces.el.MethodBinding)

      package javax.faces.el

      The following classes are listed as deprecated, however the API documentation does not state that they are. The @Deprecated annotation should be removed from the class level for the following classes:

      • javax.faces.el.EvaluationException
      • javax.faces.el.MethodBinding
      • javax.faces.el.MethodNotFoundException
      • javax.faces.el.PropertyNotFoundException
      • javax.faces.el.PropertyResolver
      • javax.faces.el.ReferenceSyntaxException
      • javax.faces.el.ValueBinding
      • javax.faces.el.VariableResolver

      package javax.faces.validator

      In class:
      javax.faces.validator.FacesValidator ( http://docs.oracle.com/javaee/7/api/javax/faces/validator/FacesValidator.html )

      the value() method does not have a default value, however the API documentation states that it should have a default value of an empty String ("").

      package javax.faces.facelets

      The class javax.faces.view.facelets.ResourceResolver should be deprecated (add @Deprecated at the class level) per the API documentation at http://docs.oracle.com/javaee/7/api/javax/faces/view/facelets/ResourceResolver.html

      package javax.faces.webapp

      The following classes are not entirely deprecated and their @Deprecated annotation should be removed from the MyFaces API:

      • javax.faces.webapp.AttributeTag
      • javax.faces.webapp.ConverterTag
      • javax.faces.webapp.UIComponentBodyTag
      • javax.faces.webapp.UIComponentTag
      • javax.faces.webapp.ValidatorTag

      In the class:
      javax.faces.webapp.UIComponentTagBase (http://docs.oracle.com/javaee/7/api/javax/faces/webapp/UIComponentTagBase.html)

      The log field should be marked final per the API documentation (http://docs.oracle.com/javaee/7/api/javax/faces/webapp/UIComponentTagBase.html#log), however it is not in the MyFaces API.

      Attachments

        Activity

          People

            lu4242 Leonardo Uribe
            sartoris Jay Sartoris
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: