The following screenshot shows the result of the analysis by FindBugs:
The analysis has detected the following two potential bugs in the application:
- One of the bugs is detected in the run() method of the Task class. If an InterruptedExeption exception is thrown, the task doesn't free the lock because it won't execute the unlock() method. This will probably cause a deadlock situation in the application.
- The other bug is detected in the main() method of the Main class because you called the run() method of a thread directly, not the start() method to begin the execution of the thread.
If you double-click on one of the two ...