From 107531ccf82ec694d69ade405995a517925af279 Mon Sep 17 00:00:00 2001
From: Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Tue, 09 Jul 2013 10:28:15 +0000
Subject: [PATCH] Remove try / catch / throw anti-pattern
---
opends/src/server/org/opends/server/plugins/profiler/ProfileStackFrame.java | 14 +++++---------
1 files changed, 5 insertions(+), 9 deletions(-)
diff --git a/opends/src/server/org/opends/server/plugins/profiler/ProfileStackFrame.java b/opends/src/server/org/opends/server/plugins/profiler/ProfileStackFrame.java
index fb9016c..2375bcf 100644
--- a/opends/src/server/org/opends/server/plugins/profiler/ProfileStackFrame.java
+++ b/opends/src/server/org/opends/server/plugins/profiler/ProfileStackFrame.java
@@ -292,6 +292,7 @@
*
* @return The hash code for this stack frame.
*/
+ @Override
public int hashCode()
{
return (className.hashCode() + methodName.hashCode());
@@ -309,6 +310,7 @@
* @return <CODE>true</CODE> if the provided object may be considered equal
* to this stack frame, or <CODE>false</CODE> if not.
*/
+ @Override
public boolean equals(Object o)
{
if (o == null)
@@ -354,18 +356,11 @@
* @throws ClassCastException If the provided object is not a profile stack
* frame.
*/
+ @Override
public int compareTo(Object o)
throws ClassCastException
{
- ProfileStackFrame f;
- try
- {
- f = (ProfileStackFrame) o;
- }
- catch (ClassCastException cce)
- {
- throw cce;
- }
+ ProfileStackFrame f = (ProfileStackFrame) o;
long thisCount = getTotalCount();
long thatCount = f.getTotalCount();
@@ -395,6 +390,7 @@
*
* @return A string representation of this stack frame.
*/
+ @Override
public String toString()
{
StringBuilder buffer = new StringBuilder();
--
Gitblit v1.10.0