FindBugs Report

Project Information

Project:

FindBugs version: 1.3.9

Code analyzed:



Metrics

32630 lines of code analyzed, in 785 classes, in 85 packages.

Metric Total Density*
High Priority Warnings 44 1.35
Medium Priority Warnings 281 8.61
Total Warnings 325 9.96

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



Contents

Summary

Warning Type Number
Bad practice Warnings 36
Correctness Warnings 30
Experimental Warnings 2
Malicious code vulnerability Warnings 69
Multithreaded correctness Warnings 34
Performance Warnings 124
Dodgy Warnings 30
Total 325

Warnings

Click on a warning row to see full context information.

Bad practice Warnings

Code Warning
BC Random object created and used only once in org.jboss.remoting.transport.PortUtil.getRandomStartingPort()
BC Random object created and used only once in org.jboss.remoting.transporter.DefaultLoadBalancer.selectServer(ArrayList)
Dm new org.jboss.remoting.samples.chat.client.Chat(String[]) invokes System.exit(...), which shuts down the entire virtual machine
Dm new org.jboss.remoting.samples.chat.server.ChatManager() invokes System.exit(...), which shuts down the entire virtual machine
Dm org.jboss.remoting.samples.chat.server.ChatManager.initialize() invokes System.exit(...), which shuts down the entire virtual machine
Dm org.jboss.remoting.samples.chat.server.ChatManagerLauncher.launchButton_actionPerformed(ActionEvent) invokes System.exit(...), which shuts down the entire virtual machine
Dm org.jboss.remoting.samples.multiplex.PrimeScenarioExampleClient.runPrimeScenario() invokes System.exit(...), which shuts down the entire virtual machine
Dm org.jboss.remoting.samples.multiplex.PrimeScenarioExampleClient$AsynchronousThread.run() invokes System.exit(...), which shuts down the entire virtual machine
Dm org.jboss.remoting.samples.multiplex.PrimeScenarioExampleServer.runPrimeScenario() invokes System.exit(...), which shuts down the entire virtual machine
Dm org.jboss.remoting.samples.multiplex.PrimeScenarioExampleServer$AsynchronousThread.run() invokes System.exit(...), which shuts down the entire virtual machine
ES Comparison of String objects using == or != in org.jboss.remoting.transport.multiplex.MultiplexServerInvoker.rule2(String, int)
HE org.jboss.remoting.InvokerRegistry$ClientInvokerHolder defines equals and uses Object.hashCode()
HE org.jboss.remoting.samples.http.ComplexObject defines equals and uses Object.hashCode()
Nm Class org.jboss.remoting.samples.transporter.complex.NoDoctorAvailableException is not derived from an Exception, even though it is named as such
NP org.jboss.remoting.network.NetworkInstance.equals(Object) does not check for null argument
NP org.jboss.remoting.transport.socket.ServerAddress.equals(Object) does not check for null argument
OS org.jboss.remoting.samples.chat.utility.Parameters.getSecondaryParameterSources() may fail to close stream
RR org.jboss.remoting.transport.multiplex.MultiplexingInputStream.read() ignores result of org.jboss.remoting.transport.multiplex.MultiplexingInputStream.skip(long)
RR org.jboss.remoting.transport.multiplex.MultiplexingInputStream.read(byte[], int, int) ignores result of org.jboss.remoting.transport.multiplex.MultiplexingInputStream.skip(long)
RV org.jboss.remoting.loading.ClassByteClassLoader.clean(ClassByteClassLoader$MyRef) ignores exceptional return value of java.io.File.delete()
RV org.jboss.remoting.loading.ClassByteClassLoader.finalize() ignores exceptional return value of java.io.File.delete()
RV org.jboss.remoting.samples.stream.StreamingServer$TestStreamInvocationHandler.handleStream(InputStream, InvocationRequest) ignores exceptional return value of java.io.File.createNewFile()
Se Class org.jboss.remoting.marshal.encryption.EncryptingMarshaller defines non-transient non-serializable instance field cipher
Se Class org.jboss.remoting.marshal.encryption.EncryptingUnMarshaller defines non-transient non-serializable instance field cipher
Se Class org.jboss.remoting.marshal.serializable.SerializableUnMarshaller defines non-transient non-serializable instance field customClassLoader
Se org.jboss.remoting.samples.chat.utility.ReadWriteArrayList$Gate is serializable and an inner class
Se Class org.jboss.remoting.socketfactory.CreationListenerServerSocketFactory defines non-transient non-serializable instance field listener
Se Class org.jboss.remoting.socketfactory.CreationListenerSocketFactory defines non-transient non-serializable instance field listener
Se Class org.jboss.remoting.transport.multiplex.MasterServerSocket defines non-transient non-serializable instance field ss
Se Class org.jboss.remoting.transport.multiplex.MasterServerSocket defines non-transient non-serializable instance field ssc
Se Class org.jboss.remoting.transport.multiplex.VirtualServerSocket defines non-transient non-serializable instance field actualSocket
Se Class org.jboss.remoting.transport.multiplex.VirtualServerSocket defines non-transient non-serializable instance field cis
Se Class org.jboss.remoting.transport.multiplex.VirtualServerSocket defines non-transient non-serializable instance field dummySocket
Se Class org.jboss.remoting.transport.multiplex.VirtualServerSocket defines non-transient non-serializable instance field is
Se Class org.jboss.remoting.transport.multiplex.VirtualServerSocket defines non-transient non-serializable instance field manager
Se Class org.jboss.remoting.transport.multiplex.VirtualServerSocket defines non-transient non-serializable instance field protocol

Correctness Warnings

