SpotBugs Report

Project Information

Project: ActiveMQ :: KahaDB Store

SpotBugs version: 4.8.3

Code analyzed:



Metrics

19525 lines of code analyzed, in 358 classes, in 10 packages.

Metric Total Density*
High Priority Warnings 26 1.33
Medium Priority Warnings 204 10.45
Total Warnings 230 11.78

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



Contents

Summary

Warning Type Number
Bad practice Warnings 47
Correctness Warnings 3
Internationalization Warnings 2
Malicious code vulnerability Warnings 100
Multithreaded correctness Warnings 30
Performance Warnings 35
Dodgy code Warnings 13
Total 230

Warnings

Click on a warning row to see full context information.

Bad practice Warnings

Code Warning
CN org.apache.activemq.store.kahadb.data.KahaAckMessageFileMapCommand defines clone() but doesn't implement Cloneable
CN org.apache.activemq.store.kahadb.data.KahaAddMessageCommand defines clone() but doesn't implement Cloneable
CN org.apache.activemq.store.kahadb.data.KahaAddScheduledJobCommand defines clone() but doesn't implement Cloneable
CN org.apache.activemq.store.kahadb.data.KahaCommitCommand defines clone() but doesn't implement Cloneable
CN org.apache.activemq.store.kahadb.data.KahaDestination defines clone() but doesn't implement Cloneable
CN org.apache.activemq.store.kahadb.data.KahaDestroySchedulerCommand defines clone() but doesn't implement Cloneable
CN org.apache.activemq.store.kahadb.data.KahaLocalTransactionId defines clone() but doesn't implement Cloneable
CN org.apache.activemq.store.kahadb.data.KahaLocation defines clone() but doesn't implement Cloneable
CN org.apache.activemq.store.kahadb.data.KahaPrepareCommand defines clone() but doesn't implement Cloneable
CN org.apache.activemq.store.kahadb.data.KahaProducerAuditCommand defines clone() but doesn't implement Cloneable
CN org.apache.activemq.store.kahadb.data.KahaRemoveDestinationCommand defines clone() but doesn't implement Cloneable
CN org.apache.activemq.store.kahadb.data.KahaRemoveMessageCommand defines clone() but doesn't implement Cloneable
CN org.apache.activemq.store.kahadb.data.KahaRemoveScheduledJobCommand defines clone() but doesn't implement Cloneable
CN org.apache.activemq.store.kahadb.data.KahaRemoveScheduledJobsCommand defines clone() but doesn't implement Cloneable
CN org.apache.activemq.store.kahadb.data.KahaRescheduleJobCommand defines clone() but doesn't implement Cloneable
CN org.apache.activemq.store.kahadb.data.KahaRewrittenDataFileCommand defines clone() but doesn't implement Cloneable
CN org.apache.activemq.store.kahadb.data.KahaRollbackCommand defines clone() but doesn't implement Cloneable
CN org.apache.activemq.store.kahadb.data.KahaSubscriptionCommand defines clone() but doesn't implement Cloneable
CN org.apache.activemq.store.kahadb.data.KahaTraceCommand defines clone() but doesn't implement Cloneable
CN org.apache.activemq.store.kahadb.data.KahaTransactionInfo defines clone() but doesn't implement Cloneable
CN org.apache.activemq.store.kahadb.data.KahaUpdateMessageCommand defines clone() but doesn't implement Cloneable
CN org.apache.activemq.store.kahadb.data.KahaXATransactionId defines clone() but doesn't implement Cloneable
CT Exception thrown in class org.apache.activemq.store.kahadb.KahaDBStore$KahaDBTopicMessageStore at new org.apache.activemq.store.kahadb.KahaDBStore$KahaDBTopicMessageStore(KahaDBStore, ActiveMQTopic) will leave the constructor. The object under construction remains partially initialized and may be vulnerable to Finalizer attacks.
CT Exception thrown in class org.apache.activemq.store.kahadb.MessageDatabase$MessageOrderIndex$MessageOrderIterator at new org.apache.activemq.store.kahadb.MessageDatabase$MessageOrderIndex$MessageOrderIterator(MessageDatabase$MessageOrderIndex, Transaction, MessageDatabase$MessageOrderCursor, MessageDatabase$MessageOrderIndex) will leave the constructor. The object under construction remains partially initialized and may be vulnerable to Finalizer attacks.
CT Exception thrown in class org.apache.activemq.store.kahadb.MultiKahaDBPersistenceAdapter at new org.apache.activemq.store.kahadb.MultiKahaDBPersistenceAdapter() will leave the constructor. The object under construction remains partially initialized and may be vulnerable to Finalizer attacks.
CT Exception thrown in class org.apache.activemq.store.kahadb.disk.journal.CallerBufferingDataFileAppender$WriteBatch at new org.apache.activemq.store.kahadb.disk.journal.CallerBufferingDataFileAppender$WriteBatch(CallerBufferingDataFileAppender, DataFile, int, Journal$WriteCommand) will leave the constructor. The object under construction remains partially initialized and may be vulnerable to Finalizer attacks.
CT Exception thrown in class org.apache.activemq.store.kahadb.disk.journal.DataFileAppender$WriteBatch at new org.apache.activemq.store.kahadb.disk.journal.DataFileAppender$WriteBatch(DataFileAppender, DataFile, int, Journal$WriteCommand) will leave the constructor. The object under construction remains partially initialized and may be vulnerable to Finalizer attacks.
CT Exception thrown in class org.apache.activemq.store.kahadb.disk.journal.TargetedDataFileAppender$WriteBatch at new org.apache.activemq.store.kahadb.disk.journal.TargetedDataFileAppender$WriteBatch(TargetedDataFileAppender, DataFile, int, Journal$WriteCommand) will leave the constructor. The object under construction remains partially initialized and may be vulnerable to Finalizer attacks.
CT Exception thrown in class org.apache.activemq.store.kahadb.disk.page.Transaction$2 at new org.apache.activemq.store.kahadb.disk.page.Transaction$2(Transaction, Page) will leave the constructor. The object under construction remains partially initialized and may be vulnerable to Finalizer attacks.
CT Exception thrown in class org.apache.activemq.store.kahadb.disk.util.DataByteArrayOutputStream at new org.apache.activemq.store.kahadb.disk.util.DataByteArrayOutputStream() will leave the constructor. The object under construction remains partially initialized and may be vulnerable to Finalizer attacks.
CT Exception thrown in class org.apache.activemq.store.kahadb.disk.util.DataByteArrayOutputStream at new org.apache.activemq.store.kahadb.disk.util.DataByteArrayOutputStream(int) will leave the constructor. The object under construction remains partially initialized and may be vulnerable to Finalizer attacks.
CT Exception thrown in class org.apache.activemq.util.LFUCache at new org.apache.activemq.util.LFUCache(int, float) will leave the constructor. The object under construction remains partially initialized and may be vulnerable to Finalizer attacks.
DE org.apache.activemq.store.kahadb.MessageDatabase.load(Location) might ignore java.io.IOException
Eq org.apache.activemq.store.kahadb.FilteredKahaDBPersistenceAdapter defines compareTo(Object) and uses Object.equals()
OS org.apache.activemq.store.kahadb.MessageDatabase.recoverAckMessageFileMap() may fail to close stream
OS org.apache.activemq.store.kahadb.MessageDatabase.recoverProducerAudit() may fail to close stream
RR org.apache.activemq.store.kahadb.disk.page.PageFile$PageWrite.getDiskBound() ignores result of java.io.RandomAccessFile.read(byte[])
RR org.apache.activemq.store.kahadb.disk.util.DataByteArrayInputStream.readChar() ignores result of org.apache.activemq.store.kahadb.disk.util.DataByteArrayInputStream.read(byte[], int, int)
RR org.apache.activemq.store.kahadb.disk.util.DataByteArrayInputStream.readFully(byte[]) ignores result of org.apache.activemq.store.kahadb.disk.util.DataByteArrayInputStream.read(byte[], int, int)
RR org.apache.activemq.store.kahadb.disk.util.DataByteArrayInputStream.readFully(byte[], int, int) ignores result of org.apache.activemq.store.kahadb.disk.util.DataByteArrayInputStream.read(byte[], int, int)
RR org.apache.activemq.store.kahadb.disk.util.DataByteArrayInputStream.readInt() ignores result of org.apache.activemq.store.kahadb.disk.util.DataByteArrayInputStream.read(byte[], int, int)
RR org.apache.activemq.store.kahadb.disk.util.DataByteArrayInputStream.readLong() ignores result of org.apache.activemq.store.kahadb.disk.util.DataByteArrayInputStream.read(byte[], int, int)
RR org.apache.activemq.store.kahadb.disk.util.DataByteArrayInputStream.readShort() ignores result of org.apache.activemq.store.kahadb.disk.util.DataByteArrayInputStream.read(byte[], int, int)
RR org.apache.activemq.store.kahadb.disk.util.DataByteArrayInputStream.readUnsignedShort() ignores result of org.apache.activemq.store.kahadb.disk.util.DataByteArrayInputStream.read(byte[], int, int)
RV Exceptional return value of java.io.File.delete() ignored in org.apache.activemq.store.kahadb.disk.page.PageFile.load()
RV Exceptional return value of java.io.File.delete() ignored in org.apache.activemq.store.kahadb.disk.util.DiskBenchmark.main(String[])
RV Exceptional return value of java.io.File.delete() ignored in org.apache.activemq.store.kahadb.disk.util.DiskBenchmark.preallocateDataFile(RecoverableRandomAccessFile, File)

