SpotBugs Bug Detector Report

The following document contains the results of SpotBugs

SpotBugs Version is 4.8.3

Threshold is low

Effort is max

Summary

Classes Bugs Errors Missing Classes
92 32 0 0

Files

Class Bugs
ch.hslu.exercises.sw02.ex2.Allocation 1
ch.hslu.exercises.sw02.ex2.MyLinkedList 1
ch.hslu.exercises.sw05.input.ex2.BankAccount 1
ch.hslu.exercises.sw05.input.ex3.JoinAndSleepTask 1
ch.hslu.exercises.sw06.ex1.DemoWaitPool 2
ch.hslu.exercises.sw06.ex1.MyTask 2
ch.hslu.exercises.sw06.ex4.Consumer 1
ch.hslu.exercises.sw06.ex4.Producer 1
ch.hslu.exercises.sw08.ex3.DemoBankAccount 1
ch.hslu.exercises.sw08.ex4.Consumer 1
ch.hslu.exercises.sw08.ex4.Producer 1
ch.hslu.exercises.sw09.ConstructorCallsOverride$1Base 1
ch.hslu.exercises.sw09.ConstructorCallsOverride$1Child 1
ch.hslu.exercises.sw09.Sorting 2
ch.hslu.exercises.sw11.ex1.mergesort.MergesortTask 1
ch.hslu.exercises.sw11.ex1.n41.array.init.RandomInitTask 1
ch.hslu.exercises.sw11.ex1.n41.array.search.SearchTask 2
ch.hslu.exercises.sw11.ex1.n41.array.sort.SortTask 1
ch.hslu.exercises.sw11.ex1.n41.array.sort.check.SortCheckTask 1
ch.hslu.exercises.sw11.ex1.n41.array.sum.SumTask 1
ch.hslu.exercises.sw11.ex2.quicksort.QuicksortTask 1
ch.hslu.exercises.sw11.ex3.fibo.DemoFibonacciCalc 1
ch.hslu.exercises.sw11.ex3.fibo.FibonacciTask 1
ch.hslu.exercises.sw11.ex4.findfile.DemoFindFile 1
ch.hslu.exercises.sw11.ex4.findfile.FindFileTask 2
ch.hslu.exercises.sw14.Sort 2

ch.hslu.exercises.sw02.ex2.Allocation

Bug Category Details Line Priority
Return value of String.compareTo(String) ignored in ch.hslu.exercises.sw02.ex2.Allocation.compareTo(Allocation) CORRECTNESS RV_RETURN_VALUE_IGNORED 24 Medium

ch.hslu.exercises.sw02.ex2.MyLinkedList

Bug Category Details Line Priority
Dead store to ignored in ch.hslu.exercises.sw02.ex2.MyLinkedList.size() STYLE DLS_DEAD_LOCAL_STORE 49 Low

ch.hslu.exercises.sw05.input.ex2.BankAccount

Bug Category Details Line Priority
Inconsistent synchronization of ch.hslu.exercises.sw05.input.ex2.BankAccount.balance; locked 80% of time MT_CORRECTNESS IS2_INCONSISTENT_SYNC 29 Low

ch.hslu.exercises.sw05.input.ex3.JoinAndSleepTask

Bug Category Details Line Priority
new ch.hslu.exercises.sw05.input.ex3.JoinAndSleepTask(String, int, Thread) may expose internal representation by storing an externally mutable object into JoinAndSleepTask.joinFor MALICIOUS_CODE EI_EXPOSE_REP2 25 Medium

ch.hslu.exercises.sw06.ex1.DemoWaitPool

Bug Category Details Line Priority
Using notify rather than notifyAll in ch.hslu.exercises.sw06.ex1.DemoWaitPool.main(String[]) MT_CORRECTNESS NO_NOTIFY_NOT_NOTIFYALL 14 Low
ch.hslu.exercises.sw06.ex1.DemoWaitPool.main(String[]) calls Thread.sleep() with a lock held MT_CORRECTNESS SWL_SLEEP_WITH_LOCK_HELD 12 Medium

