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);
|
||||
|
||||
Reference in New Issue
Block a user