mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
Removed warnings
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@114685 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -128,19 +128,6 @@ public class ReferralAdminServiceImpl implements ReferralAdminService
|
||||
return metadataReferral;
|
||||
}
|
||||
|
||||
/** Gets the {@link MetadataReferral} which uses the specified {@code assocType}. */
|
||||
private MetadataReferral getReferralForAssociation(QName assocType)
|
||||
{
|
||||
final MetadataReferral metadataReferral = registry.getReferralForAssociation(assocType);
|
||||
|
||||
if (metadataReferral == null)
|
||||
{
|
||||
throw new IllegalArgumentException("No " + MetadataReferral.class.getSimpleName() +
|
||||
" configured for assocType " + assocType);
|
||||
}
|
||||
return metadataReferral;
|
||||
}
|
||||
|
||||
@Override public MetadataReferral detachReferrer(NodeRef referrer, QName aspectName)
|
||||
{
|
||||
final MetadataReferral referral = registry.getReferralForAspect(aspectName);
|
||||
|
@@ -31,12 +31,16 @@ import java.util.List;
|
||||
*/
|
||||
public class ReferredMetadataException extends AlfrescoRuntimeException
|
||||
{
|
||||
private static final long serialVersionUID = -6059777070036571486L;
|
||||
|
||||
public ReferredMetadataException(String msgId) { super(msgId); }
|
||||
public ReferredMetadataException(String msgId, Throwable cause) { super(msgId, cause); }
|
||||
|
||||
/** This exception may be thrown when a {@link MetadataReferral} was incorrectly initialised. */
|
||||
public static class InvalidMetadataReferral extends ReferredMetadataException
|
||||
{
|
||||
private static final long serialVersionUID = 8507076314709440295L;
|
||||
|
||||
public InvalidMetadataReferral(String msgId)
|
||||
{
|
||||
super(msgId);
|
||||
@@ -46,6 +50,8 @@ public class ReferredMetadataException extends AlfrescoRuntimeException
|
||||
/** This exception may be thrown when a {@link MetadataReferral} already exists. */
|
||||
public static class MetadataReferralAlreadyExists extends ReferredMetadataException
|
||||
{
|
||||
private static final long serialVersionUID = 8119954252195817706L;
|
||||
|
||||
private final MetadataReferral metadataReferral;
|
||||
|
||||
public MetadataReferralAlreadyExists(String msgId, MetadataReferral metadataReferral)
|
||||
@@ -53,11 +59,18 @@ public class ReferredMetadataException extends AlfrescoRuntimeException
|
||||
super(msgId);
|
||||
this.metadataReferral = metadataReferral;
|
||||
}
|
||||
|
||||
public MetadataReferral getMetadataReferral()
|
||||
{
|
||||
return this.metadataReferral;
|
||||
}
|
||||
}
|
||||
|
||||
/** A {@link MetadataReferral} has not been found. */
|
||||
public static class MetadataReferralNotFound extends ReferredMetadataException
|
||||
{
|
||||
private static final long serialVersionUID = 8648089074801662142L;
|
||||
|
||||
public MetadataReferralNotFound(String msgId)
|
||||
{
|
||||
super(msgId);
|
||||
@@ -67,6 +80,8 @@ public class ReferredMetadataException extends AlfrescoRuntimeException
|
||||
/** A referent Node has not been found. */
|
||||
public static class ReferentNodeNotFound extends ReferredMetadataException
|
||||
{
|
||||
private static final long serialVersionUID = -6003487925958374458L;
|
||||
|
||||
public ReferentNodeNotFound(String msgId)
|
||||
{
|
||||
super(msgId);
|
||||
@@ -76,6 +91,8 @@ public class ReferredMetadataException extends AlfrescoRuntimeException
|
||||
/** Exception to report that chains of metadata referral are not currently supported. */
|
||||
public static class ChainedMetadataReferralUnsupported extends ReferredMetadataException
|
||||
{
|
||||
private static final long serialVersionUID = -2293262325447442964L;
|
||||
|
||||
private final List<NodeRef> existingReferrers;
|
||||
|
||||
public ChainedMetadataReferralUnsupported(String msgId, List<NodeRef> existingReferrers)
|
||||
@@ -101,6 +118,8 @@ public class ReferredMetadataException extends AlfrescoRuntimeException
|
||||
/** Exception to report that metadata referral is not supported for metadata defined on content types. */
|
||||
public static class TypeMetadataReferralUnsupported extends ReferredMetadataException
|
||||
{
|
||||
private static final long serialVersionUID = 7498707640089715503L;
|
||||
|
||||
public TypeMetadataReferralUnsupported(String msgId)
|
||||
{
|
||||
super(msgId);
|
||||
|
@@ -18,21 +18,24 @@
|
||||
*/
|
||||
package org.alfresco.module.org_alfresco_module_rm.referredmetadata;
|
||||
|
||||
import static java.util.Collections.emptyMap;
|
||||
import static java.util.Arrays.asList;
|
||||
import static org.alfresco.module.org_alfresco_module_rm.referredmetadata.ReferredMetadataException.ReferentNodeNotFound;
|
||||
import static org.alfresco.module.org_alfresco_module_rm.referredmetadata.ReferredMetadataException.MetadataReferralNotFound;
|
||||
import static java.util.Collections.emptyMap;
|
||||
import static org.alfresco.module.org_alfresco_module_rm.test.util.ExceptionUtils.expectedException;
|
||||
import static org.alfresco.module.org_alfresco_module_rm.test.util.FPUtils.asSet;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNull;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.mockito.Mockito.any;
|
||||
import static org.mockito.Matchers.any;
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.eq;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.alfresco.module.org_alfresco_module_rm.referredmetadata.ReferredMetadataException.MetadataReferralNotFound;
|
||||
import org.alfresco.module.org_alfresco_module_rm.referredmetadata.ReferredMetadataException.ReferentNodeNotFound;
|
||||
import org.alfresco.service.cmr.dictionary.ClassDefinition;
|
||||
import org.alfresco.service.cmr.dictionary.DictionaryService;
|
||||
import org.alfresco.service.cmr.dictionary.PropertyDefinition;
|
||||
@@ -47,10 +50,6 @@ import org.mockito.InjectMocks;
|
||||
import org.mockito.Mock;
|
||||
import org.mockito.MockitoAnnotations;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Unit tests for {@link ReferredMetadataServiceImpl}.
|
||||
*
|
||||
@@ -96,6 +95,7 @@ public class ReferredMetadataServiceImplUnitTest
|
||||
this.setAspects(asSet(referredAspect1, referredAspect2));
|
||||
}};
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
@Before public void setUp()
|
||||
{
|
||||
MockitoAnnotations.initMocks(this);
|
||||
|
@@ -18,7 +18,6 @@
|
||||
*/
|
||||
package org.alfresco.module.org_alfresco_module_rm.script.classification;
|
||||
|
||||
import static java.util.Collections.emptyMap;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.mockito.Matchers.any;
|
||||
@@ -34,8 +33,6 @@ import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import org.alfresco.module.org_alfresco_module_rm.classification.ClassificationLevel;
|
||||
import org.alfresco.module.org_alfresco_module_rm.classification.ClearanceLevel;
|
||||
import org.alfresco.module.org_alfresco_module_rm.classification.SecurityClearance;
|
||||
@@ -50,7 +47,6 @@ import org.alfresco.service.namespace.QName;
|
||||
import org.alfresco.util.Pair;
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONObject;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
import org.mockito.InjectMocks;
|
||||
import org.mockito.Mock;
|
||||
@@ -58,6 +54,9 @@ import org.mockito.Spy;
|
||||
import org.springframework.extensions.webscripts.DeclarativeWebScript;
|
||||
import org.springframework.extensions.webscripts.WebScriptRequest;
|
||||
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
|
||||
/**
|
||||
* Test for get user security clearance API
|
||||
*
|
||||
|
@@ -44,6 +44,7 @@ public class FPUtils
|
||||
* @param <T> the type of elements in the list.
|
||||
* @return the list with each element being the first retrieved from a {@code Supplier}.
|
||||
*/
|
||||
@SafeVarargs
|
||||
public static <T> List<T> asListFrom(Supplier<T>... suppliers)
|
||||
{
|
||||
if (suppliers == null || suppliers.length == 0)
|
||||
@@ -66,6 +67,7 @@ public class FPUtils
|
||||
* @param <T> the type of elements in the set.
|
||||
* @return the set with each element being the first retrieved from a {@code Supplier} (duplicates removed).
|
||||
*/
|
||||
@SafeVarargs
|
||||
public static <T> Set<T> asSetFrom(Supplier<T>... suppliers)
|
||||
{
|
||||
List<T> l = asListFrom(suppliers);
|
||||
@@ -78,6 +80,7 @@ public class FPUtils
|
||||
* @param objects the objects to be added to the set
|
||||
* @return a Set of objects (any equal objects will of course not be duplicated)
|
||||
*/
|
||||
@SafeVarargs
|
||||
public static <T> Set<T> asSet(T... objects)
|
||||
{
|
||||
return new HashSet<>(asList(objects));
|
||||
|
Reference in New Issue
Block a user