public int getFreezeColumns() {
Integer currentValue = (Integer) checkValueBinding("freezeColumns", this.freezeColumns);
if (currentValue != null) {
return currentValue;
}
return 0;
}
FindBugs says :
A primitive is boxed, and then immediately unboxed. This probably is due to a manual boxing in a place where an unboxed value is required, thus forcing the compiler to immediately undo the work of the boxing.
How can I possibly fix this ?
I think the complaint is somewhat misleading: you are not boxing the return value of
checkValueBindingwhich is anObject, but you are casting it toIntegerprematurelyTry changing the code to see if it helps you avoid the warning: