FindBugs Report

Project Information

Project:

FindBugs version: 3.0.1

Code analyzed:



Metrics

2428 lines of code analyzed, in 20 classes, in 1 packages.

Metric Total Density*
High Priority Warnings 15 6.18
Medium Priority Warnings 45 18.53
Total Warnings 60 24.71

(* Defects per Thousand lines of non-commenting source statements)



Contents

Summary

Warning Type Number
Bad practice Warnings 1
Correctness Warnings 1
Internationalization Warnings 2
Malicious code vulnerability Warnings 5
Multithreaded correctness Warnings 2
Performance Warnings 4
Dodgy code Warnings 45
Total 60

Warnings

Click on a warning row to see full context information.

Bad practice Warnings

Code Warning
OS com.macromedia.breeze_ext.telephony.Avaya.AvayaAdaptor.secureDownloadFTPFile(String, String, String) may fail to close stream

Correctness Warnings

Code Warning
BC Impossible cast from java.util.Map$Entry<java.lang.String,com.macromedia.breeze_ext.telephony.Avaya.ConferenceSession> to String in com.macromedia.breeze_ext.telephony.Avaya.ConnectionTester.run()

Internationalization Warnings

Code Warning
Dm Found reliance on default encoding in com.macromedia.breeze_ext.telephony.Avaya.AvayaAdaptor.secureDownloadFTPFile(String, String, String): new java.io.InputStreamReader(InputStream)
Dm Found reliance on default encoding in com.macromedia.breeze_ext.telephony.Avaya.StreamGobbler.run(): new java.io.InputStreamReader(InputStream)

Malicious code vulnerability Warnings

Code Warning
EI2 new com.macromedia.breeze_ext.telephony.Avaya.QueuedEvent(Hashtable, Object) may expose internal representation by storing an externally mutable object into QueuedEvent.eventInfo
MS com.macromedia.breeze_ext.telephony.Avaya.AvayaAdaptor.activeConferenceSessions should be package protected
MS com.macromedia.breeze_ext.telephony.Avaya.AvayaAdaptor.avayaDTMFPostfixToken should be package protected
MS com.macromedia.breeze_ext.telephony.Avaya.AvayaAdaptor.avayaDTMFPrefixToken should be package protected
MS com.macromedia.breeze_ext.telephony.Avaya.ConferenceSession.UPDATE_ALL_EVENT isn't final but should be

Multithreaded correctness Warnings

Code Warning
JLM Synchronization performed on java.util.concurrent.ConcurrentHashMap in com.macromedia.breeze_ext.telephony.Avaya.ConferenceSession.cleanupRecentlyRemovedUsersMap()
SWL com.macromedia.breeze_ext.telephony.Avaya.EventProcessor.getAssignment() calls Thread.sleep() with a lock held

Performance Warnings

Code Warning
Bx com.macromedia.breeze_ext.telephony.Avaya.AvayaAdaptor.initAdaptor(TelephonyCallback, Map, String) invokes inefficient new Integer(int) constructor; use Integer.valueOf(int) instead
Bx com.macromedia.breeze_ext.telephony.Avaya.AvayaAdaptor.initAdaptor(TelephonyCallback, Map, String) invokes inefficient new Integer(String) constructor; use Integer.valueOf(String) instead
WMI com.macromedia.breeze_ext.telephony.Avaya.EventProcessor.getAssignment() makes inefficient use of keySet iterator instead of entrySet iterator
WMI com.macromedia.breeze_ext.telephony.Avaya.EventProcessor.processQueuedEvent() makes inefficient use of keySet iterator instead of entrySet iterator

Dodgy code Warnings

