From 157910d79a4a3554774292b767c70de334db27a6 Mon Sep 17 00:00:00 2001 From: Greg Wilkins Date: Wed, 18 Sep 2019 15:58:46 +1000 Subject: [PATCH] Issue #4084 make deprecated warnings only with debug in jetty-9 Signed-off-by: Greg Wilkins --- .../eclipse/jetty/xml/XmlConfiguration.java | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/jetty-xml/src/main/java/org/eclipse/jetty/xml/XmlConfiguration.java b/jetty-xml/src/main/java/org/eclipse/jetty/xml/XmlConfiguration.java index 46d38a08e1e..2d9bb367657 100644 --- a/jetty-xml/src/main/java/org/eclipse/jetty/xml/XmlConfiguration.java +++ b/jetty-xml/src/main/java/org/eclipse/jetty/xml/XmlConfiguration.java @@ -737,32 +737,36 @@ public class XmlConfiguration private Object invokeConstructor(Constructor constructor, Object... args) throws IllegalAccessException, InvocationTargetException, InstantiationException { Object result = constructor.newInstance(args); - if (constructor.getAnnotation(Deprecated.class) != null) - LOG.warn("Deprecated constructor {} in {}", constructor, _configuration); + if (LOG.isDebugEnabled()) + if (constructor.getAnnotation(Deprecated.class) != null) + LOG.warn("Deprecated constructor {} in {}", constructor, _configuration); return result; } private Object invokeMethod(Method method, Object obj, Object... args) throws IllegalAccessException, InvocationTargetException { Object result = method.invoke(obj, args); - if (method.getAnnotation(Deprecated.class) != null) - LOG.warn("Deprecated method {} in {}", method, _configuration); + if (LOG.isDebugEnabled()) + if (method.getAnnotation(Deprecated.class) != null) + LOG.warn("Deprecated method {} in {}", method, _configuration); return result; } private Object getField(Field field, Object object) throws IllegalAccessException { Object result = field.get(object); - if (field.getAnnotation(Deprecated.class) != null) - LOG.warn("Deprecated field {} in {}", field, _configuration); + if (LOG.isDebugEnabled()) + if (field.getAnnotation(Deprecated.class) != null) + LOG.warn("Deprecated field {} in {}", field, _configuration); return result; } private void setField(Field field, Object obj, Object arg) throws IllegalAccessException { field.set(obj, arg); - if (field.getAnnotation(Deprecated.class) != null) - LOG.warn("Deprecated field {} in {}", field, _configuration); + if (LOG.isDebugEnabled()) + if (field.getAnnotation(Deprecated.class) != null) + LOG.warn("Deprecated field {} in {}", field, _configuration); } /**