Remove superfluous comments
Use '^\s+//\ \~\ .*$' and '^\s+//\ ============+$' regular expression searches to remove superfluous comments. Prior to this commit, many classes would have comments to indicate blocks of code (such as constructors/methods/instance fields). These added a lot of noise and weren't all that helpful, especially given the outline views available in most modern IDEs. Issue gh-8945
This commit is contained in:
@@ -23,15 +23,12 @@ import org.springframework.security.acls.domain.BasePermission;
|
||||
* @author Ben Alex
|
||||
*/
|
||||
public class AddPermission {
|
||||
// ~ Instance fields
|
||||
// ================================================================================================
|
||||
|
||||
|
||||
public Contact contact;
|
||||
public Integer permission = BasePermission.READ.getMask();
|
||||
public String recipient;
|
||||
|
||||
// ~ Methods
|
||||
// ========================================================================================================
|
||||
|
||||
public Contact getContact() {
|
||||
return contact;
|
||||
|
||||
@@ -27,8 +27,7 @@ import org.springframework.validation.Validator;
|
||||
* @author Ben Alex
|
||||
*/
|
||||
public class AddPermissionValidator implements Validator {
|
||||
// ~ Methods
|
||||
// ========================================================================================================
|
||||
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public boolean supports(Class clazz) {
|
||||
|
||||
@@ -36,20 +36,15 @@ import org.springframework.util.StopWatch;
|
||||
* @author Ben Alex
|
||||
*/
|
||||
public class ClientApplication {
|
||||
// ~ Instance fields
|
||||
// ================================================================================================
|
||||
|
||||
|
||||
private final ListableBeanFactory beanFactory;
|
||||
|
||||
// ~ Constructors
|
||||
// ===================================================================================================
|
||||
|
||||
public ClientApplication(ListableBeanFactory beanFactory) {
|
||||
this.beanFactory = beanFactory;
|
||||
}
|
||||
|
||||
// ~ Methods
|
||||
// ========================================================================================================
|
||||
|
||||
public void invokeContactManager(Authentication authentication, int nrOfCalls) {
|
||||
StopWatch stopWatch = new StopWatch(nrOfCalls + " ContactManager call(s)");
|
||||
|
||||
@@ -24,15 +24,12 @@ import java.io.Serializable;
|
||||
* @author Ben Alex
|
||||
*/
|
||||
public class Contact implements Serializable {
|
||||
// ~ Instance fields
|
||||
// ================================================================================================
|
||||
|
||||
|
||||
private Long id;
|
||||
private String email;
|
||||
private String name;
|
||||
|
||||
// ~ Constructors
|
||||
// ===================================================================================================
|
||||
|
||||
public Contact(String name, String email) {
|
||||
this.name = name;
|
||||
@@ -42,8 +39,6 @@ public class Contact implements Serializable {
|
||||
public Contact() {
|
||||
}
|
||||
|
||||
// ~ Methods
|
||||
// ========================================================================================================
|
||||
|
||||
/**
|
||||
* @return Returns the email.
|
||||
|
||||
@@ -24,8 +24,7 @@ import java.util.List;
|
||||
* @author Ben Alex
|
||||
*/
|
||||
public interface ContactDao {
|
||||
// ~ Methods
|
||||
// ========================================================================================================
|
||||
|
||||
|
||||
void create(Contact contact);
|
||||
|
||||
|
||||
@@ -30,8 +30,6 @@ import org.springframework.jdbc.core.support.JdbcDaoSupport;
|
||||
*/
|
||||
public class ContactDaoSpring extends JdbcDaoSupport implements ContactDao {
|
||||
|
||||
// ~ Methods
|
||||
// ========================================================================================================
|
||||
|
||||
public void create(final Contact contact) {
|
||||
getJdbcTemplate().update("insert into contacts values (?, ?, ?)",
|
||||
|
||||
@@ -28,8 +28,7 @@ import java.util.List;
|
||||
* @author Ben Alex
|
||||
*/
|
||||
public interface ContactManager {
|
||||
// ~ Methods
|
||||
// ========================================================================================================
|
||||
|
||||
@PreAuthorize("hasPermission(#contact, admin)")
|
||||
void addPermission(Contact contact, Sid recipient, Permission permission);
|
||||
|
||||
|
||||
@@ -49,15 +49,12 @@ import java.util.Random;
|
||||
@Transactional
|
||||
public class ContactManagerBackend extends ApplicationObjectSupport implements
|
||||
ContactManager, InitializingBean {
|
||||
// ~ Instance fields
|
||||
// ================================================================================================
|
||||
|
||||
|
||||
private ContactDao contactDao;
|
||||
private MutableAclService mutableAclService;
|
||||
private int counter = 1000;
|
||||
|
||||
// ~ Methods
|
||||
// ========================================================================================================
|
||||
|
||||
public void afterPropertiesSet() {
|
||||
Assert.notNull(contactDao, "contactDao required");
|
||||
|
||||
@@ -43,8 +43,7 @@ import org.springframework.util.Assert;
|
||||
* @author Ben Alex
|
||||
*/
|
||||
public class DataSourcePopulator implements InitializingBean {
|
||||
// ~ Instance fields
|
||||
// ================================================================================================
|
||||
|
||||
|
||||
JdbcTemplate template;
|
||||
private MutableAclService mutableAclService;
|
||||
@@ -60,8 +59,6 @@ public class DataSourcePopulator implements InitializingBean {
|
||||
"Parklin", "Findlay", "Robinson", "Giugni", "Lang", "Chi", "Carmichael" };
|
||||
private int createEntities = 50;
|
||||
|
||||
// ~ Methods
|
||||
// ========================================================================================================
|
||||
|
||||
public void afterPropertiesSet() {
|
||||
Assert.notNull(mutableAclService, "mutableAclService required");
|
||||
|
||||
@@ -44,16 +44,12 @@ public class IndexController {
|
||||
BasePermission.DELETE, BasePermission.ADMINISTRATION };
|
||||
private final static Permission[] HAS_ADMIN = new Permission[] { BasePermission.ADMINISTRATION };
|
||||
|
||||
// ~ Instance fields
|
||||
// ================================================================================================
|
||||
|
||||
@Autowired
|
||||
private ContactManager contactManager;
|
||||
@Autowired
|
||||
private PermissionEvaluator permissionEvaluator;
|
||||
|
||||
// ~ Methods
|
||||
// ========================================================================================================
|
||||
|
||||
/**
|
||||
* The public index page, used for unauthenticated users.
|
||||
|
||||
@@ -22,14 +22,11 @@ package sample.contact;
|
||||
* @author Ben Alex
|
||||
*/
|
||||
public class WebContact {
|
||||
// ~ Instance fields
|
||||
// ================================================================================================
|
||||
|
||||
|
||||
private String email;
|
||||
private String name;
|
||||
|
||||
// ~ Methods
|
||||
// ========================================================================================================
|
||||
|
||||
public String getEmail() {
|
||||
return email;
|
||||
|
||||
@@ -25,8 +25,7 @@ import org.springframework.validation.Validator;
|
||||
* @author Ben Alex
|
||||
*/
|
||||
public class WebContactValidator implements Validator {
|
||||
// ~ Methods
|
||||
// ========================================================================================================
|
||||
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public boolean supports(Class clazz) {
|
||||
|
||||
@@ -44,14 +44,11 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
"/applicationContext-common-business.xml" })
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
public class ContactManagerTests {
|
||||
// ~ Instance fields
|
||||
// ================================================================================================
|
||||
|
||||
|
||||
@Autowired
|
||||
protected ContactManager contactManager;
|
||||
|
||||
// ~ Methods
|
||||
// ========================================================================================================
|
||||
|
||||
void assertContainsContact(long id, List<Contact> contacts) {
|
||||
for (Contact contact : contacts) {
|
||||
|
||||
@@ -34,15 +34,12 @@ import javax.security.auth.spi.LoginModule;
|
||||
* @author Rob Winch
|
||||
*/
|
||||
public class UsernameEqualsPasswordLoginModule implements LoginModule {
|
||||
// ~ Instance fields
|
||||
// ================================================================================================
|
||||
|
||||
|
||||
private String password;
|
||||
private String username;
|
||||
private Subject subject;
|
||||
|
||||
// ~ Methods
|
||||
// ========================================================================================================
|
||||
|
||||
@Override
|
||||
public boolean abort() {
|
||||
|
||||
Reference in New Issue
Block a user