From 9453b869bfe53741c071c07d1630297954c343c0 Mon Sep 17 00:00:00 2001 From: Nils Christian Ehmke <nie@informatik.uni-kiel.de> Date: Tue, 12 Jun 2012 17:32:48 +0200 Subject: [PATCH] Some minor modifications for PMD. --- .../java/kieker/webgui/beans/session/UserBean.java | 13 +++++++------ .../main/java/kieker/webgui/common/ACManager.java | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/session/UserBean.java b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/session/UserBean.java index 76548bda..304c1bfb 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/session/UserBean.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/session/UserBean.java @@ -45,20 +45,21 @@ public final class UserBean implements Serializable { * This field contains the name of the user. */ private final String userName; - - private static final AtomicLong guestCounter = new AtomicLong(); + /** + * The counter to get a number for the current user and to differ the sessions in test purposes. + */ + private static final AtomicLong GUEST_COUNTER = new AtomicLong(); /** * Creates a new instance of this class. The user name is set to "Guest". */ public UserBean() { - this.userName = "Guest #" + UserBean.guestCounter.getAndIncrement(); + this.userName = "Guest #" + UserBean.GUEST_COUNTER.getAndIncrement(); } - @Override @PreDestroy - protected void finalize() { - UserBean.guestCounter.decrementAndGet(); + protected void destroy() { + UserBean.GUEST_COUNTER.decrementAndGet(); } /** diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/common/ACManager.java b/Kieker.WebGUI/src/main/java/kieker/webgui/common/ACManager.java index 084a6a84..a696057e 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/common/ACManager.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/common/ACManager.java @@ -447,7 +447,7 @@ public final class ACManager { ACManager.LOG.error("An error occured while updating the display.", ex); } catch (final InvocationTargetException ex) { ACManager.LOG.error("An error occured while updating the display.", ex); - } catch (final NullPointerException ex) { + } catch (final NullPointerException ex) { // NOPMD ACManager.LOG.error("An error occured while updating the display.", ex); } } -- GitLab