From 3cfb1904e53909b1067bd71c62216bdf317e283c Mon Sep 17 00:00:00 2001 From: Hardy Ferentschik Date: Wed, 19 Jan 2011 10:05:37 +0100 Subject: [PATCH] HHH-5843 Adding a log.isTraceEnabled call before the actual log call Not really related to the HQL parsing, but it is also a small logging performance change --- .../type/descriptor/sql/BasicBinder.java | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/core/src/main/java/org/hibernate/type/descriptor/sql/BasicBinder.java b/core/src/main/java/org/hibernate/type/descriptor/sql/BasicBinder.java index c3e7e83162..b303add7d5 100644 --- a/core/src/main/java/org/hibernate/type/descriptor/sql/BasicBinder.java +++ b/core/src/main/java/org/hibernate/type/descriptor/sql/BasicBinder.java @@ -78,14 +78,16 @@ public abstract class BasicBinder implements ValueBinder { st.setNull( index, sqlDescriptor.getSqlType() ); } else { - log.trace( - String.format( - BIND_MSG_TEMPLATE, - index, - JdbcTypeNameMapper.getTypeName( sqlDescriptor.getSqlType() ), - getJavaDescriptor().extractLoggableRepresentation( value ) - ) - ); + if ( log.isTraceEnabled() ) { + log.trace( + String.format( + BIND_MSG_TEMPLATE, + index, + JdbcTypeNameMapper.getTypeName( sqlDescriptor.getSqlType() ), + getJavaDescriptor().extractLoggableRepresentation( value ) + ) + ); + } doBind( st, value, index, options ); } }