# FindBugs Report

## Project Information

Project:

FindBugs version: 3.0.1

Code analyzed:

- E:\bfproject\main\Intercall\components\adaptors\Intercall\build\IntercallAdaptor.jar

## Metrics

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)

## Contents

- Multithreaded correctness Warnings
- Performance Warnings
- Dodgy code Warnings
- Details

# Summary

Warning Type | Number
--- | ---
Multithreaded correctness Warnings | 3
Performance Warnings | 10
Dodgy code Warnings | 2
Total | 15

# Warnings

Click on a warning row to see full context information.

## Multithreaded correctness Warnings

Code | Warning
--- | ---
JLM | Synchronization performed on java.util.concurrent.atomic.AtomicBoolean in com.macromedia.breeze_ext.telephony.Intercall.IntercallCallback.onContextCreatedEvent(SPIEvent, String)
| Bug type JLM_JSR166_UTILCONCURRENT_MONITORENTER (click for details) In class com.macromedia.breeze_ext.telephony.Intercall.IntercallCallback In method com.macromedia.breeze_ext.telephony.Intercall.IntercallCallback.onContextCreatedEvent(SPIEvent, String) Type java.util.concurrent.atomic.AtomicBoolean Value loaded from ? At IntercallCallback.java:[line 187]
JLM | Synchronization performed on java.util.concurrent.atomic.AtomicBoolean in com.macromedia.breeze_ext.telephony.Intercall.IntercallConference.startConference()
| Bug type JLM_JSR166_UTILCONCURRENT_MONITORENTER (click for details) In class com.macromedia.breeze_ext.telephony.Intercall.IntercallConference In method com.macromedia.breeze_ext.telephony.Intercall.IntercallConference.startConference() Type java.util.concurrent.atomic.AtomicBoolean Value loaded from field com.macromedia.breeze_ext.telephony.Intercall.IntercallConference.pendingConferenceStart At IntercallConference.java:[line 97]
JLM | Synchronization performed on java.util.concurrent.atomic.AtomicBoolean in com.macromedia.breeze_ext.telephony.Intercall.IntercallConference$2.run()
| Bug type JLM_JSR166_UTILCONCURRENT_MONITORENTER (click for details) In class com.macromedia.breeze_ext.telephony.Intercall.IntercallConference$2 In method com.macromedia.breeze_ext.telephony.Intercall.IntercallConference$2.run() Type java.util.concurrent.atomic.AtomicBoolean Value loaded from field com.macromedia.breeze_ext.telephony.Intercall.IntercallConference.pendingConferenceStart At IntercallConference.java:[line 137]

