From 7d12333c3842c92942d8a1d9a5e5cb34876c6bbe Mon Sep 17 00:00:00 2001 From: Norman Maurer Date: Mon, 14 Mar 2016 09:00:50 +0100 Subject: [PATCH] Add final keyword which was missing in 47b598e6ce6c1f0e57d6955d10652dd5e5bc1462 Motivation: The two fields should have final keyword. Modifications: Add final keyword Result: Cleaner code. --- buffer/src/main/java/io/netty/buffer/PoolArena.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/buffer/src/main/java/io/netty/buffer/PoolArena.java b/buffer/src/main/java/io/netty/buffer/PoolArena.java index a1bf78e675..7f780bdc6c 100644 --- a/buffer/src/main/java/io/netty/buffer/PoolArena.java +++ b/buffer/src/main/java/io/netty/buffer/PoolArena.java @@ -58,15 +58,16 @@ abstract class PoolArena implements PoolArenaMetric { private final List chunkListMetrics; // Metrics for allocations and deallocations - private LongCounter allocationsTiny = PlatformDependent.newLongCounter(); - private LongCounter allocationsSmall = PlatformDependent.newLongCounter(); private long allocationsNormal; // We need to use the LongCounter here as this is not guarded via synchronized block. + private final LongCounter allocationsTiny = PlatformDependent.newLongCounter(); + private final LongCounter allocationsSmall = PlatformDependent.newLongCounter(); private final LongCounter allocationsHuge = PlatformDependent.newLongCounter(); private long deallocationsTiny; private long deallocationsSmall; private long deallocationsNormal; + // We need to use the LongCounter here as this is not guarded via synchronized block. private final LongCounter deallocationsHuge = PlatformDependent.newLongCounter();