Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.2.0
    • Fix Version/s: 2.2.1
    • Component/s: None
    • Labels:
      None

      Description

      Index: jsf-ri/src/main/java/com/sun/faces/facelets/tag/jsf/core/CoreLibrary.java

      • I don't like the duplicated code among the ctors. That is just asking
        for a "failed to update both places" bug. I would rather have the
        no-arg ctor be this:

      public CoreLibrary()

      { this(Namespace); }

      And just keep the newly added public CoreLibrary(String namespace).

      Index: jsf-ri/src/main/java/com/sun/faces/facelets/tag/jsf/html/HtmlLibrary.java
      Index: jsf-ri/src/main/java/com/sun/faces/facelets/tag/ui/UILibrary.java
      Index: jsf-ri/src/main/java/com/sun/faces/facelets/tag/composite/CompositeLibrary.java

      • I think the same approach can be used here as in CoreLibrary.

      Index: jsf-ri/src/main/java/com/sun/faces/application/ApplicationAssociate.java

      • If you have symbolic constants, use them instead of literal strings.

      + c.addTagLibrary(new CoreLibrary("http://xmlns.jcp.org/jsf/core"));
      c.addTagLibrary(new HtmlLibrary());
      + c.addTagLibrary(new HtmlLibrary("http://xmlns.jcp.org/jsf/html"));
      c.addTagLibrary(new UILibrary());
      + c.addTagLibrary(new UILibrary("http://xmlns.jcp.org/jsf/facelets"));
      c.addTagLibrary(new JstlCoreLibrary());
      c.addTagLibrary(new JstlCoreLibrary("http://java.sun.com/jstl/core"));
      + c.addTagLibrary(new JstlCoreLibrary("http://xmlns.jcp.org/jsp/jstl/core"));
      c.addTagLibrary(new PassThroughAttributeLibrary());
      c.addTagLibrary(new PassThroughElementLibrary());
      c.addTagLibrary(new FunctionLibrary(JstlFunction.class, "http://java.sun.com/jsp/jstl/functions"));
      + c.addTagLibrary(new FunctionLibrary(JstlFunction.class, "http://xmlns.jcp.org/jsp/jstl/functions"));
      if (isDevModeEnabled())

      { c.addTagLibrary(new FunctionLibrary(DevTools.class, "http://java.sun.com/mojarra/private/functions")); + c.addTagLibrary(new FunctionLibrary(DevTools.class, "http://xmlns.jcp.org/mojarra/private/functions")); }

      c.addTagLibrary(new CompositeLibrary());
      + c.addTagLibrary(new CompositeLibrary("http://xmlns.jcp.org/jsf/composite"));

      If you don't have literal constants, you should. I know there are
      several places where you have a public static final String Namespace
      that can be used instead of a String literal.

      Thanks,

      Ed

        Issue Links

          Activity

          Hide
          Manfred Riem added a comment -

          Applied to 2.2 branch,

          svn commit -m "Fixes https://java.net/jira/browse/JAVASERVERFACES-2797, r=rogerk, fixes constructor pattern"
          Sending jsf-ri\src\main\java\com\sun\faces\facelets\tag\composite\CompositeLibrary.java
          Sending jsf-ri\src\main\java\com\sun\faces\facelets\tag\jsf\core\CoreLibrary.java
          Sending jsf-ri\src\main\java\com\sun\faces\facelets\tag\jsf\html\HtmlLibrary.java
          Sending jsf-ri\src\main\java\com\sun\faces\facelets\tag\ui\UILibrary.java
          Transmitting file data ....
          Committed revision 11960.

          Show
          Manfred Riem added a comment - Applied to 2.2 branch, svn commit -m "Fixes https://java.net/jira/browse/JAVASERVERFACES-2797 , r=rogerk, fixes constructor pattern" Sending jsf-ri\src\main\java\com\sun\faces\facelets\tag\composite\CompositeLibrary.java Sending jsf-ri\src\main\java\com\sun\faces\facelets\tag\jsf\core\CoreLibrary.java Sending jsf-ri\src\main\java\com\sun\faces\facelets\tag\jsf\html\HtmlLibrary.java Sending jsf-ri\src\main\java\com\sun\faces\facelets\tag\ui\UILibrary.java Transmitting file data .... Committed revision 11960.

            People

            • Assignee:
              Manfred Riem
              Reporter:
              Ed Burns
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: