@@ -53,7 +53,9 @@ public static SAXParserFactory getSAXParserFactory(final String className) {
53
53
54
54
} catch (final ClassNotFoundException ex ) {
55
55
// quick escape
56
- LOG .debug (className + ": " + ex .getMessage (), ex );
56
+ if (LOG .isDebugEnabled ()) {
57
+ LOG .debug (className + ": " + ex .getMessage (), ex );
58
+ }
57
59
return null ;
58
60
}
59
61
@@ -63,7 +65,9 @@ public static SAXParserFactory getSAXParserFactory(final String className) {
63
65
method = clazz .getMethod ("newInstance" , (Class []) null );
64
66
} catch (final SecurityException | NoSuchMethodException ex ) {
65
67
// quick escape
66
- LOG .debug ("Method " + className + ".newInstance not found." , ex );
68
+ if (LOG .isDebugEnabled ()) {
69
+ LOG .debug ("Method " + className + ".newInstance not found." , ex );
70
+ }
67
71
return null ;
68
72
}
69
73
@@ -74,12 +78,16 @@ public static SAXParserFactory getSAXParserFactory(final String className) {
74
78
75
79
} catch (final IllegalAccessException | InvocationTargetException ex ) {
76
80
// quick escape
77
- LOG .debug ("Could not invoke method " + className + ".newInstance." , ex );
81
+ if (LOG .isDebugEnabled ()) {
82
+ LOG .debug ("Could not invoke method " + className + ".newInstance." , ex );
83
+ }
78
84
return null ;
79
85
}
80
86
81
87
if (!(result instanceof SAXParserFactory )) {
82
- LOG .debug ("Could not create instance of SAXParserFactory: " + result .toString ());
88
+ if (LOG .isDebugEnabled ()) {
89
+ LOG .debug ("Could not create instance of SAXParserFactory: " + result .toString ());
90
+ }
83
91
return null ;
84
92
}
85
93
@@ -108,7 +116,9 @@ public static SAXParserFactory getSAXParserFactory() {
108
116
// If no factory could be retrieved, create system default property.
109
117
if (factory == null ) {
110
118
factory = SAXParserFactory .newInstance ();
111
- LOG .info (String .format ("Using default SAXParserFactory '%s'" , factory .getClass ().getCanonicalName ()));
119
+ if (LOG .isDebugEnabled ()) {
120
+ LOG .debug (String .format ("Using default SAXParserFactory '%s'" , factory .getClass ().getCanonicalName ()));
121
+ }
112
122
}
113
123
114
124
return factory ;
0 commit comments