Apache OpenOffice (AOO) Bugzilla – Issue 109943
wizards: FindBugs Warning
Last modified: 2017-05-20 10:30:44 UTC
Dear all, We are conducting an study about the relevance of the warnings reported by the FindBugs tool when executed over several open-source systems. Particularly, in the case of OpenOffice, we would like to confirm the relevance of the following warnings reported by the tool (for OpenOffice 2.4.0): ** Location: com.sun.star.wizards.common.Configuration set - Line 120 Warning: Method assigns boolean literal in boolean expression. This method assigns a literal boolean value (true or false) to a boolean variable inside an if or while expression. Most probably this was supposed to be a boolean comparison using ==, not an assignment using =. ** Location: com.sun.star.wizards.common.NumberFormatter convertStringToNumber - Line 131. Warning: An apparent infinite recursive loop. This method unconditionally invokes itself. This would seem to indicate an infinite recursive loop that will result in a stack overflow. ** Location:com.sun.star.wizards.form.FormDocument getControlForms - Line 263 Warning: Impossible cast. This cast will always throw a ClassCastException. ** Location: com.sun.star.wizards.form.StyleApplier getStyleColor - Line 281 Warning: Method ignores return value. The return value of this method should be checked. One common cause of this warning is to invoke a method on an immutable object, thinking that it updates the object. Since these warnings seemed relevant to us, we would like to confirm our classification with OpenOffice's developers. Best regards, Marco Tulio Valente Brazil
Can this tool be run on a more recent build? 2.4.0 is pretty old and outdated.
I will take a look at this. Not a patch.
is -> mav: today this is your code ;-)
Setting 3.3 as a target to take a look at it ASAP.
Changing the target to OOo3.4 since there are no resources to investigate it for OOo 3.3 target. Please declare it as a schowstopper if you believe that it should be fixed for OOo3.3.
Thank you for the report one more time. All the warnings have pointed to problems, that were not triggered till now, but could cause problems in future. Fixed in cws fwk160.
Development issue, verified by myself.
well, at least one warning did point to a problem, but the fixed introduced another problem :) Consider sPropValue.trim(); if ( sPropValue.indexOf("#") > 0 ) ... which yielded a warning in the first line, which then has been changed to sPropValue = sPropValue.trim(); Unfortunately, this means that a string starting with " #" now is not matched by the second line anymore, while it previously was ... which resulted in bug 117472 :) (Of course the second line is buggy, the proper check needs to be " > -1".)