From dde88d592c553549c51e88a30bd952a87f0c6c7d Mon Sep 17 00:00:00 2001 From: "Kevin W. Sutter" Date: Tue, 5 Jun 2012 02:23:03 +0000 Subject: [PATCH] OPENJPA-2204. Detect a potential null value before blindly outputting a trace string. git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@1346213 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/openjpa/jdbc/kernel/JDBCStoreManager.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/JDBCStoreManager.java b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/JDBCStoreManager.java index 0f1296092..65abde2fb 100644 --- a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/JDBCStoreManager.java +++ b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/JDBCStoreManager.java @@ -998,7 +998,9 @@ public class JDBCStoreManager implements StoreManager, JDBCStore { if (oid == null) return null; if (_log.isTraceEnabled()) { - _log.trace("find: oid="+oid+" "+vm.getDeclaredTypeMapping().getDescribedType()); + ClassMapping declaredTypeMapping = vm.getDeclaredTypeMapping(); + Class describedType = (declaredTypeMapping != null) ? declaredTypeMapping.getDescribedType() : null; + _log.trace("find: oid="+oid+", describedType="+describedType); } Object pc = _ctx.find(oid, fetch, null, null, 0); if (pc == null && vm != null) {