Use diamond type
This commit is contained in:
@@ -71,7 +71,7 @@ public final class AdminPermissionController implements MessageSourceAware {
|
||||
Contact contact = contactManager.getById(Long.valueOf(contactId));
|
||||
Acl acl = aclService.readAclById(new ObjectIdentityImpl(contact));
|
||||
|
||||
Map<String, Object> model = new HashMap<String, Object>();
|
||||
Map<String, Object> model = new HashMap<>();
|
||||
model.put("contact", contact);
|
||||
model.put("acl", acl);
|
||||
|
||||
@@ -89,7 +89,7 @@ public final class AdminPermissionController implements MessageSourceAware {
|
||||
AddPermission addPermission = new AddPermission();
|
||||
addPermission.setContact(contact);
|
||||
|
||||
Map<String, Object> model = new HashMap<String, Object>();
|
||||
Map<String, Object> model = new HashMap<>();
|
||||
model.put("addPermission", addPermission);
|
||||
model.put("recipients", listRecipients());
|
||||
model.put("permissions", listPermissions());
|
||||
@@ -151,7 +151,7 @@ public final class AdminPermissionController implements MessageSourceAware {
|
||||
|
||||
contactManager.deletePermission(contact, sidObject, permission);
|
||||
|
||||
Map<String, Object> model = new HashMap<String, Object>();
|
||||
Map<String, Object> model = new HashMap<>();
|
||||
model.put("contact", contact);
|
||||
model.put("sid", sidObject);
|
||||
model.put("permission", permission);
|
||||
@@ -160,7 +160,7 @@ public final class AdminPermissionController implements MessageSourceAware {
|
||||
}
|
||||
|
||||
private Map<Integer, String> listPermissions() {
|
||||
Map<Integer, String> map = new LinkedHashMap<Integer, String>();
|
||||
Map<Integer, String> map = new LinkedHashMap<>();
|
||||
map.put(Integer.valueOf(BasePermission.ADMINISTRATION.getMask()),
|
||||
messages.getMessage("select.administer", "Administer"));
|
||||
map.put(Integer.valueOf(BasePermission.READ.getMask()),
|
||||
@@ -172,7 +172,7 @@ public final class AdminPermissionController implements MessageSourceAware {
|
||||
}
|
||||
|
||||
private Map<String, String> listRecipients() {
|
||||
Map<String, String> map = new LinkedHashMap<String, String>();
|
||||
Map<String, String> map = new LinkedHashMap<>();
|
||||
map.put("", messages.getMessage("select.pleaseSelect", "-- please select --"));
|
||||
|
||||
for (String recipient : contactManager.getAllRecipients()) {
|
||||
|
||||
@@ -84,9 +84,9 @@ public class IndexController {
|
||||
@RequestMapping(value = "/secure/index.htm", method = RequestMethod.GET)
|
||||
public ModelAndView displayUserContacts() {
|
||||
List<Contact> myContactsList = contactManager.getAll();
|
||||
Map<Contact, Boolean> hasDelete = new HashMap<Contact, Boolean>(
|
||||
Map<Contact, Boolean> hasDelete = new HashMap<>(
|
||||
myContactsList.size());
|
||||
Map<Contact, Boolean> hasAdmin = new HashMap<Contact, Boolean>(
|
||||
Map<Contact, Boolean> hasAdmin = new HashMap<>(
|
||||
myContactsList.size());
|
||||
|
||||
Authentication user = SecurityContextHolder.getContext().getAuthentication();
|
||||
@@ -98,7 +98,7 @@ public class IndexController {
|
||||
contact, HAS_ADMIN)));
|
||||
}
|
||||
|
||||
Map<String, Object> model = new HashMap<String, Object>();
|
||||
Map<String, Object> model = new HashMap<>();
|
||||
model.put("contacts", myContactsList);
|
||||
model.put("hasDeletePermission", hasDelete);
|
||||
model.put("hasAdminPermission", hasAdmin);
|
||||
|
||||
@@ -79,7 +79,7 @@ public abstract class AbstractElement {
|
||||
* @return the fully-qualified name of this element, including any parents
|
||||
*/
|
||||
public String getFullName() {
|
||||
List<String> strings = new ArrayList<String>();
|
||||
List<String> strings = new ArrayList<>();
|
||||
AbstractElement currentElement = this;
|
||||
while (currentElement != null) {
|
||||
strings.add(0, currentElement.getName());
|
||||
|
||||
@@ -39,7 +39,7 @@ public class GaeUserAuthentication implements Authentication {
|
||||
}
|
||||
|
||||
public Collection<GrantedAuthority> getAuthorities() {
|
||||
return new HashSet<GrantedAuthority>(principal.getAuthorities());
|
||||
return new HashSet<>(principal.getAuthorities());
|
||||
}
|
||||
|
||||
public Object getCredentials() {
|
||||
|
||||
@@ -30,7 +30,7 @@ public class InMemoryUserRegistry implements UserRegistry {
|
||||
private final Logger logger = LoggerFactory.getLogger(getClass());
|
||||
|
||||
private final Map<String, GaeUser> users = Collections
|
||||
.synchronizedMap(new HashMap<String, GaeUser>());
|
||||
.synchronizedMap(new HashMap<>());
|
||||
|
||||
public GaeUser findUser(String userId) {
|
||||
return users.get(userId);
|
||||
|
||||
+1
-1
@@ -38,7 +38,7 @@ import org.springframework.security.openid.OpenIDAuthenticationToken;
|
||||
public class CustomUserDetailsService implements UserDetailsService,
|
||||
AuthenticationUserDetailsService<OpenIDAuthenticationToken> {
|
||||
|
||||
private final Map<String, CustomUserDetails> registeredUsers = new HashMap<String, CustomUserDetails>();
|
||||
private final Map<String, CustomUserDetails> registeredUsers = new HashMap<>();
|
||||
|
||||
private static final List<GrantedAuthority> DEFAULT_AUTHORITIES = AuthorityUtils
|
||||
.createAuthorityList("ROLE_USER");
|
||||
|
||||
@@ -20,7 +20,7 @@ import java.util.Map;
|
||||
|
||||
public class BankDaoStub implements BankDao {
|
||||
private long id = 0;
|
||||
private final Map<Long, Account> accounts = new HashMap<Long, Account>();
|
||||
private final Map<Long, Account> accounts = new HashMap<>();
|
||||
|
||||
public void createOrUpdateAccount(Account account) {
|
||||
if (account.getId() == -1) {
|
||||
|
||||
Reference in New Issue
Block a user