## Performance Warnings

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
| Bug type DM_NUMBER_CTOR (click for details) In class com.macromedia.breeze_ext.telephony.Intercall.IntercallConference In method com.macromedia.breeze_ext.telephony.Intercall.IntercallConference.dialOut(int, String, String, String) Called method new Integer(int) Should call Integer.valueOf(int) instead At IntercallConference.java:[line 810]
Bx | com.macromedia.breeze_ext.telephony.Intercall.IntercallConference.enableRosterReconciliation() invokes inefficient new Integer(int) constructor; use Integer.valueOf(int) instead
| Bug type DM_NUMBER_CTOR (click for details) In class com.macromedia.breeze_ext.telephony.Intercall.IntercallConference In method com.macromedia.breeze_ext.telephony.Intercall.IntercallConference.enableRosterReconciliation() Called method new Integer(int) Should call Integer.valueOf(int) instead At IntercallConference.java:[line 521]
Bx | com.macromedia.breeze_ext.telephony.Intercall.IntercallConference.hangUp(String) invokes inefficient new Integer(int) constructor; use Integer.valueOf(int) instead
| Bug type DM_NUMBER_CTOR (click for details) In class com.macromedia.breeze_ext.telephony.Intercall.IntercallConference In method com.macromedia.breeze_ext.telephony.Intercall.IntercallConference.hangUp(String) Called method new Integer(int) Should call Integer.valueOf(int) instead At IntercallConference.java:[line 873]
Dm | new com.macromedia.breeze_ext.telephony.Intercall.IntercallConference(String, String, String, AdaptorState) invokes inefficient Boolean constructor; use Boolean.valueOf(...) instead
| Bug type DM_BOOLEAN_CTOR (click for details) In class com.macromedia.breeze_ext.telephony.Intercall.IntercallConference In method new com.macromedia.breeze_ext.telephony.Intercall.IntercallConference(String, String, String, AdaptorState) At IntercallConference.java:[line 84]
Dm | com.macromedia.breeze_ext.telephony.Intercall.IntercallConference.dialOut(int, String, String, String) invokes inefficient Boolean constructor; use Boolean.valueOf(...) instead
| Bug type DM_BOOLEAN_CTOR (click for details) In class com.macromedia.breeze_ext.telephony.Intercall.IntercallConference In method com.macromedia.breeze_ext.telephony.Intercall.IntercallConference.dialOut(int, String, String, String) At IntercallConference.java:[line 808]
Dm | com.macromedia.breeze_ext.telephony.Intercall.IntercallConference.endConference() invokes inefficient Boolean constructor; use Boolean.valueOf(...) instead
| Bug type DM_BOOLEAN_CTOR (click for details) In class com.macromedia.breeze_ext.telephony.Intercall.IntercallConference In method com.macromedia.breeze_ext.telephony.Intercall.IntercallConference.endConference() At IntercallConference.java:[line 413]
Dm | com.macromedia.breeze_ext.telephony.Intercall.IntercallConference.setUserOption(String, UserOption, String) invokes inefficient Boolean constructor; use Boolean.valueOf(...) instead
| Bug type DM_BOOLEAN_CTOR (click for details) In class com.macromedia.breeze_ext.telephony.Intercall.IntercallConference In method com.macromedia.breeze_ext.telephony.Intercall.IntercallConference.setUserOption(String, UserOption, String) At IntercallConference.java:[line 1001]
WMI | com.macromedia.breeze_ext.telephony.Intercall.IntercallConference.cleanLeftUsers() makes inefficient use of keySet iterator instead of entrySet iterator
| Bug type WMI_WRONG_MAP_ITERATOR (click for details) In class com.macromedia.breeze_ext.telephony.Intercall.IntercallConference In method com.macromedia.breeze_ext.telephony.Intercall.IntercallConference.cleanLeftUsers() Field com.macromedia.breeze_ext.telephony.Intercall.IntercallConference.leftUsers At IntercallConference.java:[line 563]
WMI | com.macromedia.breeze_ext.telephony.Intercall.IntercallConference.cleanRingingUsers() makes inefficient use of keySet iterator instead of entrySet iterator
| Bug type WMI_WRONG_MAP_ITERATOR (click for details) In class com.macromedia.breeze_ext.telephony.Intercall.IntercallConference In method com.macromedia.breeze_ext.telephony.Intercall.IntercallConference.cleanRingingUsers() Field com.macromedia.breeze_ext.telephony.Intercall.IntercallConference.ringingUsers At IntercallConference.java:[line 545]
WMI | com.macromedia.breeze_ext.telephony.Intercall.IntercallConference.getConnectPartIds(String[]) makes inefficient use of keySet iterator instead of entrySet iterator
| Bug type WMI_WRONG_MAP_ITERATOR (click for details) In class com.macromedia.breeze_ext.telephony.Intercall.IntercallConference In method com.macromedia.breeze_ext.telephony.Intercall.IntercallConference.getConnectPartIds(String[]) Field com.macromedia.breeze_ext.telephony.Intercall.IntercallConference.connectPartIdtoIntercallPartIdMap At IntercallConference.java:[line 1019]

## Dodgy code Warnings

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)
| Bug type REC_CATCH_EXCEPTION (click for details) In class com.macromedia.breeze_ext.telephony.Intercall.IntercallTelephonyAdaptor In method com.macromedia.breeze_ext.telephony.Intercall.IntercallTelephonyAdaptor.dialOut(String, String, TelephonyUserInfo$UserType, String, boolean) At IntercallTelephonyAdaptor.java:[line 162]
SF | Switch statement found in com.macromedia.breeze_ext.telephony.Intercall.IntercallTelephonyAdaptor.dialOut(String, String, TelephonyUserInfo$UserType, String, boolean) where default case is missing
| Bug type SF_SWITCH_NO_DEFAULT (click for details) In class com.macromedia.breeze_ext.telephony.Intercall.IntercallTelephonyAdaptor In method com.macromedia.breeze_ext.telephony.Intercall.IntercallTelephonyAdaptor.dialOut(String, String, TelephonyUserInfo$UserType, String, boolean) At IntercallTelephonyAdaptor.java:[lines 99-107]

# Details

## DM_NUMBER_CTOR: Method invokes inefficient Number constructor; use static valueOf instead

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`.

## DM_BOOLEAN_CTOR: Method invokes inefficient 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 (or Java 1.5 autoboxing) to create `Boolean` objects instead.

## JLM_JSR166_UTILCONCURRENT_MONITORENTER: Synchronization performed on util.concurrent instance

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.

## REC_CATCH_EXCEPTION: 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.

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 ...
      }

## SF_SWITCH_NO_DEFAULT: Switch statement found where default case is missing

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.

## 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.