Update Java linters and fix new PMD errors (#4157)

PMD requires that variables only initialized in the constructor be
final. The compiler errors if those final variables aren't guaranteed to
be initialized, so extra else branches were added to ensure that.

PMD also requires that classes with only private constructors be final.
The equivalent C++ classes were finalized as well, except for
TimeInterpolatableBuffer because it doesn't expose factory functions.
This commit is contained in:
Tyler Veness
2022-04-24 07:18:05 -07:00
committed by GitHub
parent ffc69d406c
commit 355a11a414
14 changed files with 50 additions and 28 deletions

View File

@@ -16,7 +16,7 @@ import java.util.TreeMap;
*
* @param <T> The type stored in this buffer.
*/
public class TimeInterpolatableBuffer<T> {
public final class TimeInterpolatableBuffer<T> {
private final double m_historySize;
private final InterpolateFunction<T> m_interpolatingFunc;
private final NavigableMap<Double, T> m_buffer = new TreeMap<>();