diff --git a/core/src/test/java/org/acegisecurity/MockHttpServletRequest.java b/core/src/test/java/org/acegisecurity/MockHttpServletRequest.java index b7a04e2ab6..6691240418 100644 --- a/core/src/test/java/org/acegisecurity/MockHttpServletRequest.java +++ b/core/src/test/java/org/acegisecurity/MockHttpServletRequest.java @@ -48,8 +48,8 @@ public class MockHttpServletRequest implements HttpServletRequest { //~ Instance fields ======================================================== private HttpSession session; - private Map paramMap = new HashMap(); private Map headersMap = new HashMap(); + private Map paramMap = new HashMap(); private Principal principal; private String contextPath = ""; private String queryString = null; @@ -66,16 +66,17 @@ public class MockHttpServletRequest implements HttpServletRequest { this.queryString = queryString; } - private MockHttpServletRequest() { - super(); - } - - public MockHttpServletRequest(Map headers, Principal principal, HttpSession session) { + public MockHttpServletRequest(Map headers, Principal principal, + HttpSession session) { this.headersMap = headers; this.principal = principal; this.session = session; } + private MockHttpServletRequest() { + super(); + } + //~ Methods ================================================================ public void setAttribute(String arg0, Object arg1) { diff --git a/core/src/test/java/org/acegisecurity/intercept/web/RegExpBasedFilterDefinitionMapTests.java b/core/src/test/java/org/acegisecurity/intercept/web/RegExpBasedFilterDefinitionMapTests.java index c7480cbc4a..3c3c819c3b 100644 --- a/core/src/test/java/org/acegisecurity/intercept/web/RegExpBasedFilterDefinitionMapTests.java +++ b/core/src/test/java/org/acegisecurity/intercept/web/RegExpBasedFilterDefinitionMapTests.java @@ -25,8 +25,8 @@ import net.sf.acegisecurity.SecurityConfig; /** - * Tests parts of {@link RegExpBasedFilterInvocationDefinitionMap} not tested by {@link - * FilterInvocationDefinitionSourceEditorTests}. + * Tests parts of {@link RegExpBasedFilterInvocationDefinitionMap} not tested + * by {@link FilterInvocationDefinitionSourceEditorTests}. * * @author Ben Alex * @version $Id$ diff --git a/integration-test/src/net/sf/acegisecurity/integrationtests/web/AbstractContactsTests.java b/integration-test/src/net/sf/acegisecurity/integrationtests/web/AbstractContactsTests.java index 39ed0dc122..794add4d7d 100644 --- a/integration-test/src/net/sf/acegisecurity/integrationtests/web/AbstractContactsTests.java +++ b/integration-test/src/net/sf/acegisecurity/integrationtests/web/AbstractContactsTests.java @@ -95,7 +95,7 @@ public abstract class AbstractContactsTests extends TestCase { contactManager.getRandomContact(); fail("Should have thrown RemoteAccessException"); } catch (RemoteAccessException exception) { - assertTrue(true); + assertTrue(true); } } diff --git a/samples/contacts/src/main/java/sample/contact/ContactManagerBackend.java b/samples/contacts/src/main/java/sample/contact/ContactManagerBackend.java index 9813e23ce0..3999f30544 100644 --- a/samples/contacts/src/main/java/sample/contact/ContactManagerBackend.java +++ b/samples/contacts/src/main/java/sample/contact/ContactManagerBackend.java @@ -25,12 +25,12 @@ import java.util.Vector; /** * Backend business object that manages the contacts. - * + * *

* As a backend, it never faces the public callers. It is always accessed via * the {@link ContactManagerFacade}. *

- * + * *

* This facade approach is not really necessary in this application, and is * done simply to demonstrate granting additional authorities via the diff --git a/samples/contacts/src/main/java/sample/contact/SecureIndexController.java b/samples/contacts/src/main/java/sample/contact/SecureIndexController.java index 7d2b72869a..a651203e7a 100644 --- a/samples/contacts/src/main/java/sample/contact/SecureIndexController.java +++ b/samples/contacts/src/main/java/sample/contact/SecureIndexController.java @@ -16,8 +16,8 @@ package sample.contact; import net.sf.acegisecurity.Authentication; -import net.sf.acegisecurity.GrantedAuthority; import net.sf.acegisecurity.AuthenticationCredentialsNotFoundException; +import net.sf.acegisecurity.GrantedAuthority; import net.sf.acegisecurity.context.ContextHolder; import net.sf.acegisecurity.context.SecureContext; @@ -67,10 +67,11 @@ public class SecureIndexController implements Controller, InitializingBean { public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { SecureContext secureContext = ((SecureContext) ContextHolder.getContext()); + if (null == secureContext) { throw new AuthenticationCredentialsNotFoundException( - "Authentication credentials were not found in the " + - "SecureContext"); + "Authentication credentials were not found in the " + + "SecureContext"); } final Authentication currentUser = secureContext.getAuthentication();