Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.2
    • Fix Version/s: 1.0
    • Component/s: None
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      70

      Description

      AW> .... you're correct with regards to JSP 2.0, where release() is finally
      AW> specified as called once before it is truly gone. However, JSP 1.2 was
      AW> (sadly) not quite so specific, and release() can be called repeatedly.
      AW> There's a diagram that's in both 1.2 and 2.0 where the 1.2 version has
      AW> an extra arrow leading away from the "release()" state.
      AW> So, in JSF 1.2, therefore, we can rely on the JSP 2.0 behavior, while
      AW> any JSF 1.1 release theoretically has to suffer all the behavior
      AW> allowed by JSP 1.2.

      This changebundle generates the release() method on all tags. Tests for JSF-RI
      were run successfully--

      SECTION: Changes

      M HtmlTaglibGenerator.java
      -added 'tagHandlerReleaseMethod()' which follows the same logic as the ivar
      generation to set properties to null or if primitive, their default values.

      SECTION: Diffs

      Index: HtmlTaglibGenerator.java
      ===================================================================
      RCS file:
      /shared/data/ccvs/repository/javaserverfaces-sources/jsf-tools/src/com/sun/faces/generate/HtmlTaglibGenerator.java,v
      retrieving revision 1.29
      diff -u -r1.29 HtmlTaglibGenerator.java
      — HtmlTaglibGenerator.java 29 Oct 2004 00:56:39 -0000 1.29
      +++ HtmlTaglibGenerator.java 12 Nov 2004 14:32:12 -0000
      @@ -35,7 +35,7 @@

      • package.
        */
        public class HtmlTaglibGenerator extends AbstractGenerator { - + // -------------------------------------------------------- Static Variables // Log instance for this class @@ -545,6 +545,86 @@ // Generate Log declaration writer.write(" public static Log log = LogFactory.getLog("+tagClassName+".class);\n\n"); }

        +
        + private static void tagHandlerReleaseMethod() throws Exception {
        + writer.write(" //\n // Release Method\n //\n\n");
        +
        + writer.write(" public void release() {\n");
        + writer.write(" super.release();\n\n");
        + writer.write(" // component properties\n");
        +
        + // Generate from component properties
        + //
        + PropertyBean[] properties = component.getProperties();
        + PropertyBean property = null;
        + String propertyName = null;
        + String propertyType = null;
        + String ivar = null;
        + for (int i = 0, len = properties.length; i < len; i++)

        Unknown macro: {+ if (null == (property = properties[i])) { + continue; + }
        + if (!property.isTagAttribute()) {+ continue;+ }+ propertyName = property.getPropertyName();+ propertyType = property.getPropertyClass();++ // SPECIAL - Don't generate these properties+ if (propertyName.equals("binding") || propertyName.equals("id")+ || propertyName.equals("rendered")) { + continue; + }
        +
        + ivar = mangle(propertyName);
        + writer.write(" this." + ivar + " = ");
        + if (primitive(propertyType) &&
        !(valueBindingEnabledProperties.contains(propertyName)
        + || methodBindingEnabledProperties.contains(propertyName))) { + writer.write((String) defaults.get(propertyType)); + } else { + writer.write("null"); + }
        + writer.write(";\n");
        + /*
        + if (valueBindingEnabledProperties.contains(propertyName)
        + || methodBindingEnabledProperties.contains(propertyName)) { + writer.write(" private java.lang.String " + ivar + ";\n"); + } else {
        + writer
        + .write(" private " + propertyType + " " + ivar
        + + ";\n");
        + if (primitive(propertyType)) { + writer.write(" = " + (String) defaults.get(propertyType) + + ";\n"); + }
        + }
        + */
        + }
        +
        + writer.write("\n");
        + writer.write(" // rendered attributes\n");
        +
        + // Generate from renderer attributes..
        + //
        + AttributeBean[] attributes = renderer.getAttributes();
        + AttributeBean attribute = null;
        + String attributeName = null;
        + String attributeType = null;
        + for (int i = 0, len = attributes.length; i < len; i++) {
        + if (null == (attribute = attributes[i])) {+ continue;+ }+ if (!attribute.isTagAttribute()) { + continue; + }+ attributeName = attribute.getAttributeName();+ attributeType = attribute.getAttributeClass();++ ivar = mangle(attributeName);+ writer.write(" this." + ivar + " = null;n");+ }

        + writer.write(" }\n\n");
        + }

      /**

      • Generate Tag Handler instance variables from component properties
        @@ -1133,6 +1213,7 @@
        } else { tagHandlerSupportMethods(); }

        + tagHandlerReleaseMethod();
        tagHandlerSuffix();

      // Flush and close the Writer

        Activity

        Hide
        jhook added a comment -

        Created an attachment (id=49)
        New Release Method

        Show
        jhook added a comment - Created an attachment (id=49) New Release Method
        Hide
        jayashri added a comment -

        Looks good to me r=jayashri
        Please get rid of the commented block in tagHandlerReleaseMethod().

        Show
        jayashri added a comment - Looks good to me r=jayashri Please get rid of the commented block in tagHandlerReleaseMethod().
        Hide
        jhook added a comment -

        Submitted, version 1.30

        Show
        jhook added a comment - Submitted, version 1.30
        Hide
        Manfred Riem added a comment -

        Closing issue out

        Show
        Manfred Riem added a comment - Closing issue out

          People

          • Assignee:
            jhook
            Reporter:
            jhook
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: