Issue 109943 - wizards: FindBugs Warning
Summary: wizards: FindBugs Warning
Status: CLOSED FIXED
Alias: None
Product: Installation
Classification: Application
Component: code (show other issues)
Version: OOo 2.4.0
Hardware: Unknown All
: P3 Trivial (vote)
Target Milestone: 3.4.1
Assignee: mikhail.voytenko
QA Contact: issues@installation
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-08 16:26 UTC by mtov
Modified: 2017-05-20 10:30 UTC (History)
2 users (show)

See Also:
Issue Type: TASK
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description mtov 2010-03-08 16:26: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
Comment 1 Olaf Felka 2010-03-08 16:42:46 UTC
Can this tool be run on a more recent build? 2.4.0 is pretty old and outdated.
Comment 2 ingo.schmidt-rosbiegal 2010-03-08 17:30:50 UTC
I will take a look at this. Not a patch.
Comment 3 ingo.schmidt-rosbiegal 2010-03-10 14:50:54 UTC
is -> mav: today this is your code ;-)
Comment 4 mikhail.voytenko 2010-03-10 15:01:46 UTC
Setting 3.3 as a target to take a look at it ASAP.
Comment 5 mikhail.voytenko 2010-07-05 14:03:56 UTC
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.
Comment 6 mikhail.voytenko 2010-11-19 10:34:35 UTC
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.
Comment 7 mikhail.voytenko 2010-12-03 12:46:19 UTC
Development issue, verified by myself.
Comment 8 Frank Schönheit 2011-03-21 12:06:46 UTC
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".)