[jira] Created: (QDOX-151) introduce toString() according to the Java Language Specification

View: New views
6 Messages — Rating Filter:   Alert me  

[jira] Created: (QDOX-151) introduce toString() according to the Java Language Specification

by JIRA jira@codehaus.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

introduce toString() according to the Java Language Specification
-----------------------------------------------------------------

                 Key: QDOX-151
                 URL: http://jira.codehaus.org/browse/QDOX-151
             Project: QDox
          Issue Type: Improvement
          Components: Java API
    Affects Versions: 1.9
            Reporter: Robert Scholte
            Priority: Minor


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

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



[jira] Commented: (QDOX-151) introduce toString() according to the Java Language Specification

by JIRA jira@codehaus.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


    [ http://jira.codehaus.org/browse/QDOX-151?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=167409#action_167409 ]

Paul Hammant commented on QDOX-151:
-----------------------------------

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.

> introduce toString() according to the Java Language Specification
> -----------------------------------------------------------------
>
>                 Key: QDOX-151
>                 URL: http://jira.codehaus.org/browse/QDOX-151
>             Project: QDox
>          Issue Type: Improvement
>          Components: Java API
>    Affects Versions: 1.9
>            Reporter: Robert Scholte
>            Priority: Minor
>
> 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

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



RE: [jira] Commented: (QDOX-151) introduce toString() according to the Java Language Specification

by Robert Scholte-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
I didn't know what I would start with this issue, but it seems to be pretty huge...
Changing stuff from toString() to getCommentBlock() was easy.
Then I started working out the toString() for JavaClass. For classes and interfaces no problems, but the primitives, void...
 

public void todo_testToStringVoid() {

cls.setName("com.MyClass");

cls.addMethod(new JavaMethod(Type.VOID, "doSomething"));

JavaMethod javaMethod = cls.getMethods()[0];

assertEquals("void", javaMethod.getReturns().getJavaClass().toString());

}

public void todo_testToStringInt() {

cls.setName("com.MyClass");

cls.addMethod(new JavaMethod(new Type("int"), "doSomething"));

JavaMethod javaMethod = cls.getMethods()[0];

assertEquals("int", javaMethod.getReturns().getJavaClass().toString());

}
 
in both cases getJavaClass() will return null.
 
On the other hand: watch this URL
 
http://java.sun.com/j2se/1.4.2/docs/api/java/lang/reflect/Method.html#getReturnType()
 
aMethod.getReturnType().toString() will return for example the int, although getReturnType() returns a class.
 
confusing or not?!?!
 
Robert

 

> Date: Sat, 28 Feb 2009 09:08:20 -0600
> From: jira@...
> To: dev@...
> Subject: [qdox-dev] [jira] Commented: (QDOX-151) introduce toString() according to the Java Language Specification
>
>
> [ http://jira.codehaus.org/browse/QDOX-151?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=167409#action_167409 ]
>
> Paul Hammant commented on QDOX-151:
> -----------------------------------
>
> 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.
>
> > introduce toString() according to the Java Language Specification
> > -----------------------------------------------------------------
> >
> > Key: QDOX-151
> > URL: http://jira.codehaus.org/browse/QDOX-151
> > Project: QDox
> > Issue Type: Improvement
> > Components: Java API
> > Affects Versions: 1.9
> > Reporter: Robert Scholte
> > Priority: Minor
> >
> > 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
>
> --
> This message is automatically generated by JIRA.
> -
> If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
> -
> For more information on JIRA, see: http://www.atlassian.com/software/jira
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
> http://xircles.codehaus.org/manage_email
>
>


See all the ways you can stay connected to friends and family

[jira] Updated: (QDOX-151) introduce toString() according to the Java Language Specification

by JIRA jira@codehaus.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


     [ http://jira.codehaus.org/browse/QDOX-151?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Vincent Siveton updated QDOX-151:
---------------------------------

    Attachment: TestQDOX151.java

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

Here is a small test case:

{noformat}
public <T extends StringBuffer> List<T> myMethod( T field, List<T> list )
{noformat}

{noformat}
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)
{noformat}

> introduce toString() according to the Java Language Specification
> -----------------------------------------------------------------
>
>                 Key: QDOX-151
>                 URL: http://jira.codehaus.org/browse/QDOX-151
>             Project: QDox
>          Issue Type: Improvement
>          Components: Java API
>    Affects Versions: 1.9
>            Reporter: Robert Scholte
>            Priority: Minor
>         Attachments: TestQDOX151.java
>
>
> 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

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



[jira] Assigned: (QDOX-151) introduce toString() according to the Java Language Specification

by JIRA jira@codehaus.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


     [ http://jira.codehaus.org/browse/QDOX-151?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Robert Scholte reassigned QDOX-151:
-----------------------------------

    Assignee: Robert Scholte

> introduce toString() according to the Java Language Specification
> -----------------------------------------------------------------
>
>                 Key: QDOX-151
>                 URL: http://jira.codehaus.org/browse/QDOX-151
>             Project: QDox
>          Issue Type: Improvement
>          Components: Java API
>    Affects Versions: 1.9
>            Reporter: Robert Scholte
>            Assignee: Robert Scholte
>            Priority: Minor
>         Attachments: TestQDOX151.java
>
>
> 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

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



[jira] Closed: (QDOX-151) introduce toString() according to the Java Language Specification

by JIRA jira@codehaus.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


     [ http://jira.codehaus.org/browse/QDOX-151?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Robert Scholte closed QDOX-151.
-------------------------------

       Resolution: Fixed
    Fix Version/s: 1.10

> introduce toString() according to the Java Language Specification
> -----------------------------------------------------------------
>
>                 Key: QDOX-151
>                 URL: http://jira.codehaus.org/browse/QDOX-151
>             Project: QDox
>          Issue Type: Improvement
>          Components: Java API
>    Affects Versions: 1.9
>            Reporter: Robert Scholte
>            Assignee: Robert Scholte
>            Priority: Minor
>             Fix For: 1.10
>
>         Attachments: TestQDOX151.java
>
>
> 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

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email