Code Warning
RCN Redundant nullcheck of conferenceId, which is known to be non-null in com.macromedia.breeze_ext.telephony.Avaya.AvayaAdaptor.participantLeftConference(String, String)
RCN Redundant nullcheck of sessionId, which is known to be non-null in com.macromedia.breeze_ext.telephony.Avaya.AvayaAdaptor.initConferenceSession(Map)
RCN Redundant nullcheck of sessionId, which is known to be non-null in com.macromedia.breeze_ext.telephony.Avaya.AvayaAdaptor.reconnectConference(Map, List)
RCN Redundant nullcheck of sessionId, which is known to be non-null in com.macromedia.breeze_ext.telephony.Avaya.AvayaAdaptor.startConference(String)
RCN Redundant nullcheck of sessionId, which is known to be non-null in com.macromedia.breeze_ext.telephony.Avaya.AvayaAdaptor.startConferenceEvent(String, Conference)
RCN Redundant nullcheck of moderatorCode, which is known to be non-null in com.macromedia.breeze_ext.telephony.Avaya.AvayaAdaptor.validateTelephonyProfile(Map)
RCN Redundant nullcheck of participantCode, which is known to be non-null in com.macromedia.breeze_ext.telephony.Avaya.AvayaAdaptor.validateTelephonyProfile(Map)
RCN Redundant nullcheck of pendingSubConfId, which is known to be non-null in com.macromedia.breeze_ext.telephony.Avaya.AvayaAdaptor.verifyPendingMoveToSubconference(String, String)
RCN Redundant nullcheck of userId, which is known to be non-null in com.macromedia.breeze_ext.telephony.Avaya.ConferenceSession.addPhoneUser(Participant)
REC Exception is caught when Exception is not thrown in com.macromedia.breeze_ext.telephony.Avaya.AvayaAdaptor.secureDownloadFTPFile(String, String, String)
RV com.macromedia.breeze_ext.telephony.Avaya.AvayaAdaptor.secureDownloadFTPFile(String, String, String) discards result of readLine after checking if it is non-null
ST Write to static field com.macromedia.breeze_ext.telephony.Avaya.AvayaAdaptor.avayaBridgeName from instance method com.macromedia.breeze_ext.telephony.Avaya.AvayaAdaptor.initAdaptor(TelephonyCallback, Map, String)
ST Write to static field com.macromedia.breeze_ext.telephony.Avaya.AvayaAdaptor.avayaConverterPath from instance method com.macromedia.breeze_ext.telephony.Avaya.AvayaAdaptor.initAdaptor(TelephonyCallback, Map, String)
ST Write to static field com.macromedia.breeze_ext.telephony.Avaya.AvayaAdaptor.avayaDTMFPostfixToken from instance method com.macromedia.breeze_ext.telephony.Avaya.AvayaAdaptor.initAdaptor(TelephonyCallback, Map, String)
ST Write to static field com.macromedia.breeze_ext.telephony.Avaya.AvayaAdaptor.avayaDTMFPrefixToken from instance method com.macromedia.breeze_ext.telephony.Avaya.AvayaAdaptor.initAdaptor(TelephonyCallback, Map, String)
ST Write to static field com.macromedia.breeze_ext.telephony.Avaya.AvayaAdaptor.avayaMusicSource from instance method com.macromedia.breeze_ext.telephony.Avaya.AvayaAdaptor.initAdaptor(TelephonyCallback, Map, String)
ST Write to static field com.macromedia.breeze_ext.telephony.Avaya.AvayaAdaptor.avayaOperatorID from instance method com.macromedia.breeze_ext.telephony.Avaya.AvayaAdaptor.initAdaptor(TelephonyCallback, Map, String)
ST Write to static field com.macromedia.breeze_ext.telephony.Avaya.AvayaAdaptor.avayaPhonePrefix from instance method com.macromedia.breeze_ext.telephony.Avaya.AvayaAdaptor.initAdaptor(TelephonyCallback, Map, String)
ST Write to static field com.macromedia.breeze_ext.telephony.Avaya.AvayaAdaptor.avayaSystemLoginId from instance method com.macromedia.breeze_ext.telephony.Avaya.AvayaAdaptor.initAdaptor(TelephonyCallback, Map, String)
ST Write to static field com.macromedia.breeze_ext.telephony.Avaya.AvayaAdaptor.avayaSystemPassword from instance method com.macromedia.breeze_ext.telephony.Avaya.AvayaAdaptor.initAdaptor(TelephonyCallback, Map, String)
ST Write to static field com.macromedia.breeze_ext.telephony.Avaya.AvayaAdaptor.m_callbackObj from instance method com.macromedia.breeze_ext.telephony.Avaya.AvayaAdaptor.initAdaptor(TelephonyCallback, Map, String)
ST Write to static field com.macromedia.breeze_ext.telephony.Avaya.AvayaAdaptor.activeConferenceSessions from instance method com.macromedia.breeze_ext.telephony.Avaya.AvayaAdaptor.destroyAdaptor()
ST Write to static field com.macromedia.breeze_ext.telephony.Avaya.AvayaAdaptor.avayaBridge from instance method com.macromedia.breeze_ext.telephony.Avaya.AvayaAdaptor.destroyAdaptor()
ST Write to static field com.macromedia.breeze_ext.telephony.Avaya.AvayaAdaptor.m_callbackObj from instance method com.macromedia.breeze_ext.telephony.Avaya.AvayaAdaptor.destroyAdaptor()
ST Write to static field com.macromedia.breeze_ext.telephony.Avaya.AvayaAdaptor.sessionIdToConferenceIdMap from instance method com.macromedia.breeze_ext.telephony.Avaya.AvayaAdaptor.destroyAdaptor()
ST Write to static field com.macromedia.breeze_ext.telephony.Avaya.AvayaAdaptor.validatedConferences from instance method com.macromedia.breeze_ext.telephony.Avaya.AvayaAdaptor.destroyAdaptor()
ST Write to static field com.macromedia.breeze_ext.telephony.Avaya.AvayaAdaptor.activeConferenceSessions from instance method com.macromedia.breeze_ext.telephony.Avaya.AvayaAdaptor.initAdaptor(TelephonyCallback, Map, String)
ST Write to static field com.macromedia.breeze_ext.telephony.Avaya.AvayaAdaptor.avayaBridge from instance method com.macromedia.breeze_ext.telephony.Avaya.AvayaAdaptor.initAdaptor(TelephonyCallback, Map, String)
ST Write to static field com.macromedia.breeze_ext.telephony.Avaya.AvayaAdaptor.avayaBridgeListener from instance method com.macromedia.breeze_ext.telephony.Avaya.AvayaAdaptor.initAdaptor(TelephonyCallback, Map, String)
ST Write to static field com.macromedia.breeze_ext.telephony.Avaya.AvayaAdaptor.avayaDTMFCaptureAnnunciatorNum from instance method com.macromedia.breeze_ext.telephony.Avaya.AvayaAdaptor.initAdaptor(TelephonyCallback, Map, String)
ST Write to static field com.macromedia.breeze_ext.telephony.Avaya.AvayaAdaptor.avayaDTMFCaptureMaxLength from instance method com.macromedia.breeze_ext.telephony.Avaya.AvayaAdaptor.initAdaptor(TelephonyCallback, Map, String)
ST Write to static field com.macromedia.breeze_ext.telephony.Avaya.AvayaAdaptor.avayaDTMFCaptureMaxTimeout from instance method com.macromedia.breeze_ext.telephony.Avaya.AvayaAdaptor.initAdaptor(TelephonyCallback, Map, String)
ST Write to static field com.macromedia.breeze_ext.telephony.Avaya.AvayaAdaptor.avayaFTPLogin from instance method com.macromedia.breeze_ext.telephony.Avaya.AvayaAdaptor.initAdaptor(TelephonyCallback, Map, String)
ST Write to static field com.macromedia.breeze_ext.telephony.Avaya.AvayaAdaptor.avayaFTPPassword from instance method com.macromedia.breeze_ext.telephony.Avaya.AvayaAdaptor.initAdaptor(TelephonyCallback, Map, String)
ST Write to static field com.macromedia.breeze_ext.telephony.Avaya.AvayaAdaptor.avayaFTPPath from instance method com.macromedia.breeze_ext.telephony.Avaya.AvayaAdaptor.initAdaptor(TelephonyCallback, Map, String)
ST Write to static field com.macromedia.breeze_ext.telephony.Avaya.AvayaAdaptor.avayaFileTRansfer from instance method com.macromedia.breeze_ext.telephony.Avaya.AvayaAdaptor.initAdaptor(TelephonyCallback, Map, String)
ST Write to static field com.macromedia.breeze_ext.telephony.Avaya.AvayaAdaptor.avayaMaxDownlaodTries from instance method com.macromedia.breeze_ext.telephony.Avaya.AvayaAdaptor.initAdaptor(TelephonyCallback, Map, String)
ST Write to static field com.macromedia.breeze_ext.telephony.Avaya.AvayaAdaptor.avayaRecordDelay from instance method com.macromedia.breeze_ext.telephony.Avaya.AvayaAdaptor.initAdaptor(TelephonyCallback, Map, String)
ST Write to static field com.macromedia.breeze_ext.telephony.Avaya.AvayaAdaptor.avayaValidationTimeLimit from instance method com.macromedia.breeze_ext.telephony.Avaya.AvayaAdaptor.initAdaptor(TelephonyCallback, Map, String)
ST Write to static field com.macromedia.breeze_ext.telephony.Avaya.AvayaAdaptor.dialOutEnabled from instance method com.macromedia.breeze_ext.telephony.Avaya.AvayaAdaptor.initAdaptor(TelephonyCallback, Map, String)
ST Write to static field com.macromedia.breeze_ext.telephony.Avaya.AvayaAdaptor.sessionIdToConferenceIdMap from instance method com.macromedia.breeze_ext.telephony.Avaya.AvayaAdaptor.initAdaptor(TelephonyCallback, Map, String)
ST Write to static field com.macromedia.breeze_ext.telephony.Avaya.AvayaAdaptor.validatedConferences from instance method com.macromedia.breeze_ext.telephony.Avaya.AvayaAdaptor.initAdaptor(TelephonyCallback, Map, String)
ST Write to static field com.macromedia.breeze_ext.telephony.Avaya.EventProcessor.avayaBridge from instance method new com.macromedia.breeze_ext.telephony.Avaya.EventProcessor(Bridge)
ST Write to static field com.macromedia.breeze_ext.telephony.Avaya.EventProcessor.eventQueue from instance method new com.macromedia.breeze_ext.telephony.Avaya.EventProcessor(Bridge)
ST Write to static field com.macromedia.breeze_ext.telephony.Avaya.EventProcessor.queuedOnlineEvents from instance method new com.macromedia.breeze_ext.telephony.Avaya.EventProcessor(Bridge)

