Class DeterministicOutputListenerWrapper

java.lang.Object
net.sourceforge.pmd.reporting.DeterministicOutputListenerWrapper
All Implemented Interfaces:
AutoCloseable, GlobalAnalysisListener

public class DeterministicOutputListenerWrapper extends Object implements GlobalAnalysisListener
A listener that mediates access to another listener to order events in a predetermined, stable way. When running PMD with multiple threads, file listeners may be called in any order. This makes runs non-deterministic, as Renderers can output reports in the particular order files were processed, which varies between runs. This class will reorder the events by buffering them, to call the methods of the underlying GlobalAnalysisListener in a deterministic order.

Any renderer whose output may depend on ordering of files should be shielded by an instance of this wrapper. Note that each wrapper maintains its own buffer so it should be

Since:
7.12.0