sman-81 commented on code in PR #60:
URL: https://github.com/apache/maven-jxr/pull/60#discussion_r928523977
##########
maven-jxr/src/main/java/org/apache/maven/jxr/pacman/BaseType.java:
##########
@@ -36,22 +48,15 @@
*/
public String getName()
{
- if ( name == null )
- {
- return "";
- }
return this.name;
}
- /**
- * Set the name for this type
- *
- * @param name The new name value
- */
- public void setName( String name )
+ @Override
+ public String toString()
{
- this.name = name;
+ return getClass().getSimpleName() + "[name=" + name + "]";
Review Comment:
It's good practice to provide `toString` implementations.
The toString() method is used to represent objects as human-readable text.
Great help in debugging!
Square brackets are widely accepted (e.g. the toString template of Eclipse
uses them).
> format [...] can be misunderstood as array
and curly braces can be misunderstood as Map ;)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]