Merged HEAD-QA to HEAD (4.2) (including moving test classes into separate folders)

51903 to 54309 


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@54310 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Samuel Langlois
2013-08-20 17:17:31 +00:00
parent 0a36e2af67
commit ab4ca7177f
1576 changed files with 36419 additions and 8603 deletions

View File

@@ -21,7 +21,9 @@ package org.alfresco.repo.audit;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.concurrent.ThreadPoolExecutor;
@@ -331,11 +333,27 @@ public class AuditMethodInterceptor implements MethodInterceptor
{
return null;
}
Serializable audit = instanceofNonAuditClass(value);
if (audit == null)
Serializable audit;
if (instanceofNonAuditClass(value))
{
if (value instanceof Serializable)
// We will not be recording it
audit = NOT_RECORDABLE;
}
else
{
if(value instanceof List)
{
List valueList = (List) value;
List<Serializable> recordableList = new ArrayList<Serializable>();
for (Object valueListItem : valueList)
{
recordableList.add(getRecordableValue(valueListItem));
}
audit = (Serializable) recordableList;
}
// TODO we won't bother with Maps, yet.
else if (value instanceof Serializable)
{
audit = (Serializable) value;
}
@@ -360,16 +378,16 @@ public class AuditMethodInterceptor implements MethodInterceptor
}
// Returns a non null value if the supplied value is a non auditable class.
private Serializable instanceofNonAuditClass(Object value)
private boolean instanceofNonAuditClass(Object value)
{
for (@SuppressWarnings("rawtypes") Class clazz: NON_RECORDABLE_CLASSES)
{
if (clazz.isInstance(value))
{
return NOT_RECORDABLE;
return true;
}
}
return null;
return false;
}
/**