Commons Digester
  1. Commons Digester
  2. DIGESTER-59

[Digester][PATCH] Obtaining String class in CallMethodRule

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Trivial Trivial
    • Resolution: Fixed
    • Affects Version/s: 1.6
    • Fix Version/s: None
    • Labels:
      None
    • Environment:

      Operating System: other
      Platform: Other

      Description

      Recent musings on the CallMethodRule code brought to my notice an interesting
      construct for obtaining the String class

      Inlining a patch, since its trivial:

      Index: CallMethodRule.java
      ===================================================================
      RCS file: /usr/local/cvsroot/apache/patches/commons-digester-1.6-
      src/src/java/org/apache/commons/digester/CallMethodRule.java,v
      retrieving revision 1.1
      diff -c -r1.1 CallMethodRule.java

          • CallMethodRule.java 27 May 2005 02:52:14 -0000 1.2
          • CallMethodRule.java 27 May 2005 03:21:23 -0000
            ***************
            262c262
            < this.paramTypes[i] = "abc".getClass();

            > this.paramTypes[i] = String.class;
            330c330
            < this.paramTypes[i] = "abc".getClass();

            > this.paramTypes[i] = String.class;
            503c503
            < paramTypes[0] = "abc".getClass();

            > paramTypes[0] = String.class;

      -Rahul

        Activity

        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Resolved Resolved Closed Closed
        651d 7h 29m 1 Henri Yandell 09/Mar/07 20:39
        Rahul Akolkar made changes -
        Reporter Rahul [ akolkar@us.ibm.com ] Rahul Akolkar [ rahul@apache.org ]
        Hide
        Rahul Akolkar added a comment -

        Changing reporter in order to close old account.

        Show
        Rahul Akolkar added a comment - Changing reporter in order to close old account.
        Henri Yandell made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Henri Yandell made changes -
        Affects Version/s 1.6 Final [ 12311712 ]
        Henri Yandell made changes -
        Project Commons [ 12310458 ] Commons Digester [ 12310471 ]
        Affects Version/s 1.6 Final [ 12311666 ]
        Assignee Jakarta Commons Developers Mailing List [ commons-dev@jakarta.apache.org ]
        Component/s Digester [ 12311111 ]
        Key COM-2113 DIGESTER-59
        Henri Yandell made changes -
        Field Original Value New Value
        issue.field.bugzillaimportkey 35097 12342265
        Hide
        Simon Kitching added a comment -

        Committed as revision 190341. Thanks.

        Show
        Simon Kitching added a comment - Committed as revision 190341. Thanks.
        Hide
        akolkar@us.ibm.com added a comment -

        (In reply to comment #1)
        <snip>
        > I think I would prefer to commit this change after the release
        > rather than immediately before.

        Please, take your time. I wouldn't want to introduce 0.01% doubt at this stage.

        -Rahul

        Show
        akolkar@us.ibm.com added a comment - (In reply to comment #1) <snip> > I think I would prefer to commit this change after the release > rather than immediately before. Please, take your time. I wouldn't want to introduce 0.01% doubt at this stage. -Rahul
        Hide
        Simon Kitching added a comment -

        Yes, that existing code is a bit .. different.

        I'm 99.99% sure that your change is correct. But as there isn't anything
        *actually wrong with the existing code, and we are (hopefully) just a few days
        from a release, I think I would prefer to commit this change after the release
        rather than immediately before.

        Unless you can see a situation where String.class works and "abc".getClass()
        does not?

        Show
        Simon Kitching added a comment - Yes, that existing code is a bit .. different. I'm 99.99% sure that your change is correct. But as there isn't anything *actually wrong with the existing code, and we are (hopefully) just a few days from a release, I think I would prefer to commit this change after the release rather than immediately before. Unless you can see a situation where String.class works and "abc".getClass() does not?
        akolkar@us.ibm.com created issue -

          People

          • Assignee:
            Unassigned
            Reporter:
            Rahul Akolkar
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development