From ebb19c5816399b83c42b8f9194dbf3d9296975a3 Mon Sep 17 00:00:00 2001
From: Valery Kharseko <vharseko@3a-systems.ru>
Date: Thu, 30 Jul 2026 07:45:56 +0000
Subject: [PATCH] Fix concurrency and equals-contract CodeQL alerts (#785)

---
 opendj-server-legacy/src/main/java/org/opends/server/plugins/profiler/ProfileStackFrame.java |   28 ++++++----------------------
 1 files changed, 6 insertions(+), 22 deletions(-)

diff --git a/opendj-server-legacy/src/main/java/org/opends/server/plugins/profiler/ProfileStackFrame.java b/opendj-server-legacy/src/main/java/org/opends/server/plugins/profiler/ProfileStackFrame.java
index 910aff7..ea6f204 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/plugins/profiler/ProfileStackFrame.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/plugins/profiler/ProfileStackFrame.java
@@ -13,6 +13,7 @@
  *
  * Copyright 2006-2008 Sun Microsystems, Inc.
  * Portions Copyright 2014-2015 ForgeRock AS.
+ * Portions Copyright 2026 3A Systems, LLC.
  */
 package org.opends.server.plugins.profiler;
 
@@ -21,9 +22,6 @@
 import java.util.Arrays;
 import java.util.HashMap;
 
-import org.forgerock.i18n.slf4j.LocalizedLogger;
-
-
 /**
  * This class defines a data structure for holding information about a stack
  * frame captured by the Directory Server profiler.  It will contain the class
@@ -34,11 +32,6 @@
 public class ProfileStackFrame
        implements Comparable
 {
-  private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass();
-
-
-
-
   /**
    * The mapping between the line numbers for this stack frame and the
    * number of times that they were encountered.
@@ -302,26 +295,17 @@
   @Override
   public boolean equals(Object o)
   {
-    if (o == null)
-    {
-      return false;
-    }
-    else if (this == o)
+    if (this == o)
     {
       return true;
     }
-
-    try
+    if (!(o instanceof ProfileStackFrame))
     {
-      ProfileStackFrame f = (ProfileStackFrame) o;
-      return className.equals(f.className) && methodName.equals(f.methodName);
-    }
-    catch (Exception e)
-    {
-      logger.traceException(e);
-
       return false;
     }
+
+    ProfileStackFrame f = (ProfileStackFrame) o;
+    return className.equals(f.className) && methodName.equals(f.methodName);
   }
 
 

--
Gitblit v1.10.0