diff --git a/dna-jcr/src/test/java/org/jboss/dna/jcr/JcrRepositoryTest.java b/dna-jcr/src/test/java/org/jboss/dna/jcr/JcrRepositoryTest.java
index <HASH>..<HASH> 100644
--- a/dna-jcr/src/test/java/org/jboss/dna/jcr/JcrRepositoryTest.java
+++ b/dna-jcr/src/test/java/org/jboss/dna/jcr/JcrRepositoryTest.java
@@ -186,6 +186,7 @@ public class JcrRepositoryTest {
         repository.login();
     }
     
+    @SuppressWarnings("cast")
     @Test
     public void shouldAllowLoginWithNoCredentialsInPrivilegedBlock() throws Exception {
         LoginContext login = new LoginContext("dna-jcr", new UserPasswordCallbackHandler("superuser", "superuser".toCharArray()));
@@ -193,11 +194,10 @@ public class JcrRepositoryTest {
         
         Subject subject = login.getSubject();
         
-        Session session = Subject.doAsPrivileged(subject, new PrivilegedExceptionAction<Session>() {
+        Session session = (Session) Subject.doAsPrivileged(subject, new PrivilegedExceptionAction<Session>() {
 
-            @SuppressWarnings("cast")
             public Session run() throws Exception {
-                return (Session) repository.login();
+                return repository.login();
             }
         
         }, AccessController.getContext());
Tried to fix cast error that does not appear in Java <I>

git-svn-id: <URL>