我的代码出现了以下Findbugs错误,
Invocation of toString on <<Package Path>>
The code invokes toString on an array, which will generate a fairly useless
result such as [C@16f0472. Consider using Arrays.toString to convert the
array into a readable String that gives the contents of the array.
See Programming Puzzlers, chapter 3, puzzle 12.
代码:
logger.info("Adding information"+ Employee.getName()+ " "+
employeeForm.getQuestionAndAnswers());
请让我知道错误是什么。
答案 0 :(得分:20)
正如它所说,做
myArray.toString()
会产生像java.lang.int [] @ 45345262
这样无用的东西你想要使用
Arrays.toString(myArray);