Code Warning
MF Field MultiplexClientInvoker.clientSocketClassName masks field in superclass org.jboss.remoting.transport.socket.MicroSocketClientInvoker
NP callback could be null and is guaranteed to be dereferenced in org.jboss.remoting.callback.ServerInvokerCallbackHandler.handleCallback(Callback, boolean, boolean)
NP Possible null pointer dereference of Client$ConnectionValidatorKey.metadata in org.jboss.remoting.Client$ConnectionValidatorKey.equals(Object)
NP Possible null pointer dereference of domainNodes in org.jboss.remoting.detection.AbstractDetector.setConfiguration(Element)
NP Possible null pointer dereference of Detection.serverInvokers in org.jboss.remoting.detection.Detection.getLocators()
NP Possible null pointer dereference of ident in org.jboss.remoting.ident.Identity.setDomain(String)
NP Possible null pointer dereference of customer in org.jboss.remoting.samples.transporter.basic.CustomerProcessorImpl.processCustomer(Customer)
NP Possible null pointer dereference of customer in org.jboss.remoting.samples.transporter.multiple.CustomerProcessorImpl.processCustomer(Customer)
NP Possible null pointer dereference of customerProxy in org.jboss.remoting.samples.transporter.proxy.CustomerProcessorImpl.processCustomer(Customer) on exception path
NP Possible null pointer dereference of handler in org.jboss.remoting.ServerInvoker.removeCallbackListener(String, InvokerCallbackHandler)
NP Possible null pointer dereference of proxyTypeClass in org.jboss.remoting.transport.http.HTTPClientInvoker.createURLConnection(String, Map)
NP Possible null pointer dereference of configuration in new org.jboss.remoting.transport.multiplex.MultiplexingManager(InetSocketAddress, int, Map)
NP Possible null pointer dereference of configuration in new org.jboss.remoting.transport.multiplex.MultiplexingManager(Map)
NP Possible null pointer dereference of org.jboss.remoting.AbstractInvoker.configuration in org.jboss.remoting.transport.multiplex.MultiplexServerInvoker.getParameters()
RCN Nullcheck of locator at line 127 of value previously dereferenced in new org.jboss.remoting.AbstractInvoker(InvokerLocator, Map)
RCN Nullcheck of locator at line 328 of value previously dereferenced in org.jboss.remoting.marshal.MarshalFactory.getMarshaller(InvokerLocator, ClassLoader, Map)
RCN Nullcheck of locator at line 479 of value previously dereferenced in org.jboss.remoting.marshal.MarshalFactory.getUnMarshaller(InvokerLocator, ClassLoader, Map)
RCN Nullcheck of configuration at line 471 of value previously dereferenced in org.jboss.remoting.MicroRemoteClientInvoker.establishLease(String, Map, long)
RCN Nullcheck of Client2Server1.client at line 122 of value previously dereferenced in org.jboss.remoting.samples.multiplex.invoker.Client2Server1.tearDown()
RCN Nullcheck of Client2Server2.client at line 122 of value previously dereferenced in org.jboss.remoting.samples.multiplex.invoker.Client2Server2.tearDown()
RCN Nullcheck of Client3Server1.client at line 120 of value previously dereferenced in org.jboss.remoting.samples.multiplex.invoker.Client3Server1.tearDown()
RCN Nullcheck of Server2Client1.client at line 114 of value previously dereferenced in org.jboss.remoting.samples.multiplex.invoker.Server2Client1.tearDown()
RCN Nullcheck of Server2Client2.client at line 112 of value previously dereferenced in org.jboss.remoting.samples.multiplex.invoker.Server2Client2.tearDown()
RCN Nullcheck of Server3Client1.client at line 114 of value previously dereferenced in org.jboss.remoting.samples.multiplex.invoker.Server3Client1.tearDown()
RCN Nullcheck of MicroSocketClientInvoker.pool at line 435 of value previously dereferenced in org.jboss.remoting.transport.socket.MicroSocketClientInvoker.flushConnectionPool()
RCN Nullcheck of ServerThread.invoker at line 1020 of value previously dereferenced in org.jboss.remoting.transport.socket.ServerThread.processNewSocket()
RpC Repeated conditional test in org.jboss.remoting.transport.socket.ServerThread.dorun()
USELESS_STRING Invocation of toString on bytes in org.jboss.remoting.loading.ClassByteClassLoader.loadClass(String, ClassBytes[])
USELESS_STRING Invocation of toString on ClassBytes.classBytes in org.jboss.remoting.loading.ClassBytes.toString()
USELESS_STRING Invocation of toString on params in org.jboss.remoting.ServerInvoker.handleInternalInvocation(InternalInvocation, InvocationRequest, ServerInvocationHandler)

Experimental Warnings

Code Warning
OBL Method org.jboss.remoting.samples.chat.utility.Parameters.getSecondaryParameterSources() may fail to clean up java.io.InputStream
OBL Method org.jboss.remoting.samples.stream.StreamingServer$TestStreamInvocationHandler.handleStream(InputStream, InvocationRequest) may fail to clean up java.io.OutputStream

Malicious code vulnerability Warnings

