FindBugs Report

Project Information

Project: /export/home/daveho/commons-modeler-1.1/commons-modeler.fb

FindBugs version: 0.8.7

Code analyzed:

Contents

Warnings

Click on a warning row to see full context information.

Correctness Warnings

Code  Warning
IL There is an apparent infinite recursive loop in org.apache.commons.modeler.Registry.setServer(javax.management.MBeanServer).
NP Read of unwritten field in org.apache.commons.modeler.JndiJmx.handleNotification(javax.management.Notification,Object)
NP Read of unwritten field in org.apache.commons.modeler.mbeans.SimpleRemoteConnector.refreshAttributes()
NP Possible null pointer dereference in org.apache.commons.modeler.Registry.findManagedBeans(String)
NP Possible null pointer dereference in org.apache.commons.modeler.util.IntrospectionUtils.findMethod(Class,String,Class[])
UCF Useless control flow in org.apache.commons.modeler.BaseNotificationBroadcaster.registerNotifications(FixedNotificationFilter)
UwF Unwritten field: org.apache.commons.modeler.JndiJmx.mserver
UwF Unwritten field: org.apache.commons.modeler.mbeans.SimpleRemoteConnector.mserver

Internationalization Warnings

Code  Warning

Multithreaded Correctness Warnings

Code  Warning
IS2 Inconsistent synchronization of org.apache.commons.modeler.Registry.server; locked 66% of time

Malicious Code Vulnerability Warnings

Code  Warning
EI org.apache.commons.modeler.ConstructorInfo.getSignature() may expose internal representation by returning org.apache.commons.modeler.ConstructorInfo.parameters
EI org.apache.commons.modeler.ManagedBean.getAttributes() may expose internal representation by returning org.apache.commons.modeler.ManagedBean.attributes
EI org.apache.commons.modeler.ManagedBean.getConstructors() may expose internal representation by returning org.apache.commons.modeler.ManagedBean.constructors
EI org.apache.commons.modeler.ManagedBean.getNotifications() may expose internal representation by returning org.apache.commons.modeler.ManagedBean.notifications
EI org.apache.commons.modeler.ManagedBean.getOperations() may expose internal representation by returning org.apache.commons.modeler.ManagedBean.operations
EI org.apache.commons.modeler.NotificationInfo.getNotifTypes() may expose internal representation by returning org.apache.commons.modeler.NotificationInfo.notifTypes
EI org.apache.commons.modeler.OperationInfo.getSignature() may expose internal representation by returning org.apache.commons.modeler.OperationInfo.parameters
MS org.apache.commons.modeler.Registry.MODELER_MANIFEST isn't final but should be
MS org.apache.commons.modeler.util.IntrospectionUtils.PATH_SEPARATOR isn't final but should be

Performance Warnings

Code  Warning
Dm org.apache.commons.modeler.Registry.convertValue(String,String) invokes dubious Boolean constructor; use Boolean.valueOf(...) instead
Dm org.apache.commons.modeler.util.IntrospectionUtils.setProperty(Object,String,String) invokes dubious Boolean constructor; use Boolean.valueOf(...) instead
UrF Unread field: org.apache.commons.modeler.ant.MLETTask.archive
UrF Unread field: org.apache.commons.modeler.ant.MLETTask.codebase
UrF Unread field: org.apache.commons.modeler.ant.ModelerTask.log
UrF Unread field: org.apache.commons.modeler.ant.RegistryTask.log
UrF Unread field: org.apache.commons.modeler.BaseNotificationBroadcaster.hookCount
UrF Unread field: org.apache.commons.modeler.mbeans.SimpleRemoteConnector.prefix
UrF Unread field: org.apache.commons.modeler.modules.MbeansDescriptorsDOMSource.type
UrF Unread field: org.apache.commons.modeler.modules.MbeansDescriptorsSerSource.type
UrF Unread field: org.apache.commons.modeler.modules.MbeansSource.type
UrF Unread field: org.apache.commons.modeler.Registry.key
UuF Unused field: org.apache.commons.modeler.ant.MLETTask.loaderRef
UuF Unused field: org.apache.commons.modeler.mbeans.SimpleRemoteConnector.localDomain
WMI Method org.apache.commons.modeler.mbeans.SimpleRemoteConnector.refreshAttributes() makes inefficient use of keySet iterator instead of entrySet iterator

Style Warnings

