Reduce number of compilation warnings and re-format where nessesary.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@101538 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Roy Wetherall
2015-04-09 01:58:11 +00:00
parent 2ae7a18fc9
commit 16d04e84b3
5 changed files with 24 additions and 4 deletions

View File

@@ -19,7 +19,6 @@
package org.alfresco.module.org_alfresco_module_rm.test.util;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.anyString;
import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.doAnswer;
import static org.mockito.Mockito.doReturn;
@@ -54,7 +53,6 @@ import org.alfresco.module.org_alfresco_module_rm.util.TransactionalResourceHelp
import org.alfresco.module.org_alfresco_module_rm.version.RecordableVersionService;
import org.alfresco.repo.policy.BehaviourFilter;
import org.alfresco.repo.policy.PolicyComponent;
import org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork;
import org.alfresco.repo.security.permissions.impl.ExtendedPermissionService;
import org.alfresco.repo.transaction.RetryingTransactionHelper;
import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;

View File

@@ -32,6 +32,9 @@ public class ExceptionUtils
/** This represents a situation where a throwable of an unexpected type was thrown. */
public static class UnexpectedThrowableException extends RuntimeException
{
/** serial version uid */
private static final long serialVersionUID = 3900164716673246207L;
private final Class<? extends Throwable> expected;
private final Throwable actual;
@@ -54,6 +57,9 @@ public class ExceptionUtils
/** This represents a situation where an expected throwable was not thrown. */
public static class MissingThrowableException extends RuntimeException
{
/** serial version uid */
private static final long serialVersionUID = -988022536370047222L;
private final Class<? extends Throwable> expected;
public MissingThrowableException(Class<? extends Throwable> expected)
@@ -121,6 +127,7 @@ public class ExceptionUtils
* @throws UnexpectedThrowableException if a non-matching throwable was thrown out of the code block.
* @throws MissingThrowableException if the expected throwable was not thrown out of the code block.
*/
@SuppressWarnings("unchecked")
public static <R, T extends Throwable> T expectedException(final Class<T> expected, final Supplier<R> code)
{
// The code block may throw an exception or it may not.