Code Warning
EI org.jboss.remoting.detection.Detection.getServerInvokers() may expose internal representation by returning Detection.serverInvokers
EI org.jboss.remoting.detection.ServerInvokerMetadata.getSubSystems() may expose internal representation by returning ServerInvokerMetadata.subSystems
EI org.jboss.remoting.invocation.NameBasedInvocation.getSignature() may expose internal representation by returning NameBasedInvocation.sig
EI org.jboss.remoting.invocation.RemoteInvocation.getParameters() may expose internal representation by returning RemoteInvocation.params
EI org.jboss.remoting.loading.ClassBytes.getClassBytes() may expose internal representation by returning ClassBytes.classBytes
EI org.jboss.remoting.network.NetworkInstance.getLocators() may expose internal representation by returning NetworkInstance.locators
EI org.jboss.remoting.network.NetworkInstance.getServerInvokers() may expose internal representation by returning NetworkInstance.serverInvokers
EI org.jboss.remoting.network.NetworkNotification.getLocator() may expose internal representation by returning NetworkNotification.locators
EI org.jboss.remoting.network.NetworkNotification.getServerInvokers() may expose internal representation by returning NetworkNotification.serverInvokers
EI org.jboss.remoting.samples.chat.client.ChatInfo.get_origin() may expose internal representation by returning ChatInfo.origin
EI org.jboss.remoting.serialization.impl.java.JavaMarshalledValue.toByteArray() may expose internal representation by returning JavaMarshalledValue.serializedForm
EI org.jboss.remoting.stream.StreamCallPayload.getParams() may expose internal representation by returning StreamCallPayload.paramArray
EI org.jboss.remoting.transport.multiplex.SocketId.toByteArray() may expose internal representation by returning SocketId.bytes
EI org.jboss.remoting.transport.multiplex.utility.ShrinkableByteArrayOutputStream.toByteArray(int) may expose internal representation by returning ShrinkableByteArrayOutputStream.buf
EI org.jboss.remoting.transport.sslbisocket.SSLBisocketClientInvoker.getEnabledCipherSuites() may expose internal representation by returning SSLBisocketClientInvoker.enabledCipherSuites
EI org.jboss.remoting.transport.sslbisocket.SSLBisocketClientInvoker.getEnabledProtocols() may expose internal representation by returning SSLBisocketClientInvoker.enabledProtocols
EI org.jboss.remoting.transport.sslbisocket.SSLBisocketServerInvoker.getEnabledCipherSuites() may expose internal representation by returning SSLBisocketServerInvoker.enabledCipherSuites
EI org.jboss.remoting.transport.sslbisocket.SSLBisocketServerInvoker.getEnabledProtocols() may expose internal representation by returning SSLBisocketServerInvoker.enabledProtocols
EI org.jboss.remoting.transport.sslsocket.SSLSocketClientInvoker.getEnabledCipherSuites() may expose internal representation by returning SSLSocketClientInvoker.enabledCipherSuites
EI org.jboss.remoting.transport.sslsocket.SSLSocketClientInvoker.getEnabledProtocols() may expose internal representation by returning SSLSocketClientInvoker.enabledProtocols
EI org.jboss.remoting.transport.sslsocket.SSLSocketServerInvoker.getEnabledCipherSuites() may expose internal representation by returning SSLSocketServerInvoker.enabledCipherSuites
EI org.jboss.remoting.transport.sslsocket.SSLSocketServerInvoker.getEnabledProtocols() may expose internal representation by returning SSLSocketServerInvoker.enabledProtocols
EI2 new org.jboss.remoting.detection.Detection(Identity, ServerInvokerMetadata[]) may expose internal representation by storing an externally mutable object into Detection.serverInvokers
EI2 new org.jboss.remoting.detection.ServerInvokerMetadata(InvokerLocator, String[]) may expose internal representation by storing an externally mutable object into ServerInvokerMetadata.subSystems
EI2 new org.jboss.remoting.invocation.NameBasedInvocation(String, Object[], String[]) may expose internal representation by storing an externally mutable object into NameBasedInvocation.sig
EI2 new org.jboss.remoting.invocation.RemoteInvocation(String, Object[]) may expose internal representation by storing an externally mutable object into RemoteInvocation.params
EI2 new org.jboss.remoting.loading.ClassBytes(String, byte[]) may expose internal representation by storing an externally mutable object into ClassBytes.classBytes
EI2 new org.jboss.remoting.network.NetworkInstance(Identity, InvokerLocator[]) may expose internal representation by storing an externally mutable object into NetworkInstance.locators
EI2 new org.jboss.remoting.network.NetworkInstance(Identity, ServerInvokerMetadata[]) may expose internal representation by storing an externally mutable object into NetworkInstance.serverInvokers
EI2 new org.jboss.remoting.network.NetworkNotification(ObjectName, String, Identity, InvokerLocator[]) may expose internal representation by storing an externally mutable object into NetworkNotification.locators
EI2 new org.jboss.remoting.network.NetworkNotification(ObjectName, String, Identity, ServerInvokerMetadata[]) may expose internal representation by storing an externally mutable object into NetworkNotification.serverInvokers
EI2 new org.jboss.remoting.samples.chat.client.ChatInfo(String, String, ChatMember, Date, int, int) may expose internal representation by storing an externally mutable object into ChatInfo.origin
EI2 org.jboss.remoting.samples.chat.client.ChatInfo.set_origin(Date) may expose internal representation by storing an externally mutable object into ChatInfo.origin
EI2 org.jboss.remoting.samples.http.ComplexObject.setBytes(byte[]) may expose internal representation by storing an externally mutable object into ComplexObject.bytes
EI2 org.jboss.remoting.stream.StreamCallPayload.setParams(Object[]) may expose internal representation by storing an externally mutable object into StreamCallPayload.paramArray
EI2 new org.jboss.remoting.transport.multiplex.SocketId(byte[]) may expose internal representation by storing an externally mutable object into SocketId.bytes
EI2 org.jboss.remoting.transport.sslbisocket.SSLBisocketClientInvoker.setEnabledCipherSuites(String[]) may expose internal representation by storing an externally mutable object into SSLBisocketClientInvoker.enabledCipherSuites
EI2 org.jboss.remoting.transport.sslbisocket.SSLBisocketClientInvoker.setEnabledProtocols(String[]) may expose internal representation by storing an externally mutable object into SSLBisocketClientInvoker.enabledProtocols
EI2 org.jboss.remoting.transport.sslbisocket.SSLBisocketServerInvoker.setEnabledCipherSuites(String[]) may expose internal representation by storing an externally mutable object into SSLBisocketServerInvoker.enabledCipherSuites
EI2 org.jboss.remoting.transport.sslbisocket.SSLBisocketServerInvoker.setEnabledProtocols(String[]) may expose internal representation by storing an externally mutable object into SSLBisocketServerInvoker.enabledProtocols
EI2 org.jboss.remoting.transport.sslsocket.SSLSocketClientInvoker.setEnabledCipherSuites(String[]) may expose internal representation by storing an externally mutable object into SSLSocketClientInvoker.enabledCipherSuites
EI2 org.jboss.remoting.transport.sslsocket.SSLSocketClientInvoker.setEnabledProtocols(String[]) may expose internal representation by storing an externally mutable object into SSLSocketClientInvoker.enabledProtocols
EI2 org.jboss.remoting.transport.sslsocket.SSLSocketServerInvoker.setEnabledCipherSuites(String[]) may expose internal representation by storing an externally mutable object into SSLSocketServerInvoker.enabledCipherSuites
EI2 org.jboss.remoting.transport.sslsocket.SSLSocketServerInvoker.setEnabledProtocols(String[]) may expose internal representation by storing an externally mutable object into SSLSocketServerInvoker.enabledProtocols
MS org.jboss.remoting.ident.Identity.DEFAULT_DOMAIN isn't final but should be
MS org.jboss.remoting.InvokerLocator.legacyParsingFlag should be package protected
MS org.jboss.remoting.InvokerLocator.log isn't final but should be
MS org.jboss.remoting.loading.ObjectInputStreamWithClassLoader.clearMethod isn't final but should be
MS org.jboss.remoting.samples.bisocket.BisocketSampleServer.port isn't final but should be
MS org.jboss.remoting.samples.config.factories.FactoryConfigSample.log isn't final but should be
MS org.jboss.remoting.samples.detection.jndi.SimpleDetectorServer.port should be package protected
MS org.jboss.remoting.samples.detection.jndi.SimpleDetectorServer.transport should be package protected
MS org.jboss.remoting.samples.detection.jndi.SimpleDetectorServer.host isn't final but should be
MS org.jboss.remoting.samples.transporter.clustered.server.SocketServer.locatorURI isn't final but should be
MS org.jboss.remoting.samples.transporter.complex.server.Server.locatorURI isn't final but should be
MS org.jboss.remoting.samples.transporter.custom.server.SocketServer.locatorURI isn't final but should be
MS org.jboss.remoting.serialization.impl.java.ClearableObjectOutputStream.PARAMS isn't final but should be
MS org.jboss.remoting.serialization.impl.java.ClearableObjectOutputStream.clearMethod isn't final but should be
MS org.jboss.remoting.serialization.impl.java.ClearableObjectOutputStream.log isn't final but should be
MS org.jboss.remoting.transport.coyote.CoyoteInvoker.receivedInvocationRequest isn't final but should be
MS org.jboss.remoting.transport.rmi.RemotingRMIClientSocketFactory.configMaps isn't final but should be
MS org.jboss.remoting.transport.rmi.RemotingRMIClientSocketFactory.log isn't final but should be
MS org.jboss.remoting.transport.rmi.RemotingRMIClientSocketFactory.socketFactories isn't final but should be
MS org.jboss.remoting.transport.rmi.RMIServerInvoker.RMI_ONEWAY_MARSHALLING isn't final but should be
MS org.jboss.remoting.transport.socket.SocketServerInvoker.MAX_POOL_SIZE_DEFAULT isn't final but should be
MS org.jboss.remoting.transport.web.WebServerInvoker.HEADER_SESSION_ID isn't final but should be
MS org.jboss.remoting.transport.web.WebServerInvoker.HEADER_SUBSYSTEM isn't final but should be
MS org.jboss.remoting.transport.web.WebUtil.BINARY isn't final but should be
MS org.jboss.remoting.transport.web.WebUtil.HTML isn't final but should be

Multithreaded correctness Warnings

Code Warning
IS Inconsistent synchronization of org.jboss.remoting.AbstractInvoker.classbyteloader; locked 50% of time
IS Inconsistent synchronization of org.jboss.remoting.callback.CallbackPoller.reportStatistics; locked 50% of time
IS Inconsistent synchronization of org.jboss.remoting.callback.DefaultCallbackErrorHandler.callbackHandler; locked 66% of time
IS Inconsistent synchronization of org.jboss.remoting.callback.DefaultCallbackErrorHandler.handlerSubsystem; locked 50% of time
IS Inconsistent synchronization of org.jboss.remoting.callback.DefaultCallbackErrorHandler.numOfErrorsAllowed; locked 50% of time
IS Inconsistent synchronization of org.jboss.remoting.callback.DefaultCallbackErrorHandler.serverInvoker; locked 66% of time
IS Inconsistent synchronization of org.jboss.remoting.loading.RemotingClassLoader.userClassLoader; locked 50% of time
IS Inconsistent synchronization of org.jboss.remoting.samples.chat.utility.ShutDownGate.numberOfUsers; locked 87% of time
IS Inconsistent synchronization of org.jboss.remoting.samples.chat.utility.ShutDownGate.shuttingDown; locked 80% of time
IS Inconsistent synchronization of org.jboss.remoting.transport.bisocket.BisocketServerInvoker$ControlMonitorTimerTask.running; locked 80% of time
IS Inconsistent synchronization of org.jboss.remoting.transport.multiplex.MultiplexingInputStream.readException; locked 88% of time
IS Inconsistent synchronization of org.jboss.remoting.transport.multiplex.MultiplexingManager.createdForRemoteServerSocket; locked 50% of time
IS Inconsistent synchronization of org.jboss.remoting.transport.multiplex.MultiplexingManager.inputThread; locked 57% of time
IS Inconsistent synchronization of org.jboss.remoting.transport.multiplex.MultiplexingManager.remoteServerSocketRegistered; locked 71% of time
IS Inconsistent synchronization of org.jboss.remoting.transport.multiplex.MultiplexingManager.remoteSocketAddress; locked 55% of time
IS Inconsistent synchronization of org.jboss.remoting.transport.multiplex.MultiplexingManager.socket; locked 81% of time
IS Inconsistent synchronization of org.jboss.remoting.transport.multiplex.MultiplexingManager$ShutdownManager.shutdown; locked 73% of time
IS Inconsistent synchronization of org.jboss.remoting.transport.multiplex.MultiplexingManager$ShutdownManager.shutdownRequestInProgress; locked 71% of time
IS Inconsistent synchronization of org.jboss.remoting.transport.multiplex.utility.GrowablePipedInputStream.timeout; locked 75% of time
IS Inconsistent synchronization of org.jboss.remoting.transport.socket.ServerThread.invocationCount; locked 60% of time
IS Inconsistent synchronization of org.jboss.remoting.transport.socket.ServerThread.invoker; locked 50% of time
IS Inconsistent synchronization of org.jboss.remoting.transport.socket.ServerThread.socket; locked 50% of time
IS Inconsistent synchronization of org.jboss.remoting.transport.socket.ServerThread.timeout; locked 50% of time
IS Inconsistent synchronization of org.jboss.remoting.transport.socket.SocketServerInvoker.acceptThreads; locked 63% of time
IS Inconsistent synchronization of org.jboss.remoting.transport.socket.SocketServerInvoker.idleTimerTask; locked 50% of time
ML org.jboss.remoting.transport.socket.MicroSocketClientInvoker.initPool() synchronizes on updated field MicroSocketClientInvoker.pool
NN Naked notify in org.jboss.remoting.transport.bisocket.BisocketClientInvoker.handleDisconnect()
SC new org.jboss.remoting.samples.callback.CallbackServer$SampleInvocationHandler() invokes Thread.start()
SC new org.jboss.remoting.samples.callback.statistics.CallbackServer$SampleInvocationHandler() invokes Thread.start()
SC new org.jboss.remoting.samples.multiplex.invoker.MultiplexInvokerServer$SampleInvocationHandler() invokes Thread.start()
SWL org.jboss.remoting.transport.socket.SocketServerInvoker.refreshServerSocket() calls Thread.sleep() with a lock held
UW Unconditional wait in org.jboss.remoting.callback.BlockingCallbackStore.add(Serializable)
Wa Wait not in loop in org.jboss.remoting.callback.BlockingCallbackStore.add(Serializable)
Wa Wait not in loop in org.jboss.remoting.transport.multiplex.SocketId.getFreePort()

Performance Warnings

Code Warning
Bx Method org.jboss.remoting.callback.CallbackStoreWrapper$9.run() invokes inefficient new Integer(int) constructor; use Integer.valueOf(int) instead
Bx Method org.jboss.remoting.samples.callback.statistics.CallbackServer$SampleInvocationHandler.run() invokes inefficient new Integer(int) constructor; use Integer.valueOf(int) instead
Bx Method org.jboss.remoting.samples.config.factories.FactoryConfigSample$SampleInvocationHandler.addListener(InvokerCallbackHandler) invokes inefficient new Integer(int) constructor; use Integer.valueOf(int) instead
Bx Method org.jboss.remoting.samples.multiplex.invoker.Client2Server1.makeClientCall() invokes inefficient new Integer(int) constructor; use Integer.valueOf(int) instead
Bx Method org.jboss.remoting.samples.multiplex.invoker.Client2Server2.makeClientCall() invokes inefficient new Integer(int) constructor; use Integer.valueOf(int) instead
Bx Method org.jboss.remoting.samples.multiplex.invoker.Client3Server1.makeClientCall() invokes inefficient new Integer(int) constructor; use Integer.valueOf(int) instead
Bx Method org.jboss.remoting.samples.multiplex.invoker.MultiplexInvokerServer$SampleInvocationHandler.run() invokes inefficient new Integer(int) constructor; use Integer.valueOf(int) instead
Bx Method org.jboss.remoting.samples.multiplex.invoker.Server2Client1.makeClientCall() invokes inefficient new Integer(int) constructor; use Integer.valueOf(int) instead
Bx Method org.jboss.remoting.samples.multiplex.invoker.Server2Client2.makeClientCall() invokes inefficient new Integer(int) constructor; use Integer.valueOf(int) instead
Bx Method org.jboss.remoting.samples.multiplex.invoker.Server3Client1.makeClientCall() invokes inefficient new Integer(int) constructor; use Integer.valueOf(int) instead
Bx Method org.jboss.remoting.samples.multiplex.PrimeScenarioExampleClient.runPrimeScenario() invokes inefficient new Integer(int) constructor; use Integer.valueOf(int) instead
Bx Method org.jboss.remoting.samples.multiplex.PrimeScenarioExampleServer$AsynchronousThread.run() invokes inefficient new Integer(int) constructor; use Integer.valueOf(int) instead
Bx Method org.jboss.remoting.samples.stream.StreamingServer$TestStreamInvocationHandler.handleStream(InputStream, InvocationRequest) invokes inefficient new Long(long) constructor; use Long.valueOf(long) instead
Bx Method org.jboss.remoting.samples.stream.StreamingServer$TestStreamInvocationHandler.invoke(InvocationRequest) invokes inefficient new Long(long) constructor; use Long.valueOf(long) instead
Bx Method org.jboss.remoting.ServerInvoker.invoke(InvocationRequest) invokes inefficient new Long(long) constructor; use Long.valueOf(long) instead
Bx Method org.jboss.remoting.stream.StreamHandler.mark(int) invokes inefficient new Integer(int) constructor; use Integer.valueOf(int) instead
Bx Method org.jboss.remoting.stream.StreamHandler.skip(long) invokes inefficient new Long(long) constructor; use Long.valueOf(long) instead
Bx Method org.jboss.remoting.stream.StreamServer$Handler.invoke(InvocationRequest) invokes inefficient new Integer(int) constructor; use Integer.valueOf(int) instead
Bx Method org.jboss.remoting.stream.StreamServer$Handler.invoke(InvocationRequest) invokes inefficient new Long(long) constructor; use Long.valueOf(long) instead
Bx Method org.jboss.remoting.transport.bisocket.BisocketServerInvoker.createControlConnection(String, boolean) invokes inefficient new Integer(int) constructor; use Integer.valueOf(int) instead
Bx Method org.jboss.remoting.transport.bisocket.BisocketServerInvoker.setSecondaryBindPort(int) invokes inefficient new Integer(int) constructor; use Integer.valueOf(int) instead
Bx Method org.jboss.remoting.transport.bisocket.BisocketServerInvoker.setSecondaryBindPorts(String) invokes inefficient new Integer(int) constructor; use Integer.valueOf(int) instead
Bx Method org.jboss.remoting.transport.bisocket.BisocketServerInvoker.setSecondaryConnectPort(int) invokes inefficient new Integer(int) constructor; use Integer.valueOf(int) instead
Bx Method org.jboss.remoting.transport.bisocket.BisocketServerInvoker.setSecondaryConnectPorts(String) invokes inefficient new Integer(int) constructor; use Integer.valueOf(int) instead
Bx Method org.jboss.remoting.transport.bisocket.BisocketServerInvoker.setup() invokes inefficient new Integer(int) constructor; use Integer.valueOf(int) instead
Bx Method org.jboss.remoting.transport.bisocket.BisocketServerInvoker.start() invokes inefficient new Integer(int) constructor; use Integer.valueOf(int) instead
Bx Method org.jboss.remoting.transport.coyote.CoyoteInvoker.addLeaseInfo(ResponseMap) invokes inefficient new Long(long) constructor; use Long.valueOf(long) instead
Bx Method org.jboss.remoting.transport.coyote.ssl.RemotingSSLSupport.getKeySize() invokes inefficient new Integer(int) constructor; use Integer.valueOf(int) instead
Bx Method org.jboss.remoting.transport.http.HTTPClientInvoker.checkForLeasePing(HttpURLConnection, Object, Map) invokes inefficient new Integer(int) constructor; use Integer.valueOf(int) instead
Bx Method org.jboss.remoting.transport.http.HTTPClientInvoker.checkForLeasePing(HttpURLConnection, Object, Map) invokes inefficient new Long(long) constructor; use Long.valueOf(long) instead
Bx Method org.jboss.remoting.transport.http.HTTPClientInvoker.getSimulatedTimeout(Map, Map, HttpURLConnection) invokes inefficient new Integer(int) constructor; use Integer.valueOf(int) instead
Bx Method org.jboss.remoting.transport.http.HTTPClientInvoker.setChunked(Map, HttpURLConnection) invokes inefficient new Integer(int) constructor; use Integer.valueOf(int) instead
Bx Method org.jboss.remoting.transport.http.HTTPClientInvoker.useHttpURLConnection(HttpURLConnection, Object, Map, Marshaller, UnMarshaller) invokes inefficient new Integer(int) constructor; use Integer.valueOf(int) instead
Bx Method org.jboss.remoting.transport.http.HTTPClientInvoker$6.run() invokes inefficient new Integer(int) constructor; use Integer.valueOf(int) instead
Bx Method org.jboss.remoting.transport.multiplex.MultiplexServerInvoker.setInputBufferSize(int) invokes inefficient new Integer(int) constructor; use Integer.valueOf(int) instead
Bx Method org.jboss.remoting.transport.multiplex.MultiplexServerInvoker.setInputMaxErrors(int) invokes inefficient new Integer(int) constructor; use Integer.valueOf(int) instead
Bx Method org.jboss.remoting.transport.multiplex.MultiplexServerInvoker.setMaxAcceptErrors(int) invokes inefficient new Integer(int) constructor; use Integer.valueOf(int) instead
Bx Method org.jboss.remoting.transport.multiplex.MultiplexServerInvoker.setOutputMaxChunkSize(int) invokes inefficient new Integer(int) constructor; use Integer.valueOf(int) instead
Bx Method org.jboss.remoting.transport.multiplex.MultiplexServerInvoker.setOutputMaxDataSlice(int) invokes inefficient new Integer(int) constructor; use Integer.valueOf(int) instead
Bx Method org.jboss.remoting.transport.multiplex.MultiplexServerInvoker.setOutputMaxTimeSlice(int) invokes inefficient new Integer(int) constructor; use Integer.valueOf(int) instead
Bx Method org.jboss.remoting.transport.multiplex.MultiplexServerInvoker.setOutputMessagePoolSize(int) invokes inefficient new Integer(int) constructor; use Integer.valueOf(int) instead
Bx Method org.jboss.remoting.transport.multiplex.MultiplexServerInvoker.setOutputMessageSize(int) invokes inefficient new Integer(int) constructor; use Integer.valueOf(int) instead
Bx Method org.jboss.remoting.transport.multiplex.MultiplexServerInvoker.setShutdownMonitorPeriod(int) invokes inefficient new Integer(int) constructor; use Integer.valueOf(int) instead
Bx Method org.jboss.remoting.transport.multiplex.MultiplexServerInvoker.setShutdownRefusalsMaximum(int) invokes inefficient new Integer(int) constructor; use Integer.valueOf(int) instead
Bx Method org.jboss.remoting.transport.multiplex.MultiplexServerInvoker.setShutdownRequestTimeout(int) invokes inefficient new Integer(int) constructor; use Integer.valueOf(int) instead
Bx Method org.jboss.remoting.transport.multiplex.MultiplexServerInvoker.setStaticThreadsMonitorPeriod(int) invokes inefficient new Integer(int) constructor; use Integer.valueOf(int) instead
Bx Method org.jboss.remoting.transport.multiplex.SocketId.freePort(int) invokes inefficient new Integer(int) constructor; use Integer.valueOf(int) instead
Bx Method org.jboss.remoting.transport.multiplex.SocketId.getFreePort() invokes inefficient new Integer(int) constructor; use Integer.valueOf(int) instead
Bx Method org.jboss.remoting.transport.PortUtil.getFreePort(String) invokes inefficient new Integer(int) constructor; use Integer.valueOf(int) instead
Bx Method org.jboss.remoting.transport.socket.MicroSocketClientInvoker.createClientSocket(Socket, int, Map) invokes inefficient new Integer(int) constructor; use Integer.valueOf(int) instead
Bx Method org.jboss.remoting.transport.socket.MicroSocketClientInvoker.getConnection(Marshaller, UnMarshaller, boolean, int) invokes inefficient new Integer(int) constructor; use Integer.valueOf(int) instead
Bx Method org.jboss.remoting.transport.socket.ServerThread.createServerSocketWrapper(Socket, int, Map) invokes inefficient new Integer(int) constructor; use Integer.valueOf(int) instead
Bx Method org.jboss.remoting.transport.socket.SocketClientInvoker.createClientSocket(Socket, int, Map) invokes inefficient new Integer(int) constructor; use Integer.valueOf(int) instead
Bx Method org.jboss.remoting.transport.web.WebServerInvoker.addLeaseInfo(Map) invokes inefficient new Long(long) constructor; use Long.valueOf(long) instead
Bx Method org.jboss.remoting.Version.<static initializer>() invokes inefficient new Byte(byte) constructor; use Byte.valueOf(byte) instead
Dm org.jboss.remoting.callback.CallbackStore$1.run() invokes inefficient Boolean constructor; use Boolean.valueOf(...) instead
Dm org.jboss.remoting.callback.CallbackStore$2.run() invokes inefficient Boolean constructor; use Boolean.valueOf(...) instead
Dm org.jboss.remoting.callback.CallbackStore$5.run() invokes inefficient Boolean constructor; use Boolean.valueOf(...) instead
Dm org.jboss.remoting.callback.CallbackStoreWrapper$5.run() invokes inefficient Boolean constructor; use Boolean.valueOf(...) instead
Dm org.jboss.remoting.callback.ServerInvokerCallbackHandler$1.run() forces garbage collection; extremely dubious except in benchmarking code
Dm org.jboss.remoting.callback.ServerInvokerCallbackHandler$2.run() forces garbage collection; extremely dubious except in benchmarking code
Dm org.jboss.remoting.callback.ServerInvokerCallbackHandler$4.run() invokes inefficient Boolean constructor; use Boolean.valueOf(...) instead
Dm org.jboss.remoting.ident.Identity$1.run() invokes inefficient Boolean constructor; use Boolean.valueOf(...) instead
Dm org.jboss.remoting.ident.Identity$2.run() invokes inefficient Boolean constructor; use Boolean.valueOf(...) instead
Dm org.jboss.remoting.ident.Identity$5.run() invokes inefficient Boolean constructor; use Boolean.valueOf(...) instead
Dm org.jboss.remoting.ident.Identity$6.run() invokes inefficient Boolean constructor; use Boolean.valueOf(...) instead
Dm org.jboss.remoting.InvokerLocator.setUseLegacyParsing(boolean) invokes inefficient Boolean constructor; use Boolean.valueOf(...) instead
Dm org.jboss.remoting.loading.ClassByteClassLoader$2.run() invokes inefficient Boolean constructor; use Boolean.valueOf(...) instead
Dm org.jboss.remoting.loading.CompressedClassBytes.main(String[]) invokes inefficient new String(String) constructor
Dm org.jboss.remoting.loading.CompressedClassBytes$1.run() invokes inefficient Boolean constructor; use Boolean.valueOf(...) instead
Dm org.jboss.remoting.network.NetworkRegistryQuery$1.run() invokes inefficient Boolean constructor; use Boolean.valueOf(...) instead
Dm org.jboss.remoting.network.NetworkRegistryWrapper$4.run() invokes inefficient Boolean constructor; use Boolean.valueOf(...) instead
Dm org.jboss.remoting.security.CustomSSLServerSocketFactory$1.run() invokes inefficient Boolean constructor; use Boolean.valueOf(...) instead
Dm org.jboss.remoting.security.CustomSSLServerSocketFactory$2.run() invokes inefficient Boolean constructor; use Boolean.valueOf(...) instead
Dm org.jboss.remoting.security.CustomSSLServerSocketFactory$3.run() invokes inefficient Boolean constructor; use Boolean.valueOf(...) instead
Dm org.jboss.remoting.security.SSLSocketBuilder$2.run() invokes inefficient Boolean constructor; use Boolean.valueOf(...) instead
Dm org.jboss.remoting.ServerInvoker.invoke(InvocationRequest) invokes inefficient Boolean constructor; use Boolean.valueOf(...) instead
Dm org.jboss.remoting.stream.StreamServer$Handler.invoke(InvocationRequest) invokes inefficient Boolean constructor; use Boolean.valueOf(...) instead
Dm org.jboss.remoting.transport.coyote.CoyoteInvoker.<static initializer>() invokes inefficient Boolean constructor; use Boolean.valueOf(...) instead
Dm org.jboss.remoting.transport.coyote.CoyoteInvoker.addLeaseInfo(ResponseMap) invokes inefficient Boolean constructor; use Boolean.valueOf(...) instead
Dm org.jboss.remoting.transport.coyote.CoyoteInvoker.setProperty(Object, String, String) invokes inefficient Boolean constructor; use Boolean.valueOf(...) instead
Dm org.jboss.remoting.transport.http.HTTPClientInvoker.checkForLeasePing(HttpURLConnection, Object, Map) invokes inefficient Boolean constructor; use Boolean.valueOf(...) instead
Dm org.jboss.remoting.transport.http.ssl.HTTPSClientInvoker$1.run() invokes inefficient Boolean constructor; use Boolean.valueOf(...) instead
Dm org.jboss.remoting.transport.web.WebServerInvoker.addLeaseInfo(Map) invokes inefficient Boolean constructor; use Boolean.valueOf(...) instead
Dm org.jboss.remoting.util.SecurityUtility$1.run() invokes inefficient Boolean constructor; use Boolean.valueOf(...) instead
SBSC Method org.jboss.remoting.detection.Detection.toString() concatenates strings using + in a loop
SBSC Method org.jboss.remoting.detection.ServerInvokerMetadata.toString() concatenates strings using + in a loop
SBSC Method org.jboss.remoting.samples.transporter.complex.Doctor.toString() concatenates strings using + in a loop
SBSC Method org.jboss.remoting.transport.Connector.getInvokerConfigFromServerConfiguration(Map) concatenates strings using + in a loop
SBSC Method org.jboss.remoting.transport.Connector.getInvokerConfigFromXML(Map) concatenates strings using + in a loop
SIC Should org.jboss.remoting.AbstractInvoker$CallbackHandlerHolder be a _static_ inner class?
SIC Should org.jboss.remoting.AbstractInvoker$CallbackLocatorHolder be a _static_ inner class?
SIC Should org.jboss.remoting.callback.NullCallbackStore$FailedCallback be a _static_ inner class?
SIC Should org.jboss.remoting.detection.AbstractDetector$Server be a _static_ inner class?
SIC Should org.jboss.remoting.loading.ClassByteClassLoader$MyRef be a _static_ inner class?
SIC Should org.jboss.remoting.samples.callback.CallbackClient$CallbackHandler be a _static_ inner class?
SIC Should org.jboss.remoting.samples.callback.statistics.CallbackClient$CallbackHandler be a _static_ inner class?
SIC Should org.jboss.remoting.samples.chat.client.RemoteStrategyRemoting$ChatServerStub be a _static_ inner class?
SIC Should org.jboss.remoting.samples.multiplex.PrimeScenarioExampleClient$AsynchronousThread be a _static_ inner class?
SIC Should org.jboss.remoting.samples.multiplex.PrimeScenarioExampleServer$AsynchronousThread be a _static_ inner class?
SIC Should org.jboss.remoting.security.SSLSocketBuilder$NullStoreURLException be a _static_ inner class?
SIC Should org.jboss.remoting.ServerInvoker$CallbackContainer be a _static_ inner class?
SIC Should org.jboss.remoting.transport.bisocket.BisocketServerInvoker$SecondaryServerSocketThread be a _static_ inner class?
SIC Should org.jboss.remoting.transport.http.ssl.HTTPSClientInvoker$AnyhostVerifier be a _static_ inner class?
SIC Should org.jboss.remoting.transport.multiplex.VirtualServerSocket$PendingClose be a _static_ inner class?
SIC Should org.jboss.remoting.transport.multiplex.VirtualSocket$PendingClose be a _static_ inner class?
SIC Should org.jboss.remoting.transport.multiplex.VirtualSocket$PendingRemoteDisconnect be a _static_ inner class?
UrF Unread field: org.jboss.remoting.samples.chat.client.LocalStrategy$3.remoteChatServerWrapper
UrF Unread field: org.jboss.remoting.transport.coyote.InputBuffer.bytesRead
UrF Unread field: org.jboss.remoting.transport.coyote.InputBuffer.charsRead
UrF Unread field: org.jboss.remoting.transport.coyote.InputBuffer.inputChunk
UrF Unread field: org.jboss.remoting.transport.multiplex.InputMultiplexor$MultiGroupInputThread.info
UrF Unread field: org.jboss.remoting.transport.multiplex.InputMultiplexor$SingleGroupInputThread.debug
UrF Unread field: org.jboss.remoting.transport.multiplex.InputMultiplexor$SingleGroupInputThread.info
UrF Unread field: org.jboss.remoting.transport.multiplex.MultiplexingManager$ShutdownManager$ShutdownMonitorTimerTask.cancelled
WMI Method org.jboss.remoting.ServerInvoker.getMBeanObjectName() makes inefficient use of keySet iterator instead of entrySet iterator
WMI Method org.jboss.remoting.transport.Connector.configureHandlersFromServerConfiguration() makes inefficient use of keySet iterator instead of entrySet iterator
WMI Method org.jboss.remoting.transport.Connector.getInvokerConfigFromServerConfiguration(Map) makes inefficient use of keySet iterator instead of entrySet iterator
WMI Method org.jboss.remoting.transport.Connector.getInvokerConfigFromXML(Map) makes inefficient use of keySet iterator instead of entrySet iterator
WMI Method org.jboss.remoting.transport.coyote.CoyoteInvoker.setup() makes inefficient use of keySet iterator instead of entrySet iterator
WMI Method org.jboss.remoting.transport.http.HTTPClientInvoker.useHttpURLConnection(HttpURLConnection, Object, Map, Marshaller, UnMarshaller) makes inefficient use of keySet iterator instead of entrySet iterator
WMI Method org.jboss.remoting.transport.multiplex.Protocol$BackChannelThread.doRun() makes inefficient use of keySet iterator instead of entrySet iterator
WMI Method org.jboss.remoting.transport.servlet.ServletServerInvoker.processRequest(HttpServletRequest, HttpServletResponse) makes inefficient use of keySet iterator instead of entrySet iterator
WMI Method org.jboss.remoting.transport.servlet.ServletServerInvoker.processRequest(HttpServletRequest, byte[], HttpServletResponse) makes inefficient use of keySet iterator instead of entrySet iterator

Dodgy Warnings

Code Warning
BC Unchecked/unconfirmed cast from java.net.Socket to javax.net.ssl.SSLSocket in org.jboss.remoting.transport.coyote.ssl.RemotingServerSocketFactory.handshake(Socket)
BC Unchecked/unconfirmed cast from java.net.Socket to javax.net.ssl.SSLSocket in org.jboss.remoting.transport.coyote.ssl.RemotingSSLImplementation.getSSLSupport(Socket)
DLS Dead store to obj in org.jboss.remoting.loading.CompressedClassBytes.main(String[])
DLS Dead store to count in org.jboss.remoting.loading.CompressedClassBytes.readExternal(ObjectInput)
DLS Dead store to CloseableFrame in org.jboss.remoting.samples.chat.client.CloseableFrame.main(String[])
DLS Dead store to backChat in org.jboss.remoting.samples.chat.client.TalkFrame.main(String[])
DLS Dead store to backChat in new org.jboss.remoting.samples.chat.server.CallbackThread(InvokerCallbackHandler, ShutDownGate, ReadWriteArrayList)
DLS Dead store to chatManagerLauncher in org.jboss.remoting.samples.chat.server.ChatManagerLauncher.main(String[])
DLS Dead store to locatorURI in org.jboss.remoting.samples.stream.StreamingClient.main(String[])
DLS Dead store to originalPort in org.jboss.remoting.transport.multiplex.MultiplexServerInvoker.setBindingInfo()
DMI org.jboss.remoting.InvokerLocator.legacyParse(String) invokes substring(0), which returns the original value
DMI org.jboss.remoting.transport.multiplex.MultiplexServerInvoker.setBindingInfo() invokes substring(0), which returns the original value
Eq org.jboss.remoting.network.NetworkInstance.equals(Object) is unusual
IA Ambiguous invocation of either an outer or inherited method java.util.TimerTask.cancel() in org.jboss.remoting.ConnectionValidator$WaitOnConnectionCheckTimerTask.run()
ICAST integral division result cast to double or float in org.jboss.remoting.callback.ServerInvokerCallbackHandler.isMemLow()
NP Load of known null value in org.jboss.remoting.Client.addCallbackListener(InvokerCallbackHandler, Map, InvokerLocator, Object)
NP Possible null pointer dereference in org.jboss.remoting.Client.addConnectionListener(ConnectionListener, Map) due to return value of called method
NP Load of known null value in org.jboss.remoting.InvokerRegistry.loadClientInvoker(String, InvokerLocator, Map)
NP Load of known null value in org.jboss.remoting.InvokerRegistry.loadServerInvoker(String, InvokerLocator, Map)
NP Load of known null value in org.jboss.remoting.transport.http.HTTPClientInvoker.handleConnect()
REC Exception is caught when Exception is not thrown in org.jboss.remoting.detection.jndi.JNDIDetector.verifyJNDIServer()
REC Exception is caught when Exception is not thrown in org.jboss.remoting.samples.detection.jndi.SimpleJNDIServer.setupJNDIServer()
REC Exception is caught when Exception is not thrown in org.jboss.remoting.samples.transporter.custom.server.JNDIServer.main(String[])
REC Exception is caught when Exception is not thrown in org.jboss.remoting.transport.AddressUtil.checkAddress(String, int)
REC Exception is caught when Exception is not thrown in org.jboss.remoting.transport.coyote.CoyoteInvoker.setProperty(Object, String, String)
REC Exception is caught when Exception is not thrown in org.jboss.remoting.transport.coyote.ssl.RemotingSSLSupport.getX509Certificates(SSLSession)
REC Exception is caught when Exception is not thrown in org.jboss.remoting.transport.http.HTTPClientInvoker.useHttpURLConnection(HttpURLConnection, Object, Map, Marshaller, UnMarshaller)
SA Double assignment of remoteStrategyName in new org.jboss.remoting.samples.chat.client.Chat(String[])
ST Write to static field org.jboss.remoting.network.NetworkRegistry.singleton from instance method new org.jboss.remoting.network.NetworkRegistry()
ST Write to static field org.jboss.remoting.transport.multiplex.MultiplexingManager.configuration from instance method org.jboss.remoting.transport.multiplex.MultiplexingManager.initParameters(Map)

Details

DMI_RANDOM_USED_ONLY_ONCE: Random object created and used only once

This code creates a java.util.Random object, uses it to generate one random number, and then discards the Random object. This produces mediocre quality random numbers and is inefficient. If possible, rewrite the code so that the Random object is created once and saved, and each time a new random number is required invoke a method on the existing Random object to obtain it.

If it is important that the generated Random numbers not be guessable, you must not create a new Random for each random number; the values are too easily guessable. You should strongly consider using a java.security.SecureRandom instead (and avoid allocating a new SecureRandom for each random number needed).

BC_UNCONFIRMED_CAST: Unchecked/unconfirmed cast

This cast is unchecked, and not all instances of the type casted from can be cast to the type it is being cast to. Ensure that your program logic ensures that this cast will not fail.

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.

DLS_DEAD_LOCAL_STORE: Dead store to local variable

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

Note that Sun's javac compiler often generates dead stores for final local variables. Because FindBugs is a bytecode-based tool, there is no easy way to eliminate these false positives.

DM_GC: Explicit garbage collection; extremely dubious except in benchmarking code

Code explicitly invokes garbage collection. Except for specific use in benchmarking, this is very dubious.

In the past, situations where people have explicitly invoked the garbage collector in routines such as close or finalize methods has led to huge performance black holes. Garbage collection can be expensive. Any situation that forces hundreds or thousands of garbage collections will bring the machine to a crawl.

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.

DM_STRING_CTOR: Method invokes inefficient new String(String) constructor

Using the java.lang.String(String) constructor wastes memory because the object so constructed will be functionally indistinguishable from the String passed as a parameter.  Just use the argument String directly.

DM_EXIT: Method invokes System.exit(...)

Invoking System.exit shuts down the entire Java virtual machine. This should only been done when it is appropriate. Such calls make it hard or impossible for your code to be invoked by other code. Consider throwing a RuntimeException instead.

DMI_USELESS_SUBSTRING: Invocation of substring(0), which returns the original value

This code invokes substring(0) on a String, which returns the original value.

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

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.

EQ_UNUSUAL: Unusual equals method

This class doesn't do any of the patterns we recognize for checking that the type of the argument is compatible with the type of the this object. There might not be anything wrong with this code, but it is worth reviewing.

ES_COMPARING_STRINGS_WITH_EQ: Comparison of String objects using == or !=

This code compares java.lang.String objects for reference equality using the == or != operators. Unless both strings are either constants in a source file, or have been interned using the String.intern() method, the same string value may be represented by two different String objects. Consider using the equals(Object) method instead.

HE_EQUALS_USE_HASHCODE: Class defines equals() and uses Object.hashCode()

This class overrides equals(Object), but does not override hashCode(), and inherits the implementation of hashCode() from java.lang.Object (which returns the identity hash code, an arbitrary value assigned to the object by the VM).  Therefore, the class is very likely to violate the invariant that equal objects must have equal hashcodes.

If you don't think instances of this class will ever be inserted into a HashMap/HashTable, the recommended hashCode implementation to use is:

public int hashCode() {
  assert false : "hashCode not designed";
  return 42; // any arbitrary constant will do 
  }

IA_AMBIGUOUS_INVOCATION_OF_INHERITED_OR_OUTER_METHOD: Ambiguous invocation of either an inherited or outer method

An inner class is invoking a method that could be resolved to either a inherited method or a method defined in an outer class. By the Java semantics, it will be resolved to invoke the inherited method, but this may not be want you intend. If you really intend to invoke the inherited method, invoke it by invoking the method on super (e.g., invoke super.foo(17)), and thus it will be clear to other readers of your code and to FindBugs that you want to invoke the inherited method, not the method in the outer class.

ICAST_IDIV_CAST_TO_DOUBLE: integral division result cast to double or float

This code casts the result of an integral division (e.g., int or long division) operation to double or float. Doing division on integers truncates the result to the integer value closest to zero. The fact that the result was cast to double suggests that this precision should have been retained. What was probably meant was to cast one or both of the operands to double before performing the division. Here is an example:

int x = 2;
int y = 5;
// Wrong: yields result 0.0
double value1 =  x / y;

// Right: yields result 0.4
double value2 =  x / (double) y;

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

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.

MF_CLASS_MASKS_FIELD: Class defines field that masks a superclass field

This class defines a field with the same name as a visible instance field in a superclass. This is confusing, and may indicate an error if methods update or access one of the fields when they wanted the other.

