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
This commit is contained in:
Kevin W. Sutter 2012-06-05 02:23:03 +00:00
parent 4f479a9887
commit dde88d592c
1 changed files with 3 additions and 1 deletions

View File

@ -998,7 +998,9 @@ public class JDBCStoreManager implements StoreManager, JDBCStore {
if (oid == null) if (oid == null)
return null; return null;
if (_log.isTraceEnabled()) { 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); Object pc = _ctx.find(oid, fetch, null, null, 0);
if (pc == null && vm != null) { if (pc == null && vm != null) {