Correctness Warnings

Code Warning
BSHIFT 32 bit int shifted by 32 bits in org.apache.activemq.store.kahadb.scheduler.JobLocation.hashCode()
NP Possible null pointer dereference of wb in org.apache.activemq.store.kahadb.disk.journal.DataFileAppender.processQueue() on exception path
SA Nonsensical self computation of JobLocation.rescheduledCount with itself in org.apache.activemq.store.kahadb.scheduler.JobLocation.hashCode()

Internationalization Warnings

Code Warning
Dm Found reliance on default encoding in org.apache.activemq.store.kahadb.disk.index.BTreeIndex.printStructure(Transaction, OutputStream): new java.io.PrintWriter(OutputStream, boolean)
Dm Found reliance on default encoding in org.apache.activemq.store.kahadb.disk.util.DataByteArrayInputStream.readLine(): new String(byte[], int, int)

Malicious code vulnerability Warnings

Code Warning
EI org.apache.activemq.store.kahadb.AbstractKahaDBMetaData.getLastUpdateLocation() may expose internal representation by returning AbstractKahaDBMetaData.lastUpdateLocation
EI org.apache.activemq.store.kahadb.AbstractKahaDBMetaData.getPage() may expose internal representation by returning AbstractKahaDBMetaData.page
EI org.apache.activemq.store.kahadb.AbstractKahaDBStore.getJournal() may expose internal representation by returning AbstractKahaDBStore.journal
EI org.apache.activemq.store.kahadb.AbstractKahaDBStore.getPageFile() may expose internal representation by returning AbstractKahaDBStore.pageFile
EI org.apache.activemq.store.kahadb.FilteredKahaDBPersistenceAdapter.getPersistenceAdapter() may expose internal representation by returning FilteredKahaDBPersistenceAdapter.persistenceAdapter
EI org.apache.activemq.store.kahadb.FilteredKahaDBPersistenceAdapter.getUsage() may expose internal representation by returning FilteredKahaDBPersistenceAdapter.usage
EI org.apache.activemq.store.kahadb.KahaDBPersistenceAdapter.getStore() may expose internal representation by returning KahaDBPersistenceAdapter.letter
EI org.apache.activemq.store.kahadb.KahaDBStore.createTransactionStore() may expose internal representation by returning KahaDBStore.transactionStore
EI org.apache.activemq.store.kahadb.KahaDBStore.getUsageManager() may expose internal representation by returning KahaDBStore.usageManager
EI org.apache.activemq.store.kahadb.KahaDBStore$KahaDBMessageStore.getDestination() may expose internal representation by returning org.apache.activemq.store.AbstractMessageStore.destination
EI org.apache.activemq.store.kahadb.MessageDatabase.getJournal() may expose internal representation by returning MessageDatabase.journal
EI org.apache.activemq.store.kahadb.MessageDatabase.getJournalFilesBeingReplicated() may expose internal representation by returning MessageDatabase.journalFilesBeingReplicated
EI org.apache.activemq.store.kahadb.MessageDatabase.getPageFile() may expose internal representation by returning MessageDatabase.pageFile
EI org.apache.activemq.store.kahadb.MultiKahaDBPersistenceAdapter.createTransactionStore() may expose internal representation by returning MultiKahaDBPersistenceAdapter.transactionStore
EI org.apache.activemq.store.kahadb.MultiKahaDBTransactionStore$Tx.getStores() may expose internal representation by returning MultiKahaDBTransactionStore$Tx.stores
EI org.apache.activemq.store.kahadb.TempKahaDBStore$KahaDBMessageStore.getDestination() may expose internal representation by returning org.apache.activemq.store.AbstractMessageStore.destination
EI org.apache.activemq.store.kahadb.TempMessageDatabase.getJournalFilesBeingReplicated() may expose internal representation by returning TempMessageDatabase.journalFilesBeingReplicated
EI org.apache.activemq.store.kahadb.TempMessageDatabase.getPageFile() may expose internal representation by returning TempMessageDatabase.pageFile
EI org.apache.activemq.store.kahadb.disk.index.BTreeIndex.getKeyMarshaller() may expose internal representation by returning BTreeIndex.keyMarshaller
EI org.apache.activemq.store.kahadb.disk.index.BTreeIndex.getPageFile() may expose internal representation by returning BTreeIndex.pageFile
EI org.apache.activemq.store.kahadb.disk.index.BTreeIndex.getValueMarshaller() may expose internal representation by returning BTreeIndex.valueMarshaller
EI org.apache.activemq.store.kahadb.disk.index.BTreeNode.getPage() may expose internal representation by returning BTreeNode.page
EI org.apache.activemq.store.kahadb.disk.index.BTreeNode.getParent() may expose internal representation by returning BTreeNode.parent
EI org.apache.activemq.store.kahadb.disk.index.HashIndex.getKeyMarshaller() may expose internal representation by returning HashIndex.keyMarshaller
EI org.apache.activemq.store.kahadb.disk.index.HashIndex.getPageFile() may expose internal representation by returning HashIndex.pageFile
EI org.apache.activemq.store.kahadb.disk.index.HashIndex.getValueMarshaller() may expose internal representation by returning HashIndex.valueMarshaller
EI org.apache.activemq.store.kahadb.disk.index.ListIndex.getKeyMarshaller() may expose internal representation by returning ListIndex.keyMarshaller
EI org.apache.activemq.store.kahadb.disk.index.ListIndex.getPageFile() may expose internal representation by returning ListIndex.pageFile
EI org.apache.activemq.store.kahadb.disk.index.ListIndex.getValueMarshaller() may expose internal representation by returning ListIndex.valueMarshaller
EI org.apache.activemq.store.kahadb.disk.index.ListNode.getContainingList() may expose internal representation by returning ListNode.containingList
EI org.apache.activemq.store.kahadb.disk.index.ListNode.getPage() may expose internal representation by returning ListNode.page
EI org.apache.activemq.store.kahadb.disk.journal.DataFile.appendRandomAccessFile() may expose internal representation by returning DataFile.appendRandomAccessFile
EI org.apache.activemq.store.kahadb.disk.journal.DataFile.getCorruptedBlocks() may expose internal representation by returning DataFile.corruptedBlocks
EI org.apache.activemq.store.kahadb.disk.journal.Journal.getInflightWrites() may expose internal representation by returning Journal.inflightWrites
EI org.apache.activemq.store.kahadb.disk.page.Transaction.getPageFile() may expose internal representation by returning Transaction.pageFile
EI org.apache.activemq.store.kahadb.disk.util.DataByteArrayInputStream.getRawData() may expose internal representation by returning DataByteArrayInputStream.buf
EI org.apache.activemq.store.kahadb.disk.util.DataByteArrayOutputStream.getData() may expose internal representation by returning DataByteArrayOutputStream.buf
EI org.apache.activemq.store.kahadb.disk.util.LinkedNode.getList() may expose internal representation by returning LinkedNode.list
EI org.apache.activemq.store.kahadb.plist.PListStoreImpl.getJournal() may expose internal representation by returning PListStoreImpl.journal
EI org.apache.activemq.store.kahadb.scheduler.JobImpl.getPayload() may expose internal representation by returning JobImpl.payload
EI org.apache.activemq.store.kahadb.scheduler.JobSchedulerKahaDBMetaData.getJobSchedulers() may expose internal representation by returning JobSchedulerKahaDBMetaData.storedSchedulers
EI org.apache.activemq.store.kahadb.scheduler.JobSchedulerKahaDBMetaData.getJournalRC() may expose internal representation by returning JobSchedulerKahaDBMetaData.journalRC
EI org.apache.activemq.store.kahadb.scheduler.JobSchedulerKahaDBMetaData.getRemoveLocationTracker() may expose internal representation by returning JobSchedulerKahaDBMetaData.removeLocationTracker
EI2 org.apache.activemq.store.kahadb.AbstractKahaDBMetaData.setLastUpdateLocation(Location) may expose internal representation by storing an externally mutable object into AbstractKahaDBMetaData.lastUpdateLocation
EI2 org.apache.activemq.store.kahadb.AbstractKahaDBMetaData.setPage(Page) may expose internal representation by storing an externally mutable object into AbstractKahaDBMetaData.page
EI2 new org.apache.activemq.store.kahadb.FilteredKahaDBPersistenceAdapter(FilteredKahaDBPersistenceAdapter, ActiveMQDestination, PersistenceAdapter) may expose internal representation by storing an externally mutable object into FilteredKahaDBPersistenceAdapter.persistenceAdapter
EI2 org.apache.activemq.store.kahadb.FilteredKahaDBPersistenceAdapter.setPersistenceAdapter(PersistenceAdapter) may expose internal representation by storing an externally mutable object into FilteredKahaDBPersistenceAdapter.persistenceAdapter
EI2 org.apache.activemq.store.kahadb.FilteredKahaDBPersistenceAdapter.setUsage(StoreUsage) may expose internal representation by storing an externally mutable object into FilteredKahaDBPersistenceAdapter.usage
EI2 org.apache.activemq.store.kahadb.KahaDBStore.setUsageManager(SystemUsage) may expose internal representation by storing an externally mutable object into KahaDBStore.usageManager
EI2 new org.apache.activemq.store.kahadb.KahaDBStore$KahaDBMessageStore(KahaDBStore, ActiveMQDestination) may expose internal representation by storing an externally mutable object into KahaDBStore$KahaDBMessageStore.this$0
EI2 new org.apache.activemq.store.kahadb.KahaDBStore$StoreTaskExecutor(KahaDBStore, int, int, long, TimeUnit, BlockingQueue, ThreadFactory) may expose internal representation by storing an externally mutable object into KahaDBStore$StoreTaskExecutor.this$0
EI2 new org.apache.activemq.store.kahadb.KahaDBTransactionStore(KahaDBStore) may expose internal representation by storing an externally mutable object into KahaDBTransactionStore.theStore
EI2 new org.apache.activemq.store.kahadb.KahaDBTransactionStore$Tx(KahaDBTransactionStore) may expose internal representation by storing an externally mutable object into KahaDBTransactionStore$Tx.this$0
EI2 org.apache.activemq.store.kahadb.MessageDatabase.setBrokerService(BrokerService) may expose internal representation by storing an externally mutable object into MessageDatabase.brokerService
EI2 org.apache.activemq.store.kahadb.MultiKahaDBPersistenceAdapter.setTransactionStore(MultiKahaDBTransactionStore) may expose internal representation by storing an externally mutable object into MultiKahaDBPersistenceAdapter.transactionStore
EI2 new org.apache.activemq.store.kahadb.MultiKahaDBTransactionStore(MultiKahaDBPersistenceAdapter) may expose internal representation by storing an externally mutable object into MultiKahaDBTransactionStore.multiKahaDBPersistenceAdapter
EI2 new org.apache.activemq.store.kahadb.MultiKahaDBTransactionStore$Tx(MultiKahaDBTransactionStore) may expose internal representation by storing an externally mutable object into MultiKahaDBTransactionStore$Tx.this$0
EI2 org.apache.activemq.store.kahadb.TempKahaDBStore.setBrokerService(BrokerService) may expose internal representation by storing an externally mutable object into TempKahaDBStore.brokerService
EI2 new org.apache.activemq.store.kahadb.TempKahaDBStore$KahaDBMessageStore(TempKahaDBStore, ActiveMQDestination) may expose internal representation by storing an externally mutable object into TempKahaDBStore$KahaDBMessageStore.this$0
EI2 new org.apache.activemq.store.kahadb.disk.index.BTreeIndex(PageFile, long) may expose internal representation by storing an externally mutable object into BTreeIndex.pageFile
EI2 org.apache.activemq.store.kahadb.disk.index.BTreeIndex.setKeyMarshaller(Marshaller) may expose internal representation by storing an externally mutable object into BTreeIndex.keyMarshaller
EI2 org.apache.activemq.store.kahadb.disk.index.BTreeIndex.setPageFile(PageFile) may expose internal representation by storing an externally mutable object into BTreeIndex.pageFile
EI2 org.apache.activemq.store.kahadb.disk.index.BTreeIndex.setValueMarshaller(Marshaller) may expose internal representation by storing an externally mutable object into BTreeIndex.valueMarshaller
EI2 new org.apache.activemq.store.kahadb.disk.index.BTreeNode(BTreeIndex) may expose internal representation by storing an externally mutable object into BTreeNode.index
EI2 org.apache.activemq.store.kahadb.disk.index.BTreeNode.setPage(Page) may expose internal representation by storing an externally mutable object into BTreeNode.page
EI2 org.apache.activemq.store.kahadb.disk.index.BTreeNode.setParent(BTreeNode) may expose internal representation by storing an externally mutable object into BTreeNode.parent
EI2 new org.apache.activemq.store.kahadb.disk.index.BTreeNode$Marshaller(BTreeIndex) may expose internal representation by storing an externally mutable object into BTreeNode$Marshaller.index
EI2 new org.apache.activemq.store.kahadb.disk.index.BTreeVisitor$AndVisitor(List) may expose internal representation by storing an externally mutable object into BTreeVisitor$AndVisitor.conditions
EI2 new org.apache.activemq.store.kahadb.disk.index.BTreeVisitor$OrVisitor(List) may expose internal representation by storing an externally mutable object into BTreeVisitor$OrVisitor.conditions
EI2 new org.apache.activemq.store.kahadb.disk.index.HashBin$Marshaller(HashIndex) may expose internal representation by storing an externally mutable object into HashBin$Marshaller.hashIndex
EI2 new org.apache.activemq.store.kahadb.disk.index.HashIndex(PageFile, long) may expose internal representation by storing an externally mutable object into HashIndex.pageFile
EI2 org.apache.activemq.store.kahadb.disk.index.HashIndex.setKeyMarshaller(Marshaller) may expose internal representation by storing an externally mutable object into HashIndex.keyMarshaller
EI2 org.apache.activemq.store.kahadb.disk.index.HashIndex.setValueMarshaller(Marshaller) may expose internal representation by storing an externally mutable object into HashIndex.valueMarshaller
EI2 new org.apache.activemq.store.kahadb.disk.index.ListIndex(PageFile, long) may expose internal representation by storing an externally mutable object into ListIndex.pageFile
EI2 org.apache.activemq.store.kahadb.disk.index.ListIndex.setKeyMarshaller(Marshaller) may expose internal representation by storing an externally mutable object into ListIndex.keyMarshaller
EI2 org.apache.activemq.store.kahadb.disk.index.ListIndex.setPageFile(PageFile) may expose internal representation by storing an externally mutable object into ListIndex.pageFile
EI2 org.apache.activemq.store.kahadb.disk.index.ListIndex.setValueMarshaller(Marshaller) may expose internal representation by storing an externally mutable object into ListIndex.valueMarshaller
EI2 org.apache.activemq.store.kahadb.disk.index.ListNode.setContainingList(ListIndex) may expose internal representation by storing an externally mutable object into ListNode.containingList
EI2 org.apache.activemq.store.kahadb.disk.index.ListNode.setPage(Page) may expose internal representation by storing an externally mutable object into ListNode.page
EI2 new org.apache.activemq.store.kahadb.disk.index.ListNode$NodeMarshaller(Marshaller, Marshaller) may expose internal representation by storing an externally mutable object into ListNode$NodeMarshaller.keyMarshaller
EI2 new org.apache.activemq.store.kahadb.disk.index.ListNode$NodeMarshaller(Marshaller, Marshaller) may expose internal representation by storing an externally mutable object into ListNode$NodeMarshaller.valueMarshaller
EI2 new org.apache.activemq.store.kahadb.disk.journal.CallerBufferingDataFileAppender$WriteBatch(CallerBufferingDataFileAppender, DataFile, int, Journal$WriteCommand) may expose internal representation by storing an externally mutable object into CallerBufferingDataFileAppender$WriteBatch.this$0
EI2 new org.apache.activemq.store.kahadb.disk.journal.DataFileAccessorPool(Journal) may expose internal representation by storing an externally mutable object into DataFileAccessorPool.journal
EI2 new org.apache.activemq.store.kahadb.disk.journal.DataFileAppender$WriteBatch(DataFileAppender, DataFile, int) may expose internal representation by storing an externally mutable object into DataFileAppender$WriteBatch.this$0
EI2 org.apache.activemq.store.kahadb.disk.journal.Journal.setSizeAccumulator(AtomicLong) may expose internal representation by storing an externally mutable object into Journal.totalLength
EI2 new org.apache.activemq.store.kahadb.disk.journal.ReadOnlyJournal(ArrayList) may expose internal representation by storing an externally mutable object into ReadOnlyJournal.dirs
EI2 new org.apache.activemq.store.kahadb.disk.journal.TargetedDataFileAppender(Journal, DataFile) may expose internal representation by storing an externally mutable object into TargetedDataFileAppender.journal
EI2 new org.apache.activemq.store.kahadb.disk.journal.TargetedDataFileAppender(Journal, DataFile) may expose internal representation by storing an externally mutable object into TargetedDataFileAppender.target
EI2 new org.apache.activemq.store.kahadb.disk.journal.TargetedDataFileAppender$WriteBatch(TargetedDataFileAppender, DataFile, int) may expose internal representation by storing an externally mutable object into TargetedDataFileAppender$WriteBatch.this$0
EI2 new org.apache.activemq.store.kahadb.disk.page.Transaction$InvalidPageIOException(Transaction, String, long) may expose internal representation by storing an externally mutable object into Transaction$InvalidPageIOException.this$0
EI2 new org.apache.activemq.store.kahadb.disk.page.Transaction$PageOverflowIOException(Transaction, String) may expose internal representation by storing an externally mutable object into Transaction$PageOverflowIOException.this$0
EI2 new org.apache.activemq.store.kahadb.disk.util.DataByteArrayInputStream(byte[]) may expose internal representation by storing an externally mutable object into DataByteArrayInputStream.buf
EI2 org.apache.activemq.store.kahadb.disk.util.DataByteArrayInputStream.restart(byte[]) may expose internal representation by storing an externally mutable object into DataByteArrayInputStream.buf
EI2 org.apache.activemq.store.kahadb.disk.util.LinkedNode.linkToHead(LinkedNodeList) may expose internal representation by storing an externally mutable object into LinkedNode.list
EI2 org.apache.activemq.store.kahadb.disk.util.LinkedNode.linkToTail(LinkedNodeList) may expose internal representation by storing an externally mutable object into LinkedNode.list
EI2 new org.apache.activemq.store.kahadb.scheduler.JobSchedulerKahaDBMetaData(JobSchedulerStoreImpl) may expose internal representation by storing an externally mutable object into JobSchedulerKahaDBMetaData.store
MS org.apache.activemq.store.kahadb.disk.journal.Journal.BATCH_CONTROL_RECORD_HEADER should be package protected
MS org.apache.activemq.store.kahadb.disk.journal.Journal.BATCH_CONTROL_RECORD_MAGIC should be package protected
MS org.apache.activemq.store.kahadb.disk.journal.Journal.EMPTY_BATCH_CONTROL_RECORD should be package protected
MS org.apache.activemq.store.kahadb.disk.journal.Journal.EOF_RECORD should be package protected

