[ 
https://issues.apache.org/jira/browse/MNG-8612?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17933219#comment-17933219
 ] 

Guillaume Nodet edited comment on MNG-8612 at 3/7/25 8:00 AM:
--------------------------------------------------------------

I'm really not at ease with the line of reasoning [~elharo].

The built-in {{toString()}} is used a lot for debugging / logging.  If we 
remove the current {{asString()}} methods, this will mean that the debugging 
output for {{Node}} will span a bunch of lines for each node.  When debugging, 
I don't need a _user friendly_ text representation, I need an effective one, 
precise and compact.  We'd loose that.

So I think we need both here, and the short one should be used for debugging, 
which is what the {{toString)}} implementation is doing, while the second has a 
different format and purpose.


was (Author: gnt):
I'm really not at ease with the line of reasoning [~elharo].

The built-in {{toString()}} is used a lot for debugging / logging.  If we 
remove the current {{asString()}} methods, this will mean that the debugging 
output for {{Node}} will span a bunch of lines for each lines.  When debugging, 
I don't need a _user friendly_ text representation, I need an effective one, 
precise and compact.  We'd loose that.

So I think we need both here, and the short one should be used for debugging, 
which is what the {{toString)}} implementation is doing, while the second has a 
different format and purpose.

> Node.asString vs toString
> -------------------------
>
>                 Key: MNG-8612
>                 URL: https://issues.apache.org/jira/browse/MNG-8612
>             Project: Maven
>          Issue Type: Bug
>    Affects Versions: 4.0.0-rc-3
>            Reporter: Elliotte Rusty Harold
>            Assignee: Guillaume Nodet
>            Priority: Blocker
>
> The Node interface has an asString method. It seems likely that this should 
> just be toString like other Java classes. However, if there's a reason for a 
> separate method, the JavaDoc should explain that. Currently it says "Returns 
> a string representation of this dependency node." which is almost what the 
> JavaDoc for the generic toString method of object says: "Returns a string 
> representation of the object."



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to