Browse Source

Unnecessary interface modifier

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

2
core/src/main/java/org/springframework/security/access/annotation/Secured.java

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

2
core/src/main/java/org/springframework/security/access/hierarchicalroles/RoleHierarchy.java

@ -40,7 +40,7 @@ public interface RoleHierarchy { @@ -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);
}

2
core/src/main/java/org/springframework/security/access/method/MethodSecurityMetadataSource.java

@ -29,5 +29,5 @@ import org.springframework.security.access.SecurityMetadataSource; @@ -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);
}

2
core/src/main/java/org/springframework/security/access/prepost/PostAuthorize.java

@ -38,5 +38,5 @@ public @interface PostAuthorize { @@ -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();
}

2
core/src/main/java/org/springframework/security/access/prepost/PostFilter.java

@ -38,5 +38,5 @@ public @interface PostFilter { @@ -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();
}

4
core/src/main/java/org/springframework/security/access/prepost/PreFilter.java

@ -50,12 +50,12 @@ public @interface PreFilter { @@ -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 "";
}

6
core/src/main/java/org/springframework/security/core/ComparableVersion.java

@ -92,9 +92,9 @@ class ComparableVersion implements Comparable<ComparableVersion> { @@ -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);

2
core/src/main/java/org/springframework/security/core/authority/mapping/Attributes2GrantedAuthoritiesMapper.java

@ -37,6 +37,6 @@ public interface Attributes2GrantedAuthoritiesMapper { @@ -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);
}

18
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 @@ -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 @@ -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);
}
----

18
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 @@ -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 @@ -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);
}
----

2
itest/context/src/main/java/org/springframework/security/integration/UserRepository.java

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

2
itest/context/src/main/java/org/springframework/security/integration/python/TestService.java

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

6
openid/src/main/java/org/springframework/security/openid/OpenIDConsumer.java

@ -36,10 +36,10 @@ public interface OpenIDConsumer { @@ -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;
}

6
remoting/src/main/java/org/springframework/security/remoting/dns/DnsResolver.java

@ -33,7 +33,7 @@ public interface DnsResolver { @@ -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 { @@ -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 { @@ -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;
}

2
remoting/src/main/java/org/springframework/security/remoting/dns/InitialContextFactory.java

@ -34,6 +34,6 @@ public interface InitialContextFactory { @@ -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();
}

14
samples/xml/contacts/src/main/java/sample/contact/ContactDao.java

@ -27,17 +27,17 @@ public interface ContactDao { @@ -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);
}

16
samples/xml/contacts/src/main/java/sample/contact/ContactManager.java

@ -31,27 +31,27 @@ public interface ContactManager { @@ -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();
}

8
samples/xml/dms/src/main/java/sample/dms/DocumentDao.java

@ -27,21 +27,21 @@ public interface DocumentDao { @@ -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 { @@ -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);
}

2
samples/xml/dms/src/main/java/sample/dms/secured/SecureDocumentDao.java

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

6
samples/xml/tutorial/src/main/java/bigbank/BankDao.java

@ -16,9 +16,9 @@ @@ -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();
}

6
samples/xml/tutorial/src/main/java/bigbank/BankService.java

@ -19,11 +19,11 @@ import org.springframework.security.access.prepost.PreAuthorize; @@ -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);
}

6
web/src/main/java/org/springframework/security/web/access/WebInvocationPrivilegeEvaluator.java

@ -33,7 +33,7 @@ public interface WebInvocationPrivilegeEvaluator { @@ -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 { @@ -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);
}

4
web/src/main/java/org/springframework/security/web/servletapi/HttpServletRequestFactory.java

@ -34,6 +34,6 @@ interface HttpServletRequestFactory { @@ -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);
}

Loading…
Cancel
Save