Multithreaded correctness Warnings

Code Warning
IS Inconsistent synchronization of org.apache.activemq.store.kahadb.disk.index.HashIndex.metadata; locked 90% of time
IS Inconsistent synchronization of org.apache.activemq.store.kahadb.disk.index.ListIndex.keyMarshaller; locked 50% of time
IS Inconsistent synchronization of org.apache.activemq.store.kahadb.disk.index.ListIndex.lastCacheTxSrc; locked 75% of time
IS Inconsistent synchronization of org.apache.activemq.store.kahadb.disk.index.ListIndex.lastGetEntryCache; locked 80% of time
IS Inconsistent synchronization of org.apache.activemq.store.kahadb.disk.index.ListIndex.lastGetNodeCache; locked 88% of time
IS Inconsistent synchronization of org.apache.activemq.store.kahadb.disk.index.ListIndex.valueMarshaller; locked 50% of time
IS Inconsistent synchronization of org.apache.activemq.store.kahadb.disk.journal.DataFileAccessorPool$Pool.openCounter; locked 66% of time
IS Inconsistent synchronization of org.apache.activemq.store.kahadb.disk.journal.Journal.osKernelCopyTemplateFile; locked 50% of time
IS Inconsistent synchronization of org.apache.activemq.store.kahadb.disk.journal.Journal.scheduler; locked 66% of time
IS Inconsistent synchronization of org.apache.activemq.store.kahadb.plist.PListStoreImpl.directory; locked 75% of time
IS Inconsistent synchronization of org.apache.activemq.store.kahadb.plist.PListStoreImpl.indexDirectory; locked 50% of time
IS Inconsistent synchronization of org.apache.activemq.store.kahadb.plist.PListStoreImpl.journal; locked 50% of time
IS Inconsistent synchronization of org.apache.activemq.store.kahadb.plist.PListStoreImpl.pageFile; locked 80% of time
IS Inconsistent synchronization of org.apache.activemq.store.kahadb.plist.PListStoreImpl.scheduler; locked 88% of time
JLM Synchronization performed on java.util.concurrent.atomic.AtomicReference in org.apache.activemq.store.kahadb.disk.journal.Journal.close()
JLM Synchronization performed on java.util.concurrent.atomic.AtomicReference in org.apache.activemq.store.kahadb.disk.journal.Journal.delete()
JLM Synchronization performed on java.util.concurrent.atomic.AtomicReference in org.apache.activemq.store.kahadb.disk.journal.Journal.getCurrentDataFile(int)
JLM Synchronization performed on java.util.concurrent.atomic.AtomicReference in org.apache.activemq.store.kahadb.disk.journal.Journal.getCurrentDataFile(int)
JLM Synchronization performed on java.util.concurrent.atomic.AtomicReference in org.apache.activemq.store.kahadb.disk.journal.Journal.getCurrentDataFileId()
JLM Synchronization performed on java.util.concurrent.atomic.AtomicReference in org.apache.activemq.store.kahadb.disk.journal.Journal.getDataFile(Location)
JLM Synchronization performed on java.util.concurrent.atomic.AtomicReference in org.apache.activemq.store.kahadb.disk.journal.Journal.getDataFileById(int)
JLM Synchronization performed on java.util.concurrent.atomic.AtomicReference in org.apache.activemq.store.kahadb.disk.journal.Journal.getFileMap()
JLM Synchronization performed on java.util.concurrent.atomic.AtomicReference in org.apache.activemq.store.kahadb.disk.journal.Journal.getFiles()
JLM Synchronization performed on java.util.concurrent.atomic.AtomicReference in org.apache.activemq.store.kahadb.disk.journal.Journal.getNextLocation(Location, Location)
JLM Synchronization performed on java.util.concurrent.atomic.AtomicReference in org.apache.activemq.store.kahadb.disk.journal.Journal.getNextLocation(Location, Location)
JLM Synchronization performed on java.util.concurrent.atomic.AtomicReference in org.apache.activemq.store.kahadb.disk.journal.Journal.removeDataFiles(Set)
JLM Synchronization performed on java.util.concurrent.atomic.AtomicReference in org.apache.activemq.store.kahadb.disk.journal.Journal.reserveDataFile()
JLM Synchronization performed on java.util.concurrent.atomic.AtomicReference in org.apache.activemq.store.kahadb.disk.journal.Journal.rotateWriteFile()
UG org.apache.activemq.store.kahadb.disk.index.HashIndex.getKeyMarshaller() is unsynchronized, org.apache.activemq.store.kahadb.disk.index.HashIndex.setKeyMarshaller(Marshaller) is synchronized
UL org.apache.activemq.store.kahadb.AbstractKahaDBStore.doStart() does not release lock on all exception paths

Performance Warnings

Code Warning
Bx org.apache.activemq.store.kahadb.MessageDatabase.loadStoredDestination(Transaction, String, boolean) invokes inefficient new Long(long) constructor; use Long.valueOf(long) instead
Bx org.apache.activemq.store.kahadb.MessageDatabase$MessageOrderIndex.setBatch(Transaction, Long) invokes inefficient new Long(long) constructor; use Long.valueOf(long) instead
Bx Boxing/unboxing to parse a primitive new org.apache.activemq.store.kahadb.MultiKahaDBPersistenceAdapter()
Bx org.apache.activemq.store.kahadb.data.KahaAddScheduledJobCommand.hashCode() invokes inefficient new Long(long) constructor; use Long.valueOf(long) instead
Bx org.apache.activemq.store.kahadb.data.KahaLocalTransactionId.hashCode() invokes inefficient new Long(long) constructor; use Long.valueOf(long) instead
Bx org.apache.activemq.store.kahadb.data.KahaRemoveScheduledJobCommand.hashCode() invokes inefficient new Long(long) constructor; use Long.valueOf(long) instead
Bx org.apache.activemq.store.kahadb.data.KahaRemoveScheduledJobsCommand.hashCode() invokes inefficient new Long(long) constructor; use Long.valueOf(long) instead
Bx org.apache.activemq.store.kahadb.data.KahaRescheduleJobCommand.hashCode() invokes inefficient new Long(long) constructor; use Long.valueOf(long) instead
SBSC org.apache.activemq.store.kahadb.disk.util.CommandLineSupport.convertOptionToPropertyName(String) concatenates strings using + in a loop
SIC Should org.apache.activemq.store.kahadb.KahaDBStore$StoreTaskExecutor be a _static_ inner class?
SIC Should org.apache.activemq.store.kahadb.KahaDBTransactionStore$Tx be a _static_ inner class?
SIC Should org.apache.activemq.store.kahadb.MessageDatabase$LastAck be a _static_ inner class?
SIC Should org.apache.activemq.store.kahadb.MessageDatabase$TranInfo be a _static_ inner class?
SIC Should org.apache.activemq.store.kahadb.MultiKahaDBPersistenceAdapter$DelegateDestinationMap be a _static_ inner class?
SIC Should org.apache.activemq.store.kahadb.MultiKahaDBTransactionStore$Tx be a _static_ inner class?
SIC Should org.apache.activemq.store.kahadb.TempMessageDatabase$StoredSubscription be a _static_ inner class?
SIC Should org.apache.activemq.store.kahadb.disk.page.Transaction$InvalidPageIOException be a _static_ inner class?
SIC Should org.apache.activemq.store.kahadb.disk.page.Transaction$PageOverflowIOException be a _static_ inner class?
SIC Should org.apache.activemq.store.kahadb.plist.PListStoreImpl$PListMarshaller be a _static_ inner class?
SIC Should org.apache.activemq.store.kahadb.scheduler.JobSchedulerKahaDBMetaData$IntegerListMarshaller be a _static_ inner class?
SIC Should org.apache.activemq.store.kahadb.scheduler.JobSchedulerKahaDBMetaData$JobSchedulerMarshaller be a _static_ inner class?
SIC Should org.apache.activemq.store.kahadb.scheduler.JobSchedulerStoreImpl$MetaDataMarshaller be a _static_ inner class?
SIC Should org.apache.activemq.store.kahadb.scheduler.legacy.LegacyJobSchedulerStoreImpl$JobSchedulerMarshaller be a _static_ inner class?
SIC Should org.apache.activemq.store.kahadb.scheduler.legacy.LegacyJobSchedulerStoreImpl$ValueMarshaller be a _static_ inner class?
SS Unread field: org.apache.activemq.store.kahadb.KahaDBStore.concurrentStoreAndDispatchTransactions; should this field be static?
SS Unread field: org.apache.activemq.store.kahadb.scheduler.JobSchedulerImpl$ScheduleTime.DEFAULT_NEW_JOB_WAIT; should this field be static?
SS Unread field: org.apache.activemq.store.kahadb.scheduler.JobSchedulerImpl$ScheduleTime.DEFAULT_WAIT; should this field be static?
UPM Private method org.apache.activemq.store.kahadb.KahaDBStore.convert(KahaDestination) is never called
UPM Private method org.apache.activemq.store.kahadb.MessageDatabase.key(KahaTransactionInfo) is never called
UuF Unused field: org.apache.activemq.store.kahadb.TempMessageDatabase$StoredSubscription.cursor
UuF Unused field: org.apache.activemq.store.kahadb.TempMessageDatabase$StoredSubscription.lastAckByteSequence
UuF Unused field: org.apache.activemq.store.kahadb.TempMessageDatabase$StoredSubscription.lastAckId
UuF Unused field: org.apache.activemq.store.kahadb.TempMessageDatabase$StoredSubscription.subscriptionInfo
WMI org.apache.activemq.store.kahadb.MessageDatabase.recoverIndex(Transaction) makes inefficient use of keySet iterator instead of entrySet iterator
WMI org.apache.activemq.store.kahadb.MessageDatabase$StoredDestinationMarshaller$1.execute(Transaction) makes inefficient use of keySet iterator instead of entrySet iterator