Code  Warning
CD Class org.apache.commons.modeler.mbeans.SimpleRemoteConnector has a circular dependency with other classes.
DLS Dead store to local variable in method org.apache.commons.modeler.BaseModelMBean.setAttributes(javax.management.AttributeList)
REC Method org.apache.commons.modeler.modules.MbeansSource.execute() catches Exception, but Exception is not thrown in the try block and RuntimeException is not explicitly caught
REC Method org.apache.commons.modeler.modules.MbeansSource.execute() catches Exception, but Exception is not thrown in the try block and RuntimeException is not explicitly caught
REC Method org.apache.commons.modeler.util.IntrospectionUtils.setProperty(Object,String) catches Exception, but Exception is not thrown in the try block and RuntimeException is not explicitly caught

Details

CD_CIRCULAR_DEPENDENCY: Test for circular dependencies among classes.

This class has a circular dependency with other classes. This makes building these classes difficult, as each is dependent on the other to build correctly. Consider using interfaces to break the hard dependency.

DLS_DEAD_LOCAL_STORE: Dead store to local variable

This instruction assigns a value to a local variable, but the value is not read by any subsequent instruction. Often, this indicates an error, because the value computed is never used.

DM_BOOLEAN_CTOR: Method invokes dubious Boolean constructor; use Boolean.valueOf(...) instead

Creating new instances of java.lang.Boolean wastes memory, since Boolean objects are immutable and there are only two useful values of this type.  Use the Boolean.valueOf() method to create Boolean objects instead.

EI_EXPOSE_REP: Method may expose internal representation by returning reference to mutable object

Returning a reference to a mutable object value stored in one of the object's fields exposes the internal representation of the object.  If instances are accessed by untrusted code, and unchecked changes to the mutable object would compromise security or other important properties, you will need to do something different. Returning a new copy of the object is better approach in many situations.

IL_INFINITE_RECURSIVE_LOOP: 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.

IS2_INCONSISTENT_SYNC: Inconsistent synchronization

The fields of this class appear to be accessed inconsistently with respect to synchronization.  This bug report indicates that the bug pattern detector judged that

  1. The class contains a mix of locked and unlocked accesses,
  2. At least one locked access was performed by one of the class's own methods, and
  3. The number of unsynchronized field accesses (reads and writes) was no more than one third of all accesses, with writes being weighed twice as high as reads

A typical bug matching this bug pattern is forgetting to synchronize one of the methods in a class that is intended to be thread-safe.

You can select the nodes labeled "Unsynchronized access" to show the code locations where the detector believed that a field was accessed without synchronization.

Note that there are various sources of inaccuracy in this detector; for example, the detector cannot statically detect all situations in which a lock is held.  Also, even when the detector is accurate in distinguishing locked vs. unlocked accesses, the code in question may still be correct.

This description refers to the "IS2" version of the pattern detector, which has more accurate ways of detecting locked vs. unlocked accesses than the older "IS" detector.

MS_SHOULD_BE_FINAL: Field isn't final but should be

A mutable static field could be changed by malicious code or by accident from another package. The field could be made final to avoid this vulnerability.

NP_NULL_ON_SOME_PATH: Possible null pointer dereference in method

A reference value dereferenced here might be null at runtime.  This may lead to a NullPointerException when the code is executed.

NP_UNWRITTEN_FIELD: Read of unwritten field

The program is deferencing a field that does not seem to ever be written to. Deferencing this value will generate a null pointer exception.

REC_CATCH_EXCEPTION: java.lang.Exception is caught when Exception is not thrown

This method uses a try-catch block that catches Exception objects, but Exception is not thrown within the try block, and RuntimeException is not explicitly caught. It is a common bug pattern to say try { ... } catch (Exception e) { something } as a shorthand for catching a number of types of exception each of whose catch blocks is identical, but this construct also accidentally catches RuntimeException as well, masking potential bugs.

UCF_USELESS_CONTROL_FLOW: Useless control flow in method

This method contains a useless control flow statement.  Often, this is caused by inadvertently using an empty statement as the body of an if statement, e.g.:

    if (argv.length == 1);
        System.out.println("Hello, " + argv[0]);

URF_UNREAD_FIELD: Unread field

This field is never read.  Consider removing it from the class.

UUF_UNUSED_FIELD: Unused field

This field is never used.  Consider removing it from the class.

UWF_UNWRITTEN_FIELD: Unwritten field

This field is never written.  All reads of it will return the default value. Check for errors (should it have been initialized?), or remove it if it is useless.

WMI_WRONG_MAP_ITERATOR: Inefficient use of keySet iterator instead of entrySet iterator

This method accesses the value of a Map entry, using a key that was retrieved from a keySet iterator. It is more efficient to use an iterator on the entrySet of the map, to avoid the Map.get(key) lookup.