QDox
  1. QDox
  2. QDOX-151

introduce toString() according to the Java Language Specification

    Details

    • Type: Improvement Improvement
    • Status: Closed Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.9
    • Fix Version/s: 1.10
    • Component/s: Java API
    • Labels:
      None
    • Number of attachments :
      1

      Description

      When calling the toString() on most of the model-Java* classes in qdox, it'll return the complete codeblock.
      Their java.lang.reflect equivalent acts a bit different. For example http://java.sun.com/j2se/1.5.0/docs/api/java/lang/reflect/Method.html#toString()
      Nowhere is documented that toString() will return the complete codeblock.

      two choices: keep the current toString(0 as it is and introduce another method ( toMethodString() or toSpecString() or ....)
      or rename toString() (to getCodeblock() or ....) and implement the toString() according to tha javaAPI

        Activity

        Hide
        Paul Hammant added a comment -

        I'm for the getCodeBlock() change.

        Its a very very niche case where someone uses the codeblock from toString() and they should be able to change happily. Meanwhile a huge percentage of folks watching QDox go by in an interactive debugger will be very pleased.

        Show
        Paul Hammant added a comment - I'm for the getCodeBlock() change. Its a very very niche case where someone uses the codeblock from toString() and they should be able to change happily. Meanwhile a huge percentage of folks watching QDox go by in an interactive debugger will be very pleased.
        Hide
        Vincent Siveton added a comment -

        Using qdox 1.10 snapshot, I noticed that the JavaMethod#toSting() is different form the Method#toString().

        Here is a small test case:

        public <T extends StringBuffer> List<T> myMethod( T field, List<T> list )
        
        javaMethod.toString()=public java.util.List test.TestQDOX151.myMethod(java.lang.StringBuffer fieldjava.util.List)
        class.getMethods()[1]=public java.util.List test.TestQDOX151.myMethod(java.lang.StringBuffer,java.util.List)
        
        Show
        Vincent Siveton added a comment - Using qdox 1.10 snapshot, I noticed that the JavaMethod#toSting() is different form the Method#toString(). Here is a small test case: public <T extends StringBuffer> List<T> myMethod( T field, List<T> list ) javaMethod.toString()=public java.util.List test.TestQDOX151.myMethod(java.lang.StringBuffer fieldjava.util.List) class.getMethods()[1]=public java.util.List test.TestQDOX151.myMethod(java.lang.StringBuffer,java.util.List)
        Vincent Siveton made changes -
        Field Original Value New Value
        Attachment TestQDOX151.java [ 40818 ]
        Robert Scholte made changes -
        Assignee Robert Scholte [ rfscholte ]
        Robert Scholte made changes -
        Resolution Fixed [ 1 ]
        Fix Version/s 1.10 [ 15020 ]
        Status Open [ 1 ] Closed [ 6 ]

          People

          • Assignee:
            Robert Scholte
            Reporter:
            Robert Scholte
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: