You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is already a similar issue about Intellij IDEA generated toString, however that one is very specific about a String property, so I opted to create a new one for this:
public class SearchResult
{
private final Object[] lastRecordSortValues;
private final int pageTotal;
public Object[] getLastRecordSortValues()
{
return lastRecordSortValues;
}
public int getPageTotal()
{
return pageTotal;
}
@Override
public boolean equals(final Object o)
{
...
}
@Override
public int hashCode()
{
...
}
@Override
public String toString()
{
return "SearchResult{" +
"lastRecordSortValues=" + Arrays.toString(lastRecordSortValues) +
", pageTotal=" + pageTotal +
'}';
}
}
It seems it dislikes this: lastRecordSortValues=" + Arrays.toString(lastRecordSortValues)
This is the full message I get:
Class com.myapp.SearchResult has bad 'toString' method implementation.
The toString method should contain:
lastRecordSortValues=[Ljava.lang.Object;@26f09a1c
But does not.
Result of toString:
SearchResult{lastRecordSortValues=[], pageTotal=0}
The text was updated successfully, but these errors were encountered:
There is already a similar issue about Intellij IDEA generated toString, however that one is very specific about a String property, so I opted to create a new one for this:
It seems it dislikes this:
lastRecordSortValues=" + Arrays.toString(lastRecordSortValues)
This is the full message I get:
The text was updated successfully, but these errors were encountered: