summaryrefslogtreecommitdiffstats
path: root/client-compiler
diff options
context:
space:
mode:
authorArtur Signell <artur@vaadin.com>2016-09-05 12:33:39 +0300
committerJohannes Dahlström <johannesd@vaadin.com>2016-09-05 10:02:48 +0000
commit504b3c4c65c6a2ccfeeb1501eff7a29f5a3dbec3 (patch)
treee65c1813439a25bbab6c81e71c27ba8ccf69970b /client-compiler
parent6941d683eb15a8ae10e0d302bcf9608be8825f8a (diff)
downloadvaadin-framework-504b3c4c65c6a2ccfeeb1501eff7a29f5a3dbec3.tar.gz
vaadin-framework-504b3c4c65c6a2ccfeeb1501eff7a29f5a3dbec3.zip
Use diamond operator where it can be used
Does not modify compatibility packages to keep to closer to Vaadin 7.7 Change-Id: Ic9c4944eb90218290545a04ecd7455eb63910012
Diffstat (limited to 'client-compiler')
-rw-r--r--client-compiler/src/main/java/com/vaadin/sass/linker/SassLinker.java2
-rw-r--r--client-compiler/src/main/java/com/vaadin/server/widgetsetutils/ConnectorBundleLoaderFactory.java20
-rw-r--r--client-compiler/src/main/java/com/vaadin/server/widgetsetutils/metadata/ConnectorBundle.java50
-rw-r--r--client-compiler/src/main/java/com/vaadin/server/widgetsetutils/metadata/FieldProperty.java6
-rw-r--r--client-compiler/src/main/java/com/vaadin/server/widgetsetutils/metadata/MethodProperty.java6
-rw-r--r--client-compiler/src/main/java/com/vaadin/tools/CvalAddonsChecker.java2
6 files changed, 43 insertions, 43 deletions
diff --git a/client-compiler/src/main/java/com/vaadin/sass/linker/SassLinker.java b/client-compiler/src/main/java/com/vaadin/sass/linker/SassLinker.java
index df87cbcba1..e411b27d00 100644
--- a/client-compiler/src/main/java/com/vaadin/sass/linker/SassLinker.java
+++ b/client-compiler/src/main/java/com/vaadin/sass/linker/SassLinker.java
@@ -63,7 +63,7 @@ public class SassLinker extends AbstractLinker {
ArtifactSet toReturn = new ArtifactSet(artifacts);
// The temporary scss files provided from the artefacts
- List<FileInfo> scssFiles = new ArrayList<FileInfo>();
+ List<FileInfo> scssFiles = new ArrayList<>();
// The public files are provided as inputstream, but the compiler
// needs real files, as they can contain references to other
diff --git a/client-compiler/src/main/java/com/vaadin/server/widgetsetutils/ConnectorBundleLoaderFactory.java b/client-compiler/src/main/java/com/vaadin/server/widgetsetutils/ConnectorBundleLoaderFactory.java
index 50b9bf4b05..7e8da70ac8 100644
--- a/client-compiler/src/main/java/com/vaadin/server/widgetsetutils/ConnectorBundleLoaderFactory.java
+++ b/client-compiler/src/main/java/com/vaadin/server/widgetsetutils/ConnectorBundleLoaderFactory.java
@@ -100,7 +100,7 @@ public class ConnectorBundleLoaderFactory extends Generator {
this.target = target;
this.baseName = baseName;
this.splitSize = splitSize;
- methodNames = new ArrayList<String>();
+ methodNames = new ArrayList<>();
methodNames.add(baseName);
}
@@ -421,13 +421,13 @@ public class ConnectorBundleLoaderFactory extends Generator {
private void detectBadProperties(ConnectorBundle bundle, TreeLogger logger)
throws UnableToCompleteException {
- Map<JClassType, Set<String>> definedProperties = new HashMap<JClassType, Set<String>>();
+ Map<JClassType, Set<String>> definedProperties = new HashMap<>();
for (Property property : bundle.getNeedsProperty()) {
JClassType beanType = property.getBeanType();
Set<String> usedPropertyNames = definedProperties.get(beanType);
if (usedPropertyNames == null) {
- usedPropertyNames = new HashSet<String>();
+ usedPropertyNames = new HashSet<>();
definedProperties.put(beanType, usedPropertyNames);
}
@@ -532,7 +532,7 @@ public class ConnectorBundleLoaderFactory extends Generator {
+ connector.getName());
// Build map to speed up error checking
- HashMap<String, Property> stateProperties = new HashMap<String, Property>();
+ HashMap<String, Property> stateProperties = new HashMap<>();
JClassType stateType = ConnectorBundle
.findInheritedMethod(connector, "getState").getReturnType()
.isClassOrInterface();
@@ -603,7 +603,7 @@ public class ConnectorBundleLoaderFactory extends Generator {
private void writeSuperClasses(SplittingSourceWriter w,
ConnectorBundle bundle) {
- List<JClassType> needsSuperclass = new ArrayList<JClassType>(
+ List<JClassType> needsSuperclass = new ArrayList<>(
bundle.getNeedsSuperclass());
// Emit in hierarchy order to ensure superclass is defined when
// referenced
@@ -1092,7 +1092,7 @@ public class ConnectorBundleLoaderFactory extends Generator {
TypeOracle typeOracle)
throws NotFoundException, UnableToCompleteException {
- Map<LoadStyle, Collection<JClassType>> connectorsByLoadStyle = new HashMap<LoadStyle, Collection<JClassType>>();
+ Map<LoadStyle, Collection<JClassType>> connectorsByLoadStyle = new HashMap<>();
for (LoadStyle loadStyle : LoadStyle.values()) {
connectorsByLoadStyle.put(loadStyle, new ArrayList<JClassType>());
}
@@ -1109,7 +1109,7 @@ public class ConnectorBundleLoaderFactory extends Generator {
}
}
- List<ConnectorBundle> bundles = new ArrayList<ConnectorBundle>();
+ List<ConnectorBundle> bundles = new ArrayList<>();
Collection<TypeVisitor> visitors = getVisitors(typeOracle);
@@ -1187,10 +1187,10 @@ public class ConnectorBundleLoaderFactory extends Generator {
JClassType[] types = serverConnectorType.getSubtypes();
- Map<String, JClassType> mappings = new TreeMap<String, JClassType>();
+ Map<String, JClassType> mappings = new TreeMap<>();
// Keep track of what has happened to avoid logging intermediate state
- Map<JClassType, List<JClassType>> replaced = new TreeMap<JClassType, List<JClassType>>(
+ Map<JClassType, List<JClassType>> replaced = new TreeMap<>(
ConnectorBundle.jClassComparator);
for (JClassType type : types) {
@@ -1229,7 +1229,7 @@ public class ConnectorBundleLoaderFactory extends Generator {
List<JClassType> previousReplacements = replaced
.remove(superclass);
if (previousReplacements == null) {
- previousReplacements = new ArrayList<JClassType>();
+ previousReplacements = new ArrayList<>();
}
previousReplacements.add(superclass);
diff --git a/client-compiler/src/main/java/com/vaadin/server/widgetsetutils/metadata/ConnectorBundle.java b/client-compiler/src/main/java/com/vaadin/server/widgetsetutils/metadata/ConnectorBundle.java
index f26aa14ead..7428c643c9 100644
--- a/client-compiler/src/main/java/com/vaadin/server/widgetsetutils/metadata/ConnectorBundle.java
+++ b/client-compiler/src/main/java/com/vaadin/server/widgetsetutils/metadata/ConnectorBundle.java
@@ -80,10 +80,10 @@ public class ConnectorBundle {
private final Collection<TypeVisitor> visitors;
private final Map<JType, JClassType> customSerializers;
- private final Set<JType> hasSerializeSupport = new HashSet<JType>();
- private final Set<JType> needsSerializeSupport = new HashSet<JType>();
+ private final Set<JType> hasSerializeSupport = new HashSet<>();
+ private final Set<JType> needsSerializeSupport = new HashSet<>();
- private final Map<JType, GeneratedSerializer> serializers = new TreeMap<JType, GeneratedSerializer>(
+ private final Map<JType, GeneratedSerializer> serializers = new TreeMap<>(
new Comparator<JType>() {
@Override
public int compare(JType o1, JType o2) {
@@ -91,32 +91,32 @@ public class ConnectorBundle {
}
});
- private final Map<JClassType, Map<JMethod, Set<MethodAttribute>>> methodAttributes = new TreeMap<JClassType, Map<JMethod, Set<MethodAttribute>>>(
+ private final Map<JClassType, Map<JMethod, Set<MethodAttribute>>> methodAttributes = new TreeMap<>(
jClassComparator);
- private final Set<JClassType> needsSuperClass = new TreeSet<JClassType>(
+ private final Set<JClassType> needsSuperClass = new TreeSet<>(
jClassComparator);
- private final Set<JClassType> needsGwtConstructor = new TreeSet<JClassType>(
+ private final Set<JClassType> needsGwtConstructor = new TreeSet<>(
jClassComparator);
- private final Set<JClassType> visitedTypes = new HashSet<JClassType>();
+ private final Set<JClassType> visitedTypes = new HashSet<>();
- private final Set<JClassType> needsProxySupport = new TreeSet<JClassType>(
+ private final Set<JClassType> needsProxySupport = new TreeSet<>(
jClassComparator);
- private final Map<JClassType, JType> presentationTypes = new TreeMap<JClassType, JType>(
+ private final Map<JClassType, JType> presentationTypes = new TreeMap<>(
jClassComparator);
- private final Map<JClassType, Set<String>> identifiers = new TreeMap<JClassType, Set<String>>(
+ private final Map<JClassType, Set<String>> identifiers = new TreeMap<>(
jClassComparator);
- private final Map<JClassType, Set<JMethod>> needsReturnType = new TreeMap<JClassType, Set<JMethod>>(
+ private final Map<JClassType, Set<JMethod>> needsReturnType = new TreeMap<>(
jClassComparator);
- private final Map<JClassType, Set<JMethod>> needsInvoker = new TreeMap<JClassType, Set<JMethod>>(
+ private final Map<JClassType, Set<JMethod>> needsInvoker = new TreeMap<>(
jClassComparator);
- private final Map<JClassType, Set<JMethod>> needsParamTypes = new TreeMap<JClassType, Set<JMethod>>(
+ private final Map<JClassType, Set<JMethod>> needsParamTypes = new TreeMap<>(
jClassComparator);
- private final Map<JClassType, Set<JMethod>> needsOnStateChange = new TreeMap<JClassType, Set<JMethod>>(
+ private final Map<JClassType, Set<JMethod>> needsOnStateChange = new TreeMap<>(
jClassComparator);
- private final Set<Property> needsProperty = new TreeSet<Property>();
- private final Map<JClassType, Set<Property>> needsDelegateToWidget = new TreeMap<JClassType, Set<Property>>(
+ private final Set<Property> needsProperty = new TreeSet<>();
+ private final Map<JClassType, Set<Property>> needsDelegateToWidget = new TreeMap<>(
jClassComparator);
private ConnectorBundle(String name, ConnectorBundle previousBundle,
@@ -140,7 +140,7 @@ public class ConnectorBundle {
private static Map<JType, JClassType> findCustomSerializers(
TypeOracle oracle) throws NotFoundException {
- Map<JType, JClassType> serializers = new HashMap<JType, JClassType>();
+ Map<JType, JClassType> serializers = new HashMap<>();
JClassType serializerInterface = oracle
.findType(JSONSerializer.class.getName());
@@ -406,7 +406,7 @@ public class ConnectorBundle {
}
public Collection<Property> getProperties(JClassType type) {
- Set<Property> properties = new TreeSet<Property>();
+ Set<Property> properties = new TreeSet<>();
properties.addAll(MethodProperty.findProperties(type));
properties.addAll(FieldProperty.findProperties(type));
@@ -518,7 +518,7 @@ public class ConnectorBundle {
private <K> void addMapping(Map<K, Set<String>> map, K key, String value) {
Set<String> set = map.get(key);
if (set == null) {
- set = new TreeSet<String>();
+ set = new TreeSet<>();
map.put(key, set);
}
set.add(value);
@@ -528,7 +528,7 @@ public class ConnectorBundle {
JMethod value) {
Set<JMethod> set = map.get(key);
if (set == null) {
- set = new TreeSet<JMethod>(jMethodComparator);
+ set = new TreeSet<>(jMethodComparator);
map.put(key, set);
}
set.add(value);
@@ -595,7 +595,7 @@ public class ConnectorBundle {
Map<JMethod, Set<MethodAttribute>> typeData = methodAttributes
.get(type);
if (typeData == null) {
- typeData = new TreeMap<JMethod, Set<MethodAttribute>>(
+ typeData = new TreeMap<>(
jMethodComparator);
methodAttributes.put(type, typeData);
}
@@ -603,14 +603,14 @@ public class ConnectorBundle {
Map<JMethod, Set<MethodAttribute>> methods = methodAttributes
.get(type);
if (methods == null) {
- methods = new TreeMap<JMethod, Set<MethodAttribute>>(
+ methods = new TreeMap<>(
jMethodComparator);
methodAttributes.put(type, methods);
}
Set<MethodAttribute> attributes = methods.get(method);
if (attributes == null) {
- attributes = new TreeSet<MethodAttribute>();
+ attributes = new TreeSet<>();
methods.put(method, attributes);
}
@@ -640,7 +640,7 @@ public class ConnectorBundle {
}
}
- private static Set<Class<?>> frameworkHandledTypes = new LinkedHashSet<Class<?>>();
+ private static Set<Class<?>> frameworkHandledTypes = new LinkedHashSet<>();
{
frameworkHandledTypes.add(String.class);
frameworkHandledTypes.add(Boolean.class);
@@ -687,7 +687,7 @@ public class ConnectorBundle {
public void setNeedsDelegateToWidget(Property property, JClassType type) {
if (!isNeedsDelegateToWidget(type)) {
- TreeSet<Property> set = new TreeSet<Property>();
+ TreeSet<Property> set = new TreeSet<>();
set.add(property);
needsDelegateToWidget.put(type, set);
} else if (!needsDelegateToWidget.get(type).contains(property)) {
diff --git a/client-compiler/src/main/java/com/vaadin/server/widgetsetutils/metadata/FieldProperty.java b/client-compiler/src/main/java/com/vaadin/server/widgetsetutils/metadata/FieldProperty.java
index ee328354d4..a001f591c1 100644
--- a/client-compiler/src/main/java/com/vaadin/server/widgetsetutils/metadata/FieldProperty.java
+++ b/client-compiler/src/main/java/com/vaadin/server/widgetsetutils/metadata/FieldProperty.java
@@ -61,7 +61,7 @@ public class FieldProperty extends Property {
}
public static Collection<FieldProperty> findProperties(JClassType type) {
- Collection<FieldProperty> properties = new ArrayList<FieldProperty>();
+ Collection<FieldProperty> properties = new ArrayList<>();
List<JField> fields = getPublicFields(type);
for (JField field : fields) {
@@ -72,8 +72,8 @@ public class FieldProperty extends Property {
}
private static List<JField> getPublicFields(JClassType type) {
- Set<String> names = new HashSet<String>();
- ArrayList<JField> fields = new ArrayList<JField>();
+ Set<String> names = new HashSet<>();
+ ArrayList<JField> fields = new ArrayList<>();
for (JClassType subType : type.getFlattenedSupertypeHierarchy()) {
JField[] subFields = subType.getFields();
for (JField field : subFields) {
diff --git a/client-compiler/src/main/java/com/vaadin/server/widgetsetutils/metadata/MethodProperty.java b/client-compiler/src/main/java/com/vaadin/server/widgetsetutils/metadata/MethodProperty.java
index 65ccef8149..bd8e487cbf 100644
--- a/client-compiler/src/main/java/com/vaadin/server/widgetsetutils/metadata/MethodProperty.java
+++ b/client-compiler/src/main/java/com/vaadin/server/widgetsetutils/metadata/MethodProperty.java
@@ -48,9 +48,9 @@ public class MethodProperty extends Property {
}
public static Collection<MethodProperty> findProperties(JClassType type) {
- Collection<MethodProperty> properties = new ArrayList<MethodProperty>();
+ Collection<MethodProperty> properties = new ArrayList<>();
- Set<String> getters = new HashSet<String>();
+ Set<String> getters = new HashSet<>();
List<JMethod> setters = getSetters(type, getters);
for (JMethod setter : setters) {
String getter = findGetter(type, setter);
@@ -72,7 +72,7 @@ public class MethodProperty extends Property {
*/
private static List<JMethod> getSetters(JClassType beanType,
Set<String> getters) {
- List<JMethod> setterMethods = new ArrayList<JMethod>();
+ List<JMethod> setterMethods = new ArrayList<>();
while (beanType != null && !beanType.getQualifiedSourceName()
.equals(Object.class.getName())) {
diff --git a/client-compiler/src/main/java/com/vaadin/tools/CvalAddonsChecker.java b/client-compiler/src/main/java/com/vaadin/tools/CvalAddonsChecker.java
index 8f6e7130c3..027747fd09 100644
--- a/client-compiler/src/main/java/com/vaadin/tools/CvalAddonsChecker.java
+++ b/client-compiler/src/main/java/com/vaadin/tools/CvalAddonsChecker.java
@@ -84,7 +84,7 @@ public final class CvalAddonsChecker {
* generate nag messages in the UI.
*/
public List<CValUiInfo> run() throws InvalidCvalException {
- List<CValUiInfo> ret = new ArrayList<CValUiInfo>();
+ List<CValUiInfo> ret = new ArrayList<>();
try {
// Visit all MANIFEST in our classpath
Enumeration<URL> manifests = Thread.currentThread()