Does not modify compatibility packages to keep to closer to Vaadin 7.7 Change-Id: Ic9c4944eb90218290545a04ecd7455eb63910012tags/8.0.0.alpha1
@@ -56,7 +56,7 @@ public class FetchReleaseNotesAuthors { | |||
new InputStreamReader(p.getInputStream())); | |||
String line = ""; | |||
List<String> authors = new ArrayList<String>(); | |||
List<String> authors = new ArrayList<>(); | |||
while ((line = b.readLine()) != null) { | |||
String author = line; | |||
if (authorMap.containsKey(author)) { |
@@ -39,7 +39,7 @@ public class FetchReleaseNotesTickets { | |||
} | |||
String milestone = ""; | |||
List<String> versions = new ArrayList<String>(); | |||
List<String> versions = new ArrayList<>(); | |||
for (String version : versionsProperty.split(" ")) { | |||
if (version.endsWith(".0") || version.matches(".*\\.rc\\d+")) { | |||
// Find all prerelease versions for final or rc | |||
@@ -63,7 +63,7 @@ public class FetchReleaseNotesTickets { | |||
} | |||
private static List<String> findPrereleaseVersions(String baseVersion) { | |||
List<String> versions = new ArrayList<String>(); | |||
List<String> versions = new ArrayList<>(); | |||
for (int i = 0; i < 50; i++) { | |||
versions.add(baseVersion + ".alpha" + i); |
@@ -62,7 +62,7 @@ public class GeneratePackageExports { | |||
} | |||
// Accepted packages | |||
List<String> acceptedPackagePrefixes = new ArrayList<String>(); | |||
List<String> acceptedPackagePrefixes = new ArrayList<>(); | |||
for (int i = 1; i < args.length; i++) { | |||
acceptedPackagePrefixes.add(args[i]); | |||
} | |||
@@ -179,7 +179,7 @@ public class GeneratePackageExports { | |||
private static HashSet<String> getPackages(JarFile jar, | |||
List<String> acceptedPackagePrefixes, | |||
boolean includeNumberPackages) { | |||
HashSet<String> packages = new HashSet<String>(); | |||
HashSet<String> packages = new HashSet<>(); | |||
Pattern startsWithNumber = Pattern.compile("\\.\\d"); | |||
@@ -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 |
@@ -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); |
@@ -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)) { |
@@ -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) { |
@@ -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())) { |
@@ -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() |
@@ -249,20 +249,20 @@ public class ApplicationConfiguration implements EntryPoint { | |||
private HashMap<Integer, String> unknownComponents; | |||
private Map<Integer, Class<? extends ServerConnector>> classes = new HashMap<Integer, Class<? extends ServerConnector>>(); | |||
private Map<Integer, Class<? extends ServerConnector>> classes = new HashMap<>(); | |||
private boolean widgetsetVersionSent = false; | |||
private static boolean moduleLoaded = false; | |||
static// TODO consider to make this hashmap per application | |||
LinkedList<Command> callbacks = new LinkedList<Command>(); | |||
LinkedList<Command> callbacks = new LinkedList<>(); | |||
private static int dependenciesLoading; | |||
private static ArrayList<ApplicationConnection> runningApplications = new ArrayList<ApplicationConnection>(); | |||
private static ArrayList<ApplicationConnection> runningApplications = new ArrayList<>(); | |||
private Map<Integer, Integer> componentInheritanceMap = new HashMap<Integer, Integer>(); | |||
private Map<Integer, String> tagToServerSideClassName = new HashMap<Integer, String>(); | |||
private Map<Integer, Integer> componentInheritanceMap = new HashMap<>(); | |||
private Map<Integer, String> tagToServerSideClassName = new HashMap<>(); | |||
/** | |||
* Checks whether path info in requests to the server-side service should be | |||
@@ -528,7 +528,7 @@ public class ApplicationConfiguration implements EntryPoint { | |||
if (type == null) { | |||
type = UnknownComponentConnector.class; | |||
if (unknownComponents == null) { | |||
unknownComponents = new HashMap<Integer, String>(); | |||
unknownComponents = new HashMap<>(); | |||
} | |||
unknownComponents.put(tag, getServerSideClassNameForTag(tag)); | |||
} | |||
@@ -572,7 +572,7 @@ public class ApplicationConfiguration implements EntryPoint { | |||
* @return Integer array of tags pointing to this classname | |||
*/ | |||
public Integer[] getTagsForServerSideClassName(String classname) { | |||
List<Integer> tags = new ArrayList<Integer>(); | |||
List<Integer> tags = new ArrayList<>(); | |||
for (Map.Entry<Integer, String> entry : tagToServerSideClassName | |||
.entrySet()) { |
@@ -117,7 +117,7 @@ public class ApplicationConnection implements HasHandlers { | |||
*/ | |||
public static final String UIDL_REFRESH_TOKEN = "Vaadin-Refresh"; | |||
private final HashMap<String, String> resourcesMap = new HashMap<String, String>(); | |||
private final HashMap<String, String> resourcesMap = new HashMap<>(); | |||
private WidgetSet widgetSet; | |||
@@ -159,7 +159,7 @@ public class ApplicationConnection implements HasHandlers { | |||
public static class RequestStartingEvent | |||
extends ApplicationConnectionEvent { | |||
public static Type<CommunicationHandler> TYPE = new Type<CommunicationHandler>(); | |||
public static Type<CommunicationHandler> TYPE = new Type<>(); | |||
public RequestStartingEvent(ApplicationConnection connection) { | |||
super(connection); | |||
@@ -179,7 +179,7 @@ public class ApplicationConnection implements HasHandlers { | |||
public static class ResponseHandlingEndedEvent | |||
extends ApplicationConnectionEvent { | |||
public static Type<CommunicationHandler> TYPE = new Type<CommunicationHandler>(); | |||
public static Type<CommunicationHandler> TYPE = new Type<>(); | |||
public ResponseHandlingEndedEvent(ApplicationConnection connection) { | |||
super(connection); | |||
@@ -218,7 +218,7 @@ public class ApplicationConnection implements HasHandlers { | |||
super(connection); | |||
} | |||
public static Type<CommunicationHandler> TYPE = new Type<CommunicationHandler>(); | |||
public static Type<CommunicationHandler> TYPE = new Type<>(); | |||
@Override | |||
public Type<CommunicationHandler> getAssociatedType() { | |||
@@ -246,7 +246,7 @@ public class ApplicationConnection implements HasHandlers { | |||
public static class ApplicationStoppedEvent | |||
extends GwtEvent<ApplicationStoppedHandler> { | |||
public static Type<ApplicationStoppedHandler> TYPE = new Type<ApplicationStoppedHandler>(); | |||
public static Type<ApplicationStoppedHandler> TYPE = new Type<>(); | |||
@Override | |||
public Type<ApplicationStoppedHandler> getAssociatedType() { |
@@ -61,7 +61,7 @@ class ComponentDetail { | |||
additionalTooltips.remove(key); | |||
} else { | |||
if (additionalTooltips == null) { | |||
additionalTooltips = new HashMap<Object, TooltipInfo>(); | |||
additionalTooltips = new HashMap<>(); | |||
} | |||
additionalTooltips.put(key, tooltip); | |||
} |
@@ -80,7 +80,7 @@ final class ComponentDetailMap extends JavaScriptObject { | |||
}-*/; | |||
final Collection<ComponentDetail> values() { | |||
ArrayList<ComponentDetail> list = new ArrayList<ComponentDetail>(); | |||
ArrayList<ComponentDetail> list = new ArrayList<>(); | |||
fillWithValues(list); | |||
return list; | |||
} |
@@ -39,7 +39,7 @@ public class ConnectorHierarchyChangeEvent | |||
/** | |||
* Type of this event, used by the event bus. | |||
*/ | |||
public static final Type<ConnectorHierarchyChangeHandler> TYPE = new Type<ConnectorHierarchyChangeHandler>(); | |||
public static final Type<ConnectorHierarchyChangeHandler> TYPE = new Type<>(); | |||
List<ComponentConnector> oldChildren; | |||
@@ -217,7 +217,7 @@ public class ConnectorMap { | |||
*/ | |||
@Deprecated | |||
public ComponentConnector[] getComponentConnectors() { | |||
ArrayList<ComponentConnector> result = new ArrayList<ComponentConnector>(); | |||
ArrayList<ComponentConnector> result = new ArrayList<>(); | |||
JsArrayObject<ServerConnector> connectors = getConnectorsAsJsArray(); | |||
int size = connectors.size(); | |||
@@ -267,7 +267,7 @@ public class ConnectorMap { | |||
@Deprecated | |||
public Collection<? extends ServerConnector> getConnectors() { | |||
Collection<ComponentDetail> values = idToComponentDetail.values(); | |||
ArrayList<ServerConnector> arrayList = new ArrayList<ServerConnector>( | |||
ArrayList<ServerConnector> arrayList = new ArrayList<>( | |||
values.size()); | |||
for (ComponentDetail componentDetail : values) { | |||
arrayList.add(componentDetail.getConnector()); |
@@ -45,9 +45,9 @@ public class JavaScriptConnectorHelper { | |||
.createObject(); | |||
private final JavaScriptObject rpcMap = JavaScriptObject.createObject(); | |||
private final Map<String, JavaScriptObject> rpcObjects = new HashMap<String, JavaScriptObject>(); | |||
private final Map<String, Set<String>> rpcMethods = new HashMap<String, Set<String>>(); | |||
private final Map<Element, Map<JavaScriptObject, ElementResizeListener>> resizeListeners = new HashMap<Element, Map<JavaScriptObject, ElementResizeListener>>(); | |||
private final Map<String, JavaScriptObject> rpcObjects = new HashMap<>(); | |||
private final Map<String, Set<String>> rpcMethods = new HashMap<>(); | |||
private final Map<Element, Map<JavaScriptObject, ElementResizeListener>> resizeListeners = new HashMap<>(); | |||
private JavaScriptObject connectorWrapper; | |||
private int tag; | |||
@@ -120,7 +120,7 @@ public class JavaScriptConnectorHelper { | |||
JavaScriptObject wildcardRpcObject = rpcObjects.get(""); | |||
Set<String> interfaces = rpcMethods.get(method); | |||
if (interfaces == null) { | |||
interfaces = new HashSet<String>(); | |||
interfaces = new HashSet<>(); | |||
rpcMethods.put(method, interfaces); | |||
attachRpcMethod(wildcardRpcObject, null, method); | |||
} | |||
@@ -155,7 +155,7 @@ public class JavaScriptConnectorHelper { | |||
protected boolean initJavaScript() { | |||
ApplicationConfiguration conf = connector.getConnection() | |||
.getConfiguration(); | |||
ArrayList<String> attemptedNames = new ArrayList<String>(); | |||
ArrayList<String> attemptedNames = new ArrayList<>(); | |||
Integer tag = Integer.valueOf(this.tag); | |||
while (tag != null) { | |||
String serverSideClassName = conf.getServerSideClassNameForTag(tag); | |||
@@ -260,7 +260,7 @@ public class JavaScriptConnectorHelper { | |||
Map<JavaScriptObject, ElementResizeListener> elementListeners = resizeListeners | |||
.get(element); | |||
if (elementListeners == null) { | |||
elementListeners = new HashMap<JavaScriptObject, ElementResizeListener>(); | |||
elementListeners = new HashMap<>(); | |||
resizeListeners.put(element, elementListeners); | |||
} | |||
@@ -46,7 +46,7 @@ public class LayoutManager { | |||
private static final boolean debugLogging = false; | |||
private ApplicationConnection connection; | |||
private final Set<Element> measuredNonConnectorElements = new HashSet<Element>(); | |||
private final Set<Element> measuredNonConnectorElements = new HashSet<>(); | |||
private final MeasuredSize nullSize = new MeasuredSize(); | |||
private LayoutDependencyTree currentDependencyTree; | |||
@@ -58,8 +58,8 @@ public class LayoutManager { | |||
private FastStringSet pendingOverflowFixes = FastStringSet.create(); | |||
private final Map<Element, Collection<ElementResizeListener>> elementResizeListeners = new HashMap<Element, Collection<ElementResizeListener>>(); | |||
private final Set<Element> listenersToFire = new HashSet<Element>(); | |||
private final Map<Element, Collection<ElementResizeListener>> elementResizeListeners = new HashMap<>(); | |||
private final Set<Element> listenersToFire = new HashSet<>(); | |||
private boolean layoutPending = false; | |||
private Timer layoutTimer = new Timer() { | |||
@@ -618,7 +618,7 @@ public class LayoutManager { | |||
int pendingOverflowCount = pendingOverflowConnectorsIds.length(); | |||
ConnectorMap connectorMap = ConnectorMap.get(connection); | |||
if (pendingOverflowCount > 0) { | |||
HashMap<Element, String> originalOverflows = new HashMap<Element, String>(); | |||
HashMap<Element, String> originalOverflows = new HashMap<>(); | |||
FastStringSet delayedOverflowFixes = FastStringSet.create(); | |||
@@ -1724,7 +1724,7 @@ public class LayoutManager { | |||
Collection<ElementResizeListener> listeners = elementResizeListeners | |||
.get(element); | |||
if (listeners == null) { | |||
listeners = new HashSet<ElementResizeListener>(); | |||
listeners = new HashSet<>(); | |||
elementResizeListeners.put(element, listeners); | |||
ensureMeasured(element); | |||
} |
@@ -33,7 +33,7 @@ import com.vaadin.shared.ui.ui.UIState.LocaleData; | |||
*/ | |||
public class LocaleService { | |||
private static Map<String, LocaleData> cache = new HashMap<String, LocaleData>(); | |||
private static Map<String, LocaleData> cache = new HashMap<>(); | |||
private static String defaultLocale; | |||
@@ -89,7 +89,7 @@ public class Profiler { | |||
*/ | |||
public static class Node { | |||
private final String name; | |||
private final LinkedHashMap<String, Node> children = new LinkedHashMap<String, Node>(); | |||
private final LinkedHashMap<String, Node> children = new LinkedHashMap<>(); | |||
private double time = 0; | |||
private int count = 0; | |||
private double enterTime = 0; | |||
@@ -462,7 +462,7 @@ public class Profiler { | |||
return; | |||
} | |||
LinkedList<Node> stack = new LinkedList<Node>(); | |||
LinkedList<Node> stack = new LinkedList<>(); | |||
Node rootNode = new Node(null); | |||
stack.add(rootNode); | |||
JsArray<GwtStatsEvent> gwtStatsEvents = getGwtStatsEvents(); | |||
@@ -472,7 +472,7 @@ public class Profiler { | |||
return; | |||
} | |||
Set<Node> extendedTimeNodes = new HashSet<Node>(); | |||
Set<Node> extendedTimeNodes = new HashSet<>(); | |||
for (int i = 0; i < gwtStatsEvents.length(); i++) { | |||
GwtStatsEvent gwtStatsEvent = gwtStatsEvents.get(i); | |||
String eventName = gwtStatsEvent.getEventName(); | |||
@@ -540,10 +540,10 @@ public class Profiler { | |||
return; | |||
} | |||
Map<String, Node> totals = new HashMap<String, Node>(); | |||
Map<String, Node> totals = new HashMap<>(); | |||
rootNode.sumUpTotals(totals); | |||
ArrayList<Node> totalList = new ArrayList<Node>(totals.values()); | |||
ArrayList<Node> totalList = new ArrayList<>(totals.values()); | |||
Collections.sort(totalList, new Comparator<Node>() { | |||
@Override | |||
public int compare(Node o1, Node o2) { | |||
@@ -584,7 +584,7 @@ public class Profiler { | |||
"domContentLoadedEventStart", "domContentLoadedEventEnd", | |||
"domComplete", "loadEventStart", "loadEventEnd" }; | |||
LinkedHashMap<String, Double> timings = new LinkedHashMap<String, Double>(); | |||
LinkedHashMap<String, Double> timings = new LinkedHashMap<>(); | |||
for (String key : keys) { | |||
double value = getPerformanceTiming(key); |
@@ -142,11 +142,11 @@ public class ResourceLoader { | |||
private ApplicationConnection connection; | |||
private final Set<String> loadedResources = new HashSet<String>(); | |||
private final Set<String> preloadedResources = new HashSet<String>(); | |||
private final Set<String> loadedResources = new HashSet<>(); | |||
private final Set<String> preloadedResources = new HashSet<>(); | |||
private final Map<String, Collection<ResourceLoadListener>> loadListeners = new HashMap<String, Collection<ResourceLoadListener>>(); | |||
private final Map<String, Collection<ResourceLoadListener>> preloadListeners = new HashMap<String, Collection<ResourceLoadListener>>(); | |||
private final Map<String, Collection<ResourceLoadListener>> loadListeners = new HashMap<>(); | |||
private final Map<String, Collection<ResourceLoadListener>> preloadListeners = new HashMap<>(); | |||
private final Element head; | |||
@@ -555,7 +555,7 @@ public class ResourceLoader { | |||
Map<String, Collection<ResourceLoadListener>> listenerMap) { | |||
Collection<ResourceLoadListener> listeners = listenerMap.get(url); | |||
if (listeners == null) { | |||
listeners = new HashSet<ResourceLoader.ResourceLoadListener>(); | |||
listeners = new HashSet<>(); | |||
listeners.add(listener); | |||
listenerMap.put(url, listeners); | |||
return true; |
@@ -121,7 +121,7 @@ public final class UIDL extends JavaScriptObject { | |||
*/ | |||
public Set<String> getVariableNames() { | |||
if (!hasVariables()) { | |||
return new HashSet<String>(); | |||
return new HashSet<>(); | |||
} else { | |||
Set<String> keySet = var().getKeySet(); | |||
return keySet; | |||
@@ -453,7 +453,7 @@ public final class UIDL extends JavaScriptObject { | |||
* @return the value of the variable | |||
*/ | |||
public Set<String> getStringArrayVariableAsSet(final String name) { | |||
final HashSet<String> s = new HashSet<String>(); | |||
final HashSet<String> s = new HashSet<>(); | |||
JsArrayString a = var().getJSStringArray(name); | |||
for (int i = 0; i < a.length(); i++) { | |||
s.add(a.get(i)); |
@@ -777,7 +777,7 @@ public class Util { | |||
try { | |||
getLogger().info("RPC invocations to be sent to the server:"); | |||
String curId = null; | |||
ArrayList<MethodInvocation> invocations = new ArrayList<MethodInvocation>(); | |||
ArrayList<MethodInvocation> invocations = new ArrayList<>(); | |||
for (MethodInvocation methodInvocation : methodInvocations) { | |||
String id = methodInvocation.getConnectorId(); | |||
@@ -62,7 +62,7 @@ public final class ValueMap extends JavaScriptObject { | |||
}-*/; | |||
public Set<String> getKeySet() { | |||
final HashSet<String> attrs = new HashSet<String>(); | |||
final HashSet<String> attrs = new HashSet<>(); | |||
JsArrayString attributeNamesArray = getKeyArray(); | |||
for (int i = 0; i < attributeNamesArray.length(); i++) { | |||
attrs.add(attributeNamesArray.get(i)); |
@@ -26,7 +26,7 @@ import java.util.HashMap; | |||
*/ | |||
abstract class WidgetMap { | |||
protected static HashMap<Class<? extends ServerConnector>, WidgetInstantiator> instmap = new HashMap<Class<? extends ServerConnector>, WidgetInstantiator>(); | |||
protected static HashMap<Class<? extends ServerConnector>, WidgetInstantiator> instmap = new HashMap<>(); | |||
/** | |||
* Create a new instance of a connector based on its type. |
@@ -1387,7 +1387,7 @@ public class WidgetUtil { | |||
/* | |||
* Map the size units with their type. | |||
*/ | |||
private static Map<String, Unit> type2Unit = new HashMap<String, Style.Unit>(); | |||
private static Map<String, Unit> type2Unit = new HashMap<>(); | |||
static { | |||
for (Unit unit : Unit.values()) { | |||
type2Unit.put(unit.getType(), unit); |
@@ -203,7 +203,7 @@ public class JsonDecoder { | |||
if (jsonMap.getType() == JsonType.ARRAY) { | |||
JsonArray array = (JsonArray) jsonMap; | |||
if (array.length() == 0) { | |||
return new HashMap<Object, Object>(); | |||
return new HashMap<>(); | |||
} | |||
} | |||
@@ -228,7 +228,7 @@ public class JsonDecoder { | |||
private static Map<Object, Object> decodeObjectMap(Type keyType, | |||
Type valueType, JsonArray jsonValue, | |||
ApplicationConnection connection) { | |||
Map<Object, Object> map = new HashMap<Object, Object>(); | |||
Map<Object, Object> map = new HashMap<>(); | |||
JsonArray keys = jsonValue.get(0); | |||
JsonArray values = jsonValue.get(1); | |||
@@ -249,7 +249,7 @@ public class JsonDecoder { | |||
private static Map<Object, Object> decodeConnectorMap(Type valueType, | |||
JsonObject jsonMap, ApplicationConnection connection) { | |||
Map<Object, Object> map = new HashMap<Object, Object>(); | |||
Map<Object, Object> map = new HashMap<>(); | |||
ConnectorMap connectorMap = ConnectorMap.get(connection); | |||
@@ -264,7 +264,7 @@ public class JsonDecoder { | |||
private static Map<Object, Object> decodeStringMap(Type valueType, | |||
JsonObject jsonMap, ApplicationConnection connection) { | |||
Map<Object, Object> map = new HashMap<Object, Object>(); | |||
Map<Object, Object> map = new HashMap<>(); | |||
for (String key : jsonMap.keys()) { | |||
Object value = decodeValue(valueType, jsonMap.get(key), null, | |||
@@ -277,7 +277,7 @@ public class JsonDecoder { | |||
private static List<Object> decodeList(Type type, JsonArray jsonArray, | |||
ApplicationConnection connection) { | |||
List<Object> tokens = new ArrayList<Object>(); | |||
List<Object> tokens = new ArrayList<>(); | |||
decodeIntoCollection(type.getParameterTypes()[0], jsonArray, connection, | |||
tokens); | |||
return tokens; | |||
@@ -285,7 +285,7 @@ public class JsonDecoder { | |||
private static Set<Object> decodeSet(Type type, JsonArray jsonArray, | |||
ApplicationConnection connection) { | |||
Set<Object> tokens = new HashSet<Object>(); | |||
Set<Object> tokens = new HashSet<>(); | |||
decodeIntoCollection(type.getParameterTypes()[0], jsonArray, connection, | |||
tokens); | |||
return tokens; |
@@ -123,12 +123,12 @@ public class MessageHandler { | |||
* If responseHandlingLocks contains any objects, response handling is | |||
* suspended until the collection is empty or a timeout has occurred. | |||
*/ | |||
private Set<Object> responseHandlingLocks = new HashSet<Object>(); | |||
private Set<Object> responseHandlingLocks = new HashSet<>(); | |||
/** | |||
* Contains all UIDL messages received while response handling is suspended | |||
*/ | |||
private List<PendingUIDLMessage> pendingUIDLMessages = new ArrayList<PendingUIDLMessage>(); | |||
private List<PendingUIDLMessage> pendingUIDLMessages = new ArrayList<>(); | |||
// will hold the CSRF token once received | |||
private String csrfToken = ApplicationConstants.CSRF_TOKEN_DEFAULT_VALUE; | |||
@@ -1227,8 +1227,8 @@ public class MessageHandler { | |||
Profiler.enter( | |||
"updateConnectorHierarchy find new connectors"); | |||
List<ServerConnector> newChildren = new ArrayList<ServerConnector>(); | |||
List<ComponentConnector> newComponents = new ArrayList<ComponentConnector>(); | |||
List<ServerConnector> newChildren = new ArrayList<>(); | |||
List<ComponentConnector> newComponents = new ArrayList<>(); | |||
for (int connectorIndex = 0; connectorIndex < childConnectorSize; connectorIndex++) { | |||
String childConnectorId = childConnectorIds | |||
.get(connectorIndex); |
@@ -53,7 +53,7 @@ public class ServerRpcQueue { | |||
* invocation. Without lastonly, an incremental id based on | |||
* {@link #lastInvocationTag} is used to get unique values. | |||
*/ | |||
private LinkedHashMap<String, MethodInvocation> pendingInvocations = new LinkedHashMap<String, MethodInvocation>(); | |||
private LinkedHashMap<String, MethodInvocation> pendingInvocations = new LinkedHashMap<>(); | |||
private int lastInvocationTag = 0; | |||
@@ -38,7 +38,7 @@ public class StateChangeEvent | |||
/** | |||
* Type of this event, used by the event bus. | |||
*/ | |||
public static final Type<StateChangeHandler> TYPE = new Type<StateChangeHandler>(); | |||
public static final Type<StateChangeHandler> TYPE = new Type<>(); | |||
/** | |||
* Used to cache a FastStringSet representation of the properties that have | |||
@@ -158,7 +158,7 @@ public class StateChangeEvent | |||
public Set<String> getChangedProperties() { | |||
if (changedPropertiesSet == null) { | |||
Profiler.enter("StateChangeEvent.getChangedProperties populate"); | |||
changedPropertiesSet = new HashSet<String>(); | |||
changedPropertiesSet = new HashSet<>(); | |||
getChangedPropertiesFastSet().addAllTo(changedPropertiesSet); | |||
Profiler.leave("StateChangeEvent.getChangedProperties populate"); | |||
} |
@@ -242,7 +242,7 @@ public class LegacyLocatorStrategy implements LocatorStrategy { | |||
@Override | |||
public List<Element> getElementsByPath(String path) { | |||
// This type of search is not supported in LegacyLocator | |||
List<Element> array = new ArrayList<Element>(); | |||
List<Element> array = new ArrayList<>(); | |||
Element e = getElementByPath(path); | |||
if (e != null) { | |||
array.add(e); | |||
@@ -257,7 +257,7 @@ public class LegacyLocatorStrategy implements LocatorStrategy { | |||
public List<Element> getElementsByPathStartingAt(String path, | |||
Element root) { | |||
// This type of search is not supported in LegacyLocator | |||
List<Element> array = new ArrayList<Element>(); | |||
List<Element> array = new ArrayList<>(); | |||
Element e = getElementByPathStartingAt(path, root); | |||
if (e != null) { | |||
array.add(e); | |||
@@ -647,7 +647,7 @@ public class LegacyLocatorStrategy implements LocatorStrategy { | |||
if (widgetClassName.equals("VWindow")) { | |||
List<WindowConnector> windows = client.getUIConnector() | |||
.getSubWindows(); | |||
List<VWindow> windowWidgets = new ArrayList<VWindow>( | |||
List<VWindow> windowWidgets = new ArrayList<>( | |||
windows.size()); | |||
for (WindowConnector wc : windows) { | |||
windowWidgets.add(wc.getWidget()); |
@@ -38,7 +38,7 @@ public class SelectorPredicate { | |||
if (path.startsWith("(")) { | |||
return extractPredicates(path.substring(path.lastIndexOf(')'))); | |||
} | |||
return new ArrayList<SelectorPredicate>(); | |||
return new ArrayList<>(); | |||
} | |||
/** | |||
@@ -49,7 +49,7 @@ public class SelectorPredicate { | |||
* @return a List of Predicate objects | |||
*/ | |||
public static List<SelectorPredicate> extractPredicates(String path) { | |||
List<SelectorPredicate> predicates = new ArrayList<SelectorPredicate>(); | |||
List<SelectorPredicate> predicates = new ArrayList<>(); | |||
String predicateStr = extractPredicateString(path); | |||
if (null == predicateStr || predicateStr.length() == 0) { | |||
@@ -114,7 +114,7 @@ public class SelectorPredicate { | |||
* @return List of predicate strings | |||
*/ | |||
private static List<String> readPredicatesFromString(String predicateStr) { | |||
List<String> predicates = new ArrayList<String>(); | |||
List<String> predicates = new ArrayList<>(); | |||
int prevIdx = 0; | |||
int idx = LocatorUtil.indexOfIgnoringQuoted(predicateStr, ',', prevIdx); | |||
@@ -98,7 +98,7 @@ public class VaadinFinderLocatorStrategy implements LocatorStrategy { | |||
List<ConnectorPath> hierarchy = getConnectorHierarchyForElement( | |||
targetElement); | |||
List<String> path = new ArrayList<String>(); | |||
List<String> path = new ArrayList<>(); | |||
// Assemble longname path components back-to-forth with useful | |||
// predicates - first try ID, then caption. | |||
@@ -182,7 +182,7 @@ public class VaadinFinderLocatorStrategy implements LocatorStrategy { | |||
*/ | |||
private List<String> generateQueries(List<String> components) { | |||
// Prepare to loop through all the elements. | |||
List<String> paths = new ArrayList<String>(); | |||
List<String> paths = new ArrayList<>(); | |||
int compIdx = 0; | |||
String basePath = components.get(compIdx).replace("com.vaadin.ui.", ""); | |||
// Add a basic search for the first element (eg. //Button) | |||
@@ -243,7 +243,7 @@ public class VaadinFinderLocatorStrategy implements LocatorStrategy { | |||
private List<ConnectorPath> getConnectorHierarchyForElement(Element elem) { | |||
Element e = elem; | |||
ComponentConnector c = Util.findPaintable(client, e); | |||
List<ConnectorPath> connectorHierarchy = new ArrayList<ConnectorPath>(); | |||
List<ConnectorPath> connectorHierarchy = new ArrayList<>(); | |||
while (c != null) { | |||
@@ -281,7 +281,7 @@ public class VaadinFinderLocatorStrategy implements LocatorStrategy { | |||
path = path.substring(1, path.lastIndexOf(')')); | |||
} | |||
List<Element> elements = new ArrayList<Element>(); | |||
List<Element> elements = new ArrayList<>(); | |||
if (LocatorUtil.isNotificationElement(path)) { | |||
for (VNotification n : findNotificationsByPath(path)) { | |||
@@ -385,7 +385,7 @@ public class VaadinFinderLocatorStrategy implements LocatorStrategy { | |||
*/ | |||
private List<VNotification> findNotificationsByPath(String path) { | |||
List<VNotification> notifications = new ArrayList<VNotification>(); | |||
List<VNotification> notifications = new ArrayList<>(); | |||
for (Widget w : RootPanel.get()) { | |||
if (w instanceof VNotification) { | |||
notifications.add((VNotification) w); | |||
@@ -431,7 +431,7 @@ public class VaadinFinderLocatorStrategy implements LocatorStrategy { | |||
connectors = Arrays.asList(root); | |||
} | |||
List<Element> output = new ArrayList<Element>(); | |||
List<Element> output = new ArrayList<>(); | |||
if (null != connectors && !connectors.isEmpty()) { | |||
for (ComponentConnector connector : connectors) { | |||
if (!actualRoot | |||
@@ -474,7 +474,7 @@ public class VaadinFinderLocatorStrategy implements LocatorStrategy { | |||
String[] fragments = splitFirstFragmentFromTheRest(path); | |||
List<ComponentConnector> connectors = new ArrayList<ComponentConnector>(); | |||
List<ComponentConnector> connectors = new ArrayList<>(); | |||
for (ComponentConnector parent : parents) { | |||
connectors.addAll(filterMatches( | |||
collectPotentialMatches(parent, fragments[0], | |||
@@ -557,7 +557,7 @@ public class VaadinFinderLocatorStrategy implements LocatorStrategy { | |||
private List<ComponentConnector> collectPotentialMatches( | |||
ComponentConnector parent, String pathFragment, | |||
boolean collectRecursively) { | |||
ArrayList<ComponentConnector> potentialMatches = new ArrayList<ComponentConnector>(); | |||
ArrayList<ComponentConnector> potentialMatches = new ArrayList<>(); | |||
String widgetName = getWidgetName(pathFragment); | |||
// Special case when searching for UIElement. | |||
if (LocatorUtil.isUIElement(pathFragment)) { | |||
@@ -585,7 +585,7 @@ public class VaadinFinderLocatorStrategy implements LocatorStrategy { | |||
private List<String> getIDsForConnector(ComponentConnector connector) { | |||
Class<?> connectorClass = connector.getClass(); | |||
List<String> ids = new ArrayList<String>(); | |||
List<String> ids = new ArrayList<>(); | |||
TypeDataStore.get().findIdentifiersFor(connectorClass).addAllTo(ids); | |||
@@ -732,7 +732,7 @@ public class VaadinFinderLocatorStrategy implements LocatorStrategy { | |||
*/ | |||
private final <T> List<T> eliminateDuplicates(List<T> list) { | |||
LinkedHashSet<T> set = new LinkedHashSet<T>(list); | |||
LinkedHashSet<T> set = new LinkedHashSet<>(list); | |||
list.clear(); | |||
list.addAll(set); | |||
return list; |
@@ -48,7 +48,7 @@ public class DataCommunicatorConnector extends AbstractExtensionConnector { | |||
*/ | |||
public class VaadinDataSource extends AbstractRemoteDataSource<JsonObject> { | |||
private Set<String> droppedKeys = new HashSet<String>(); | |||
private Set<String> droppedKeys = new HashSet<>(); | |||
protected VaadinDataSource() { | |||
registerRpc(DataCommunicatorClientRpc.class, | |||
@@ -61,7 +61,7 @@ public class DataCommunicatorConnector extends AbstractExtensionConnector { | |||
@Override | |||
public void setData(int firstIndex, JsonArray data) { | |||
ArrayList<JsonObject> rows = new ArrayList<JsonObject>( | |||
ArrayList<JsonObject> rows = new ArrayList<>( | |||
data.length()); | |||
for (int i = 0; i < data.length(); i++) { | |||
JsonObject rowObject = data.getObject(i); |
@@ -66,7 +66,7 @@ public class GridConnector extends AbstractListingConnector | |||
protected void init() { | |||
super.init(); | |||
new ClickSelectHandler<JsonObject>(getWidget()); | |||
new ClickSelectHandler<>(getWidget()); | |||
getWidget().addSortHandler(this::handleSortEvent); | |||
layout(); |
@@ -178,8 +178,8 @@ public abstract class AbstractRemoteDataSource<T> implements DataSource<T> { | |||
private Range cached = Range.between(0, 0); | |||
private final HashMap<Integer, T> indexToRowMap = new HashMap<Integer, T>(); | |||
private final HashMap<Object, Integer> keyToIndexMap = new HashMap<Object, Integer>(); | |||
private final HashMap<Integer, T> indexToRowMap = new HashMap<>(); | |||
private final HashMap<Object, Integer> keyToIndexMap = new HashMap<>(); | |||
private Set<DataChangeHandler> dataChangeHandlers = new LinkedHashSet<>(); | |||
@@ -193,8 +193,8 @@ public abstract class AbstractRemoteDataSource<T> implements DataSource<T> { | |||
} | |||
}; | |||
private Map<Object, Integer> pinnedCounts = new HashMap<Object, Integer>(); | |||
private Map<Object, RowHandleImpl> pinnedRows = new HashMap<Object, RowHandleImpl>(); | |||
private Map<Object, Integer> pinnedCounts = new HashMap<>(); | |||
private Map<Object, RowHandleImpl> pinnedRows = new HashMap<>(); | |||
// Size not yet known | |||
private int size = -1; | |||
@@ -374,7 +374,7 @@ public abstract class AbstractRemoteDataSource<T> implements DataSource<T> { | |||
if (range.isEmpty()) { | |||
return; | |||
} | |||
currentRequestCallback = new RequestRowsCallback<T>(this, range); | |||
currentRequestCallback = new RequestRowsCallback<>(this, range); | |||
requestRows(range.getStart(), range.length(), currentRequestCallback); | |||
} | |||
@@ -49,7 +49,7 @@ import com.vaadin.client.ValueMap; | |||
*/ | |||
public class AnalyzeLayoutsPanel extends FlowPanel { | |||
private List<SelectConnectorListener> listeners = new ArrayList<SelectConnectorListener>(); | |||
private List<SelectConnectorListener> listeners = new ArrayList<>(); | |||
public void update() { | |||
clear(); | |||
@@ -79,8 +79,8 @@ public class AnalyzeLayoutsPanel extends FlowPanel { | |||
add(new Label("Layouts analyzed, no top level problems")); | |||
} | |||
Set<ComponentConnector> zeroHeightComponents = new HashSet<ComponentConnector>(); | |||
Set<ComponentConnector> zeroWidthComponents = new HashSet<ComponentConnector>(); | |||
Set<ComponentConnector> zeroHeightComponents = new HashSet<>(); | |||
Set<ComponentConnector> zeroWidthComponents = new HashSet<>(); | |||
findZeroSizeComponents(zeroHeightComponents, zeroWidthComponents, | |||
ac.getUIConnector()); | |||
if (zeroHeightComponents.size() > 0 || zeroWidthComponents.size() > 0) { | |||
@@ -106,7 +106,7 @@ public class AnalyzeLayoutsPanel extends FlowPanel { | |||
Set<ComponentConnector> zeroSized, ApplicationConnection ac) { | |||
// keep track of already highlighted parents | |||
HashSet<String> parents = new HashSet<String>(); | |||
HashSet<String> parents = new HashSet<>(); | |||
for (final ComponentConnector connector : zeroSized) { | |||
final ServerConnector parent = connector.getParent(); |
@@ -48,7 +48,7 @@ public class ConnectorInfoPanel extends FlowPanel { | |||
public void update(ServerConnector connector) { | |||
SharedState state = connector.getState(); | |||
Set<String> ignoreProperties = new HashSet<String>(); | |||
Set<String> ignoreProperties = new HashSet<>(); | |||
ignoreProperties.add("id"); | |||
String html = getRowHTML("Id", connector.getConnectorId()); |
@@ -45,7 +45,7 @@ import com.vaadin.client.Util; | |||
public class HierarchyPanel extends FlowPanel { | |||
// TODO separate click listeners for simple selection and doubleclick | |||
private List<SelectConnectorListener> listeners = new ArrayList<SelectConnectorListener>(); | |||
private List<SelectConnectorListener> listeners = new ArrayList<>(); | |||
public void update() { | |||
// Try to keep track of currently open nodes and reopen them |
@@ -180,7 +180,7 @@ public class Highlight { | |||
static Element show(Element element, String color) { | |||
if (element != null) { | |||
if (highlights == null) { | |||
highlights = new HashSet<Element>(); | |||
highlights = new HashSet<>(); | |||
} | |||
Element highlight = DOM.createDiv(); |
@@ -76,7 +76,7 @@ public class OptimizedWidgetsetPanel extends FlowPanel { | |||
private Set<String> getUsedConnectorNames( | |||
ApplicationConfiguration configuration) { | |||
int tag = 0; | |||
Set<String> usedConnectors = new HashSet<String>(); | |||
Set<String> usedConnectors = new HashSet<>(); | |||
while (true) { | |||
String serverSideClass = configuration | |||
.getServerSideClassNameForTag(tag); |
@@ -38,8 +38,8 @@ public class SelectorPath { | |||
private final String path; | |||
private final Element element; | |||
private final ComponentLocator locator; | |||
private static Map<String, Integer> counter = new HashMap<String, Integer>(); | |||
private static Map<String, String> legacyNames = new HashMap<String, String>(); | |||
private static Map<String, Integer> counter = new HashMap<>(); | |||
private static Map<String, String> legacyNames = new HashMap<>(); | |||
static { | |||
legacyNames.put("FilterSelect", "ComboBox"); |
@@ -94,7 +94,7 @@ public class TestBenchSection implements Section { | |||
private final FlowPanel selectorPanel = new FlowPanel(); | |||
// map from full path to SelectorWidget to enable reuse of old selectors | |||
private Map<SelectorPath, SelectorWidget> selectorWidgets = new HashMap<SelectorPath, SelectorWidget>(); | |||
private Map<SelectorPath, SelectorWidget> selectorWidgets = new HashMap<>(); | |||
private final FlowPanel controls = new FlowPanel(); | |||
@@ -133,7 +133,7 @@ public final class VDebugWindow extends VOverlay { | |||
protected SimplePanel content = new SimplePanel(); | |||
// sections | |||
protected ArrayList<Section> sections = new ArrayList<Section>(); | |||
protected ArrayList<Section> sections = new ArrayList<>(); | |||
// handles resize/move | |||
protected HandlerRegistration mouseDownHandler = null; |
@@ -28,7 +28,7 @@ public class InputEvent extends DomEvent<InputHandler> { | |||
* Event type for InputEvent. Represents the meta-data associated with this | |||
* event. | |||
*/ | |||
private static final Type<InputHandler> TYPE = new Type<InputHandler>( | |||
private static final Type<InputHandler> TYPE = new Type<>( | |||
"input", new InputEvent()); | |||
protected InputEvent() { |
@@ -28,7 +28,7 @@ public class PointerCancelEvent extends PointerEvent<PointerCancelHandler> { | |||
* Event type for PointerCancelEvent. Represents the meta-data associated | |||
* with this event. | |||
*/ | |||
private static final Type<PointerCancelHandler> TYPE = new Type<PointerCancelHandler>( | |||
private static final Type<PointerCancelHandler> TYPE = new Type<>( | |||
EventType.PointerCancel.getNativeEventName(), | |||
new PointerCancelEvent()); | |||
@@ -28,7 +28,7 @@ public class PointerDownEvent extends PointerEvent<PointerDownHandler> { | |||
* Event type for PointerDownEvent. Represents the meta-data associated with | |||
* this event. | |||
*/ | |||
private static final Type<PointerDownHandler> TYPE = new Type<PointerDownHandler>( | |||
private static final Type<PointerDownHandler> TYPE = new Type<>( | |||
EventType.PointerDown.getNativeEventName(), new PointerDownEvent()); | |||
/** |
@@ -28,7 +28,7 @@ public class PointerMoveEvent extends PointerEvent<PointerMoveHandler> { | |||
* Event type for PointerMoveEvent. Represents the meta-data associated with | |||
* this event. | |||
*/ | |||
private static final Type<PointerMoveHandler> TYPE = new Type<PointerMoveHandler>( | |||
private static final Type<PointerMoveHandler> TYPE = new Type<>( | |||
EventType.PointerMove.getNativeEventName(), new PointerMoveEvent()); | |||
/** |
@@ -28,7 +28,7 @@ public class PointerUpEvent extends PointerEvent<PointerUpHandler> { | |||
* Event type for PointerUpEvent. Represents the meta-data associated with | |||
* this event. | |||
*/ | |||
private static final Type<PointerUpHandler> TYPE = new Type<PointerUpHandler>( | |||
private static final Type<PointerUpHandler> TYPE = new Type<>( | |||
EventType.PointerUp.getNativeEventName(), new PointerUpEvent()); | |||
/** |
@@ -34,7 +34,7 @@ import com.vaadin.ui.JavaScript; | |||
@Connect(JavaScript.class) | |||
public class JavaScriptManagerConnector extends AbstractExtensionConnector { | |||
private Set<String> currentNames = new HashSet<String>(); | |||
private Set<String> currentNames = new HashSet<>(); | |||
@Override | |||
protected void init() { | |||
@@ -59,7 +59,7 @@ public class JavaScriptManagerConnector extends AbstractExtensionConnector { | |||
removeCallback(name); | |||
} | |||
currentNames = new HashSet<String>(newNames); | |||
currentNames = new HashSet<>(newNames); | |||
for (String name : newNames) { | |||
addCallback(name); | |||
} |
@@ -30,7 +30,7 @@ public abstract class AsyncBundleLoader { | |||
private Throwable error = null; | |||
private List<BundleLoadCallback> callbacks = new ArrayList<BundleLoadCallback>(); | |||
private List<BundleLoadCallback> callbacks = new ArrayList<>(); | |||
private final String packageName; | |||
@@ -143,7 +143,7 @@ public abstract class ConnectorBundleLoader { | |||
public abstract void init(); | |||
protected List<CValUiInfo> cvals = new ArrayList<CValUiInfo>(); | |||
protected List<CValUiInfo> cvals = new ArrayList<>(); | |||
public void cval(String typeName) { | |||
if (!cvals.isEmpty()) { |
@@ -260,7 +260,7 @@ public class TypeDataStore { | |||
throws NoDataException { | |||
JsArrayObject<Property> propertiesArray = getPropertiesAsArray(type); | |||
int size = propertiesArray.size(); | |||
ArrayList<Property> properties = new ArrayList<Property>(size); | |||
ArrayList<Property> properties = new ArrayList<>(size); | |||
for (int i = 0; i < size; i++) { | |||
properties.add(propertiesArray.get(i)); | |||
} |
@@ -152,7 +152,7 @@ public abstract class ClickableRenderer<T, W extends Widget> | |||
return null; | |||
} | |||
Cell cell = container.getCell(e); | |||
EventCellReference<T> cellReference = new EventCellReference<T>( | |||
EventCellReference<T> cellReference = new EventCellReference<>( | |||
grid); | |||
// FIXME: Section is currently always body. Might be useful for the | |||
// future to have an actual check. |
@@ -306,7 +306,7 @@ public abstract class AbstractConnector | |||
if (handlers != null) { | |||
Profiler.enter("AbstractConnector.onStateChanged @OnStateChange"); | |||
HashSet<OnStateChangeMethod> invokedMethods = new HashSet<OnStateChangeMethod>(); | |||
HashSet<OnStateChangeMethod> invokedMethods = new HashSet<>(); | |||
JsArrayString propertyNames = handlers.getKeys(); | |||
for (int i = 0; i < propertyNames.length(); i++) { |
@@ -58,7 +58,7 @@ public class ShortcutActionHandler { | |||
ShortcutActionHandler getShortcutActionHandler(); | |||
} | |||
private final ArrayList<ShortcutAction> actions = new ArrayList<ShortcutAction>(); | |||
private final ArrayList<ShortcutAction> actions = new ArrayList<>(); | |||
private ApplicationConnection client; | |||
private String paintableId; | |||
@@ -419,7 +419,7 @@ public class TouchScrollDelegate implements NativePreviewHandler { | |||
public static ArrayList<Element> getElements(Element scrolledElement2) { | |||
NodeList<Node> childNodes = scrolledElement2.getChildNodes(); | |||
ArrayList<Element> l = new ArrayList<Element>(); | |||
ArrayList<Element> l = new ArrayList<>(); | |||
for (int i = 0; i < childNodes.getLength(); i++) { | |||
Node item = childNodes.getItem(i); | |||
if (item.getNodeType() == Node.ELEMENT_NODE) { | |||
@@ -707,7 +707,7 @@ public class TouchScrollDelegate implements NativePreviewHandler { | |||
} | |||
public void setElements(Element[] elements) { | |||
scrollableElements = new HashSet<Element>(Arrays.asList(elements)); | |||
scrollableElements = new HashSet<>(Arrays.asList(elements)); | |||
} | |||
/** |
@@ -736,7 +736,7 @@ public abstract class VAbstractSplitPanel extends ComplexPanel { | |||
public static class SplitterMoveEvent | |||
extends GwtEvent<SplitterMoveHandler> { | |||
public static final Type<SplitterMoveHandler> TYPE = new Type<SplitterMoveHandler>(); | |||
public static final Type<SplitterMoveHandler> TYPE = new Type<>(); | |||
private Widget splitPanel; | |||
@@ -42,7 +42,7 @@ public class VAccordion extends VTabsheetBase { | |||
public static final String CLASSNAME = AccordionState.PRIMARY_STYLE_NAME; | |||
private Set<Widget> widgets = new HashSet<Widget>(); | |||
private Set<Widget> widgets = new HashSet<>(); | |||
private StackItem openTab; | |||
@@ -50,13 +50,13 @@ public class VCustomLayout extends ComplexPanel { | |||
public static final String CLASSNAME = "v-customlayout"; | |||
/** Location-name to containing element in DOM map */ | |||
private final HashMap<String, Element> locationToElement = new HashMap<String, Element>(); | |||
private final HashMap<String, Element> locationToElement = new HashMap<>(); | |||
/** Location-name to contained widget map */ | |||
final HashMap<String, Widget> locationToWidget = new HashMap<String, Widget>(); | |||
final HashMap<String, Widget> locationToWidget = new HashMap<>(); | |||
/** Widget to captionwrapper map */ | |||
private final HashMap<Widget, VCaptionWrapper> childWidgetToCaptionWrapper = new HashMap<Widget, VCaptionWrapper>(); | |||
private final HashMap<Widget, VCaptionWrapper> childWidgetToCaptionWrapper = new HashMap<>(); | |||
/** | |||
* Unexecuted scripts loaded from the template. |
@@ -477,10 +477,10 @@ public class VDragAndDropWrapper extends VCustomComponent | |||
} | |||
/** For internal use only. May be removed or replaced in the future. */ | |||
public List<Integer> fileIds = new ArrayList<Integer>(); | |||
public List<Integer> fileIds = new ArrayList<>(); | |||
/** For internal use only. May be removed or replaced in the future. */ | |||
public List<VHtml5File> files = new ArrayList<VHtml5File>(); | |||
public List<VHtml5File> files = new ArrayList<>(); | |||
private void queueFilePost(final int fileId, final VHtml5File file) { | |||
fileIds.add(fileId); |
@@ -206,7 +206,7 @@ public class VEmbedded extends HTML { | |||
* @return | |||
*/ | |||
public static Map<String, String> getParameters(UIDL uidl) { | |||
Map<String, String> parameters = new HashMap<String, String>(); | |||
Map<String, String> parameters = new HashMap<>(); | |||
Iterator<Object> childIterator = uidl.getChildIterator(); | |||
while (childIterator.hasNext()) { |
@@ -32,7 +32,7 @@ public class VFlash extends HTML { | |||
protected String codetype; | |||
protected String standby; | |||
protected String archive; | |||
protected Map<String, String> embedParams = new HashMap<String, String>(); | |||
protected Map<String, String> embedParams = new HashMap<>(); | |||
protected boolean needsRebuild = false; | |||
protected String width; | |||
protected String height; | |||
@@ -131,7 +131,7 @@ public class VFlash extends HTML { | |||
} | |||
if (!embedParams.equals(params)) { | |||
embedParams = new HashMap<String, String>(params); | |||
embedParams = new HashMap<>(params); | |||
needsRebuild = true; | |||
} | |||
} |
@@ -68,7 +68,7 @@ public class VFormLayout extends SimplePanel { | |||
*/ | |||
private String[] getStylesFromState(AbstractComponentState state, | |||
boolean enabled) { | |||
List<String> styles = new ArrayList<String>(); | |||
List<String> styles = new ArrayList<>(); | |||
if (ComponentStateUtil.hasStyles(state)) { | |||
for (String name : state.styles) { | |||
styles.add(name); | |||
@@ -88,8 +88,8 @@ public class VFormLayout extends SimplePanel { | |||
private static final int COLUMN_ERRORFLAG = 1; | |||
public static final int COLUMN_WIDGET = 2; | |||
private HashMap<Widget, Caption> widgetToCaption = new HashMap<Widget, Caption>(); | |||
private HashMap<Widget, ErrorFlag> widgetToError = new HashMap<Widget, ErrorFlag>(); | |||
private HashMap<Widget, Caption> widgetToCaption = new HashMap<>(); | |||
private HashMap<Widget, ErrorFlag> widgetToError = new HashMap<>(); | |||
public VFormLayoutTable() { | |||
DOM.setElementProperty(getElement(), "cellPadding", "0"); |
@@ -52,7 +52,7 @@ public class VGridLayout extends ComplexPanel { | |||
public ApplicationConnection client; | |||
/** For internal use only. May be removed or replaced in the future. */ | |||
public HashMap<Widget, Cell> widgetToCell = new HashMap<Widget, Cell>(); | |||
public HashMap<Widget, Cell> widgetToCell = new HashMap<>(); | |||
/** For internal use only. May be removed or replaced in the future. */ | |||
public int[] columnWidths; | |||
@@ -586,12 +586,12 @@ public class VGridLayout extends ComplexPanel { | |||
} | |||
} | |||
private LinkedList<SpanList> colSpans = new LinkedList<SpanList>(); | |||
private LinkedList<SpanList> rowSpans = new LinkedList<SpanList>(); | |||
private LinkedList<SpanList> colSpans = new LinkedList<>(); | |||
private LinkedList<SpanList> rowSpans = new LinkedList<>(); | |||
private class SpanList { | |||
final int span; | |||
List<Cell> cells = new LinkedList<Cell>(); | |||
List<Cell> cells = new LinkedList<>(); | |||
public SpanList(int span) { | |||
this.span = span; |
@@ -138,7 +138,7 @@ public class VMenuBar extends SimpleFocusablePanel | |||
public VMenuBar(boolean subMenu, VMenuBar parentMenu) { | |||
items = new ArrayList<CustomMenuItem>(); | |||
items = new ArrayList<>(); | |||
popup = null; | |||
visibleChildMenu = null; | |||
this.subMenu = subMenu; | |||
@@ -928,7 +928,7 @@ public class VMenuBar extends SimpleFocusablePanel | |||
} | |||
String currentStyles = super.getStyleName(); | |||
List<String> customStyles = new ArrayList<String>(); | |||
List<String> customStyles = new ArrayList<>(); | |||
for (String style : currentStyles.split(" ")) { | |||
if (!style.isEmpty() && !style.startsWith(primaryStyleName)) { | |||
customStyles.add(style); | |||
@@ -1594,7 +1594,7 @@ public class VMenuBar extends SimpleFocusablePanel | |||
return item.getElement(); | |||
} else { | |||
Queue<CustomMenuItem> submenuItems = new LinkedList<CustomMenuItem>(); | |||
Queue<CustomMenuItem> submenuItems = new LinkedList<>(); | |||
for (CustomMenuItem item : getItems()) { | |||
if (isItemNamed(item, subPart)) { | |||
return item.getElement(); |
@@ -81,7 +81,7 @@ public class VNotification extends VOverlay { | |||
private static final int Z_INDEX_BASE = 20000; | |||
public static final String STYLE_SYSTEM = "system"; | |||
private static final ArrayList<VNotification> notifications = new ArrayList<VNotification>(); | |||
private static final ArrayList<VNotification> notifications = new ArrayList<>(); | |||
private boolean infiniteDelay = false; | |||
private int hideDelay = 0; | |||
@@ -464,7 +464,7 @@ public class VNotification extends VOverlay { | |||
public void addEventListener(EventListener listener) { | |||
if (listeners == null) { | |||
listeners = new ArrayList<EventListener>(); | |||
listeners = new ArrayList<>(); | |||
} | |||
listeners.add(listener); | |||
} |
@@ -240,7 +240,7 @@ public class VPopupView extends HTML | |||
private boolean hasHadMouseOver = false; | |||
private boolean hideOnMouseOut = true; | |||
private final Set<Element> activeChildren = new HashSet<Element>(); | |||
private final Set<Element> activeChildren = new HashSet<>(); | |||
private ShortcutActionHandler shortcutActionHandler; | |||
@@ -35,9 +35,9 @@ public abstract class VTabsheetBase extends ComplexPanel implements HasEnabled { | |||
protected ApplicationConnection client; | |||
/** For internal use only. May be removed or replaced in the future. */ | |||
protected final ArrayList<String> tabKeys = new ArrayList<String>(); | |||
protected final ArrayList<String> tabKeys = new ArrayList<>(); | |||
/** For internal use only. May be removed or replaced in the future. */ | |||
protected Set<String> disabledTabKeys = new HashSet<String>(); | |||
protected Set<String> disabledTabKeys = new HashSet<>(); | |||
/** For internal use only. May be removed or replaced in the future. */ | |||
protected int activeTabIndex = 0; |
@@ -77,7 +77,7 @@ import com.vaadin.shared.ui.window.WindowRole; | |||
public class VWindow extends VOverlay implements ShortcutActionHandlerOwner, | |||
ScrollHandler, KeyDownHandler, FocusHandler, BlurHandler, Focusable { | |||
private static ArrayList<VWindow> windowOrder = new ArrayList<VWindow>(); | |||
private static ArrayList<VWindow> windowOrder = new ArrayList<>(); | |||
private static boolean orderingDefered; | |||
@@ -52,7 +52,7 @@ public class VDragEvent { | |||
private int id; | |||
private HashMap<String, Object> dropDetails = new HashMap<String, Object>(); | |||
private HashMap<String, Object> dropDetails = new HashMap<>(); | |||
private Element elementOver; | |||
@@ -48,7 +48,7 @@ public class VLazyInitItemIdentifiers extends VAcceptCriterion { | |||
@Override | |||
public void handleResponse(boolean accepted, UIDL response) { | |||
hashSet = new HashSet<String>(); | |||
hashSet = new HashSet<>(); | |||
String[] stringArrayAttribute = response | |||
.getStringArrayAttribute("allowedIds"); | |||
for (int i = 0; i < stringArrayAttribute.length; i++) { |
@@ -30,7 +30,7 @@ public class VTransferable { | |||
private ComponentConnector component; | |||
private final Map<String, Object> variables = new HashMap<String, Object>(); | |||
private final Map<String, Object> variables = new HashMap<>(); | |||
/** | |||
* Returns the component from which the transferable is created (eg. a tree |
@@ -63,7 +63,7 @@ public class DragAndDropWrapperConnector extends CustomComponentConnector | |||
String receiverUrl = uidl.getStringVariable(fileId); | |||
fileId = fileId.substring(4); | |||
if (getWidget().fileIdToReceiver == null) { | |||
getWidget().fileIdToReceiver = new HashMap<String, String>(); | |||
getWidget().fileIdToReceiver = new HashMap<>(); | |||
} | |||
if ("".equals(receiverUrl)) { | |||
Integer id = Integer.parseInt(fileId); |
@@ -121,7 +121,7 @@ public class FormLayoutConnector extends AbstractLayoutConnector | |||
targetWidth = Math.max(0, targetWidth); | |||
if (oldMaxWidths == null) { | |||
oldMaxWidths = new HashMap<ComponentConnector, String>(); | |||
oldMaxWidths = new HashMap<>(); | |||
} | |||
for (ComponentConnector child : getChildComponents()) { |
@@ -725,7 +725,7 @@ public class LayoutDependencyTree { | |||
public Collection<ComponentConnector> getMeasureTargets() { | |||
JsArrayString targetIds = getMeasureTargetsJsArray(); | |||
int length = targetIds.length(); | |||
ArrayList<ComponentConnector> targets = new ArrayList<ComponentConnector>( | |||
ArrayList<ComponentConnector> targets = new ArrayList<>( | |||
length); | |||
ConnectorMap connectorMap = ConnectorMap.get(connection); | |||
@@ -76,7 +76,7 @@ public class MenuBar extends Widget implements PopupListener { | |||
private final Element table; | |||
private final Element outer; | |||
private final ArrayList<MenuItem> items = new ArrayList<MenuItem>(); | |||
private final ArrayList<MenuItem> items = new ArrayList<>(); | |||
private MenuBar parentMenu; | |||
private PopupPanel popup; | |||
private MenuItem selectedItem; |
@@ -102,8 +102,8 @@ public class MenuBarConnector extends AbstractComponentConnector | |||
UIDL uidlItems = uidl.getChildUIDL(1); | |||
Iterator<Object> itr = uidlItems.getChildIterator(); | |||
Stack<Iterator<Object>> iteratorStack = new Stack<Iterator<Object>>(); | |||
Stack<VMenuBar> menuStack = new Stack<VMenuBar>(); | |||
Stack<Iterator<Object>> iteratorStack = new Stack<>(); | |||
Stack<VMenuBar> menuStack = new Stack<>(); | |||
VMenuBar currentMenu = getWidget(); | |||
while (itr.hasNext()) { |
@@ -47,7 +47,7 @@ public class VAbstractOrderedLayout extends FlowPanel { | |||
protected boolean definedHeight = false; | |||
private Map<Widget, Slot> widgetToSlot = new HashMap<Widget, Slot>(); | |||
private Map<Widget, Slot> widgetToSlot = new HashMap<>(); | |||
private Element expandWrapper; | |||
@@ -40,7 +40,7 @@ public class PopupViewConnector extends AbstractHasComponentsConnector | |||
private boolean centerAfterLayout = false; | |||
private final List<HandlerRegistration> handlerRegistration = new ArrayList<HandlerRegistration>(); | |||
private final List<HandlerRegistration> handlerRegistration = new ArrayList<>(); | |||
@Override | |||
protected void init() { |
@@ -38,7 +38,7 @@ public class VisibilityChangeEvent extends GwtEvent<VisibilityChangeHandler> { | |||
public static Type<VisibilityChangeHandler> getType() { | |||
if (TYPE == null) { | |||
TYPE = new Type<VisibilityChangeHandler>(); | |||
TYPE = new Type<>(); | |||
} | |||
return TYPE; | |||
} |
@@ -133,7 +133,7 @@ public abstract class AbstractSplitPanelConnector extends | |||
if (ComponentStateUtil.hasStyles(getState())) { | |||
getWidget().componentStyleNames = getState().styles; | |||
} else { | |||
getWidget().componentStyleNames = new LinkedList<String>(); | |||
getWidget().componentStyleNames = new LinkedList<>(); | |||
} | |||
// Splitter updates |
@@ -56,7 +56,7 @@ public abstract class TabsheetBaseConnector | |||
getWidget().setEnabled(isEnabled()); | |||
// Widgets in the TabSheet before update | |||
ArrayList<Widget> oldWidgets = new ArrayList<Widget>(); | |||
ArrayList<Widget> oldWidgets = new ArrayList<>(); | |||
for (Iterator<Widget> iterator = getWidget() | |||
.getWidgetIterator(); iterator.hasNext();) { | |||
oldWidgets.add(iterator.next()); |
@@ -625,7 +625,7 @@ public class UIConnector extends AbstractSingleComponentContainerConnector | |||
* @return | |||
*/ | |||
public List<WindowConnector> getSubWindows() { | |||
ArrayList<WindowConnector> windows = new ArrayList<WindowConnector>(); | |||
ArrayList<WindowConnector> windows = new ArrayList<>(); | |||
for (ComponentConnector child : getChildComponents()) { | |||
if (child instanceof WindowConnector) { | |||
windows.add((WindowConnector) child); |
@@ -25,7 +25,7 @@ import com.google.gwt.event.shared.GwtEvent; | |||
*/ | |||
public class WindowMoveEvent extends GwtEvent<WindowMoveHandler> { | |||
private static final Type<WindowMoveHandler> TYPE = new Type<WindowMoveHandler>(); | |||
private static final Type<WindowMoveHandler> TYPE = new Type<>(); | |||
private final int newX; | |||
private final int newY; |
@@ -71,7 +71,7 @@ public class FlyweightRow implements Row { | |||
private CellIterator(final Collection<FlyweightCell> cells, | |||
final boolean attached) { | |||
this.cells = new ArrayList<FlyweightCell>(cells); | |||
this.cells = new ArrayList<>(cells); | |||
cellsAttached = attached; | |||
} | |||
@@ -142,7 +142,7 @@ public class FlyweightRow implements Row { | |||
private int row; | |||
private TableRowElement element; | |||
private double[] columnWidths = null; | |||
private final List<FlyweightCell> cells = new ArrayList<FlyweightCell>(); | |||
private final List<FlyweightCell> cells = new ArrayList<>(); | |||
public void setup(final TableRowElement e, final int row, | |||
double[] columnWidths) { |
@@ -30,7 +30,7 @@ public class RowVisibilityChangeEvent | |||
/** | |||
* The type of this event. | |||
*/ | |||
public static final Type<RowVisibilityChangeHandler> TYPE = new Type<RowVisibilityChangeHandler>(); | |||
public static final Type<RowVisibilityChangeHandler> TYPE = new Type<>(); | |||
private final Range visibleRows; | |||
@@ -29,7 +29,7 @@ public class RowHeightChangedEvent extends GwtEvent<RowHeightChangedHandler> { | |||
/** | |||
* Handler type. | |||
*/ | |||
public final static Type<RowHeightChangedHandler> TYPE = new Type<RowHeightChangedHandler>(); | |||
public final static Type<RowHeightChangedHandler> TYPE = new Type<>(); | |||
public static final Type<RowHeightChangedHandler> getType() { | |||
return TYPE; |
@@ -27,7 +27,7 @@ import com.vaadin.shared.Range; | |||
public class DataAvailableEvent extends GwtEvent<DataAvailableHandler> { | |||
private Range rowsAvailable; | |||
public static final Type<DataAvailableHandler> TYPE = new Type<DataAvailableHandler>(); | |||
public static final Type<DataAvailableHandler> TYPE = new Type<>(); | |||
public DataAvailableEvent(Range rowsAvailable) { | |||
this.rowsAvailable = rowsAvailable; |
@@ -38,7 +38,7 @@ public class EventCellReference<T> extends CellReference<T> { | |||
private TableCellElement element; | |||
public EventCellReference(Grid<T> grid) { | |||
super(new RowReference<T>(grid)); | |||
super(new RowReference<>(grid)); | |||
} | |||
/** |
@@ -344,7 +344,7 @@ public class ListDataSource<T> implements DataSource<T> { | |||
if (datasource == null) { | |||
throw new IllegalArgumentException("datasource cannot be null"); | |||
} | |||
ds = new ArrayList<T>(datasource); | |||
ds = new ArrayList<>(datasource); | |||
wrapper = new ListWrapper(); | |||
} | |||
@@ -358,9 +358,9 @@ public class ListDataSource<T> implements DataSource<T> { | |||
*/ | |||
public ListDataSource(T... rows) { | |||
if (rows == null) { | |||
ds = new ArrayList<T>(); | |||
ds = new ArrayList<>(); | |||
} else { | |||
ds = new ArrayList<T>(Arrays.asList(rows)); | |||
ds = new ArrayList<>(Arrays.asList(rows)); | |||
} | |||
wrapper = new ListWrapper(); | |||
} |
@@ -50,7 +50,7 @@ public class ListSorter<T> { | |||
} | |||
this.grid = grid; | |||
comparators = new HashMap<Grid.Column<?, T>, Comparator<?>>(); | |||
comparators = new HashMap<>(); | |||
sortHandlerRegistration = grid.addSortHandler(new SortHandler<T>() { | |||
@Override |
@@ -31,7 +31,7 @@ public class ColumnReorderEvent<T> extends GwtEvent<ColumnReorderHandler<T>> { | |||
/** | |||
* Handler type. | |||
*/ | |||
private final static Type<ColumnReorderHandler<?>> TYPE = new Type<ColumnReorderHandler<?>>(); | |||
private final static Type<ColumnReorderHandler<?>> TYPE = new Type<>(); | |||
public static final Type<ColumnReorderHandler<?>> getType() { | |||
return TYPE; |
@@ -32,7 +32,7 @@ public class ColumnResizeEvent<T> extends GwtEvent<ColumnResizeHandler<T>> { | |||
/** | |||
* Handler type. | |||
*/ | |||
private final static Type<ColumnResizeHandler<?>> TYPE = new Type<ColumnResizeHandler<?>>(); | |||
private final static Type<ColumnResizeHandler<?>> TYPE = new Type<>(); | |||
private Column<?, T> column; | |||
@@ -31,7 +31,7 @@ import com.vaadin.client.widgets.Grid.Column; | |||
public class ColumnVisibilityChangeEvent<T> | |||
extends GwtEvent<ColumnVisibilityChangeHandler<T>> { | |||
private final static Type<ColumnVisibilityChangeHandler<?>> TYPE = new Type<ColumnVisibilityChangeHandler<?>>(); | |||
private final static Type<ColumnVisibilityChangeHandler<?>> TYPE = new Type<>(); | |||
public static final Type<ColumnVisibilityChangeHandler<?>> getType() { | |||
return TYPE; |
@@ -27,7 +27,7 @@ public class GridEnabledEvent extends GwtEvent<GridEnabledHandler> { | |||
/** | |||
* The type of this event | |||
*/ | |||
public static final Type<GridEnabledHandler> TYPE = new Type<GridEnabledHandler>(); | |||
public static final Type<GridEnabledHandler> TYPE = new Type<>(); | |||
private final boolean enabled; | |||
public GridEnabledEvent(boolean enabled) { |
@@ -26,7 +26,7 @@ import com.google.gwt.event.shared.GwtEvent; | |||
public class ScrollEvent extends GwtEvent<ScrollHandler> { | |||
/** The type of this event */ | |||
public static final Type<ScrollHandler> TYPE = new Type<ScrollHandler>(); | |||
public static final Type<ScrollHandler> TYPE = new Type<>(); | |||
@Override | |||
public Type<ScrollHandler> getAssociatedType() { |
@@ -30,7 +30,7 @@ public class SelectAllEvent<T> extends GwtEvent<SelectAllHandler<T>> { | |||
/** | |||
* Handler type. | |||
*/ | |||
private final static Type<SelectAllHandler<?>> TYPE = new Type<SelectAllHandler<?>>();; | |||
private final static Type<SelectAllHandler<?>> TYPE = new Type<>();; | |||
private SelectionModel.Multi<T> selectionModel; | |||
@@ -639,7 +639,7 @@ public class MultiSelectionRenderer<T> | |||
@Override | |||
public Collection<String> getConsumedEvents() { | |||
final HashSet<String> events = new HashSet<String>(); | |||
final HashSet<String> events = new HashSet<>(); | |||
/* | |||
* this column's first interest is only to attach a NativePreventHandler |
@@ -32,7 +32,7 @@ import com.vaadin.client.widgets.Grid; | |||
@SuppressWarnings("rawtypes") | |||
public class SelectionEvent<T> extends GwtEvent<SelectionHandler> { | |||
private static final Type<SelectionHandler> eventType = new Type<SelectionHandler>(); | |||
private static final Type<SelectionHandler> eventType = new Type<>(); | |||
private final Grid<T> grid; | |||
private final List<T> added; | |||
@@ -92,13 +92,13 @@ public class SelectionEvent<T> extends GwtEvent<SelectionHandler> { | |||
this.batched = batched; | |||
if (added != null) { | |||
this.added = new ArrayList<T>(added); | |||
this.added = new ArrayList<>(added); | |||
} else { | |||
this.added = Collections.emptyList(); | |||
} | |||
if (removed != null) { | |||
this.removed = new ArrayList<T>(removed); | |||
this.removed = new ArrayList<>(removed); | |||
} else { | |||
this.removed = Collections.emptyList(); | |||
} |