1
1
/*
2
- * Copyright 2002-2016 the original author or authors.
2
+ * Copyright 2002-2017 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -128,20 +128,20 @@ public class CustomizableTraceInterceptor extends AbstractTraceInterceptor {
128
128
/**
129
129
* The default message used for writing method entry messages.
130
130
*/
131
- private static final String DEFAULT_ENTER_MESSAGE =
132
- "Entering method '" + PLACEHOLDER_METHOD_NAME + "' of class [" + PLACEHOLDER_TARGET_CLASS_NAME + "]" ;
131
+ private static final String DEFAULT_ENTER_MESSAGE = "Entering method '" +
132
+ PLACEHOLDER_METHOD_NAME + "' of class [" + PLACEHOLDER_TARGET_CLASS_NAME + "]" ;
133
133
134
134
/**
135
135
* The default message used for writing method exit messages.
136
136
*/
137
- private static final String DEFAULT_EXIT_MESSAGE =
138
- "Exiting method '" + PLACEHOLDER_METHOD_NAME + "' of class [" + PLACEHOLDER_TARGET_CLASS_NAME + "]" ;
137
+ private static final String DEFAULT_EXIT_MESSAGE = "Exiting method '" +
138
+ PLACEHOLDER_METHOD_NAME + "' of class [" + PLACEHOLDER_TARGET_CLASS_NAME + "]" ;
139
139
140
140
/**
141
141
* The default message used for writing exception messages.
142
142
*/
143
- private static final String DEFAULT_EXCEPTION_MESSAGE =
144
- "Exception thrown in method '" + PLACEHOLDER_METHOD_NAME + "' of class [" + PLACEHOLDER_TARGET_CLASS_NAME + "]" ;
143
+ private static final String DEFAULT_EXCEPTION_MESSAGE = "Exception thrown in method '" +
144
+ PLACEHOLDER_METHOD_NAME + "' of class [" + PLACEHOLDER_TARGET_CLASS_NAME + "]" ;
145
145
146
146
/**
147
147
* The {@code Pattern} used to match placeholders.
@@ -182,14 +182,14 @@ public class CustomizableTraceInterceptor extends AbstractTraceInterceptor {
182
182
* </ul>
183
183
*/
184
184
public void setEnterMessage (String enterMessage ) throws IllegalArgumentException {
185
- Assert .hasText (enterMessage , "' enterMessage' must not be empty" );
185
+ Assert .hasText (enterMessage , "enterMessage must not be empty" );
186
186
checkForInvalidPlaceholders (enterMessage );
187
187
Assert .doesNotContain (enterMessage , PLACEHOLDER_RETURN_VALUE ,
188
- "enterMessage cannot contain placeholder [ " + PLACEHOLDER_RETURN_VALUE + "]" );
188
+ "enterMessage cannot contain placeholder " + PLACEHOLDER_RETURN_VALUE );
189
189
Assert .doesNotContain (enterMessage , PLACEHOLDER_EXCEPTION ,
190
- "enterMessage cannot contain placeholder [ " + PLACEHOLDER_EXCEPTION + "]" );
190
+ "enterMessage cannot contain placeholder " + PLACEHOLDER_EXCEPTION );
191
191
Assert .doesNotContain (enterMessage , PLACEHOLDER_INVOCATION_TIME ,
192
- "enterMessage cannot contain placeholder [ " + PLACEHOLDER_INVOCATION_TIME + "]" );
192
+ "enterMessage cannot contain placeholder " + PLACEHOLDER_INVOCATION_TIME );
193
193
this .enterMessage = enterMessage ;
194
194
}
195
195
@@ -206,10 +206,10 @@ public void setEnterMessage(String enterMessage) throws IllegalArgumentException
206
206
* </ul>
207
207
*/
208
208
public void setExitMessage (String exitMessage ) {
209
- Assert .hasText (exitMessage , "' exitMessage' must not be empty" );
209
+ Assert .hasText (exitMessage , "exitMessage must not be empty" );
210
210
checkForInvalidPlaceholders (exitMessage );
211
211
Assert .doesNotContain (exitMessage , PLACEHOLDER_EXCEPTION ,
212
- "exitMessage cannot contain placeholder [ " + PLACEHOLDER_EXCEPTION + "]" );
212
+ "exitMessage cannot contain placeholder" + PLACEHOLDER_EXCEPTION );
213
213
this .exitMessage = exitMessage ;
214
214
}
215
215
@@ -225,12 +225,10 @@ public void setExitMessage(String exitMessage) {
225
225
* </ul>
226
226
*/
227
227
public void setExceptionMessage (String exceptionMessage ) {
228
- Assert .hasText (exceptionMessage , "' exceptionMessage' must not be empty" );
228
+ Assert .hasText (exceptionMessage , "exceptionMessage must not be empty" );
229
229
checkForInvalidPlaceholders (exceptionMessage );
230
230
Assert .doesNotContain (exceptionMessage , PLACEHOLDER_RETURN_VALUE ,
231
- "exceptionMessage cannot contain placeholder [" + PLACEHOLDER_RETURN_VALUE + "]" );
232
- Assert .doesNotContain (exceptionMessage , PLACEHOLDER_INVOCATION_TIME ,
233
- "exceptionMessage cannot contain placeholder [" + PLACEHOLDER_INVOCATION_TIME + "]" );
231
+ "exceptionMessage cannot contain placeholder " + PLACEHOLDER_RETURN_VALUE );
234
232
this .exceptionMessage = exceptionMessage ;
235
233
}
236
234
@@ -262,17 +260,17 @@ protected Object invokeUnderTrace(MethodInvocation invocation, Log logger) throw
262
260
stopWatch .stop ();
263
261
}
264
262
exitThroughException = true ;
265
- writeToLog (logger ,
266
- replacePlaceholders ( this .exceptionMessage , invocation , null , ex , stopWatch .getTotalTimeMillis ()), ex );
263
+ writeToLog (logger , replacePlaceholders (
264
+ this .exceptionMessage , invocation , null , ex , stopWatch .getTotalTimeMillis ()), ex );
267
265
throw ex ;
268
266
}
269
267
finally {
270
268
if (!exitThroughException ) {
271
269
if (stopWatch .isRunning ()) {
272
270
stopWatch .stop ();
273
271
}
274
- writeToLog (logger ,
275
- replacePlaceholders ( this .exitMessage , invocation , returnValue , null , stopWatch .getTotalTimeMillis ()));
272
+ writeToLog (logger , replacePlaceholders (
273
+ this .exitMessage , invocation , returnValue , null , stopWatch .getTotalTimeMillis ()));
276
274
}
277
275
}
278
276
}
0 commit comments