Dodgy code Warnings

Code Warning
BC instanceof will always return true for all non-null values in org.apache.activemq.store.kahadb.MultiKahaDBPersistenceAdapter.removeQueueMessageStore(ActiveMQQueue), since all org.apache.activemq.store.PersistenceAdapter are instances of org.apache.activemq.store.PersistenceAdapter
BC instanceof will always return true for all non-null values in org.apache.activemq.store.kahadb.MultiKahaDBPersistenceAdapter.removeTopicMessageStore(ActiveMQTopic), since all org.apache.activemq.store.PersistenceAdapter are instances of org.apache.activemq.store.PersistenceAdapter
DLS Dead store to info in org.apache.activemq.store.kahadb.KahaDBStore$KahaDBTopicMessageStore.recoverNextMessages(String, String, int, MessageRecoveryListener)
DLS Dead store to info in org.apache.activemq.store.kahadb.KahaDBStore$KahaDBTopicMessageStore.recoverSubscription(String, String, MessageRecoveryListener)
DLS Dead store to updates in org.apache.activemq.store.kahadb.MessageDatabase.process(KahaRollbackCommand, Location)
DLS Dead store to buffer in org.apache.activemq.store.kahadb.disk.util.DataByteArrayOutputStream.writeUTF(String)
NP Possible null pointer dereference in org.apache.activemq.store.kahadb.disk.journal.ReadOnlyJournal.start() due to return value of called method
RCN Redundant nullcheck of org.apache.activemq.store.kahadb.disk.journal.DataFileAppender.nextWriteBatch, which is known to be non-null in org.apache.activemq.store.kahadb.disk.journal.DataFileAppender.enqueue(Journal$WriteCommand)
REC Exception is caught when Exception is not thrown in org.apache.activemq.store.kahadb.scheduler.JobSchedulerImpl.mainLoop()
SF Switch statement found in org.apache.activemq.store.kahadb.MessageDatabase$MessageOrderIndex.setBatch(Transaction, MessageDatabase$LastAck) where default case is missing
UCF Useless control flow in org.apache.activemq.store.kahadb.disk.index.BTreeIndex.unload(Transaction)
UCF Useless control flow in org.apache.activemq.store.kahadb.disk.index.ListIndex.unload(Transaction)
UrF Unread public/protected field: org.apache.activemq.store.kahadb.disk.journal.TargetedDataFileAppender$WriteBatch.exception

Details

BC_VACUOUS_INSTANCEOF: instanceof will always return true

This instanceof test will always return true (unless the value being tested is null). Although this is safe, make sure it isn't an indication of some misunderstanding or some other logic error. If you really want to test the value for being null, perhaps it would be clearer to do better to do a null test rather than an instanceof test.

ICAST_BAD_SHIFT_AMOUNT: 32 bit int shifted by an amount not in the range -31..31

The code performs shift of a 32 bit int by a constant amount outside the range -31..31. The effect of this is to use the lower 5 bits of the integer value to decide how much to shift by (e.g., shifting by 40 bits is the same as shifting by 8 bits, and shifting by 32 bits is the same as shifting by zero bits). This probably isn't what was expected, and it is at least confusing.

DM_BOXED_PRIMITIVE_FOR_PARSING: Boxing/unboxing to parse a primitive

A boxed primitive is created from a String, just to extract the unboxed primitive value. It is more efficient to just call the static parseXXX method.

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 5, use either autoboxing or the valueOf() method when creating instances of Long, Integer, Short, Character, and Byte.

CN_IMPLEMENTS_CLONE_BUT_NOT_CLONEABLE: Class defines clone() but doesn't implement Cloneable

This class defines a clone() method but the class doesn't implement Cloneable. There are some situations in which this is OK (e.g., you want to control how subclasses can clone themselves), but just make sure that this is what you intended.

