Cleanup Code Style Issues

Cleanup Code Style Issues
This commit is contained in:
Rob Winch
2019-08-12 13:06:49 -05:00
committed by GitHub
172 changed files with 288 additions and 306 deletions

View File

@@ -191,7 +191,7 @@ class UserConfig extends WebSecurityConfigurerAdapter {
class IntrospectEndpoint {
TokenStore tokenStore;
public IntrospectEndpoint(TokenStore tokenStore) {
IntrospectEndpoint(TokenStore tokenStore) {
this.tokenStore = tokenStore;
}
@@ -226,7 +226,7 @@ class IntrospectEndpoint {
class JwkSetEndpoint {
KeyPair keyPair;
public JwkSetEndpoint(KeyPair keyPair) {
JwkSetEndpoint(KeyPair keyPair) {
this.keyPair = keyPair;
}

View File

@@ -84,7 +84,7 @@ public class OAuth2ResourceServerApplicationITests {
private static class BearerTokenRequestPostProcessor implements RequestPostProcessor {
private String token;
public BearerTokenRequestPostProcessor(String token) {
BearerTokenRequestPostProcessor(String token) {
this.token = token;
}

View File

@@ -132,7 +132,7 @@ public class OAuth2ResourceServerApplicationITests {
private static class BearerTokenRequestPostProcessor implements RequestPostProcessor {
private String token;
public BearerTokenRequestPostProcessor(String token) {
BearerTokenRequestPostProcessor(String token) {
this.token = token;
}

View File

@@ -84,7 +84,7 @@ public class OAuth2ResourceServerApplicationITests {
private static class BearerTokenRequestPostProcessor implements RequestPostProcessor {
private String token;
public BearerTokenRequestPostProcessor(String token) {
BearerTokenRequestPostProcessor(String token) {
this.token = token;
}

View File

@@ -84,7 +84,7 @@ public class OAuth2ResourceServerApplicationITests {
private static class BearerTokenRequestPostProcessor implements RequestPostProcessor {
private String token;
public BearerTokenRequestPostProcessor(String token) {
BearerTokenRequestPostProcessor(String token) {
this.token = token;
}

View File

@@ -107,7 +107,7 @@ public class OAuth2ResourceServerApplicationITests {
private static class BearerTokenRequestPostProcessor implements RequestPostProcessor {
private String token;
public BearerTokenRequestPostProcessor(String token) {
BearerTokenRequestPostProcessor(String token) {
this.token = token;
}

View File

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

View File

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

View File

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

View File

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

View File

@@ -32,7 +32,7 @@ public class SecurePage {
public static LoginPage to(WebDriver driver, int port) {
driver.get("http://localhost:" + port + "/secure");
return PageFactory.initElements(driver, LoginPage.class);
};
}
private final WebDriver webDriver;

View File

@@ -94,7 +94,7 @@ public class UsernameEqualsPasswordLoginModule implements LoginModule {
private static class UsernamePrincipal implements Principal, Serializable {
private final String username;
public UsernamePrincipal(String username) {
UsernamePrincipal(String username) {
this.username = username;
}

View File

@@ -32,7 +32,7 @@ public class SecurePage {
public static LoginPage to(WebDriver driver, int port) {
driver.get("http://localhost:" + port + "/secure");
return PageFactory.initElements(driver, LoginPage.class);
};
}
private final WebDriver webDriver;

View File

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

View File

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