Unnecessary interface modifier

This commit is contained in:
Lars Grefer 2019-08-09 00:42:35 +02:00
parent 40bee457f9
commit d9c1f03b84
23 changed files with 63 additions and 75 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -16,9 +16,9 @@
package bigbank; package bigbank;
public interface BankDao { 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();
} }

View File

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

View File

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

View File

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