Details

BC_IMPOSSIBLE_CAST: Impossible cast

This cast will always throw a ClassCastException. FindBugs tracks type information from instanceof checks, and also uses more precise information about the types of values returned from methods and loaded from fields. Thus, it may have more precise information that just the declared type of a variable, and can use this to determine that a cast will always throw an exception at runtime.

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_DEFAULT_ENCODING: Reliance on default encoding

Found a call to a method which will perform a byte to String (or String to byte) conversion, and will assume that the default platform encoding is suitable. This will cause the application behaviour to vary between platforms. Use an alternative API and specify a charset name or Charset object explicitly.

EI_EXPOSE_REP2: May expose internal representation by incorporating reference to mutable object

This code stores a reference to an externally mutable object into 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. Storing a copy of the object is better approach in many situations.

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.

MS_SHOULD_BE_FINAL: Field isn't final but should be

This static field public but not final, and could be changed by malicious code or by accident from another package. The field could be made final to avoid this vulnerability.

MS_PKGPROTECT: Field should be package protected

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

OS_OPEN_STREAM: Method may fail to close stream

The method creates an IO stream object, does not assign it to any fields, pass it to other methods that might close it, or return it, and does not appear to close the stream on all paths out of the method.  This may result in a file descriptor leak.  It is generally a good idea to use a finally block to ensure that streams are closed.

RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE: Redundant nullcheck of value known to be non-null

This method contains a redundant check of a known non-null value against the constant null.

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

RV_DONT_JUST_NULL_CHECK_READLINE: Method discards result of readLine after checking if it is non-null

The value returned by readLine is discarded after checking to see if the return value is non-null. In almost all situations, if the result is non-null, you will want to use that non-null value. Calling readLine again will give you a different line.

ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD: Write to static field from instance method

This instance method writes to a static field. This is tricky to get correct if multiple instances are being manipulated, and generally bad practice.

SWL_SLEEP_WITH_LOCK_HELD: Method calls Thread.sleep() with a lock held

This method calls Thread.sleep() with a lock held. This may result in very poor performance and scalability, or a deadlock, since other threads may be waiting to acquire the lock. It is a much better idea to call wait() on the lock, which releases the lock and allows other threads to run.

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.