Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[dsdp-tm-dev] FindBugs

Hi folks,

I would like to draw your attention to a very useful tool for finding bugs in Java programs called
FindBugs[1]. It performs static analysis over Java byte code and search for bugs. There is also an
Eclipse plug-in which provides integration with the Eclipse platform and can be used for finding
bugs in Eclipse projects. You can take a look at [1] for more details about the tool.

So I gave it a try over some of the TM plug-ins and I got some interesting results. Here is a very
small excerpt of the results for org.eclipse.rse.core and org.eclipse.rse.ui:

org.eclipse.rse.core
-----
H B ES: Comparison of String parameter using == or != in
org.eclipse.rse.internal.core.model.SystemRegistry.updateHost(IHost, IRSESystemType, String, String,
String, String, int)

H B ES: Comparison of String parameter using == or != in
org.eclipse.rse.internal.core.filters.SystemFilterPool.setOwningParentName(String)

H B ES: Comparison of String parameter using == or != in
org.eclipse.rse.core.subsystems.RemoteServerLauncher.setServerScript(String)

M C NP: Possible null pointer dereference of SystemFilterPoolManager.name in
org.eclipse.rse.internal.core.filters.SystemFilterPoolManager.setName(String)


org.eclipse.rse.ui
-----
H C EC: Call to equals() comparing unrelated class and interface in
org.eclipse.rse.internal.ui.view.SystemViewFilterStringAdapter.doDelete(Shell, Object, IProgressMonitor)

H B HE: org.eclipse.rse.internal.ui.view.team.SystemTeamViewSubSystemConfigurationNode defines
equals and uses Object.hashCode()

M D BC: instanceof will always return true in
org.eclipse.rse.core.subsystems.SubSystemConfiguration.createServerLauncher(IConnectorService),
since all org.eclipse.rse.core.subsystems.RemoteServerLauncher are instances of
org.eclipse.rse.core.model.ILabeledObject

M D BC: instanceof will always return true in
org.eclipse.rse.internal.ui.view.SystemView.getSelection(Control), since all
org.eclipse.swt.widgets.TreeItem are instances of org.eclipse.swt.widgets.TreeItem

M B Eq: org.eclipse.rse.ui.open.SystemQuickOpenPageDescriptor defines compareTo(Object) and uses
Object.equals()

While some of the problems can be classified as "warnings" or "bad practice" there are also such
that are real bugs. I think it will be useful for everyone to check his stuff with this tool.

[1] http://findbugs.sourceforge.net/

Cheers,
Rado


Back to the top