From 14e8b7d8f0c94d316665036c3968821f8874678e Mon Sep 17 00:00:00 2001 From: mwebster Date: Wed, 30 Aug 2006 09:46:37 +0000 Subject: [PATCH] Bug 155238 "Trace should use System.identityHashCode, not hashCode" --- .../src/org/aspectj/weaver/loadtime/DefaultWeavingContext.java | 2 +- weaver/src/org/aspectj/weaver/tools/AbstractTrace.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/loadtime/src/org/aspectj/weaver/loadtime/DefaultWeavingContext.java b/loadtime/src/org/aspectj/weaver/loadtime/DefaultWeavingContext.java index 403a3576f..02c8a091e 100644 --- a/loadtime/src/org/aspectj/weaver/loadtime/DefaultWeavingContext.java +++ b/loadtime/src/org/aspectj/weaver/loadtime/DefaultWeavingContext.java @@ -53,7 +53,7 @@ public class DefaultWeavingContext implements IWeavingContext { * @return classname@hashcode */ public String getClassLoaderName() { - return ((loader!=null)?loader.getClass().getName()+"@"+Integer.toHexString(loader.hashCode()):"null"); + return ((loader!=null)?loader.getClass().getName()+"@"+Integer.toHexString(System.identityHashCode(loader)):"null"); } /** diff --git a/weaver/src/org/aspectj/weaver/tools/AbstractTrace.java b/weaver/src/org/aspectj/weaver/tools/AbstractTrace.java index 28755dfd2..6034a1f05 100644 --- a/weaver/src/org/aspectj/weaver/tools/AbstractTrace.java +++ b/weaver/src/org/aspectj/weaver/tools/AbstractTrace.java @@ -139,7 +139,7 @@ public abstract class AbstractTrace implements Trace { } /* Use classname@hashcode */ - else return obj.getClass().getName() + "@" + Integer.toHexString(obj.hashCode()); + else return obj.getClass().getName() + "@" + Integer.toHexString(System.identityHashCode(obj)); /* Object.hashCode() can be override and may thow an exception */ } catch (Exception ex) { -- 2.39.5