diff --git a/source/java/org/alfresco/repo/model/ml/MLContentInterceptor.java b/source/java/org/alfresco/repo/model/ml/MLContentInterceptor.java index d1e2a7928d..3612116cd2 100644 --- a/source/java/org/alfresco/repo/model/ml/MLContentInterceptor.java +++ b/source/java/org/alfresco/repo/model/ml/MLContentInterceptor.java @@ -74,12 +74,13 @@ public class MLContentInterceptor implements MethodInterceptor public Object invoke(MethodInvocation invocation) throws Throwable { String methodName = invocation.getMethod().getName(); - Object[] args = invocation.getArguments(); Object ret = null; if (methodName.equals("getReader")) { + Object[] args = invocation.getArguments(); + NodeRef nodeRef = (NodeRef) args[0]; // Shortcut it if the node is not an empty translation diff --git a/source/java/org/alfresco/repo/node/MLPropertyInterceptor.java b/source/java/org/alfresco/repo/node/MLPropertyInterceptor.java index 3de9929f1d..2c529980e7 100644 --- a/source/java/org/alfresco/repo/node/MLPropertyInterceptor.java +++ b/source/java/org/alfresco/repo/node/MLPropertyInterceptor.java @@ -67,7 +67,6 @@ public class MLPropertyInterceptor implements MethodInterceptor { private static Log logger = LogFactory.getLog(MLPropertyInterceptor.class); - private static ThreadLocal mlAware = new ThreadLocal(); /** Direct access to the NodeService */ @@ -118,25 +117,26 @@ public class MLPropertyInterceptor implements MethodInterceptor @SuppressWarnings("unchecked") public Object invoke(MethodInvocation invocation) throws Throwable { + if (logger.isDebugEnabled()) + { + logger.debug("Intercepting method " + invocation.getMethod().getName() + " using content filter " + I18NUtil.getContentLocale()); + } + + // If isMLAware then no treatment is done, just return + if (isMLAware()) + { + // Don't interfere + return invocation.proceed(); + } + + Object ret = null; + String methodName = invocation.getMethod().getName(); Object[] args = invocation.getArguments(); // What locale must be used for filtering Locale contentLocale = I18NUtil.getContentLocale(); - if (logger.isDebugEnabled()) - { - logger.debug("Intercepting method " + methodName + " using content filter " + contentLocale); - } - Object ret = null; - - // If isMLAware then no treatment is done, just return - if(isMLAware()) - { - // Don't interfere - return invocation.proceed(); - } - if (methodName.equals("getProperty")) { NodeRef nodeRef = (NodeRef) args[0];