79277058

Date: 2024-12-13 02:03:50
Score: 1
Natty:
Report link

If you just want to replace the line breaks with the following, then you can. Improve it, the return value of toStringMethod should use replaceAll instead of replace. If you want every POJO's toString to call toStringMethod, unfortunately it's not possible because POJO.toString calls toStringMethod, and you also see that toStringMethod calls POJO.toString, causing stack overflow due to cyclic method dependencies. Generally speaking, toString can be automatically generated using IDEA or annotated using LomBok's @ AKS class

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (1):
Posted by: Johnathan Joestar