From 018cf3278a4f28f012bef3f8942273492404f737 Mon Sep 17 00:00:00 2001 From: Pinaki Poddar Date: Tue, 20 Feb 2007 18:08:22 +0000 Subject: [PATCH] Use safe and standard way to print a pc.toString() using Exceptions.toString(Object) when logging messages that may cause infinite loop. git-svn-id: https://svn.apache.org/repos/asf/incubator/openjpa/trunk@509691 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/openjpa/kernel/DetachedStateManager.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/DetachedStateManager.java b/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/DetachedStateManager.java index f0bdd1fc2..01ce8737d 100644 --- a/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/DetachedStateManager.java +++ b/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/DetachedStateManager.java @@ -30,6 +30,7 @@ import org.apache.openjpa.meta.ClassMetaData; import org.apache.openjpa.meta.FieldMetaData; import org.apache.openjpa.meta.JavaTypes; import org.apache.openjpa.meta.ValueMetaData; +import org.apache.openjpa.util.Exceptions; import org.apache.openjpa.util.Proxy; import org.apache.openjpa.util.UnsupportedException; @@ -399,7 +400,7 @@ public class DetachedStateManager // do not access the pc fields by implictly invoking _pc.toString() // may cause infinite loop if again tries to access unloaded field throw new IllegalStateException(_loc.get("unloaded-detached", - _pc.getClass()+"@"+System.identityHashCode(_pc)).getMessage()); + Exceptions.toString(_pc)).getMessage()); } public boolean serializing() {