CT_CONSTRUCTOR_THROW: Be wary of letting constructors throw exceptions.

Classes that throw exceptions in their constructors are vulnerable to Finalizer attacks

A finalizer attack can be prevented, by declaring the class final, using an empty finalizer declared as final, or by a clever use of a private constructor.

See SEI CERT Rule OBJ-11 for more information.

DE_MIGHT_IGNORE: Method might ignore exception

This method might ignore an exception.  In general, exceptions should be handled or reported in some way, or they should be thrown out of the method.

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 SpotBugs is a bytecode-based tool, there is no easy way to eliminate these false positives.

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 behavior to vary between platforms. Use an alternative API and specify a charset name or Charset object explicitly.

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_COMPARETO_USE_OBJECT_EQUALS: Class defines compareTo(...) and uses Object.equals()

This class defines a compareTo(...) method but inherits its equals() method from java.lang.Object. Generally, the value of compareTo should return zero if and only if equals returns true. If this is violated, weird and unpredictable failures will occur in classes such as PriorityQueue. In Java 5 the PriorityQueue.remove method uses the compareTo method, while in Java 6 it uses the equals method.

From the JavaDoc for the compareTo method in the Comparable interface:

It is strongly recommended, but not strictly required that (x.compareTo(y)==0) == (x.equals(y)). Generally speaking, any class that implements the Comparable interface and violates this condition should clearly indicate this fact. The recommended language is "Note: this class has a natural ordering that is inconsistent with equals."

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.

