Some changes that are possible in Java language level 7 and 8. (#1007)

This commit is contained in:
Koen De Groote authored and Rob Bygrave committed 2017-04-22 15:43:56 +12:00
1 parent bdd7884f42
commit 8432f7b0d5
7 files changed
+12 -12

No files matched your search

@@ -23,19 +23,19 @@ public class SortAutoTuneDocument {
ProfileDiff profileDiff = document.getProfileDiff();
if (profileDiff != null) {
Collections.sort(profileDiff.getOrigin(), NAME_KEY_SORT);
profileDiff.getOrigin().sort(NAME_KEY_SORT);
}
ProfileNew profileNew = document.getProfileNew();
if (profileNew != null) {
Collections.sort(profileNew.getOrigin(), NAME_KEY_SORT);
profileNew.getOrigin().sort(NAME_KEY_SORT);
}
ProfileEmpty profileEmpty = document.getProfileEmpty();
if (profileEmpty != null) {
Collections.sort(profileEmpty.getOrigin(), KEY_SORT);
profileEmpty.getOrigin().sort(KEY_SORT);
}
List<Origin> origins = document.getOrigin();
if (!origins.isEmpty()) {
Collections.sort(origins, NAME_KEY_SORT);
origins.sort(NAME_KEY_SORT);
}
}
@@ -1992,7 +1992,7 @@ public class BeanDescriptor<T> implements MetaBeanInfo, BeanType<T> {
public void sort(List<T> list, String sortByClause) {
ElComparator<T> comparator = getElComparator(sortByClause);
Collections.sort(list, comparator);
list.sort(comparator);
}
public ElComparator<T> getElComparator(String propNameOrSortBy) {
@@ -328,7 +328,7 @@ public class BeanDescriptorManager implements BeanDescriptorMap {
readEntityRelationships();
List<BeanDescriptor<?>> list = new ArrayList<>(descMap.values());
Collections.sort(list, beanDescComparator);
list.sort(beanDescComparator);
immutableDescriptorList = Collections.unmodifiableList(list);
initialiseAll();
@@ -635,7 +635,7 @@ public class DeployBeanDescriptor<T> {
public void sortProperties() {
ArrayList<DeployBeanProperty> list = new ArrayList<>(propMap.values());
Collections.sort(list, PROP_ORDER);
list.sort(PROP_ORDER);
propMap = new LinkedHashMap<>(list.size());
for (DeployBeanProperty aList : list) {
@@ -218,8 +218,8 @@ public abstract class AnnotationBase {
if (annotationType == null) {
return null;
}
Set<A> ret = new LinkedHashSet<A>();
findMetaAnnotations(annotatedElement, annotationType, ret, new HashSet<Annotation>());
Set<A> ret = new LinkedHashSet<>();
findMetaAnnotations(annotatedElement, annotationType, ret, new HashSet<>());
return ret;
}
@@ -264,7 +264,7 @@ public abstract class AnnotationBase {
}
}
private static final ConcurrentMap<Annotation, Method> valueMethods = new ConcurrentHashMap<Annotation, Method>();
private static final ConcurrentMap<Annotation, Method> valueMethods = new ConcurrentHashMap<>();
private static final Method nullMethod = getNullMethod();
@@ -265,7 +265,7 @@ public class CQueryEngine {
List<Version<T>> versions = cquery.readVersions();
// just order in memory rather than use NULLS LAST as that
// is not universally supported, not expect huge list here
Collections.sort(versions, OrderVersionDesc.INSTANCE);
versions.sort(OrderVersionDesc.INSTANCE);
deriveVersionDiffs(versions, request);
if (request.isLogSummary()) {
@@ -46,6 +46,6 @@ public class DJsonBeanReader<T> implements JsonBeanReader<T> {
@Override
public JsonBeanReader<T> forJson(JsonParser moreJson, boolean resetContext) {
return new DJsonBeanReader<T>(desc, readJson.forJson(moreJson, resetContext));
return new DJsonBeanReader<>(desc, readJson.forJson(moreJson, resetContext));
}
}