Project:
FindBugs version: 3.0.1
Code analyzed:
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)
| 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 |
Click on a warning row to see full context information.
| Code | Warning |
|---|---|
| OS | com.macromedia.breeze_ext.telephony.Avaya.AvayaAdaptor.secureDownloadFTPFile(String, String, String) may fail to close stream |
| 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() |
| 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) |
| 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 |
| 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 |
| 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 |
| 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) |
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.
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.
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.
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.
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 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.
A mutable static field could be changed by malicious code or by accident. The field could be made package protected to avoid this vulnerability.
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.
This method contains a redundant check of a known non-null value against the constant null.
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 ...
}
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.
This instance method writes to a static field. This is tricky to get correct if multiple instances are being manipulated, and generally bad practice.
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.
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.