JLM_JSR166_UTILCONCURRENT_MONITORENTER: Synchronization performed on util.concurrent instance

This method performs synchronization on 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_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.

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 SpotBugs currently does not prune infeasible exception paths, this may be a false warning.

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

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

RR_NOT_CHECKED: Method ignores results of InputStream.read()

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

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_FIELD_SELF_COMPUTATION: Nonsensical self computation involving a field (e.g., x & x)

This method performs a nonsensical computation of a field with another reference to the same field (e.g., x&x or x-x). Because of the nature of the computation, this operation doesn't seem to make sense, and may indicate a typo or a logic error. Double-check the computation.

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 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();

SF_SWITCH_NO_DEFAULT: Switch statement found where default case is missing

This method contains a switch statement where default case is missing. Usually you need to provide a default case.

Because the analysis only looks at the generated bytecode, this warning can be incorrect triggered if the default case is at the end of the switch statement and the switch statement doesn't contain break statements for other cases.

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.

SS_SHOULD_BE_STATIC: Unread field: should this field be static?

This class contains an instance final field that is initialized to a compile-time static value. Consider making the field static.

UCF_USELESS_CONTROL_FLOW: Useless control flow

This method contains a useless control flow statement, where control flow continues onto the same place regardless of whether or not the branch is taken. For example, this is caused by having an empty statement block for an if statement:

if (argv.length == 0) {
    // TODO: handle this case
}

UG_SYNC_SET_UNSYNC_GET: Unsynchronized get method, synchronized set method

This class contains similarly-named get and set methods where the set method is synchronized and the get method is not.  This may result in incorrect behavior at runtime, as callers of the get method will not necessarily see a consistent state for the object.  The get method should be made synchronized.

UL_UNRELEASED_LOCK_EXCEPTION_PATH: Method does not release lock on all exception paths

This method acquires a JSR-166 (java.util.concurrent) lock, but does not release it on all exception paths out of the method. In general, the correct idiom for using a JSR-166 lock is:

Lock l = ...;
l.lock();
try {
    // do something
} finally {
    l.unlock();
}

UPM_UNCALLED_PRIVATE_METHOD: Private method is never called

This private method is never called. Although it is possible that the method will be invoked through reflection, it is more likely that the method is never used, and should be removed.

URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD: Unread public/protected field

This field is never read.  The field is public or protected, so perhaps it is intended to be used with classes not seen as part of the analysis. If not, consider removing it from the class.

UUF_UNUSED_FIELD: Unused field

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

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.