QDox
  1. QDox
  2. QDOX-48

getTagByName does not work with fields when there's no javadoc

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Incomplete
    • Affects Version/s: 1.4
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:
      SO: Linux Debian SID (unstable)
      IDE: Eclipse 3.0M8
      JDK: j2sdk 1.4.2_04
    • Number of attachments :
      1

      Description

      I observed this issue when trying to iterate over class' fields.
      Only the first of them has a javadoc tag.
      But it seems that the subsequent fields see the same javadoc tag as their own.

      Example class:

      public class A {
      /**

      • @tag no-access="true"
        */
        private int field1;

      private int field2;

      private int field3;
      }

      Velocity template:

      #foreach($field in $class.fields)
      #set($tag = $field.getTagByName("tag"))

      #if($tag.getNamedParameter("no-access"))
      <!-- Skipped by tag 'no-access' presence in field $field.name -->
      #else
      <!-- access the field
      do something... -->
      #end

      #end

      Result:

      <!-- Skipped by tag 'no-access' presence in field field1 -->
      <!-- Skipped by tag 'no-access' presence in field field2 -->
      <!-- Skipped by tag 'no-access' presence in field field3 -->

        Activity

        Hide
        Miguel Griffa added a comment -

        A failing test case

        Show
        Miguel Griffa added a comment - A failing test case
        Miguel Griffa made changes -
        Field Original Value New Value
        Attachment jira-qdox48-patch.txt [ 12053 ]
        Hide
        Miguel Griffa added a comment -

        oops, seems the previous test case was wrong and the CVS version is working fine

        Show
        Miguel Griffa added a comment - oops, seems the previous test case was wrong and the CVS version is working fine
        Hide
        Aslak Hellesøy added a comment -

        Can we close this issue then?

        Show
        Aslak Hellesøy added a comment - Can we close this issue then?
        Hide
        Mike Williams added a comment -

        I think this might be a Velocity issue: if the RHS of a #set is null, Velocity just skips the #set, and leaves the variable set to it's previous value.

        Show
        Mike Williams added a comment - I think this might be a Velocity issue: if the RHS of a #set is null, Velocity just skips the #set, and leaves the variable set to it's previous value.
        Hide
        Miguel Griffa added a comment -

        Yes, plesse close it and forgive the noise.

        Show
        Miguel Griffa added a comment - Yes, plesse close it and forgive the noise.
        Mike Williams made changes -
        Resolution Incomplete [ 4 ]
        Status Open [ 1 ] Closed [ 6 ]

          People

          • Assignee:
            Unassigned
            Reporter:
            Horacio Lertora
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: