Project:
FindBugs version: 3.0.1
Code analyzed:
1629 lines of code analyzed, in 13 classes, in 1 packages.
| Metric | Total | Density* |
|---|---|---|
| High Priority Warnings | 0.00 | |
| Medium Priority Warnings | 15 | 9.21 |
| Total Warnings | 15 | 9.21 |
(* Defects per Thousand lines of non-commenting source statements)
| Warning Type | Number |
|---|---|
| Multithreaded correctness Warnings | 3 |
| Performance Warnings | 10 |
| Dodgy code Warnings | 2 |
| Total | 15 |
Click on a warning row to see full context information.
| Code | Warning |
|---|---|
| JLM | Synchronization performed on java.util.concurrent.atomic.AtomicBoolean in com.macromedia.breeze_ext.telephony.Intercall.IntercallCallback.onContextCreatedEvent(SPIEvent, String) |
| JLM | Synchronization performed on java.util.concurrent.atomic.AtomicBoolean in com.macromedia.breeze_ext.telephony.Intercall.IntercallConference.startConference() |
| JLM | Synchronization performed on java.util.concurrent.atomic.AtomicBoolean in com.macromedia.breeze_ext.telephony.Intercall.IntercallConference$2.run() |
| Code | Warning |
|---|---|
| Bx | com.macromedia.breeze_ext.telephony.Intercall.IntercallConference.dialOut(int, String, String, String) invokes inefficient new Integer(int) constructor; use Integer.valueOf(int) instead |
| Bx | com.macromedia.breeze_ext.telephony.Intercall.IntercallConference.enableRosterReconciliation() invokes inefficient new Integer(int) constructor; use Integer.valueOf(int) instead |
| Bx | com.macromedia.breeze_ext.telephony.Intercall.IntercallConference.hangUp(String) invokes inefficient new Integer(int) constructor; use Integer.valueOf(int) instead |
| Dm | new com.macromedia.breeze_ext.telephony.Intercall.IntercallConference(String, String, String, AdaptorState) invokes inefficient Boolean constructor; use Boolean.valueOf(...) instead |
| Dm | com.macromedia.breeze_ext.telephony.Intercall.IntercallConference.dialOut(int, String, String, String) invokes inefficient Boolean constructor; use Boolean.valueOf(...) instead |
| Dm | com.macromedia.breeze_ext.telephony.Intercall.IntercallConference.endConference() invokes inefficient Boolean constructor; use Boolean.valueOf(...) instead |
| Dm | com.macromedia.breeze_ext.telephony.Intercall.IntercallConference.setUserOption(String, UserOption, String) invokes inefficient Boolean constructor; use Boolean.valueOf(...) instead |
| WMI | com.macromedia.breeze_ext.telephony.Intercall.IntercallConference.cleanLeftUsers() makes inefficient use of keySet iterator instead of entrySet iterator |
| WMI | com.macromedia.breeze_ext.telephony.Intercall.IntercallConference.cleanRingingUsers() makes inefficient use of keySet iterator instead of entrySet iterator |
| WMI | com.macromedia.breeze_ext.telephony.Intercall.IntercallConference.getConnectPartIds(String[]) makes inefficient use of keySet iterator instead of entrySet iterator |
| Code | Warning |
|---|---|
| REC | Exception is caught when Exception is not thrown in com.macromedia.breeze_ext.telephony.Intercall.IntercallTelephonyAdaptor.dialOut(String, String, TelephonyUserInfo$UserType, String, boolean) |
| SF | Switch statement found in com.macromedia.breeze_ext.telephony.Intercall.IntercallTelephonyAdaptor.dialOut(String, String, TelephonyUserInfo$UserType, String, boolean) where default case is missing |
Using new Integer(int) is guaranteed to always result in a new object whereas
Integer.valueOf(int) allows caching of values to be done by the compiler, class library, or JVM.
Using of cached values avoids object allocation and the code will be faster.
Values between -128 and 127 are guaranteed to have corresponding cached instances
and using valueOf is approximately 3.5 times faster than using constructor.
For values outside the constant range the performance of both styles is the same.
Unless the class must be compatible with JVMs predating Java 1.5,
use either autoboxing or the valueOf() method when creating instances of
Long, Integer, Short, Character, and Byte.
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 (or Java 1.5 autoboxing) to create Boolean objects instead.
This method performs synchronization an object that is an instance of
a class from the java.util.concurrent package (or its subclasses). Instances
of these classes have their own concurrency control mechanisms that are orthogonal to
the synchronization provided by the Java keyword synchronized. For example,
synchronizing on an AtomicBoolean will not prevent other threads
from modifying the AtomicBoolean.
Such code may be correct, but should be carefully reviewed and documented, and may confuse people who have to maintain the code at a later date.
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.
A better approach is to either explicitly catch the specific exceptions that are thrown, or to explicitly catch RuntimeException exception, rethrow it, and then catch all non-Runtime Exceptions, as shown below:
try {
...
} catch (RuntimeException e) {
throw e;
} catch (Exception e) {
... deal with all non-runtime exceptions ...
}
This method contains a switch statement where default case is missing. Usually you need to provide a default case.
Because the analysis only looks at the generated bytecode, this warning can be incorrect triggered if the default case is at the end of the switch statement and the switch statement doesn't contain break statements for other cases.
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.