Apply "type inference for generic instance creation" Java 7 feature

Since GWT 2.6.0 support for Java 7 is added. Simplify creation of
classes in GWT's client code.

Change-Id: I08ff2c189d2874a6b957072912912e4a6089cdd1
This commit is contained in:
David Ostrovsky
2014-01-19 17:39:10 +01:00
parent dd34a05fdf
commit 6ee971b373
74 changed files with 194 additions and 214 deletions

View File

@@ -145,7 +145,7 @@ public class ProjectAccessScreen extends ProjectScreen {
private void displayReadOnly(ProjectAccess access) {
this.access = access;
Map<String, String> allCapabilities = new HashMap<String, String>();
Map<String, String> allCapabilities = new HashMap<>();
for (CapabilityInfo c : Natives.asList(capabilityMap.values())) {
allCapabilities.put(c.id(), c.name());
}
@@ -233,17 +233,16 @@ public class ProjectAccessScreen extends ProjectScreen {
ProjectAccess newAccess) {
final List<AccessSection> wantedSections =
mergeSections(removeEmptyPermissionsAndSections(wantedAccess.getLocal()));
final HashSet<AccessSection> same =
new HashSet<AccessSection>(wantedSections);
final HashSet<AccessSection> same = new HashSet<>(wantedSections);
final HashSet<AccessSection> different =
new HashSet<AccessSection>(wantedSections.size()
new HashSet<>(wantedSections.size()
+ newAccess.getLocal().size());
different.addAll(wantedSections);
different.addAll(newAccess.getLocal());
same.retainAll(newAccess.getLocal());
different.removeAll(same);
final Set<String> differentNames = new HashSet<String>();
final Set<String> differentNames = new HashSet<>();
for (final AccessSection s : different) {
differentNames.add(s.getName());
}