ch.hslu.exercises.sw06.ex1.MyTask

Bug Category Details Line Priority
Unconditional wait in ch.hslu.exercises.sw06.ex1.MyTask.run() MT_CORRECTNESS UW_UNCOND_WAIT 19 Medium
Wait not in loop in ch.hslu.exercises.sw06.ex1.MyTask.run() MT_CORRECTNESS WA_NOT_IN_LOOP 19 Medium

ch.hslu.exercises.sw06.ex4.Consumer

Bug Category Details Line Priority
new ch.hslu.exercises.sw06.ex4.Consumer(BoundedBuffer) may expose internal representation by storing an externally mutable object into Consumer.queue MALICIOUS_CODE EI_EXPOSE_REP2 21 Medium

ch.hslu.exercises.sw06.ex4.Producer

Bug Category Details Line Priority
new ch.hslu.exercises.sw06.ex4.Producer(BoundedBuffer, int) may expose internal representation by storing an externally mutable object into Producer.queue MALICIOUS_CODE EI_EXPOSE_REP2 23 Medium

ch.hslu.exercises.sw08.ex3.DemoBankAccount

Bug Category Details Line Priority
Dead store to futures in ch.hslu.exercises.sw08.ex3.DemoBankAccount.main(String[]) STYLE DLS_DEAD_LOCAL_STORE 50 Medium

ch.hslu.exercises.sw08.ex4.Consumer

Bug Category Details Line Priority
new ch.hslu.exercises.sw08.ex4.Consumer(List) may expose internal representation by storing an externally mutable object into Consumer.list MALICIOUS_CODE EI_EXPOSE_REP2 20 Medium

ch.hslu.exercises.sw08.ex4.Producer

Bug Category Details Line Priority
new ch.hslu.exercises.sw08.ex4.Producer(List, int) may expose internal representation by storing an externally mutable object into Producer.list MALICIOUS_CODE EI_EXPOSE_REP2 23 Medium

ch.hslu.exercises.sw09.ConstructorCallsOverride$1Base

Bug Category Details Line Priority
Overridable method overrideMe is called from constructor new ch.hslu.exercises.sw09.ConstructorCallsOverride$1Base(). MALICIOUS_CODE MC_OVERRIDABLE_METHOD_CALL_IN_CONSTRUCTOR 11 Low

ch.hslu.exercises.sw09.ConstructorCallsOverride$1Child

Bug Category Details Line Priority
x isn't initialized in ch.hslu.exercises.sw09.ConstructorCallsOverride$1Child.overrideMe() when invoked from constructor for superclass CORRECTNESS UR_UNINIT_READ_CALLED_FROM_SUPER_CONSTRUCTOR 11 High

ch.hslu.exercises.sw09.Sorting

Bug Category Details Line Priority
Random object created and used only once in ch.hslu.exercises.sw09.Sorting.initTestData() BAD_PRACTICE DMI_RANDOM_USED_ONLY_ONCE 124 High
new ch.hslu.exercises.sw09.Sorting(List) may expose internal representation by storing an externally mutable object into Sorting.sortingAlgos MALICIOUS_CODE EI_EXPOSE_REP2 27 Medium

ch.hslu.exercises.sw11.ex1.mergesort.MergesortTask

Bug Category Details Line Priority
ch.hslu.exercises.sw11.ex1.mergesort.MergesortTask is Serializable; consider declaring a serialVersionUID BAD_PRACTICE SE_NO_SERIALVERSIONID 39-89 Low

ch.hslu.exercises.sw11.ex1.n41.array.init.RandomInitTask

Bug Category Details Line Priority
ch.hslu.exercises.sw11.ex1.n41.array.init.RandomInitTask is Serializable; consider declaring a serialVersionUID BAD_PRACTICE SE_NO_SERIALVERSIONID 40-62 Low

ch.hslu.exercises.sw11.ex1.n41.array.search.SearchTask

Bug Category Details Line Priority
Non-virtual method call in new ch.hslu.exercises.sw11.ex1.n41.array.search.SearchTask(int, int[]) passes null for non-null parameter of new SearchTask(CountedCompleter, int, int[], int, AtomicInteger) CORRECTNESS NP_NULL_PARAM_DEREF_NONVIRTUAL 41 High
ch.hslu.exercises.sw11.ex1.n41.array.search.SearchTask is Serializable; consider declaring a serialVersionUID BAD_PRACTICE SE_NO_SERIALVERSIONID 25-78 Low

ch.hslu.exercises.sw11.ex1.n41.array.sort.SortTask

Bug Category Details Line Priority
ch.hslu.exercises.sw11.ex1.n41.array.sort.SortTask is Serializable; consider declaring a serialVersionUID BAD_PRACTICE SE_NO_SERIALVERSIONID 37-81 Low

ch.hslu.exercises.sw11.ex1.n41.array.sort.check.SortCheckTask

Bug Category Details Line Priority
ch.hslu.exercises.sw11.ex1.n41.array.sort.check.SortCheckTask is Serializable; consider declaring a serialVersionUID BAD_PRACTICE SE_NO_SERIALVERSIONID 24-64 Low

ch.hslu.exercises.sw11.ex1.n41.array.sum.SumTask

Bug Category Details Line Priority
ch.hslu.exercises.sw11.ex1.n41.array.sum.SumTask is Serializable; consider declaring a serialVersionUID BAD_PRACTICE SE_NO_SERIALVERSIONID 23-60 Low

ch.hslu.exercises.sw11.ex2.quicksort.QuicksortTask

Bug Category Details Line Priority
ch.hslu.exercises.sw11.ex2.quicksort.QuicksortTask is Serializable; consider declaring a serialVersionUID BAD_PRACTICE SE_NO_SERIALVERSIONID 36-68 Low

ch.hslu.exercises.sw11.ex3.fibo.DemoFibonacciCalc

Bug Category Details Line Priority
Private method ch.hslu.exercises.sw11.ex3.fibo.DemoFibonacciCalc.executeFibonacciCalculation(int) is never called PERFORMANCE UPM_UNCALLED_PRIVATE_METHOD 116-153 Low

ch.hslu.exercises.sw11.ex3.fibo.FibonacciTask

Bug Category Details Line Priority
ch.hslu.exercises.sw11.ex3.fibo.FibonacciTask is Serializable; consider declaring a serialVersionUID BAD_PRACTICE SE_NO_SERIALVERSIONID 23-45 Low

ch.hslu.exercises.sw11.ex4.findfile.DemoFindFile

Bug Category Details Line Priority
Dead store to maxV in ch.hslu.exercises.sw11.ex4.findfile.DemoFindFile.main(String[]) STYLE DLS_DEAD_LOCAL_STORE 68 Medium

ch.hslu.exercises.sw11.ex4.findfile.FindFileTask

Bug Category Details Line Priority
Non-virtual method call in new ch.hslu.exercises.sw11.ex4.findfile.FindFileTask(String, File) passes null for non-null parameter of new FindFileTask(CountedCompleter, String, File, AtomicReference) CORRECTNESS NP_NULL_PARAM_DEREF_NONVIRTUAL 41 High
ch.hslu.exercises.sw11.ex4.findfile.FindFileTask is Serializable; consider declaring a serialVersionUID BAD_PRACTICE SE_NO_SERIALVERSIONID 27-75 Low

ch.hslu.exercises.sw14.Sort

Bug Category Details Line Priority
Dead store to thread in ch.hslu.exercises.sw14.Sort.insertionSort(int[]) STYLE DLS_DEAD_LOCAL_STORE 9 High
ch.hslu.exercises.sw14.Sort.insertionSort(int[]) creates a thread using the default empty run method MT_CORRECTNESS DM_USELESS_THREAD 9 Low