Skip to content
Snippets Groups Projects
Commit 1e40c340 authored by ribeaudc's avatar ribeaudc
Browse files

minor: - Add final keyword when possible.

SVN: 6527
parent 4d185978
No related branches found
No related tags found
No related merge requests found
...@@ -47,8 +47,8 @@ public final class LogInvocationHandler implements InvocationHandler ...@@ -47,8 +47,8 @@ public final class LogInvocationHandler implements InvocationHandler
* @param logLevel The log level to use for normal (successful) events. * @param logLevel The log level to use for normal (successful) events.
* @param classUsedToNameLogger Class used to specify the name of the logger. * @param classUsedToNameLogger Class used to specify the name of the logger.
*/ */
public LogInvocationHandler(Object object, String name, Level logLevel, public LogInvocationHandler(final Object object, final String name, final Level logLevel,
Class<?> classUsedToNameLogger) final Class<?> classUsedToNameLogger)
{ {
this.object = object; this.object = object;
this.name = name; this.name = name;
...@@ -56,22 +56,23 @@ public final class LogInvocationHandler implements InvocationHandler ...@@ -56,22 +56,23 @@ public final class LogInvocationHandler implements InvocationHandler
this.classUsedToNameLogger = classUsedToNameLogger; this.classUsedToNameLogger = classUsedToNameLogger;
} }
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable public Object invoke(final Object proxy, final Method method, final Object[] args)
throws Throwable
{ {
long time = System.currentTimeMillis(); final long time = System.currentTimeMillis();
Throwable throwable = null; Throwable throwable = null;
try try
{ {
return method.invoke(object, args); return method.invoke(object, args);
} catch (InvocationTargetException e) } catch (final InvocationTargetException e)
{ {
throwable = e.getCause(); throwable = e.getCause();
throw throwable; throw throwable;
} catch (UndeclaredThrowableException e) } catch (final UndeclaredThrowableException e)
{ {
throwable = e.getCause(); throwable = e.getCause();
throw throwable; throw throwable;
} catch (Throwable t) } catch (final Throwable t)
{ {
throwable = t; throwable = t;
throw t; throw t;
...@@ -108,7 +109,7 @@ public final class LogInvocationHandler implements InvocationHandler ...@@ -108,7 +109,7 @@ public final class LogInvocationHandler implements InvocationHandler
} }
} }
private Level getLogLevel(Method method) private final Level getLogLevel(final Method method)
{ {
final LogAnnotation annotation = method.getAnnotation(LogAnnotation.class); final LogAnnotation annotation = method.getAnnotation(LogAnnotation.class);
if (annotation == null) if (annotation == null)
...@@ -123,7 +124,7 @@ public final class LogInvocationHandler implements InvocationHandler ...@@ -123,7 +124,7 @@ public final class LogInvocationHandler implements InvocationHandler
} }
} }
private Logger createLogger(Method method) private final Logger createLogger(final Method method)
{ {
final LogAnnotation annotation = method.getAnnotation(LogAnnotation.class); final LogAnnotation annotation = method.getAnnotation(LogAnnotation.class);
final LogCategory logCategory = final LogCategory logCategory =
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment