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;
|
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)
|
@Override public MetadataReferral detachReferrer(NodeRef referrer, QName aspectName)
|
||||||
{
|
{
|
||||||
final MetadataReferral referral = registry.getReferralForAspect(aspectName);
|
final MetadataReferral referral = registry.getReferralForAspect(aspectName);
|
||||||
|
@@ -31,12 +31,16 @@ import java.util.List;
|
|||||||
*/
|
*/
|
||||||
public class ReferredMetadataException extends AlfrescoRuntimeException
|
public class ReferredMetadataException extends AlfrescoRuntimeException
|
||||||
{
|
{
|
||||||
|
private static final long serialVersionUID = -6059777070036571486L;
|
||||||
|
|
||||||
public ReferredMetadataException(String msgId) { super(msgId); }
|
public ReferredMetadataException(String msgId) { super(msgId); }
|
||||||
public ReferredMetadataException(String msgId, Throwable cause) { super(msgId, cause); }
|
public ReferredMetadataException(String msgId, Throwable cause) { super(msgId, cause); }
|
||||||
|
|
||||||
/** This exception may be thrown when a {@link MetadataReferral} was incorrectly initialised. */
|
/** This exception may be thrown when a {@link MetadataReferral} was incorrectly initialised. */
|
||||||
public static class InvalidMetadataReferral extends ReferredMetadataException
|
public static class InvalidMetadataReferral extends ReferredMetadataException
|
||||||
{
|
{
|
||||||
|
private static final long serialVersionUID = 8507076314709440295L;
|
||||||
|
|
||||||
public InvalidMetadataReferral(String msgId)
|
public InvalidMetadataReferral(String msgId)
|
||||||
{
|
{
|
||||||
super(msgId);
|
super(msgId);
|
||||||
@@ -46,6 +50,8 @@ public class ReferredMetadataException extends AlfrescoRuntimeException
|
|||||||
/** This exception may be thrown when a {@link MetadataReferral} already exists. */
|
/** This exception may be thrown when a {@link MetadataReferral} already exists. */
|
||||||
public static class MetadataReferralAlreadyExists extends ReferredMetadataException
|
public static class MetadataReferralAlreadyExists extends ReferredMetadataException
|
||||||
{
|
{
|
||||||
|
private static final long serialVersionUID = 8119954252195817706L;
|
||||||
|
|
||||||
private final MetadataReferral metadataReferral;
|
private final MetadataReferral metadataReferral;
|
||||||
|
|
||||||
public MetadataReferralAlreadyExists(String msgId, MetadataReferral metadataReferral)
|
public MetadataReferralAlreadyExists(String msgId, MetadataReferral metadataReferral)
|
||||||
@@ -53,11 +59,18 @@ public class ReferredMetadataException extends AlfrescoRuntimeException
|
|||||||
super(msgId);
|
super(msgId);
|
||||||
this.metadataReferral = metadataReferral;
|
this.metadataReferral = metadataReferral;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public MetadataReferral getMetadataReferral()
|
||||||
|
{
|
||||||
|
return this.metadataReferral;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** A {@link MetadataReferral} has not been found. */
|
/** A {@link MetadataReferral} has not been found. */
|
||||||
public static class MetadataReferralNotFound extends ReferredMetadataException
|
public static class MetadataReferralNotFound extends ReferredMetadataException
|
||||||
{
|
{
|
||||||
|
private static final long serialVersionUID = 8648089074801662142L;
|
||||||
|
|
||||||
public MetadataReferralNotFound(String msgId)
|
public MetadataReferralNotFound(String msgId)
|
||||||
{
|
{
|
||||||
super(msgId);
|
super(msgId);
|
||||||
@@ -67,6 +80,8 @@ public class ReferredMetadataException extends AlfrescoRuntimeException
|
|||||||
/** A referent Node has not been found. */
|
/** A referent Node has not been found. */
|
||||||
public static class ReferentNodeNotFound extends ReferredMetadataException
|
public static class ReferentNodeNotFound extends ReferredMetadataException
|
||||||
{
|
{
|
||||||
|
private static final long serialVersionUID = -6003487925958374458L;
|
||||||
|
|
||||||
public ReferentNodeNotFound(String msgId)
|
public ReferentNodeNotFound(String msgId)
|
||||||
{
|
{
|
||||||
super(msgId);
|
super(msgId);
|
||||||
@@ -76,6 +91,8 @@ public class ReferredMetadataException extends AlfrescoRuntimeException
|
|||||||
/** Exception to report that chains of metadata referral are not currently supported. */
|
/** Exception to report that chains of metadata referral are not currently supported. */
|
||||||
public static class ChainedMetadataReferralUnsupported extends ReferredMetadataException
|
public static class ChainedMetadataReferralUnsupported extends ReferredMetadataException
|
||||||
{
|
{
|
||||||
|
private static final long serialVersionUID = -2293262325447442964L;
|
||||||
|
|
||||||
private final List<NodeRef> existingReferrers;
|
private final List<NodeRef> existingReferrers;
|
||||||
|
|
||||||
public ChainedMetadataReferralUnsupported(String msgId, 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. */
|
/** Exception to report that metadata referral is not supported for metadata defined on content types. */
|
||||||
public static class TypeMetadataReferralUnsupported extends ReferredMetadataException
|
public static class TypeMetadataReferralUnsupported extends ReferredMetadataException
|
||||||
{
|
{
|
||||||
|
private static final long serialVersionUID = 7498707640089715503L;
|
||||||
|
|
||||||
public TypeMetadataReferralUnsupported(String msgId)
|
public TypeMetadataReferralUnsupported(String msgId)
|
||||||
{
|
{
|
||||||
super(msgId);
|
super(msgId);
|
||||||
|
@@ -18,21 +18,24 @@
|
|||||||
*/
|
*/
|
||||||
package org.alfresco.module.org_alfresco_module_rm.referredmetadata;
|
package org.alfresco.module.org_alfresco_module_rm.referredmetadata;
|
||||||
|
|
||||||
import static java.util.Collections.emptyMap;
|
|
||||||
import static java.util.Arrays.asList;
|
import static java.util.Arrays.asList;
|
||||||
import static org.alfresco.module.org_alfresco_module_rm.referredmetadata.ReferredMetadataException.ReferentNodeNotFound;
|
import static java.util.Collections.emptyMap;
|
||||||
import static org.alfresco.module.org_alfresco_module_rm.referredmetadata.ReferredMetadataException.MetadataReferralNotFound;
|
|
||||||
import static org.alfresco.module.org_alfresco_module_rm.test.util.ExceptionUtils.expectedException;
|
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.alfresco.module.org_alfresco_module_rm.test.util.FPUtils.asSet;
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
import static org.junit.Assert.assertNull;
|
|
||||||
import static org.junit.Assert.assertFalse;
|
import static org.junit.Assert.assertFalse;
|
||||||
|
import static org.junit.Assert.assertNull;
|
||||||
import static org.junit.Assert.assertTrue;
|
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.mock;
|
||||||
import static org.mockito.Mockito.eq;
|
|
||||||
import static org.mockito.Mockito.when;
|
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.ClassDefinition;
|
||||||
import org.alfresco.service.cmr.dictionary.DictionaryService;
|
import org.alfresco.service.cmr.dictionary.DictionaryService;
|
||||||
import org.alfresco.service.cmr.dictionary.PropertyDefinition;
|
import org.alfresco.service.cmr.dictionary.PropertyDefinition;
|
||||||
@@ -47,10 +50,6 @@ import org.mockito.InjectMocks;
|
|||||||
import org.mockito.Mock;
|
import org.mockito.Mock;
|
||||||
import org.mockito.MockitoAnnotations;
|
import org.mockito.MockitoAnnotations;
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Unit tests for {@link ReferredMetadataServiceImpl}.
|
* Unit tests for {@link ReferredMetadataServiceImpl}.
|
||||||
*
|
*
|
||||||
@@ -96,6 +95,7 @@ public class ReferredMetadataServiceImplUnitTest
|
|||||||
this.setAspects(asSet(referredAspect1, referredAspect2));
|
this.setAspects(asSet(referredAspect1, referredAspect2));
|
||||||
}};
|
}};
|
||||||
|
|
||||||
|
@SuppressWarnings("serial")
|
||||||
@Before public void setUp()
|
@Before public void setUp()
|
||||||
{
|
{
|
||||||
MockitoAnnotations.initMocks(this);
|
MockitoAnnotations.initMocks(this);
|
||||||
|
@@ -18,7 +18,6 @@
|
|||||||
*/
|
*/
|
||||||
package org.alfresco.module.org_alfresco_module_rm.script.classification;
|
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.assertEquals;
|
||||||
import static org.junit.Assert.assertNotNull;
|
import static org.junit.Assert.assertNotNull;
|
||||||
import static org.mockito.Matchers.any;
|
import static org.mockito.Matchers.any;
|
||||||
@@ -34,8 +33,6 @@ import java.util.Arrays;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
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.ClassificationLevel;
|
||||||
import org.alfresco.module.org_alfresco_module_rm.classification.ClearanceLevel;
|
import org.alfresco.module.org_alfresco_module_rm.classification.ClearanceLevel;
|
||||||
import org.alfresco.module.org_alfresco_module_rm.classification.SecurityClearance;
|
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.alfresco.util.Pair;
|
||||||
import org.json.JSONArray;
|
import org.json.JSONArray;
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
import org.junit.Ignore;
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.mockito.InjectMocks;
|
import org.mockito.InjectMocks;
|
||||||
import org.mockito.Mock;
|
import org.mockito.Mock;
|
||||||
@@ -58,6 +54,9 @@ import org.mockito.Spy;
|
|||||||
import org.springframework.extensions.webscripts.DeclarativeWebScript;
|
import org.springframework.extensions.webscripts.DeclarativeWebScript;
|
||||||
import org.springframework.extensions.webscripts.WebScriptRequest;
|
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
|
* Test for get user security clearance API
|
||||||
*
|
*
|
||||||
|
@@ -44,6 +44,7 @@ public class FPUtils
|
|||||||
* @param <T> the type of elements in the list.
|
* @param <T> the type of elements in the list.
|
||||||
* @return the list with each element being the first retrieved from a {@code Supplier}.
|
* @return the list with each element being the first retrieved from a {@code Supplier}.
|
||||||
*/
|
*/
|
||||||
|
@SafeVarargs
|
||||||
public static <T> List<T> asListFrom(Supplier<T>... suppliers)
|
public static <T> List<T> asListFrom(Supplier<T>... suppliers)
|
||||||
{
|
{
|
||||||
if (suppliers == null || suppliers.length == 0)
|
if (suppliers == null || suppliers.length == 0)
|
||||||
@@ -66,6 +67,7 @@ public class FPUtils
|
|||||||
* @param <T> the type of elements in the set.
|
* @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).
|
* @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)
|
public static <T> Set<T> asSetFrom(Supplier<T>... suppliers)
|
||||||
{
|
{
|
||||||
List<T> l = asListFrom(suppliers);
|
List<T> l = asListFrom(suppliers);
|
||||||
@@ -78,6 +80,7 @@ public class FPUtils
|
|||||||
* @param objects the objects to be added to the set
|
* @param objects the objects to be added to the set
|
||||||
* @return a Set of objects (any equal objects will of course not be duplicated)
|
* @return a Set of objects (any equal objects will of course not be duplicated)
|
||||||
*/
|
*/
|
||||||
|
@SafeVarargs
|
||||||
public static <T> Set<T> asSet(T... objects)
|
public static <T> Set<T> asSet(T... objects)
|
||||||
{
|
{
|
||||||
return new HashSet<>(asList(objects));
|
return new HashSet<>(asList(objects));
|
||||||
|
Reference in New Issue
Block a user