aboutsummaryrefslogtreecommitdiff
path: root/velocity-engine-core/src/main/java/org/apache/velocity/util
diff options
context:
space:
mode:
authorClaude Brisson <cbrisson@apache.org>2017-01-26 02:09:39 +0000
committerClaude Brisson <cbrisson@apache.org>2017-01-26 02:09:39 +0000
commit858859caf3addb6b77677631867a8660c5fdc12f (patch)
treec25daeab02776163819330c1c1fe2b25f7cc4060 /velocity-engine-core/src/main/java/org/apache/velocity/util
parent2880a3c02ddc0b4aa8990c04d2580ea9db0d2acf (diff)
downloadapache-velocity-engine-858859caf3addb6b77677631867a8660c5fdc12f.tar.gz
[engine] remove useless isXXXEnabled() tests
git-svn-id: https://svn.apache.org/repos/asf/velocity/engine/trunk@1780311 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'velocity-engine-core/src/main/java/org/apache/velocity/util')
-rw-r--r--velocity-engine-core/src/main/java/org/apache/velocity/util/introspection/ClassFieldMap.java11
-rw-r--r--velocity-engine-core/src/main/java/org/apache/velocity/util/introspection/ClassMap.java13
-rw-r--r--velocity-engine-core/src/main/java/org/apache/velocity/util/introspection/UberspectImpl.java22
3 files changed, 17 insertions, 29 deletions
diff --git a/velocity-engine-core/src/main/java/org/apache/velocity/util/introspection/ClassFieldMap.java b/velocity-engine-core/src/main/java/org/apache/velocity/util/introspection/ClassFieldMap.java
index c01f465b..6bc7481f 100644
--- a/velocity-engine-core/src/main/java/org/apache/velocity/util/introspection/ClassFieldMap.java
+++ b/velocity-engine-core/src/main/java/org/apache/velocity/util/introspection/ClassFieldMap.java
@@ -67,7 +67,7 @@ public class ClassFieldMap
this.clazz = clazz;
this.log = log;
- if (debugReflection && log.isDebugEnabled())
+ if (debugReflection)
{
log.debug("=================================================================");
log.debug("== Class: {}", clazz);
@@ -75,7 +75,7 @@ public class ClassFieldMap
fieldCache = createFieldCache();
- if (debugReflection && log.isDebugEnabled())
+ if (debugReflection)
{
log.debug("=================================================================");
}
@@ -148,7 +148,7 @@ public class ClassFieldMap
private void populateFieldCacheWith(Map fieldCache, Class classToReflect)
{
- if (debugReflection && log.isDebugEnabled())
+ if (debugReflection)
{
log.debug("Reflecting {}", classToReflect);
}
@@ -167,10 +167,7 @@ public class ClassFieldMap
}
catch (SecurityException se) // Everybody feels better with...
{
- if (log.isDebugEnabled())
- {
- log.debug("While accessing fields of {}:", classToReflect, se);
- }
+ log.debug("While accessing fields of {}:", classToReflect, se);
}
}
diff --git a/velocity-engine-core/src/main/java/org/apache/velocity/util/introspection/ClassMap.java b/velocity-engine-core/src/main/java/org/apache/velocity/util/introspection/ClassMap.java
index cc447459..16a3baae 100644
--- a/velocity-engine-core/src/main/java/org/apache/velocity/util/introspection/ClassMap.java
+++ b/velocity-engine-core/src/main/java/org/apache/velocity/util/introspection/ClassMap.java
@@ -78,7 +78,7 @@ public class ClassMap
this.clazz = clazz;
this.log = log;
- if (debugReflection && log.isDebugEnabled())
+ if (debugReflection)
{
log.debug("=================================================================");
log.debug("== Class: {}", clazz);
@@ -86,7 +86,7 @@ public class ClassMap
methodCache = createMethodCache(conversionHandler);
- if (debugReflection && log.isDebugEnabled())
+ if (debugReflection)
{
log.debug("=================================================================");
}
@@ -170,7 +170,7 @@ public class ClassMap
private void populateMethodCacheWith(MethodCache methodCache, Class classToReflect)
{
- if (debugReflection && log.isDebugEnabled())
+ if (debugReflection)
{
log.debug("Reflecting {}", classToReflect);
}
@@ -189,10 +189,7 @@ public class ClassMap
}
catch (SecurityException se) // Everybody feels better with...
{
- if (log.isDebugEnabled())
- {
- log.debug("While accessing methods of {}:", classToReflect, se);
- }
+ log.debug("While accessing methods of {}:", classToReflect, se);
}
}
@@ -304,7 +301,7 @@ public class ClassMap
{
cache.put(methodKey, method);
methodMap.add(method);
- if (debugReflection && log.isDebugEnabled())
+ if (debugReflection)
{
log.debug("Adding {}", method);
}
diff --git a/velocity-engine-core/src/main/java/org/apache/velocity/util/introspection/UberspectImpl.java b/velocity-engine-core/src/main/java/org/apache/velocity/util/introspection/UberspectImpl.java
index 14e6a5e6..fa57e8c9 100644
--- a/velocity-engine-core/src/main/java/org/apache/velocity/util/introspection/UberspectImpl.java
+++ b/velocity-engine-core/src/main/java/org/apache/velocity/util/introspection/UberspectImpl.java
@@ -181,24 +181,18 @@ public class UberspectImpl implements Uberspect, RuntimeServicesAware
}
else if (obj instanceof Iterator)
{
- if (log.isDebugEnabled())
- {
- log.debug("The iterative object in the #foreach() loop at {}" +
- " is of type java.util.Iterator. Because " +
- "it is not resettable, if used in more than once it " +
- "may lead to unexpected results.", i);
- }
+ log.debug("The iterative object in the #foreach() loop at {}" +
+ " is of type java.util.Iterator. Because " +
+ "it is not resettable, if used in more than once it " +
+ "may lead to unexpected results.", i);
return ((Iterator) obj);
}
else if (obj instanceof Enumeration)
{
- if (log.isDebugEnabled())
- {
- log.debug("The iterative object in the #foreach() loop at {}" +
- " is of type java.util.Enumeration. Because " +
- "it is not resettable, if used in more than once it " +
- "may lead to unexpected results.", i);
- }
+ log.debug("The iterative object in the #foreach() loop at {}" +
+ " is of type java.util.Enumeration. Because " +
+ "it is not resettable, if used in more than once it " +
+ "may lead to unexpected results.", i);
return new EnumerationIterator((Enumeration) obj);
}
else