Skip to content

Files

Latest commit

 

History

History
19 lines (12 loc) · 567 Bytes

SystemRunFinalizersOnExit.md

File metadata and controls

19 lines (12 loc) · 567 Bytes

Pattern: Use of System.runFinalizersOnExit()

Issue: -

Description

This method is inherently non-thread-safe, may result in data corruption, deadlock, and may affect parts of the program far removed from it's call point. It is deprecated, and it's use strongly discouraged.

Here is an example of code that produces a violation:

def method() {
    System.runFinalizersOnExit(true)
}

Further Reading