Browse Source

Unnecessary interface modifier

Lars Grefer 6 years ago
parent
commit
d9c1f03b84
23 changed files with 63 additions and 75 deletions
  1. 1 1
      core/src/main/java/org/springframework/security/access/annotation/Secured.java
  2. 1 1
      core/src/main/java/org/springframework/security/access/hierarchicalroles/RoleHierarchy.java
  3. 1 1
      core/src/main/java/org/springframework/security/access/method/MethodSecurityMetadataSource.java
  4. 1 1
      core/src/main/java/org/springframework/security/access/prepost/PostAuthorize.java
  5. 1 1
      core/src/main/java/org/springframework/security/access/prepost/PostFilter.java
  6. 2 2
      core/src/main/java/org/springframework/security/access/prepost/PreFilter.java
  7. 3 3
      core/src/main/java/org/springframework/security/core/ComparableVersion.java
  8. 1 1
      core/src/main/java/org/springframework/security/core/authority/mapping/Attributes2GrantedAuthoritiesMapper.java
  9. 6 12
      docs/manual/src/docs/asciidoc/_includes/servlet/preface/java-configuration.adoc
  10. 6 12
      docs/manual/src/docs/asciidoc/_includes/servlet/preface/namespace.adoc
  11. 1 1
      itest/context/src/main/java/org/springframework/security/integration/UserRepository.java
  12. 1 1
      itest/context/src/main/java/org/springframework/security/integration/python/TestService.java
  13. 3 3
      openid/src/main/java/org/springframework/security/openid/OpenIDConsumer.java
  14. 3 3
      remoting/src/main/java/org/springframework/security/remoting/dns/DnsResolver.java
  15. 1 1
      remoting/src/main/java/org/springframework/security/remoting/dns/InitialContextFactory.java
  16. 7 7
      samples/xml/contacts/src/main/java/sample/contact/ContactDao.java
  17. 8 8
      samples/xml/contacts/src/main/java/sample/contact/ContactManager.java
  18. 4 4
      samples/xml/dms/src/main/java/sample/dms/DocumentDao.java
  19. 1 1
      samples/xml/dms/src/main/java/sample/dms/secured/SecureDocumentDao.java
  20. 3 3
      samples/xml/tutorial/src/main/java/bigbank/BankDao.java
  21. 3 3
      samples/xml/tutorial/src/main/java/bigbank/BankService.java
  22. 3 3
      web/src/main/java/org/springframework/security/web/access/WebInvocationPrivilegeEvaluator.java
  23. 2 2
      web/src/main/java/org/springframework/security/web/servletapi/HttpServletRequestFactory.java

+ 1 - 1
core/src/main/java/org/springframework/security/access/annotation/Secured.java

@@ -55,5 +55,5 @@ public @interface Secured {
 	 *
 	 * @return String[] The secure method attributes
 	 */
-	public String[] value();
+	String[] value();
 }

+ 1 - 1
core/src/main/java/org/springframework/security/access/hierarchicalroles/RoleHierarchy.java

@@ -40,7 +40,7 @@ public interface RoleHierarchy {
 	 * @param authorities - List of the directly assigned authorities.
 	 * @return List of all reachable authorities given the assigned authorities.
 	 */
-	public Collection<? extends GrantedAuthority> getReachableGrantedAuthorities(
+	Collection<? extends GrantedAuthority> getReachableGrantedAuthorities(
 			Collection<? extends GrantedAuthority> authorities);
 
 }

+ 1 - 1
core/src/main/java/org/springframework/security/access/method/MethodSecurityMetadataSource.java

@@ -29,5 +29,5 @@ import org.springframework.security.access.SecurityMetadataSource;
  * @author Ben Alex
  */
 public interface MethodSecurityMetadataSource extends SecurityMetadataSource {
-	public Collection<ConfigAttribute> getAttributes(Method method, Class<?> targetClass);
+	Collection<ConfigAttribute> getAttributes(Method method, Class<?> targetClass);
 }

+ 1 - 1
core/src/main/java/org/springframework/security/access/prepost/PostAuthorize.java

@@ -38,5 +38,5 @@ public @interface PostAuthorize {
 	 * @return the Spring-EL expression to be evaluated after invoking the protected
 	 * method
 	 */
-	public String value();
+	String value();
 }

+ 1 - 1
core/src/main/java/org/springframework/security/access/prepost/PostFilter.java

@@ -38,5 +38,5 @@ public @interface PostFilter {
 	 * @return the Spring-EL expression to be evaluated after invoking the protected
 	 * method
 	 */
-	public String value();
+	String value();
 }

+ 2 - 2
core/src/main/java/org/springframework/security/access/prepost/PreFilter.java

@@ -50,12 +50,12 @@ public @interface PreFilter {
 	 * @return the Spring-EL expression to be evaluated before invoking the protected
 	 * method
 	 */
-	public String value();
+	String value();
 
 	/**
 	 * @return the name of the parameter which should be filtered (must be a non-null
 	 * collection instance) If the method contains a single collection argument, then this
 	 * attribute can be omitted.
 	 */
-	public String filterTarget() default "";
+	String filterTarget() default "";
 }

+ 3 - 3
core/src/main/java/org/springframework/security/core/ComparableVersion.java

@@ -92,9 +92,9 @@ class ComparableVersion implements Comparable<ComparableVersion> {
 	private ListItem items;
 
 	private interface Item {
-		final int INTEGER_ITEM = 0;
-		final int STRING_ITEM = 1;
-		final int LIST_ITEM = 2;
+		int INTEGER_ITEM = 0;
+		int STRING_ITEM = 1;
+		int LIST_ITEM = 2;
 
 		int compareTo(Item item);
 

+ 1 - 1
core/src/main/java/org/springframework/security/core/authority/mapping/Attributes2GrantedAuthoritiesMapper.java

@@ -37,6 +37,6 @@ public interface Attributes2GrantedAuthoritiesMapper {
 	 * @param attributes the attributes to be mapped
 	 * @return the collection of authorities created from the attributes
 	 */
-	public Collection<? extends GrantedAuthority> getGrantedAuthorities(
+	Collection<? extends GrantedAuthority> getGrantedAuthorities(
 			Collection<String> attributes);
 }

+ 6 - 12
docs/manual/src/docs/asciidoc/_includes/servlet/preface/java-configuration.adoc

@@ -1165,14 +1165,11 @@ These will be passed to the AccessDecisionManager for it to make the actual deci
 ----
 public interface BankService {
 
-@Secured("IS_AUTHENTICATED_ANONYMOUSLY")
-public Account readAccount(Long id);
+@Secured("IS_AUTHENTICATED_ANONYMOUSLY") Account readAccount(Long id);
 
-@Secured("IS_AUTHENTICATED_ANONYMOUSLY")
-public Account[] findAccounts();
+@Secured("IS_AUTHENTICATED_ANONYMOUSLY") Account[] findAccounts();
 
-@Secured("ROLE_TELLER")
-public Account post(Account account, double amount);
+@Secured("ROLE_TELLER") Account post(Account account, double amount);
 }
 ----
 
@@ -1203,14 +1200,11 @@ and the equivalent Java code would be
 ----
 public interface BankService {
 
-@PreAuthorize("isAnonymous()")
-public Account readAccount(Long id);
+@PreAuthorize("isAnonymous()") Account readAccount(Long id);
 
-@PreAuthorize("isAnonymous()")
-public Account[] findAccounts();
+@PreAuthorize("isAnonymous()") Account[] findAccounts();
 
-@PreAuthorize("hasAuthority('ROLE_TELLER')")
-public Account post(Account account, double amount);
+@PreAuthorize("hasAuthority('ROLE_TELLER')") Account post(Account account, double amount);
 }
 ----
 

+ 6 - 12
docs/manual/src/docs/asciidoc/_includes/servlet/preface/namespace.adoc

@@ -763,14 +763,11 @@ These will be passed to the `AccessDecisionManager` for it to make the actual de
 ----
 public interface BankService {
 
-@Secured("IS_AUTHENTICATED_ANONYMOUSLY")
-public Account readAccount(Long id);
+@Secured("IS_AUTHENTICATED_ANONYMOUSLY") Account readAccount(Long id);
 
-@Secured("IS_AUTHENTICATED_ANONYMOUSLY")
-public Account[] findAccounts();
+@Secured("IS_AUTHENTICATED_ANONYMOUSLY") Account[] findAccounts();
 
-@Secured("ROLE_TELLER")
-public Account post(Account account, double amount);
+@Secured("ROLE_TELLER") Account post(Account account, double amount);
 }
 ----
 
@@ -795,14 +792,11 @@ and the equivalent Java code would be
 ----
 public interface BankService {
 
-@PreAuthorize("isAnonymous()")
-public Account readAccount(Long id);
+@PreAuthorize("isAnonymous()") Account readAccount(Long id);
 
-@PreAuthorize("isAnonymous()")
-public Account[] findAccounts();
+@PreAuthorize("isAnonymous()") Account[] findAccounts();
 
-@PreAuthorize("hasAuthority('ROLE_TELLER')")
-public Account post(Account account, double amount);
+@PreAuthorize("hasAuthority('ROLE_TELLER')") Account post(Account account, double amount);
 }
 ----
 

+ 1 - 1
itest/context/src/main/java/org/springframework/security/integration/UserRepository.java

@@ -17,6 +17,6 @@ package org.springframework.security.integration;
 
 public interface UserRepository {
 
-	public void doSomething();
+	void doSomething();
 
 }

+ 1 - 1
itest/context/src/main/java/org/springframework/security/integration/python/TestService.java

@@ -20,6 +20,6 @@ import org.springframework.security.access.prepost.PreAuthorize;
 public interface TestService {
 
 	@PreAuthorize("someMethod.py")
-	public void someMethod();
+	void someMethod();
 
 }

+ 3 - 3
openid/src/main/java/org/springframework/security/openid/OpenIDConsumer.java

@@ -36,10 +36,10 @@ public interface OpenIDConsumer {
 	 * @return String URI to redirect user to for authentication
 	 * @throws OpenIDConsumerException if anything bad happens
 	 */
-	public String beginConsumption(HttpServletRequest req, String claimedIdentity,
-			String returnToUrl, String realm) throws OpenIDConsumerException;
+	String beginConsumption(HttpServletRequest req, String claimedIdentity,
+							String returnToUrl, String realm) throws OpenIDConsumerException;
 
-	public OpenIDAuthenticationToken endConsumption(HttpServletRequest req)
+	OpenIDAuthenticationToken endConsumption(HttpServletRequest req)
 			throws OpenIDConsumerException;
 
 }

+ 3 - 3
remoting/src/main/java/org/springframework/security/remoting/dns/DnsResolver.java

@@ -33,7 +33,7 @@ public interface DnsResolver {
 	 * @throws DnsEntryNotFoundException No record found
 	 * @throws DnsLookupException Unknown DNS error
 	 */
-	public String resolveIpAddress(String hostname) throws DnsEntryNotFoundException,
+	String resolveIpAddress(String hostname) throws DnsEntryNotFoundException,
 			DnsLookupException;
 
 	/**
@@ -65,7 +65,7 @@ public interface DnsResolver {
 	 * @throws DnsEntryNotFoundException No record found
 	 * @throws DnsLookupException Unknown DNS error
 	 */
-	public String resolveServiceEntry(String serviceType, String domain)
+	String resolveServiceEntry(String serviceType, String domain)
 			throws DnsEntryNotFoundException, DnsLookupException;
 
 	/**
@@ -80,7 +80,7 @@ public interface DnsResolver {
 	 * @see #resolveServiceEntry(String, String)
 	 * @see #resolveIpAddress(String)
 	 */
-	public String resolveServiceIpAddress(String serviceType, String domain)
+	String resolveServiceIpAddress(String serviceType, String domain)
 			throws DnsEntryNotFoundException, DnsLookupException;
 
 }

+ 1 - 1
remoting/src/main/java/org/springframework/security/remoting/dns/InitialContextFactory.java

@@ -34,6 +34,6 @@ public interface InitialContextFactory {
 	 * Must return a DirContext which can be used for DNS queries
 	 * @return JNDI DirContext
 	 */
-	public DirContext getCtx();
+	DirContext getCtx();
 
 }

+ 7 - 7
samples/xml/contacts/src/main/java/sample/contact/ContactDao.java

@@ -27,17 +27,17 @@ public interface ContactDao {
 	// ~ Methods
 	// ========================================================================================================
 
-	public void create(Contact contact);
+	void create(Contact contact);
 
-	public void delete(Long contactId);
+	void delete(Long contactId);
 
-	public List<Contact> findAll();
+	List<Contact> findAll();
 
-	public List<String> findAllPrincipals();
+	List<String> findAllPrincipals();
 
-	public List<String> findAllRoles();
+	List<String> findAllRoles();
 
-	public Contact getById(Long id);
+	Contact getById(Long id);
 
-	public void update(Contact contact);
+	void update(Contact contact);
 }

+ 8 - 8
samples/xml/contacts/src/main/java/sample/contact/ContactManager.java

@@ -31,27 +31,27 @@ public interface ContactManager {
 	// ~ Methods
 	// ========================================================================================================
 	@PreAuthorize("hasPermission(#contact, admin)")
-	public void addPermission(Contact contact, Sid recipient, Permission permission);
+	void addPermission(Contact contact, Sid recipient, Permission permission);
 
 	@PreAuthorize("hasPermission(#contact, admin)")
-	public void deletePermission(Contact contact, Sid recipient, Permission permission);
+	void deletePermission(Contact contact, Sid recipient, Permission permission);
 
 	@PreAuthorize("hasRole('ROLE_USER')")
-	public void create(Contact contact);
+	void create(Contact contact);
 
 	@PreAuthorize("hasPermission(#contact, 'delete') or hasPermission(#contact, admin)")
-	public void delete(Contact contact);
+	void delete(Contact contact);
 
 	@PreAuthorize("hasRole('ROLE_USER')")
 	@PostFilter("hasPermission(filterObject, 'read') or hasPermission(filterObject, admin)")
-	public List<Contact> getAll();
+	List<Contact> getAll();
 
 	@PreAuthorize("hasRole('ROLE_USER')")
-	public List<String> getAllRecipients();
+	List<String> getAllRecipients();
 
 	@PreAuthorize("hasPermission(#id, 'sample.contact.Contact', read) or "
 			+ "hasPermission(#id, 'sample.contact.Contact', admin)")
-	public Contact getById(Long id);
+	Contact getById(Long id);
 
-	public Contact getRandomContact();
+	Contact getRandomContact();
 }

+ 4 - 4
samples/xml/dms/src/main/java/sample/dms/DocumentDao.java

@@ -27,21 +27,21 @@ public interface DocumentDao {
 	 * @param element an unsaved element (the "id" will be updated after method is
 	 * invoked)
 	 */
-	public void create(AbstractElement element);
+	void create(AbstractElement element);
 
 	/**
 	 * Removes a file from the database for the specified element.
 	 *
 	 * @param file the file to remove (cannot be null)
 	 */
-	public void delete(File file);
+	void delete(File file);
 
 	/**
 	 * Modifies a file in the database.
 	 *
 	 * @param file the file to update (cannot be null)
 	 */
-	public void update(File file);
+	void update(File file);
 
 	/**
 	 * Locates elements in the database which appear under the presented directory
@@ -51,5 +51,5 @@ public interface DocumentDao {
 	 * @return zero or more elements in the directory (an empty array may be returned -
 	 * never null)
 	 */
-	public AbstractElement[] findElements(Directory directory);
+	AbstractElement[] findElements(Directory directory);
 }

+ 1 - 1
samples/xml/dms/src/main/java/sample/dms/secured/SecureDocumentDao.java

@@ -27,5 +27,5 @@ public interface SecureDocumentDao extends DocumentDao {
 	/**
 	 * @return all the usernames existing in the system.
 	 */
-	public String[] getUsers();
+	String[] getUsers();
 }

+ 3 - 3
samples/xml/tutorial/src/main/java/bigbank/BankDao.java

@@ -16,9 +16,9 @@
 package bigbank;
 
 public interface BankDao {
-	public Account readAccount(Long id);
+	Account readAccount(Long id);
 
-	public void createOrUpdateAccount(Account account);
+	void createOrUpdateAccount(Account account);
 
-	public Account[] findAccounts();
+	Account[] findAccounts();
 }

+ 3 - 3
samples/xml/tutorial/src/main/java/bigbank/BankService.java

@@ -19,11 +19,11 @@ import org.springframework.security.access.prepost.PreAuthorize;
 
 public interface BankService {
 
-	public Account readAccount(Long id);
+	Account readAccount(Long id);
 
-	public Account[] findAccounts();
+	Account[] findAccounts();
 
 	@PreAuthorize("hasRole('supervisor') or "
 			+ "hasRole('teller') and (#account.balance + #amount >= -#account.overdraft)")
-	public Account post(Account account, double amount);
+	Account post(Account account, double amount);
 }

+ 3 - 3
web/src/main/java/org/springframework/security/web/access/WebInvocationPrivilegeEvaluator.java

@@ -33,7 +33,7 @@ public interface WebInvocationPrivilegeEvaluator {
 	 * @param uri the URI excluding the context path (a default context path setting will
 	 * be used)
 	 */
-	public boolean isAllowed(String uri, Authentication authentication);
+	boolean isAllowed(String uri, Authentication authentication);
 
 	/**
 	 * Determines whether the user represented by the supplied <tt>Authentication</tt>
@@ -52,6 +52,6 @@ public interface WebInvocationPrivilegeEvaluator {
 	 * be used in evaluation whether access should be granted.
 	 * @return true if access is allowed, false if denied
 	 */
-	public boolean isAllowed(String contextPath, String uri, String method,
-			Authentication authentication);
+	boolean isAllowed(String contextPath, String uri, String method,
+					  Authentication authentication);
 }

+ 2 - 2
web/src/main/java/org/springframework/security/web/servletapi/HttpServletRequestFactory.java

@@ -34,6 +34,6 @@ interface HttpServletRequestFactory {
 	 * @param response the original {@link HttpServletResponse}. Cannot be null.
 	 * @return a non-null HttpServletRequest
 	 */
-	public HttpServletRequest create(HttpServletRequest request,
-			HttpServletResponse response);
+	HttpServletRequest create(HttpServletRequest request,
+							  HttpServletResponse response);
 }