ML_SYNC_ON_UPDATED_FIELD: Method synchronizes on an updated field

This method synchronizes on an object referenced from a mutable field. This is unlikely to have useful semantics, since different threads may be synchronizing on different objects.

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.

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.

NM_CLASS_NOT_EXCEPTION: Class is not derived from an Exception, even though it is named as such

This class is not derived from another exception, but ends with 'Exception'. This will be confusing to users of this class.

NN_NAKED_NOTIFY: Naked notify

A call to notify() or notifyAll() was made without any (apparent) accompanying modification to mutable object state.  In general, calling a notify method on a monitor is done because some condition another thread is waiting for has become true.  However, for the condition to be meaningful, it must involve a heap object that is visible to both threads.

This bug does not necessarily indicate an error, since the change to mutable object state may have taken place in a method which then called the method containing the notification.

NP_EQUALS_SHOULD_HANDLE_NULL_ARGUMENT: equals() method does not check for null argument

This implementation of equals(Object) violates the contract defined by java.lang.Object.equals() because it does not check for null being passed as the argument. All equals() methods should return false if passed a null value.

NP_LOAD_OF_KNOWN_NULL_VALUE: Load of known null value

The variable referenced at this point is known to be null due to an earlier check against null. Although this is valid, it might be a mistake (perhaps you intended to refer to a different variable, or perhaps the earlier check to see if the variable is null should have been a check to see if it was nonnull).

NP_GUARANTEED_DEREF: Null value is guaranteed to be dereferenced

There is a statement or branch that if executed guarantees that a value is null at this point, and that value that is guaranteed to be dereferenced (except on forward paths involving runtime exceptions).

NP_NULL_ON_SOME_PATH: Possible null pointer dereference

There is a branch of statement that, if executed, guarantees that a null value will be dereferenced, which would generate a NullPointerException when the code is executed. Of course, the problem might be that the branch or statement is infeasible and that the null pointer exception can't ever be executed; deciding that is beyond the ability of FindBugs.

NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE: Possible null pointer dereference due to return value of called method

The return value from a method is dereferenced without a null check, and the return value of that method is one that should generally be checked for null. This may lead to a NullPointerException when the code is executed.

NP_NULL_ON_SOME_PATH_EXCEPTION: Possible null pointer dereference in method on exception path

A reference value which is null on some exception control path is dereferenced here.  This may lead to a NullPointerException when the code is executed.  Note that because FindBugs currently does not prune infeasible exception paths, this may be a false warning.

Also note that FindBugs considers the default case of a switch statement to be an exception path, since the default case is often infeasible.

OBL_UNSATISFIED_OBLIGATION: Method may fail to clean up stream or resource

This method may fail to clean up (close, dispose of) a stream, database object, or other resource requiring an explicit cleanup operation.

In general, if a method opens a stream or other resource, the method should use a try/finally block to ensure that the stream or resource is cleaned up before the method returns.

This bug pattern is essentially the same as the OS_OPEN_STREAM and ODR_OPEN_DATABASE_RESOURCE bug patterns, but is based on a different (and hopefully better) static analysis technique. We are interested is getting feedback about the usefulness of this bug pattern. To send feedback, either:

In particular, the false-positive suppression heuristics for this bug pattern have not been extensively tuned, so reports about false positives are helpful to us.

See Weimer and Necula, Finding and Preventing Run-Time Error Handling Mistakes, for a description of the analysis technique.

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_WOULD_HAVE_BEEN_A_NPE: Nullcheck of value previously dereferenced

A value is checked here to see whether it is null, but this value can't be null because it was previously dereferenced and if it were null a null pointer exception would have occurred at the earlier dereference. Essentially, this code and the previous dereference disagree as to whether this value is allowed to be null. Either the check is redundant or the previous dereference is erroneous.

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.

RpC_REPEATED_CONDITIONAL_TEST: Repeated conditional tests

The code contains a conditional test is performed twice, one right after the other (e.g., x == 0 || x == 0). Perhaps the second occurrence is intended to be something else (e.g., x == 0 || y == 0).

SR_NOT_CHECKED: Method ignores results of InputStream.skip()

This method ignores the return value of java.io.InputStream.skip() which can skip multiple bytes.  If the return value is not checked, the caller will not be able to correctly handle the case where fewer bytes were skipped than the caller requested.  This is a particularly insidious kind of bug, because in many programs, skips from input streams usually do skip the full amount of data requested, causing the program to fail only sporadically. With Buffered streams, however, skip() will only skip data in the buffer, and will routinely fail to skip the requested number of bytes.

RV_RETURN_VALUE_IGNORED_BAD_PRACTICE: Method ignores exceptional return value

This method returns a value that is not checked. The return value should be checked since it can indicate an unusual or unexpected function execution. For example, the File.delete() method returns false if the file could not be successfully deleted (rather than throwing an Exception). If you don't check the result, you won't notice if the method invocation signals unexpected behavior by returning an atypical return value.

SA_LOCAL_DOUBLE_ASSIGNMENT: Double assignment of local variable

This method contains a double assignment of a local variable; e.g.

  public void foo() {
    int x,y;
    x = x = 17;
  }

Assigning the same value to a variable twice is useless, and may indicate a logic error or typo.

SBSC_USE_STRINGBUFFER_CONCATENATION: Method concatenates strings using + in a loop

The method seems to be building a String using concatenation in a loop. In each iteration, the String is converted to a StringBuffer/StringBuilder, appended to, and converted back to a String. This can lead to a cost quadratic in the number of iterations, as the growing string is recopied in each iteration.

Better performance can be obtained by using a StringBuffer (or StringBuilder in Java 1.5) explicitly.

For example:

  // This is bad
  String s = "";
  for (int i = 0; i < field.length; ++i) {
    s = s + field[i];
  }

  // This is better
  StringBuffer buf = new StringBuffer();
  for (int i = 0; i < field.length; ++i) {
    buf.append(field[i]);
  }
  String s = buf.toString();

SC_START_IN_CTOR: Constructor invokes Thread.start()

The constructor starts a thread. This is likely to be wrong if the class is ever extended/subclassed, since the thread will be started before the subclass constructor is started.

SE_BAD_FIELD: Non-transient non-serializable instance field in serializable class

This Serializable class defines a non-primitive instance field which is neither transient, Serializable, or java.lang.Object, and does not appear to implement the Externalizable interface or the readObject() and writeObject() methods.  Objects of this class will not be deserialized correctly if a non-Serializable object is stored in this field.

SE_INNER_CLASS: Serializable inner class

This Serializable class is an inner class. Any attempt to serialize it will also serialize the associated outer instance. The outer instance is serializable, so this won't fail, but it might serialize a lot more data than intended. If possible, making the inner class a static inner class (also known as a nested class) should solve the problem.

SIC_INNER_SHOULD_BE_STATIC: Should be a static inner class

This class is an inner class, but does not use its embedded reference to the object which created it.  This reference makes the instances of the class larger, and may keep the reference to the creator object alive longer than necessary.  If possible, the class should be made static.

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.

URF_UNREAD_FIELD: Unread field

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

DMI_INVOKING_TOSTRING_ON_ARRAY: Invocation of toString on an array

The code invokes toString on an array, which will generate a fairly useless result such as [C@16f0472. Consider using Arrays.toString to convert the array into a readable String that gives the contents of the array. See Programming Puzzlers, chapter 3, puzzle 12.

UW_UNCOND_WAIT: Unconditional wait

This method contains a call to java.lang.Object.wait() which is not guarded by conditional control flow.  The code should verify that condition it intends to wait for is not already satisfied before calling wait; any previous notifications will be ignored.

WA_NOT_IN_LOOP: Wait not in loop

This method contains a call to java.lang.Object.wait() which is not in a loop.  If the monitor is used for multiple conditions, the condition the caller intended to wait for might not be the one that actually occurred.

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.