From 504b3c4c65c6a2ccfeeb1501eff7a29f5a3dbec3 Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Mon, 5 Sep 2016 12:33:39 +0300 Subject: [PATCH] Use diamond operator where it can be used Does not modify compatibility packages to keep to closer to Vaadin 7.7 Change-Id: Ic9c4944eb90218290545a04ecd7455eb63910012 --- .../FetchReleaseNotesAuthors.java | 2 +- .../FetchReleaseNotesTickets.java | 4 +- .../buildhelpers/GeneratePackageExports.java | 4 +- .../com/vaadin/sass/linker/SassLinker.java | 2 +- .../ConnectorBundleLoaderFactory.java | 20 ++-- .../metadata/ConnectorBundle.java | 50 +++++----- .../metadata/FieldProperty.java | 6 +- .../metadata/MethodProperty.java | 6 +- .../com/vaadin/tools/CvalAddonsChecker.java | 2 +- .../client/ApplicationConfiguration.java | 14 +-- .../vaadin/client/ApplicationConnection.java | 10 +- .../com/vaadin/client/ComponentDetail.java | 2 +- .../com/vaadin/client/ComponentDetailMap.java | 2 +- .../client/ConnectorHierarchyChangeEvent.java | 2 +- .../java/com/vaadin/client/ConnectorMap.java | 4 +- .../client/JavaScriptConnectorHelper.java | 12 +-- .../java/com/vaadin/client/LayoutManager.java | 10 +- .../java/com/vaadin/client/LocaleService.java | 2 +- .../main/java/com/vaadin/client/Profiler.java | 12 +-- .../com/vaadin/client/ResourceLoader.java | 10 +- .../src/main/java/com/vaadin/client/UIDL.java | 4 +- .../src/main/java/com/vaadin/client/Util.java | 2 +- .../main/java/com/vaadin/client/ValueMap.java | 2 +- .../java/com/vaadin/client/WidgetMap.java | 2 +- .../java/com/vaadin/client/WidgetUtil.java | 2 +- .../client/communication/JsonDecoder.java | 12 +-- .../client/communication/MessageHandler.java | 8 +- .../client/communication/ServerRpcQueue.java | 2 +- .../communication/StateChangeEvent.java | 4 +- .../LegacyLocatorStrategy.java | 6 +- .../componentlocator/SelectorPredicate.java | 6 +- .../VaadinFinderLocatorStrategy.java | 20 ++-- .../data/DataCommunicatorConnector.java | 4 +- .../client/connectors/grid/GridConnector.java | 2 +- .../client/data/AbstractRemoteDataSource.java | 10 +- .../debug/internal/AnalyzeLayoutsPanel.java | 8 +- .../debug/internal/ConnectorInfoPanel.java | 2 +- .../client/debug/internal/HierarchyPanel.java | 2 +- .../client/debug/internal/Highlight.java | 2 +- .../internal/OptimizedWidgetsetPanel.java | 2 +- .../client/debug/internal/SelectorPath.java | 4 +- .../debug/internal/TestBenchSection.java | 2 +- .../client/debug/internal/VDebugWindow.java | 2 +- .../com/vaadin/client/event/InputEvent.java | 2 +- .../client/event/PointerCancelEvent.java | 2 +- .../vaadin/client/event/PointerDownEvent.java | 2 +- .../vaadin/client/event/PointerMoveEvent.java | 2 +- .../vaadin/client/event/PointerUpEvent.java | 2 +- .../JavaScriptManagerConnector.java | 4 +- .../client/metadata/AsyncBundleLoader.java | 2 +- .../metadata/ConnectorBundleLoader.java | 2 +- .../vaadin/client/metadata/TypeDataStore.java | 2 +- .../client/renderers/ClickableRenderer.java | 2 +- .../vaadin/client/ui/AbstractConnector.java | 2 +- .../client/ui/ShortcutActionHandler.java | 2 +- .../vaadin/client/ui/TouchScrollDelegate.java | 4 +- .../vaadin/client/ui/VAbstractSplitPanel.java | 2 +- .../java/com/vaadin/client/ui/VAccordion.java | 2 +- .../com/vaadin/client/ui/VCustomLayout.java | 6 +- .../vaadin/client/ui/VDragAndDropWrapper.java | 4 +- .../java/com/vaadin/client/ui/VEmbedded.java | 2 +- .../java/com/vaadin/client/ui/VFlash.java | 4 +- .../com/vaadin/client/ui/VFormLayout.java | 6 +- .../com/vaadin/client/ui/VGridLayout.java | 8 +- .../java/com/vaadin/client/ui/VMenuBar.java | 6 +- .../com/vaadin/client/ui/VNotification.java | 4 +- .../java/com/vaadin/client/ui/VPopupView.java | 2 +- .../com/vaadin/client/ui/VTabsheetBase.java | 4 +- .../java/com/vaadin/client/ui/VWindow.java | 2 +- .../com/vaadin/client/ui/dd/VDragEvent.java | 2 +- .../ui/dd/VLazyInitItemIdentifiers.java | 2 +- .../vaadin/client/ui/dd/VTransferable.java | 2 +- .../DragAndDropWrapperConnector.java | 2 +- .../ui/formlayout/FormLayoutConnector.java | 2 +- .../ui/layout/LayoutDependencyTree.java | 2 +- .../com/vaadin/client/ui/menubar/MenuBar.java | 2 +- .../client/ui/menubar/MenuBarConnector.java | 4 +- .../orderedlayout/VAbstractOrderedLayout.java | 2 +- .../ui/popupview/PopupViewConnector.java | 2 +- .../ui/popupview/VisibilityChangeEvent.java | 2 +- .../AbstractSplitPanelConnector.java | 2 +- .../ui/tabsheet/TabsheetBaseConnector.java | 2 +- .../com/vaadin/client/ui/ui/UIConnector.java | 2 +- .../client/ui/window/WindowMoveEvent.java | 2 +- .../client/widget/escalator/FlyweightRow.java | 4 +- .../escalator/RowVisibilityChangeEvent.java | 2 +- .../events/RowHeightChangedEvent.java | 2 +- .../widget/grid/DataAvailableEvent.java | 2 +- .../widget/grid/EventCellReference.java | 2 +- .../grid/datasources/ListDataSource.java | 6 +- .../widget/grid/datasources/ListSorter.java | 2 +- .../grid/events/ColumnReorderEvent.java | 2 +- .../widget/grid/events/ColumnResizeEvent.java | 2 +- .../events/ColumnVisibilityChangeEvent.java | 2 +- .../widget/grid/events/GridEnabledEvent.java | 2 +- .../widget/grid/events/ScrollEvent.java | 2 +- .../widget/grid/events/SelectAllEvent.java | 2 +- .../selection/MultiSelectionRenderer.java | 2 +- .../widget/grid/selection/SelectionEvent.java | 6 +- .../grid/selection/SelectionModelMulti.java | 26 +++--- .../grid/selection/SelectionModelSingle.java | 8 +- .../vaadin/client/widget/grid/sort/Sort.java | 2 +- .../client/widget/grid/sort/SortEvent.java | 2 +- .../com/vaadin/client/widgets/Escalator.java | 28 +++--- .../java/com/vaadin/client/widgets/Grid.java | 92 +++++++++---------- .../com/vaadin/client/widgets/Overlay.java | 2 +- .../vaadin/client/DateTimeServiceTest.java | 2 +- .../client/ui/grid/ListDataSourceTest.java | 20 ++-- .../src/main/java/com/vaadin/data/Result.java | 2 +- .../main/java/com/vaadin/data/sort/Sort.java | 2 +- .../java/com/vaadin/event/ActionManager.java | 8 +- .../java/com/vaadin/event/EventRouter.java | 6 +- .../java/com/vaadin/event/SelectionEvent.java | 6 +- .../com/vaadin/event/TransferableImpl.java | 2 +- .../vaadin/event/dd/TargetDetailsImpl.java | 2 +- .../java/com/vaadin/navigator/Navigator.java | 8 +- .../server/AbstractClientConnector.java | 14 +-- .../vaadin/server/AbstractErrorMessage.java | 2 +- .../com/vaadin/server/BootstrapHandler.java | 2 +- .../vaadin/server/ComponentSizeValidator.java | 14 +-- .../com/vaadin/server/DownloadStream.java | 2 +- .../com/vaadin/server/GAEVaadinServlet.java | 4 +- .../vaadin/server/GlobalResourceHandler.java | 10 +- .../server/JavaScriptCallbackHelper.java | 4 +- .../java/com/vaadin/server/JsonCodec.java | 26 +++--- .../com/vaadin/server/JsonPaintTarget.java | 18 ++-- .../java/com/vaadin/server/KeyMapper.java | 4 +- .../com/vaadin/server/LegacyApplication.java | 2 +- .../server/LegacyCommunicationManager.java | 10 +- .../src/main/java/com/vaadin/server/Page.java | 10 +- .../com/vaadin/server/ServerRpcManager.java | 2 +- .../server/ServerRpcMethodInvocation.java | 2 +- .../vaadin/server/VaadinPortletSession.java | 18 ++-- .../java/com/vaadin/server/VaadinService.java | 8 +- .../java/com/vaadin/server/VaadinServlet.java | 6 +- .../java/com/vaadin/server/VaadinSession.java | 16 ++-- .../com/vaadin/server/WrappedHttpSession.java | 2 +- .../server/communication/ClientRpcWriter.java | 4 +- .../communication/LegacyUidlWriter.java | 2 +- .../communication/ServerRpcHandler.java | 4 +- .../communication/SessionRequestHandler.java | 2 +- .../communication/SharedStateWriter.java | 2 +- .../server/communication/UidlWriter.java | 10 +- .../SASSAddonImportFileCreator.java | 6 +- .../widgetsetutils/ClassPathExplorer.java | 10 +- .../widgetsetutils/WidgetSetBuilder.java | 2 +- .../java/com/vaadin/ui/AbsoluteLayout.java | 4 +- .../java/com/vaadin/ui/AbstractComponent.java | 10 +- .../vaadin/ui/AbstractComponentContainer.java | 6 +- .../java/com/vaadin/ui/AbstractMedia.java | 2 +- .../com/vaadin/ui/AbstractOrderedLayout.java | 2 +- .../java/com/vaadin/ui/ConnectorTracker.java | 32 +++---- .../main/java/com/vaadin/ui/CssLayout.java | 2 +- .../main/java/com/vaadin/ui/CustomLayout.java | 2 +- .../com/vaadin/ui/DragAndDropWrapper.java | 6 +- .../src/main/java/com/vaadin/ui/Embedded.java | 2 +- server/src/main/java/com/vaadin/ui/Flash.java | 4 +- .../main/java/com/vaadin/ui/GridLayout.java | 18 ++-- .../main/java/com/vaadin/ui/JavaScript.java | 2 +- .../main/java/com/vaadin/ui/LoginForm.java | 2 +- .../src/main/java/com/vaadin/ui/MenuBar.java | 10 +- .../src/main/java/com/vaadin/ui/TabSheet.java | 6 +- server/src/main/java/com/vaadin/ui/UI.java | 4 +- .../src/main/java/com/vaadin/ui/Upload.java | 2 +- .../src/main/java/com/vaadin/ui/Window.java | 4 +- .../declarative/DesignAttributeHandler.java | 8 +- .../vaadin/ui/declarative/DesignContext.java | 20 ++-- .../ui/declarative/DesignFormatter.java | 2 +- .../vaadin/ui/declarative/FieldBinder.java | 6 +- .../converters/DesignResourceConverter.java | 2 +- .../DesignShortcutActionConverter.java | 4 +- .../converters/ShortcutKeyMapper.java | 4 +- .../java/com/vaadin/util/ConnectorHelper.java | 2 +- .../java/com/vaadin/util/CurrentInstance.java | 10 +- .../com/vaadin/util/FileTypeResolver.java | 4 +- .../test/java/com/vaadin/data/ResultTest.java | 2 +- .../vaadin/server/DragAndDropServiceTest.java | 8 +- .../com/vaadin/server/JSONSerializerTest.java | 4 +- .../com/vaadin/server/MockVaadinSession.java | 2 +- .../server/data/datasource/StrBean.java | 2 +- .../java/com/vaadin/tests/VaadinClasses.java | 4 +- .../tests/design/ComponentFactoryTest.java | 6 +- .../tests/design/ComponentMapperTest.java | 2 +- .../tests/design/DeclarativeTestBase.java | 2 +- .../tests/design/DeclarativeTestBaseBase.java | 8 +- .../tests/design/DesignFormatterTest.java | 2 +- .../design/DesignReadInConstructorTest.java | 2 +- .../tests/event/ShortcutActionTest.java | 4 +- .../tests/server/ClassesSerializableTest.java | 14 +-- .../vaadin/tests/server/KeyMapperTest.java | 6 +- .../AttachDetachListenersTest.java | 2 +- .../AbstractListenerMethodsTestBase.java | 2 +- .../server/component/FinalMethodTest.java | 2 +- .../StateGetDoesNotMarkDirtyTest.java | 4 +- .../customlayout/CustomLayoutTest.java | 2 +- .../component/datefield/ResolutionTest.java | 10 +- .../component/menubar/MenuBarIdsTest.java | 4 +- .../component/ui/CustomUIClassLoaderTest.java | 2 +- .../tests/server/components/WindowTest.java | 4 +- .../tests/server/navigator/NavigatorTest.java | 6 +- .../util/GraphVizClassHierarchyCreator.java | 4 +- .../util/MockDeploymentConfiguration.java | 2 +- .../com/vaadin/util/CurrentInstanceTest.java | 2 +- .../shared/JavaScriptExtensionState.java | 4 +- .../LegacyChangeVariablesInvocation.java | 2 +- .../shared/communication/SharedState.java | 2 +- .../JavaScriptManagerState.java | 2 +- .../vaadin/shared/ui/AbstractMediaState.java | 4 +- .../shared/ui/BrowserWindowOpenerState.java | 2 +- .../vaadin/shared/ui/ComponentStateUtil.java | 2 +- .../shared/ui/JavaScriptComponentState.java | 4 +- .../absolutelayout/AbsoluteLayoutState.java | 2 +- .../shared/ui/csslayout/CssLayoutState.java | 2 +- .../ui/customlayout/CustomLayoutState.java | 2 +- .../shared/ui/datefield/Resolution.java | 4 +- .../com/vaadin/shared/ui/grid/GridState.java | 2 +- .../shared/ui/gridlayout/GridLayoutState.java | 6 +- .../AbstractOrderedLayoutState.java | 2 +- .../shared/ui/tabsheet/TabsheetState.java | 2 +- .../java/com/vaadin/shared/ui/ui/UIState.java | 6 +- .../com/vaadin/tests/tb3/AbstractTB3Test.java | 4 +- .../vaadin/tests/tb3/MultiBrowserTest.java | 2 +- .../vaadin/tests/tb3/ParallelScheduler.java | 2 +- .../tests/tb3/ParameterizedTB3Runner.java | 4 +- .../vaadin/tests/tb3/ScreenshotTB3Test.java | 6 +- .../com/vaadin/tests/tb3/TB3TestLocator.java | 2 +- .../launcher/ApplicationRunnerServlet.java | 6 +- .../launcher/DevelopmentServerLauncher.java | 4 +- .../screenshotbrowser/ScreenshotBrowser.java | 2 +- .../java/com/vaadin/tests/Components.java | 6 +- .../java/com/vaadin/tests/ListenerOrder.java | 2 +- .../tests/OrderedLayoutSwapComponents.java | 2 +- .../vaadin/tests/StressComponentsInTable.java | 2 +- .../main/java/com/vaadin/tests/TestBench.java | 6 +- .../tests/TestForChildComponentRendering.java | 4 +- ...tForGridLayoutChildComponentRendering.java | 4 +- .../tests/TestForMultipleStyleNames.java | 4 +- ...ablesInitialColumnWidthLogicRendering.java | 2 +- .../com/vaadin/tests/TestMethodProperty.java | 2 +- .../TestSelectAndDatefieldInDeepLayouts.java | 2 +- .../tests/TestSizeableIncomponents.java | 2 +- .../vaadin/tests/UsingObjectsInSelect.java | 2 +- .../java/com/vaadin/tests/VaadinClasses.java | 2 +- .../accessibility/WindowWaiAriaRoles.java | 2 +- .../application/DetachOldUIOnReload.java | 2 +- .../AbstractComponentContainerTest.java | 4 +- .../components/AbstractComponentTest.java | 32 +++---- .../components/AbstractComponentTestCase.java | 2 +- .../tests/components/AbstractLayoutTest.java | 4 +- .../components/AbstractOrderedLayoutTest.java | 2 +- .../tests/components/ComponentTestCase.java | 2 +- .../tests/components/ErrorMessages.java | 2 +- .../tests/components/FileDownloaderUI.java | 2 +- .../HierarchicalContainerSorting.java | 2 +- .../AbstractComponentDataBindingTest.java | 2 +- .../AbstractFieldCommitWithInvalidValues.java | 2 +- .../AbstractFieldDataSourceReadOnly.java | 2 +- .../DateFieldBackedByString.java | 2 +- .../abstractfield/DateFieldBasedOnLong.java | 2 +- .../IntegerDoubleFieldsWithDataSource.java | 4 +- .../LegacyAbstractFieldTest.java | 4 +- ...uiredIndicatorForFieldsWithoutCaption.java | 2 +- .../abstractfield/TextFieldConversions.java | 2 +- .../components/accordion/RemoveTabs.java | 2 +- .../BeanItemContainerGenerator.java | 2 +- .../TestBeanItemContainerUsage.java | 4 +- .../calendar/BeanItemContainerTestUI.java | 4 +- .../calendar/CalendarActionEventSource.java | 2 +- .../calendar/CalendarActionsMenuTest.java | 2 +- .../calendar/CalendarHtmlInEvents.java | 2 +- .../calendar/CalendarNotifications.java | 2 +- .../CalendarResizeOverlappingEvents.java | 2 +- .../calendar/NotificationTestUI.java | 2 +- .../combobox/ComboBoxClickIcon.java | 2 +- .../combobox/ComboBoxDuplicateCaption.java | 4 +- .../components/combobox/ComboBoxes2.java | 6 +- .../combobox/ComboFocusBlurEvents.java | 4 +- .../components/combobox/ComboPushTiming.java | 4 +- .../combobox/ComboboxMenuBarAutoopen.java | 2 +- .../tests/components/combobox/Comboboxes.java | 2 +- .../datefield/CustomDateFormats.java | 2 +- .../datefield/DateFieldEmptyValid.java | 4 +- .../datefield/DateFieldRangeValidation.java | 2 +- .../components/datefield/DateFieldTest.java | 6 +- .../datefield/DateFieldTimezone.java | 2 +- .../datefield/InlineDateFields.java | 4 +- .../datefield/LegacyDateFieldTest.java | 6 +- .../datefield/LegacyPopupDateFieldTest.java | 2 +- .../datefield/PopupDateFieldTest.java | 2 +- .../components/datefield/PopupDateFields.java | 4 +- .../datefield/RequiredInvalidDateField.java | 4 +- .../datefield/ValueThroughProperty.java | 2 +- .../BasicJavaScriptComponent.java | 2 +- .../label/LabelPropertySourceValue.java | 2 +- .../tests/components/label/LabelTest.java | 4 +- .../tests/components/link/LinkTest.java | 2 +- .../components/listselect/ListSelectJump.java | 2 +- .../tests/components/menubar/MenuBarTest.java | 14 +-- .../tests/components/menubar/Menubars.java | 2 +- .../components/optiongroup/OptionGroups.java | 2 +- .../orderedlayout/BoxLayoutTest.java | 6 +- .../HorizontalRelativeSizeWithoutExpand.java | 2 +- .../orderedlayout/OrderedLayoutCases.java | 2 +- .../VerticalRelativeSizeWithoutExpand.java | 2 +- .../panel/PanelShouldRemoveActionHandler.java | 2 +- .../popupview/PopupViewOffScreen.java | 2 +- .../ProgressBarGenericTest.java | 4 +- .../ProgressIndicatorTest.java | 4 +- .../richtextarea/RichTextAreaTest.java | 2 +- .../select/AbstractSelectTestCase.java | 8 +- .../select/SelectDisplaysOldValue.java | 6 +- .../tests/components/slider/SliderTest.java | 2 +- ...hsAfterChangeTableColumnsCountOrOrder.java | 4 +- .../components/table/ContextMenuSize.java | 2 +- .../table/DndTableTargetDetails.java | 4 +- .../components/table/DoublesInTable.java | 4 +- .../components/table/EditableTableLeak.java | 2 +- .../table/EmptyRowsWhenScrolling.java | 2 +- .../components/table/ExpandingContainer.java | 2 +- .../table/HeaderRightClickAfterDrag.java | 2 +- ...KeyboardNavigationWithChangingContent.java | 10 +- .../table/LargeSelectionCausesNPE.java | 2 +- .../components/table/LeftColumnAlignment.java | 2 +- .../table/MultiSelectWithRemovedRow.java | 2 +- .../table/NotselectablePaintSelections.java | 2 +- .../tests/components/table/ReloadWidgets.java | 2 +- .../table/ScrollCausesRequestLoop.java | 2 +- .../table/SetDataSourceWithPropertyIds.java | 4 +- .../tests/components/table/TableJumpUI.java | 2 +- .../table/TableMoveFocusWithSelection.java | 2 +- .../table/TableReduceContainerSize.java | 2 +- ...epairsScrollPositionOnReAddingAllRows.java | 12 +-- .../table/TableSelectPagingOff.java | 2 +- .../tests/components/table/TableSorting.java | 2 +- .../table/TableSortingIndicator.java | 2 +- .../TableSortingStopsWorkingOnChrome.java | 2 +- .../table/TableUnregisterComponent.java | 2 +- .../vaadin/tests/components/table/Tables.java | 34 +++---- ...stTabNotVisibleWhenTabsheetNotClipped.java | 2 +- .../tests/components/tabsheet/RemoveTabs.java | 2 +- .../tabsheet/TabKeyboardNavigation.java | 2 +- .../TabKeyboardNavigationWaiAria.java | 2 +- .../components/tabsheet/TabSheetTest.java | 2 +- .../textfield/BigDecimalTextField.java | 2 +- ...TextFieldWithDataSourceAndInputPrompt.java | 2 +- .../textfield/TextFieldWithProperty.java | 2 +- .../vaadin/tests/components/tree/Trees.java | 14 +-- .../treetable/ProgrammaticSelect.java | 2 +- .../treetable/RowHeightWithoutRows.java | 2 +- .../TreeTableCacheOnPartialUpdates.java | 6 +- ...TreeTableContainerHierarchicalWrapper.java | 2 +- .../components/treetable/TreeTableTest.java | 8 +- .../twincolselect/TwinColSelects.java | 2 +- .../components/ui/CurrentUiRetained.java | 4 +- .../components/ui/UIsInMultipleTabs.java | 2 +- .../tests/components/uitest/TestSampler.java | 2 +- .../uitest/components/FormsCssTest.java | 4 +- .../uitest/components/TablesCssTest.java | 2 +- .../tests/components/upload/TestUpload.java | 2 +- .../upload/TestUploadAndDisableOnSuccess.java | 2 +- .../window/BottomComponentScrollsUp.java | 2 +- .../components/window/SubWindowOrder.java | 2 +- .../window/WindowCloseShortcuts.java | 2 +- .../WindowShouldRemoveActionHandler.java | 2 +- .../tests/components/window/WindowZIndex.java | 2 +- .../BeanItemContainerFilteringTest.java | 2 +- .../containers/BeanItemContainerTest.java | 6 +- .../FileSystemContainerInTreeTable.java | 2 +- .../java/com/vaadin/tests/dd/DDTest2.java | 2 +- .../java/com/vaadin/tests/dd/DDTest6.java | 6 +- .../java/com/vaadin/tests/dd/DDTest7.java | 2 +- .../com/vaadin/tests/dd/TreeDragStart.java | 12 +-- .../vaadin/tests/declarative/PotusCrud.java | 2 +- .../extensions/BrowserPopupExtensionTest.java | 2 +- .../tests/fieldgroup/BasicPersonForm.java | 4 +- .../tests/fieldgroup/ComplexPerson.java | 2 +- .../com/vaadin/tests/fieldgroup/DateForm.java | 4 +- .../FieldBinderWithBeanValidation.java | 4 +- .../FormBuilderWithNestedProperties.java | 4 +- .../fieldgroup/FormWithNestedProperties.java | 2 +- .../fieldgroup/MultipleValidationErrors.java | 2 +- .../com/vaadin/tests/fields/TabIndexes.java | 2 +- .../tests/layouts/CaptionsInLayouts.java | 2 +- .../tests/layouts/CssLayoutCustomCss.java | 2 +- ...vingComponentsWhileOldParentInvisible.java | 2 +- .../tests/layouts/OrderedLayoutBasics.java | 2 +- .../broadcastingmessages/Broadcaster.java | 2 +- .../minitutorials/v7_4/GridExampleHelper.java | 2 +- .../v7a1/AutoGeneratingForm.java | 4 +- .../v7a1/FormUsingExistingLayout.java | 2 +- .../v7a1/IntegerTextFieldDataSource.java | 2 +- .../v7a1/UsingBeanValidation.java | 2 +- .../minitutorials/v7a2/WidgetContainer.java | 2 +- .../v7a3/ComplexTypesComponent.java | 8 +- .../vaadin/tests/minitutorials/v7a3/Flot.java | 2 +- .../tests/minitutorials/v7a3/FlotState.java | 2 +- .../minitutorials/v7b9/SettingsView.java | 2 +- .../vaadin/tests/push/PushConfigurator.java | 2 +- .../vaadin/tests/push/PushErrorHandling.java | 2 +- .../vaadin/tests/rpclogger/RPCLoggerUI.java | 2 +- .../tests/serialization/SerializerTest.java | 14 +-- .../themes/valo/CollapsibleTableColumn.java | 2 +- .../vaadin/tests/themes/valo/DateFields.java | 2 +- .../vaadin/tests/themes/valo/Dragging.java | 2 +- .../vaadin/tests/themes/valo/TestIcon.java | 2 +- .../vaadin/tests/themes/valo/ValoThemeUI.java | 4 +- .../com/vaadin/tests/util/LargeContainer.java | 6 +- .../main/java/com/vaadin/tests/util/Log.java | 2 +- .../com/vaadin/tests/util/Millionaire.java | 2 +- .../main/java/com/vaadin/tests/util/Role.java | 2 +- .../vaadin/tests/util/TestClickListener.java | 2 +- .../main/java/com/vaadin/tests/util/User.java | 2 +- .../client/RoundTripTesterConnector.java | 2 +- .../client/SerializerTestConnector.java | 16 ++-- .../widgetset/client/TestWidgetConnector.java | 2 +- .../EscalatorBasicClientFeaturesWidget.java | 10 +- .../grid/GridBasicClientFeaturesWidget.java | 20 ++-- .../grid/GridCellFocusOnResetSizeWidget.java | 2 +- .../GridClientColumnRendererConnector.java | 10 +- .../v7/grid/GridClientDataSourcesWidget.java | 2 +- .../grid/GridColumnAutoWidthClientWidget.java | 4 +- .../v7/grid/GridDataChangeHandlerWidget.java | 2 +- .../grid/GridDefaultTextRendererWidget.java | 2 +- .../v7/grid/GridHeightByRowOnInitWidget.java | 4 +- .../v7/grid/MySelectionModelConnector.java | 2 +- .../v7/grid/PureGWTTestApplication.java | 8 +- .../rebind/TestWidgetRegistryGenerator.java | 2 +- .../components/grid/GridCheckBoxDisplay.java | 2 +- .../grid/GridColumnWidthRecalculation.java | 2 +- .../components/grid/GridDataSourceReset.java | 4 +- .../grid/GridDefaultSelectionMode.java | 4 +- .../components/grid/GridDetailsDetach.java | 2 +- .../grid/GridHeaderFormatChange.java | 2 +- .../v7/tests/components/grid/GridHeight.java | 2 +- .../components/grid/GridReplaceContainer.java | 2 +- .../components/grid/GridSortIndicator.java | 4 +- .../grid/GridSubPixelProblemWrapping.java | 2 +- .../v7/tests/components/grid/GridThemeUI.java | 2 +- .../grid/basicfeatures/GridBasicFeatures.java | 28 +++--- .../textfield/AbstractTextFieldTest.java | 10 +- .../DeploymentConfigurationTest.java | 2 +- .../ComboBoxSuggestionPageLengthTest.java | 2 +- .../PopupDateFieldExtendedRangeTest.java | 6 +- ...QueryWithNonUniqueFirstPrimaryKeyTest.java | 2 +- .../vaadin/tests/fields/TabIndexesTest.java | 2 +- .../AbstractServletIntegrationTest.java | 2 +- .../tests/integration/JSPIntegrationTest.java | 6 +- .../tests/tb3/AffectedTB3TestLocator.java | 6 +- .../tests/tb3/ChangedTB3TestLocator.java | 8 +- .../tests/tb3/MultiBrowserThemeTest.java | 2 +- .../tb3/MultiBrowserThemeTestWithProxy.java | 2 +- .../tests/tb3/ServletIntegrationTests.java | 4 +- .../grid/GridDetailsLocationTest.java | 2 +- .../tests/components/grid/GridHeightTest.java | 2 +- .../basicfeatures/GridBasicFeaturesTest.java | 4 +- .../GridClientColumnPropertiesTest.java | 2 +- 456 files changed, 1039 insertions(+), 1039 deletions(-) diff --git a/all/src/main/java/com/vaadin/buildhelpers/FetchReleaseNotesAuthors.java b/all/src/main/java/com/vaadin/buildhelpers/FetchReleaseNotesAuthors.java index 5d92b499fe..72c10e892f 100644 --- a/all/src/main/java/com/vaadin/buildhelpers/FetchReleaseNotesAuthors.java +++ b/all/src/main/java/com/vaadin/buildhelpers/FetchReleaseNotesAuthors.java @@ -56,7 +56,7 @@ public class FetchReleaseNotesAuthors { new InputStreamReader(p.getInputStream())); String line = ""; - List authors = new ArrayList(); + List authors = new ArrayList<>(); while ((line = b.readLine()) != null) { String author = line; if (authorMap.containsKey(author)) { diff --git a/all/src/main/java/com/vaadin/buildhelpers/FetchReleaseNotesTickets.java b/all/src/main/java/com/vaadin/buildhelpers/FetchReleaseNotesTickets.java index 9f51bbf47f..7865770be8 100644 --- a/all/src/main/java/com/vaadin/buildhelpers/FetchReleaseNotesTickets.java +++ b/all/src/main/java/com/vaadin/buildhelpers/FetchReleaseNotesTickets.java @@ -39,7 +39,7 @@ public class FetchReleaseNotesTickets { } String milestone = ""; - List versions = new ArrayList(); + List 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 findPrereleaseVersions(String baseVersion) { - List versions = new ArrayList(); + List versions = new ArrayList<>(); for (int i = 0; i < 50; i++) { versions.add(baseVersion + ".alpha" + i); diff --git a/buildhelpers/src/main/java/com/vaadin/buildhelpers/GeneratePackageExports.java b/buildhelpers/src/main/java/com/vaadin/buildhelpers/GeneratePackageExports.java index 0db7609f69..9717c35353 100644 --- a/buildhelpers/src/main/java/com/vaadin/buildhelpers/GeneratePackageExports.java +++ b/buildhelpers/src/main/java/com/vaadin/buildhelpers/GeneratePackageExports.java @@ -62,7 +62,7 @@ public class GeneratePackageExports { } // Accepted packages - List acceptedPackagePrefixes = new ArrayList(); + List 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 getPackages(JarFile jar, List acceptedPackagePrefixes, boolean includeNumberPackages) { - HashSet packages = new HashSet(); + HashSet packages = new HashSet<>(); Pattern startsWithNumber = Pattern.compile("\\.\\d"); 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 scssFiles = new ArrayList(); + List 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(); + 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> definedProperties = new HashMap>(); + Map> definedProperties = new HashMap<>(); for (Property property : bundle.getNeedsProperty()) { JClassType beanType = property.getBeanType(); Set usedPropertyNames = definedProperties.get(beanType); if (usedPropertyNames == null) { - usedPropertyNames = new HashSet(); + 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 stateProperties = new HashMap(); + HashMap 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 needsSuperclass = new ArrayList( + List 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> connectorsByLoadStyle = new HashMap>(); + Map> connectorsByLoadStyle = new HashMap<>(); for (LoadStyle loadStyle : LoadStyle.values()) { connectorsByLoadStyle.put(loadStyle, new ArrayList()); } @@ -1109,7 +1109,7 @@ public class ConnectorBundleLoaderFactory extends Generator { } } - List bundles = new ArrayList(); + List bundles = new ArrayList<>(); Collection visitors = getVisitors(typeOracle); @@ -1187,10 +1187,10 @@ public class ConnectorBundleLoaderFactory extends Generator { JClassType[] types = serverConnectorType.getSubtypes(); - Map mappings = new TreeMap(); + Map mappings = new TreeMap<>(); // Keep track of what has happened to avoid logging intermediate state - Map> replaced = new TreeMap>( + Map> replaced = new TreeMap<>( ConnectorBundle.jClassComparator); for (JClassType type : types) { @@ -1229,7 +1229,7 @@ public class ConnectorBundleLoaderFactory extends Generator { List previousReplacements = replaced .remove(superclass); if (previousReplacements == null) { - previousReplacements = new ArrayList(); + 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 visitors; private final Map customSerializers; - private final Set hasSerializeSupport = new HashSet(); - private final Set needsSerializeSupport = new HashSet(); + private final Set hasSerializeSupport = new HashSet<>(); + private final Set needsSerializeSupport = new HashSet<>(); - private final Map serializers = new TreeMap( + private final Map serializers = new TreeMap<>( new Comparator() { @Override public int compare(JType o1, JType o2) { @@ -91,32 +91,32 @@ public class ConnectorBundle { } }); - private final Map>> methodAttributes = new TreeMap>>( + private final Map>> methodAttributes = new TreeMap<>( jClassComparator); - private final Set needsSuperClass = new TreeSet( + private final Set needsSuperClass = new TreeSet<>( jClassComparator); - private final Set needsGwtConstructor = new TreeSet( + private final Set needsGwtConstructor = new TreeSet<>( jClassComparator); - private final Set visitedTypes = new HashSet(); + private final Set visitedTypes = new HashSet<>(); - private final Set needsProxySupport = new TreeSet( + private final Set needsProxySupport = new TreeSet<>( jClassComparator); - private final Map presentationTypes = new TreeMap( + private final Map presentationTypes = new TreeMap<>( jClassComparator); - private final Map> identifiers = new TreeMap>( + private final Map> identifiers = new TreeMap<>( jClassComparator); - private final Map> needsReturnType = new TreeMap>( + private final Map> needsReturnType = new TreeMap<>( jClassComparator); - private final Map> needsInvoker = new TreeMap>( + private final Map> needsInvoker = new TreeMap<>( jClassComparator); - private final Map> needsParamTypes = new TreeMap>( + private final Map> needsParamTypes = new TreeMap<>( jClassComparator); - private final Map> needsOnStateChange = new TreeMap>( + private final Map> needsOnStateChange = new TreeMap<>( jClassComparator); - private final Set needsProperty = new TreeSet(); - private final Map> needsDelegateToWidget = new TreeMap>( + private final Set needsProperty = new TreeSet<>(); + private final Map> needsDelegateToWidget = new TreeMap<>( jClassComparator); private ConnectorBundle(String name, ConnectorBundle previousBundle, @@ -140,7 +140,7 @@ public class ConnectorBundle { private static Map findCustomSerializers( TypeOracle oracle) throws NotFoundException { - Map serializers = new HashMap(); + Map serializers = new HashMap<>(); JClassType serializerInterface = oracle .findType(JSONSerializer.class.getName()); @@ -406,7 +406,7 @@ public class ConnectorBundle { } public Collection getProperties(JClassType type) { - Set properties = new TreeSet(); + Set properties = new TreeSet<>(); properties.addAll(MethodProperty.findProperties(type)); properties.addAll(FieldProperty.findProperties(type)); @@ -518,7 +518,7 @@ public class ConnectorBundle { private void addMapping(Map> map, K key, String value) { Set set = map.get(key); if (set == null) { - set = new TreeSet(); + set = new TreeSet<>(); map.put(key, set); } set.add(value); @@ -528,7 +528,7 @@ public class ConnectorBundle { JMethod value) { Set set = map.get(key); if (set == null) { - set = new TreeSet(jMethodComparator); + set = new TreeSet<>(jMethodComparator); map.put(key, set); } set.add(value); @@ -595,7 +595,7 @@ public class ConnectorBundle { Map> typeData = methodAttributes .get(type); if (typeData == null) { - typeData = new TreeMap>( + typeData = new TreeMap<>( jMethodComparator); methodAttributes.put(type, typeData); } @@ -603,14 +603,14 @@ public class ConnectorBundle { Map> methods = methodAttributes .get(type); if (methods == null) { - methods = new TreeMap>( + methods = new TreeMap<>( jMethodComparator); methodAttributes.put(type, methods); } Set attributes = methods.get(method); if (attributes == null) { - attributes = new TreeSet(); + attributes = new TreeSet<>(); methods.put(method, attributes); } @@ -640,7 +640,7 @@ public class ConnectorBundle { } } - private static Set> frameworkHandledTypes = new LinkedHashSet>(); + private static Set> 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 set = new TreeSet(); + TreeSet 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 findProperties(JClassType type) { - Collection properties = new ArrayList(); + Collection properties = new ArrayList<>(); List fields = getPublicFields(type); for (JField field : fields) { @@ -72,8 +72,8 @@ public class FieldProperty extends Property { } private static List getPublicFields(JClassType type) { - Set names = new HashSet(); - ArrayList fields = new ArrayList(); + Set names = new HashSet<>(); + ArrayList 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 findProperties(JClassType type) { - Collection properties = new ArrayList(); + Collection properties = new ArrayList<>(); - Set getters = new HashSet(); + Set getters = new HashSet<>(); List 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 getSetters(JClassType beanType, Set getters) { - List setterMethods = new ArrayList(); + List 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 run() throws InvalidCvalException { - List ret = new ArrayList(); + List ret = new ArrayList<>(); try { // Visit all MANIFEST in our classpath Enumeration manifests = Thread.currentThread() diff --git a/client/src/main/java/com/vaadin/client/ApplicationConfiguration.java b/client/src/main/java/com/vaadin/client/ApplicationConfiguration.java index 2221f045b2..db7900fd15 100644 --- a/client/src/main/java/com/vaadin/client/ApplicationConfiguration.java +++ b/client/src/main/java/com/vaadin/client/ApplicationConfiguration.java @@ -249,20 +249,20 @@ public class ApplicationConfiguration implements EntryPoint { private HashMap unknownComponents; - private Map> classes = new HashMap>(); + private Map> classes = new HashMap<>(); private boolean widgetsetVersionSent = false; private static boolean moduleLoaded = false; static// TODO consider to make this hashmap per application - LinkedList callbacks = new LinkedList(); + LinkedList callbacks = new LinkedList<>(); private static int dependenciesLoading; - private static ArrayList runningApplications = new ArrayList(); + private static ArrayList runningApplications = new ArrayList<>(); - private Map componentInheritanceMap = new HashMap(); - private Map tagToServerSideClassName = new HashMap(); + private Map componentInheritanceMap = new HashMap<>(); + private Map 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(); + 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 tags = new ArrayList(); + List tags = new ArrayList<>(); for (Map.Entry entry : tagToServerSideClassName .entrySet()) { diff --git a/client/src/main/java/com/vaadin/client/ApplicationConnection.java b/client/src/main/java/com/vaadin/client/ApplicationConnection.java index 8bc6a7460f..1fe1f83cb1 100644 --- a/client/src/main/java/com/vaadin/client/ApplicationConnection.java +++ b/client/src/main/java/com/vaadin/client/ApplicationConnection.java @@ -117,7 +117,7 @@ public class ApplicationConnection implements HasHandlers { */ public static final String UIDL_REFRESH_TOKEN = "Vaadin-Refresh"; - private final HashMap resourcesMap = new HashMap(); + private final HashMap resourcesMap = new HashMap<>(); private WidgetSet widgetSet; @@ -159,7 +159,7 @@ public class ApplicationConnection implements HasHandlers { public static class RequestStartingEvent extends ApplicationConnectionEvent { - public static Type TYPE = new Type(); + public static Type 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 TYPE = new Type(); + public static Type TYPE = new Type<>(); public ResponseHandlingEndedEvent(ApplicationConnection connection) { super(connection); @@ -218,7 +218,7 @@ public class ApplicationConnection implements HasHandlers { super(connection); } - public static Type TYPE = new Type(); + public static Type TYPE = new Type<>(); @Override public Type getAssociatedType() { @@ -246,7 +246,7 @@ public class ApplicationConnection implements HasHandlers { public static class ApplicationStoppedEvent extends GwtEvent { - public static Type TYPE = new Type(); + public static Type TYPE = new Type<>(); @Override public Type getAssociatedType() { diff --git a/client/src/main/java/com/vaadin/client/ComponentDetail.java b/client/src/main/java/com/vaadin/client/ComponentDetail.java index 43874a1922..ebdcc4414c 100644 --- a/client/src/main/java/com/vaadin/client/ComponentDetail.java +++ b/client/src/main/java/com/vaadin/client/ComponentDetail.java @@ -61,7 +61,7 @@ class ComponentDetail { additionalTooltips.remove(key); } else { if (additionalTooltips == null) { - additionalTooltips = new HashMap(); + additionalTooltips = new HashMap<>(); } additionalTooltips.put(key, tooltip); } diff --git a/client/src/main/java/com/vaadin/client/ComponentDetailMap.java b/client/src/main/java/com/vaadin/client/ComponentDetailMap.java index bed3ae9387..f95c1c1a83 100644 --- a/client/src/main/java/com/vaadin/client/ComponentDetailMap.java +++ b/client/src/main/java/com/vaadin/client/ComponentDetailMap.java @@ -80,7 +80,7 @@ final class ComponentDetailMap extends JavaScriptObject { }-*/; final Collection values() { - ArrayList list = new ArrayList(); + ArrayList list = new ArrayList<>(); fillWithValues(list); return list; } diff --git a/client/src/main/java/com/vaadin/client/ConnectorHierarchyChangeEvent.java b/client/src/main/java/com/vaadin/client/ConnectorHierarchyChangeEvent.java index f63a509161..516cd808b5 100644 --- a/client/src/main/java/com/vaadin/client/ConnectorHierarchyChangeEvent.java +++ b/client/src/main/java/com/vaadin/client/ConnectorHierarchyChangeEvent.java @@ -39,7 +39,7 @@ public class ConnectorHierarchyChangeEvent /** * Type of this event, used by the event bus. */ - public static final Type TYPE = new Type(); + public static final Type TYPE = new Type<>(); List oldChildren; diff --git a/client/src/main/java/com/vaadin/client/ConnectorMap.java b/client/src/main/java/com/vaadin/client/ConnectorMap.java index 8ac9fe5c8f..ab31f0c1cb 100644 --- a/client/src/main/java/com/vaadin/client/ConnectorMap.java +++ b/client/src/main/java/com/vaadin/client/ConnectorMap.java @@ -217,7 +217,7 @@ public class ConnectorMap { */ @Deprecated public ComponentConnector[] getComponentConnectors() { - ArrayList result = new ArrayList(); + ArrayList result = new ArrayList<>(); JsArrayObject connectors = getConnectorsAsJsArray(); int size = connectors.size(); @@ -267,7 +267,7 @@ public class ConnectorMap { @Deprecated public Collection getConnectors() { Collection values = idToComponentDetail.values(); - ArrayList arrayList = new ArrayList( + ArrayList arrayList = new ArrayList<>( values.size()); for (ComponentDetail componentDetail : values) { arrayList.add(componentDetail.getConnector()); diff --git a/client/src/main/java/com/vaadin/client/JavaScriptConnectorHelper.java b/client/src/main/java/com/vaadin/client/JavaScriptConnectorHelper.java index 04d316a4e9..4a6e474a59 100644 --- a/client/src/main/java/com/vaadin/client/JavaScriptConnectorHelper.java +++ b/client/src/main/java/com/vaadin/client/JavaScriptConnectorHelper.java @@ -45,9 +45,9 @@ public class JavaScriptConnectorHelper { .createObject(); private final JavaScriptObject rpcMap = JavaScriptObject.createObject(); - private final Map rpcObjects = new HashMap(); - private final Map> rpcMethods = new HashMap>(); - private final Map> resizeListeners = new HashMap>(); + private final Map rpcObjects = new HashMap<>(); + private final Map> rpcMethods = new HashMap<>(); + private final Map> resizeListeners = new HashMap<>(); private JavaScriptObject connectorWrapper; private int tag; @@ -120,7 +120,7 @@ public class JavaScriptConnectorHelper { JavaScriptObject wildcardRpcObject = rpcObjects.get(""); Set interfaces = rpcMethods.get(method); if (interfaces == null) { - interfaces = new HashSet(); + 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 attemptedNames = new ArrayList(); + ArrayList 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 elementListeners = resizeListeners .get(element); if (elementListeners == null) { - elementListeners = new HashMap(); + elementListeners = new HashMap<>(); resizeListeners.put(element, elementListeners); } diff --git a/client/src/main/java/com/vaadin/client/LayoutManager.java b/client/src/main/java/com/vaadin/client/LayoutManager.java index 48a5ae10e5..841eead561 100644 --- a/client/src/main/java/com/vaadin/client/LayoutManager.java +++ b/client/src/main/java/com/vaadin/client/LayoutManager.java @@ -46,7 +46,7 @@ public class LayoutManager { private static final boolean debugLogging = false; private ApplicationConnection connection; - private final Set measuredNonConnectorElements = new HashSet(); + private final Set 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> elementResizeListeners = new HashMap>(); - private final Set listenersToFire = new HashSet(); + private final Map> elementResizeListeners = new HashMap<>(); + private final Set 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 originalOverflows = new HashMap(); + HashMap originalOverflows = new HashMap<>(); FastStringSet delayedOverflowFixes = FastStringSet.create(); @@ -1724,7 +1724,7 @@ public class LayoutManager { Collection listeners = elementResizeListeners .get(element); if (listeners == null) { - listeners = new HashSet(); + listeners = new HashSet<>(); elementResizeListeners.put(element, listeners); ensureMeasured(element); } diff --git a/client/src/main/java/com/vaadin/client/LocaleService.java b/client/src/main/java/com/vaadin/client/LocaleService.java index 661c885c9f..01fbeb4d2c 100644 --- a/client/src/main/java/com/vaadin/client/LocaleService.java +++ b/client/src/main/java/com/vaadin/client/LocaleService.java @@ -33,7 +33,7 @@ import com.vaadin.shared.ui.ui.UIState.LocaleData; */ public class LocaleService { - private static Map cache = new HashMap(); + private static Map cache = new HashMap<>(); private static String defaultLocale; diff --git a/client/src/main/java/com/vaadin/client/Profiler.java b/client/src/main/java/com/vaadin/client/Profiler.java index 223f19b1b0..290ec8a4a9 100644 --- a/client/src/main/java/com/vaadin/client/Profiler.java +++ b/client/src/main/java/com/vaadin/client/Profiler.java @@ -89,7 +89,7 @@ public class Profiler { */ public static class Node { private final String name; - private final LinkedHashMap children = new LinkedHashMap(); + private final LinkedHashMap children = new LinkedHashMap<>(); private double time = 0; private int count = 0; private double enterTime = 0; @@ -462,7 +462,7 @@ public class Profiler { return; } - LinkedList stack = new LinkedList(); + LinkedList stack = new LinkedList<>(); Node rootNode = new Node(null); stack.add(rootNode); JsArray gwtStatsEvents = getGwtStatsEvents(); @@ -472,7 +472,7 @@ public class Profiler { return; } - Set extendedTimeNodes = new HashSet(); + Set 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 totals = new HashMap(); + Map totals = new HashMap<>(); rootNode.sumUpTotals(totals); - ArrayList totalList = new ArrayList(totals.values()); + ArrayList totalList = new ArrayList<>(totals.values()); Collections.sort(totalList, new Comparator() { @Override public int compare(Node o1, Node o2) { @@ -584,7 +584,7 @@ public class Profiler { "domContentLoadedEventStart", "domContentLoadedEventEnd", "domComplete", "loadEventStart", "loadEventEnd" }; - LinkedHashMap timings = new LinkedHashMap(); + LinkedHashMap timings = new LinkedHashMap<>(); for (String key : keys) { double value = getPerformanceTiming(key); diff --git a/client/src/main/java/com/vaadin/client/ResourceLoader.java b/client/src/main/java/com/vaadin/client/ResourceLoader.java index 72274c8d42..37f6f51a4c 100644 --- a/client/src/main/java/com/vaadin/client/ResourceLoader.java +++ b/client/src/main/java/com/vaadin/client/ResourceLoader.java @@ -142,11 +142,11 @@ public class ResourceLoader { private ApplicationConnection connection; - private final Set loadedResources = new HashSet(); - private final Set preloadedResources = new HashSet(); + private final Set loadedResources = new HashSet<>(); + private final Set preloadedResources = new HashSet<>(); - private final Map> loadListeners = new HashMap>(); - private final Map> preloadListeners = new HashMap>(); + private final Map> loadListeners = new HashMap<>(); + private final Map> preloadListeners = new HashMap<>(); private final Element head; @@ -555,7 +555,7 @@ public class ResourceLoader { Map> listenerMap) { Collection listeners = listenerMap.get(url); if (listeners == null) { - listeners = new HashSet(); + listeners = new HashSet<>(); listeners.add(listener); listenerMap.put(url, listeners); return true; diff --git a/client/src/main/java/com/vaadin/client/UIDL.java b/client/src/main/java/com/vaadin/client/UIDL.java index dd546eb4bb..165f0c6b05 100644 --- a/client/src/main/java/com/vaadin/client/UIDL.java +++ b/client/src/main/java/com/vaadin/client/UIDL.java @@ -121,7 +121,7 @@ public final class UIDL extends JavaScriptObject { */ public Set getVariableNames() { if (!hasVariables()) { - return new HashSet(); + return new HashSet<>(); } else { Set keySet = var().getKeySet(); return keySet; @@ -453,7 +453,7 @@ public final class UIDL extends JavaScriptObject { * @return the value of the variable */ public Set getStringArrayVariableAsSet(final String name) { - final HashSet s = new HashSet(); + final HashSet s = new HashSet<>(); JsArrayString a = var().getJSStringArray(name); for (int i = 0; i < a.length(); i++) { s.add(a.get(i)); diff --git a/client/src/main/java/com/vaadin/client/Util.java b/client/src/main/java/com/vaadin/client/Util.java index 7d7a6483e3..553911b7b8 100644 --- a/client/src/main/java/com/vaadin/client/Util.java +++ b/client/src/main/java/com/vaadin/client/Util.java @@ -777,7 +777,7 @@ public class Util { try { getLogger().info("RPC invocations to be sent to the server:"); String curId = null; - ArrayList invocations = new ArrayList(); + ArrayList invocations = new ArrayList<>(); for (MethodInvocation methodInvocation : methodInvocations) { String id = methodInvocation.getConnectorId(); diff --git a/client/src/main/java/com/vaadin/client/ValueMap.java b/client/src/main/java/com/vaadin/client/ValueMap.java index ebc387a486..119e169e82 100644 --- a/client/src/main/java/com/vaadin/client/ValueMap.java +++ b/client/src/main/java/com/vaadin/client/ValueMap.java @@ -62,7 +62,7 @@ public final class ValueMap extends JavaScriptObject { }-*/; public Set getKeySet() { - final HashSet attrs = new HashSet(); + final HashSet attrs = new HashSet<>(); JsArrayString attributeNamesArray = getKeyArray(); for (int i = 0; i < attributeNamesArray.length(); i++) { attrs.add(attributeNamesArray.get(i)); diff --git a/client/src/main/java/com/vaadin/client/WidgetMap.java b/client/src/main/java/com/vaadin/client/WidgetMap.java index 6e002b6fc2..5a2fb06a69 100644 --- a/client/src/main/java/com/vaadin/client/WidgetMap.java +++ b/client/src/main/java/com/vaadin/client/WidgetMap.java @@ -26,7 +26,7 @@ import java.util.HashMap; */ abstract class WidgetMap { - protected static HashMap, WidgetInstantiator> instmap = new HashMap, WidgetInstantiator>(); + protected static HashMap, WidgetInstantiator> instmap = new HashMap<>(); /** * Create a new instance of a connector based on its type. diff --git a/client/src/main/java/com/vaadin/client/WidgetUtil.java b/client/src/main/java/com/vaadin/client/WidgetUtil.java index 8ba678e429..5a679e897d 100644 --- a/client/src/main/java/com/vaadin/client/WidgetUtil.java +++ b/client/src/main/java/com/vaadin/client/WidgetUtil.java @@ -1387,7 +1387,7 @@ public class WidgetUtil { /* * Map the size units with their type. */ - private static Map type2Unit = new HashMap(); + private static Map type2Unit = new HashMap<>(); static { for (Unit unit : Unit.values()) { type2Unit.put(unit.getType(), unit); diff --git a/client/src/main/java/com/vaadin/client/communication/JsonDecoder.java b/client/src/main/java/com/vaadin/client/communication/JsonDecoder.java index 4de251a411..9a0eb60983 100644 --- a/client/src/main/java/com/vaadin/client/communication/JsonDecoder.java +++ b/client/src/main/java/com/vaadin/client/communication/JsonDecoder.java @@ -203,7 +203,7 @@ public class JsonDecoder { if (jsonMap.getType() == JsonType.ARRAY) { JsonArray array = (JsonArray) jsonMap; if (array.length() == 0) { - return new HashMap(); + return new HashMap<>(); } } @@ -228,7 +228,7 @@ public class JsonDecoder { private static Map decodeObjectMap(Type keyType, Type valueType, JsonArray jsonValue, ApplicationConnection connection) { - Map map = new HashMap(); + Map map = new HashMap<>(); JsonArray keys = jsonValue.get(0); JsonArray values = jsonValue.get(1); @@ -249,7 +249,7 @@ public class JsonDecoder { private static Map decodeConnectorMap(Type valueType, JsonObject jsonMap, ApplicationConnection connection) { - Map map = new HashMap(); + Map map = new HashMap<>(); ConnectorMap connectorMap = ConnectorMap.get(connection); @@ -264,7 +264,7 @@ public class JsonDecoder { private static Map decodeStringMap(Type valueType, JsonObject jsonMap, ApplicationConnection connection) { - Map map = new HashMap(); + Map 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 decodeList(Type type, JsonArray jsonArray, ApplicationConnection connection) { - List tokens = new ArrayList(); + List tokens = new ArrayList<>(); decodeIntoCollection(type.getParameterTypes()[0], jsonArray, connection, tokens); return tokens; @@ -285,7 +285,7 @@ public class JsonDecoder { private static Set decodeSet(Type type, JsonArray jsonArray, ApplicationConnection connection) { - Set tokens = new HashSet(); + Set tokens = new HashSet<>(); decodeIntoCollection(type.getParameterTypes()[0], jsonArray, connection, tokens); return tokens; diff --git a/client/src/main/java/com/vaadin/client/communication/MessageHandler.java b/client/src/main/java/com/vaadin/client/communication/MessageHandler.java index f3c84c39c3..a8e22ea53b 100644 --- a/client/src/main/java/com/vaadin/client/communication/MessageHandler.java +++ b/client/src/main/java/com/vaadin/client/communication/MessageHandler.java @@ -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 responseHandlingLocks = new HashSet(); + private Set responseHandlingLocks = new HashSet<>(); /** * Contains all UIDL messages received while response handling is suspended */ - private List pendingUIDLMessages = new ArrayList(); + private List 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 newChildren = new ArrayList(); - List newComponents = new ArrayList(); + List newChildren = new ArrayList<>(); + List newComponents = new ArrayList<>(); for (int connectorIndex = 0; connectorIndex < childConnectorSize; connectorIndex++) { String childConnectorId = childConnectorIds .get(connectorIndex); diff --git a/client/src/main/java/com/vaadin/client/communication/ServerRpcQueue.java b/client/src/main/java/com/vaadin/client/communication/ServerRpcQueue.java index dfea30eb86..35d6f48565 100644 --- a/client/src/main/java/com/vaadin/client/communication/ServerRpcQueue.java +++ b/client/src/main/java/com/vaadin/client/communication/ServerRpcQueue.java @@ -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 pendingInvocations = new LinkedHashMap(); + private LinkedHashMap pendingInvocations = new LinkedHashMap<>(); private int lastInvocationTag = 0; diff --git a/client/src/main/java/com/vaadin/client/communication/StateChangeEvent.java b/client/src/main/java/com/vaadin/client/communication/StateChangeEvent.java index c5872866a9..0795d69b32 100644 --- a/client/src/main/java/com/vaadin/client/communication/StateChangeEvent.java +++ b/client/src/main/java/com/vaadin/client/communication/StateChangeEvent.java @@ -38,7 +38,7 @@ public class StateChangeEvent /** * Type of this event, used by the event bus. */ - public static final Type TYPE = new Type(); + public static final Type TYPE = new Type<>(); /** * Used to cache a FastStringSet representation of the properties that have @@ -158,7 +158,7 @@ public class StateChangeEvent public Set getChangedProperties() { if (changedPropertiesSet == null) { Profiler.enter("StateChangeEvent.getChangedProperties populate"); - changedPropertiesSet = new HashSet(); + changedPropertiesSet = new HashSet<>(); getChangedPropertiesFastSet().addAllTo(changedPropertiesSet); Profiler.leave("StateChangeEvent.getChangedProperties populate"); } diff --git a/client/src/main/java/com/vaadin/client/componentlocator/LegacyLocatorStrategy.java b/client/src/main/java/com/vaadin/client/componentlocator/LegacyLocatorStrategy.java index 9f34c3468b..2e56918ab3 100644 --- a/client/src/main/java/com/vaadin/client/componentlocator/LegacyLocatorStrategy.java +++ b/client/src/main/java/com/vaadin/client/componentlocator/LegacyLocatorStrategy.java @@ -242,7 +242,7 @@ public class LegacyLocatorStrategy implements LocatorStrategy { @Override public List getElementsByPath(String path) { // This type of search is not supported in LegacyLocator - List array = new ArrayList(); + List array = new ArrayList<>(); Element e = getElementByPath(path); if (e != null) { array.add(e); @@ -257,7 +257,7 @@ public class LegacyLocatorStrategy implements LocatorStrategy { public List getElementsByPathStartingAt(String path, Element root) { // This type of search is not supported in LegacyLocator - List array = new ArrayList(); + List 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 windows = client.getUIConnector() .getSubWindows(); - List windowWidgets = new ArrayList( + List windowWidgets = new ArrayList<>( windows.size()); for (WindowConnector wc : windows) { windowWidgets.add(wc.getWidget()); diff --git a/client/src/main/java/com/vaadin/client/componentlocator/SelectorPredicate.java b/client/src/main/java/com/vaadin/client/componentlocator/SelectorPredicate.java index f76a0bc34c..f01c693c4c 100644 --- a/client/src/main/java/com/vaadin/client/componentlocator/SelectorPredicate.java +++ b/client/src/main/java/com/vaadin/client/componentlocator/SelectorPredicate.java @@ -38,7 +38,7 @@ public class SelectorPredicate { if (path.startsWith("(")) { return extractPredicates(path.substring(path.lastIndexOf(')'))); } - return new ArrayList(); + return new ArrayList<>(); } /** @@ -49,7 +49,7 @@ public class SelectorPredicate { * @return a List of Predicate objects */ public static List extractPredicates(String path) { - List predicates = new ArrayList(); + List 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 readPredicatesFromString(String predicateStr) { - List predicates = new ArrayList(); + List predicates = new ArrayList<>(); int prevIdx = 0; int idx = LocatorUtil.indexOfIgnoringQuoted(predicateStr, ',', prevIdx); diff --git a/client/src/main/java/com/vaadin/client/componentlocator/VaadinFinderLocatorStrategy.java b/client/src/main/java/com/vaadin/client/componentlocator/VaadinFinderLocatorStrategy.java index 3e1387b314..3ba6284cf2 100644 --- a/client/src/main/java/com/vaadin/client/componentlocator/VaadinFinderLocatorStrategy.java +++ b/client/src/main/java/com/vaadin/client/componentlocator/VaadinFinderLocatorStrategy.java @@ -98,7 +98,7 @@ public class VaadinFinderLocatorStrategy implements LocatorStrategy { List hierarchy = getConnectorHierarchyForElement( targetElement); - List path = new ArrayList(); + List 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 generateQueries(List components) { // Prepare to loop through all the elements. - List paths = new ArrayList(); + List 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 getConnectorHierarchyForElement(Element elem) { Element e = elem; ComponentConnector c = Util.findPaintable(client, e); - List connectorHierarchy = new ArrayList(); + List connectorHierarchy = new ArrayList<>(); while (c != null) { @@ -281,7 +281,7 @@ public class VaadinFinderLocatorStrategy implements LocatorStrategy { path = path.substring(1, path.lastIndexOf(')')); } - List elements = new ArrayList(); + List elements = new ArrayList<>(); if (LocatorUtil.isNotificationElement(path)) { for (VNotification n : findNotificationsByPath(path)) { @@ -385,7 +385,7 @@ public class VaadinFinderLocatorStrategy implements LocatorStrategy { */ private List findNotificationsByPath(String path) { - List notifications = new ArrayList(); + List 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 output = new ArrayList(); + List 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 connectors = new ArrayList(); + List 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 collectPotentialMatches( ComponentConnector parent, String pathFragment, boolean collectRecursively) { - ArrayList potentialMatches = new ArrayList(); + ArrayList 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 getIDsForConnector(ComponentConnector connector) { Class connectorClass = connector.getClass(); - List ids = new ArrayList(); + List ids = new ArrayList<>(); TypeDataStore.get().findIdentifiersFor(connectorClass).addAllTo(ids); @@ -732,7 +732,7 @@ public class VaadinFinderLocatorStrategy implements LocatorStrategy { */ private final List eliminateDuplicates(List list) { - LinkedHashSet set = new LinkedHashSet(list); + LinkedHashSet set = new LinkedHashSet<>(list); list.clear(); list.addAll(set); return list; diff --git a/client/src/main/java/com/vaadin/client/connectors/data/DataCommunicatorConnector.java b/client/src/main/java/com/vaadin/client/connectors/data/DataCommunicatorConnector.java index b2b3372764..d3e381f0c3 100644 --- a/client/src/main/java/com/vaadin/client/connectors/data/DataCommunicatorConnector.java +++ b/client/src/main/java/com/vaadin/client/connectors/data/DataCommunicatorConnector.java @@ -48,7 +48,7 @@ public class DataCommunicatorConnector extends AbstractExtensionConnector { */ public class VaadinDataSource extends AbstractRemoteDataSource { - private Set droppedKeys = new HashSet(); + private Set 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 rows = new ArrayList( + ArrayList rows = new ArrayList<>( data.length()); for (int i = 0; i < data.length(); i++) { JsonObject rowObject = data.getObject(i); diff --git a/client/src/main/java/com/vaadin/client/connectors/grid/GridConnector.java b/client/src/main/java/com/vaadin/client/connectors/grid/GridConnector.java index 9f2b8971c1..2259f47647 100644 --- a/client/src/main/java/com/vaadin/client/connectors/grid/GridConnector.java +++ b/client/src/main/java/com/vaadin/client/connectors/grid/GridConnector.java @@ -66,7 +66,7 @@ public class GridConnector extends AbstractListingConnector protected void init() { super.init(); - new ClickSelectHandler(getWidget()); + new ClickSelectHandler<>(getWidget()); getWidget().addSortHandler(this::handleSortEvent); layout(); diff --git a/client/src/main/java/com/vaadin/client/data/AbstractRemoteDataSource.java b/client/src/main/java/com/vaadin/client/data/AbstractRemoteDataSource.java index 71568cac7a..9cc32998b2 100644 --- a/client/src/main/java/com/vaadin/client/data/AbstractRemoteDataSource.java +++ b/client/src/main/java/com/vaadin/client/data/AbstractRemoteDataSource.java @@ -178,8 +178,8 @@ public abstract class AbstractRemoteDataSource implements DataSource { private Range cached = Range.between(0, 0); - private final HashMap indexToRowMap = new HashMap(); - private final HashMap keyToIndexMap = new HashMap(); + private final HashMap indexToRowMap = new HashMap<>(); + private final HashMap keyToIndexMap = new HashMap<>(); private Set dataChangeHandlers = new LinkedHashSet<>(); @@ -193,8 +193,8 @@ public abstract class AbstractRemoteDataSource implements DataSource { } }; - private Map pinnedCounts = new HashMap(); - private Map pinnedRows = new HashMap(); + private Map pinnedCounts = new HashMap<>(); + private Map pinnedRows = new HashMap<>(); // Size not yet known private int size = -1; @@ -374,7 +374,7 @@ public abstract class AbstractRemoteDataSource implements DataSource { if (range.isEmpty()) { return; } - currentRequestCallback = new RequestRowsCallback(this, range); + currentRequestCallback = new RequestRowsCallback<>(this, range); requestRows(range.getStart(), range.length(), currentRequestCallback); } diff --git a/client/src/main/java/com/vaadin/client/debug/internal/AnalyzeLayoutsPanel.java b/client/src/main/java/com/vaadin/client/debug/internal/AnalyzeLayoutsPanel.java index a33f7f8ceb..a1bcae5524 100644 --- a/client/src/main/java/com/vaadin/client/debug/internal/AnalyzeLayoutsPanel.java +++ b/client/src/main/java/com/vaadin/client/debug/internal/AnalyzeLayoutsPanel.java @@ -49,7 +49,7 @@ import com.vaadin.client.ValueMap; */ public class AnalyzeLayoutsPanel extends FlowPanel { - private List listeners = new ArrayList(); + private List 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 zeroHeightComponents = new HashSet(); - Set zeroWidthComponents = new HashSet(); + Set zeroHeightComponents = new HashSet<>(); + Set 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 zeroSized, ApplicationConnection ac) { // keep track of already highlighted parents - HashSet parents = new HashSet(); + HashSet parents = new HashSet<>(); for (final ComponentConnector connector : zeroSized) { final ServerConnector parent = connector.getParent(); diff --git a/client/src/main/java/com/vaadin/client/debug/internal/ConnectorInfoPanel.java b/client/src/main/java/com/vaadin/client/debug/internal/ConnectorInfoPanel.java index c724b95b4e..89d50a39b3 100644 --- a/client/src/main/java/com/vaadin/client/debug/internal/ConnectorInfoPanel.java +++ b/client/src/main/java/com/vaadin/client/debug/internal/ConnectorInfoPanel.java @@ -48,7 +48,7 @@ public class ConnectorInfoPanel extends FlowPanel { public void update(ServerConnector connector) { SharedState state = connector.getState(); - Set ignoreProperties = new HashSet(); + Set ignoreProperties = new HashSet<>(); ignoreProperties.add("id"); String html = getRowHTML("Id", connector.getConnectorId()); diff --git a/client/src/main/java/com/vaadin/client/debug/internal/HierarchyPanel.java b/client/src/main/java/com/vaadin/client/debug/internal/HierarchyPanel.java index d3322b64a5..e70da1188c 100644 --- a/client/src/main/java/com/vaadin/client/debug/internal/HierarchyPanel.java +++ b/client/src/main/java/com/vaadin/client/debug/internal/HierarchyPanel.java @@ -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 listeners = new ArrayList(); + private List listeners = new ArrayList<>(); public void update() { // Try to keep track of currently open nodes and reopen them diff --git a/client/src/main/java/com/vaadin/client/debug/internal/Highlight.java b/client/src/main/java/com/vaadin/client/debug/internal/Highlight.java index 502949d4c8..7601a39289 100644 --- a/client/src/main/java/com/vaadin/client/debug/internal/Highlight.java +++ b/client/src/main/java/com/vaadin/client/debug/internal/Highlight.java @@ -180,7 +180,7 @@ public class Highlight { static Element show(Element element, String color) { if (element != null) { if (highlights == null) { - highlights = new HashSet(); + highlights = new HashSet<>(); } Element highlight = DOM.createDiv(); diff --git a/client/src/main/java/com/vaadin/client/debug/internal/OptimizedWidgetsetPanel.java b/client/src/main/java/com/vaadin/client/debug/internal/OptimizedWidgetsetPanel.java index 5db2611b18..807b6e65bb 100644 --- a/client/src/main/java/com/vaadin/client/debug/internal/OptimizedWidgetsetPanel.java +++ b/client/src/main/java/com/vaadin/client/debug/internal/OptimizedWidgetsetPanel.java @@ -76,7 +76,7 @@ public class OptimizedWidgetsetPanel extends FlowPanel { private Set getUsedConnectorNames( ApplicationConfiguration configuration) { int tag = 0; - Set usedConnectors = new HashSet(); + Set usedConnectors = new HashSet<>(); while (true) { String serverSideClass = configuration .getServerSideClassNameForTag(tag); diff --git a/client/src/main/java/com/vaadin/client/debug/internal/SelectorPath.java b/client/src/main/java/com/vaadin/client/debug/internal/SelectorPath.java index 3291e64973..be6bd231e8 100644 --- a/client/src/main/java/com/vaadin/client/debug/internal/SelectorPath.java +++ b/client/src/main/java/com/vaadin/client/debug/internal/SelectorPath.java @@ -38,8 +38,8 @@ public class SelectorPath { private final String path; private final Element element; private final ComponentLocator locator; - private static Map counter = new HashMap(); - private static Map legacyNames = new HashMap(); + private static Map counter = new HashMap<>(); + private static Map legacyNames = new HashMap<>(); static { legacyNames.put("FilterSelect", "ComboBox"); diff --git a/client/src/main/java/com/vaadin/client/debug/internal/TestBenchSection.java b/client/src/main/java/com/vaadin/client/debug/internal/TestBenchSection.java index 644fde4f0c..e838c417ba 100644 --- a/client/src/main/java/com/vaadin/client/debug/internal/TestBenchSection.java +++ b/client/src/main/java/com/vaadin/client/debug/internal/TestBenchSection.java @@ -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 selectorWidgets = new HashMap(); + private Map selectorWidgets = new HashMap<>(); private final FlowPanel controls = new FlowPanel(); diff --git a/client/src/main/java/com/vaadin/client/debug/internal/VDebugWindow.java b/client/src/main/java/com/vaadin/client/debug/internal/VDebugWindow.java index 12ff06dd8b..3abc848187 100644 --- a/client/src/main/java/com/vaadin/client/debug/internal/VDebugWindow.java +++ b/client/src/main/java/com/vaadin/client/debug/internal/VDebugWindow.java @@ -133,7 +133,7 @@ public final class VDebugWindow extends VOverlay { protected SimplePanel content = new SimplePanel(); // sections - protected ArrayList
sections = new ArrayList
(); + protected ArrayList
sections = new ArrayList<>(); // handles resize/move protected HandlerRegistration mouseDownHandler = null; diff --git a/client/src/main/java/com/vaadin/client/event/InputEvent.java b/client/src/main/java/com/vaadin/client/event/InputEvent.java index 762c916741..b8e14dc756 100644 --- a/client/src/main/java/com/vaadin/client/event/InputEvent.java +++ b/client/src/main/java/com/vaadin/client/event/InputEvent.java @@ -28,7 +28,7 @@ public class InputEvent extends DomEvent { * Event type for InputEvent. Represents the meta-data associated with this * event. */ - private static final Type TYPE = new Type( + private static final Type TYPE = new Type<>( "input", new InputEvent()); protected InputEvent() { diff --git a/client/src/main/java/com/vaadin/client/event/PointerCancelEvent.java b/client/src/main/java/com/vaadin/client/event/PointerCancelEvent.java index ba11b88831..921b030f60 100644 --- a/client/src/main/java/com/vaadin/client/event/PointerCancelEvent.java +++ b/client/src/main/java/com/vaadin/client/event/PointerCancelEvent.java @@ -28,7 +28,7 @@ public class PointerCancelEvent extends PointerEvent { * Event type for PointerCancelEvent. Represents the meta-data associated * with this event. */ - private static final Type TYPE = new Type( + private static final Type TYPE = new Type<>( EventType.PointerCancel.getNativeEventName(), new PointerCancelEvent()); diff --git a/client/src/main/java/com/vaadin/client/event/PointerDownEvent.java b/client/src/main/java/com/vaadin/client/event/PointerDownEvent.java index ae8fb1f6b7..77c146cf4b 100644 --- a/client/src/main/java/com/vaadin/client/event/PointerDownEvent.java +++ b/client/src/main/java/com/vaadin/client/event/PointerDownEvent.java @@ -28,7 +28,7 @@ public class PointerDownEvent extends PointerEvent { * Event type for PointerDownEvent. Represents the meta-data associated with * this event. */ - private static final Type TYPE = new Type( + private static final Type TYPE = new Type<>( EventType.PointerDown.getNativeEventName(), new PointerDownEvent()); /** diff --git a/client/src/main/java/com/vaadin/client/event/PointerMoveEvent.java b/client/src/main/java/com/vaadin/client/event/PointerMoveEvent.java index c957ef9e7f..b58bf66e19 100644 --- a/client/src/main/java/com/vaadin/client/event/PointerMoveEvent.java +++ b/client/src/main/java/com/vaadin/client/event/PointerMoveEvent.java @@ -28,7 +28,7 @@ public class PointerMoveEvent extends PointerEvent { * Event type for PointerMoveEvent. Represents the meta-data associated with * this event. */ - private static final Type TYPE = new Type( + private static final Type TYPE = new Type<>( EventType.PointerMove.getNativeEventName(), new PointerMoveEvent()); /** diff --git a/client/src/main/java/com/vaadin/client/event/PointerUpEvent.java b/client/src/main/java/com/vaadin/client/event/PointerUpEvent.java index 67d64c70e8..52588c83ed 100644 --- a/client/src/main/java/com/vaadin/client/event/PointerUpEvent.java +++ b/client/src/main/java/com/vaadin/client/event/PointerUpEvent.java @@ -28,7 +28,7 @@ public class PointerUpEvent extends PointerEvent { * Event type for PointerUpEvent. Represents the meta-data associated with * this event. */ - private static final Type TYPE = new Type( + private static final Type TYPE = new Type<>( EventType.PointerUp.getNativeEventName(), new PointerUpEvent()); /** diff --git a/client/src/main/java/com/vaadin/client/extensions/javascriptmanager/JavaScriptManagerConnector.java b/client/src/main/java/com/vaadin/client/extensions/javascriptmanager/JavaScriptManagerConnector.java index 9c415f5c5d..d303a549be 100644 --- a/client/src/main/java/com/vaadin/client/extensions/javascriptmanager/JavaScriptManagerConnector.java +++ b/client/src/main/java/com/vaadin/client/extensions/javascriptmanager/JavaScriptManagerConnector.java @@ -34,7 +34,7 @@ import com.vaadin.ui.JavaScript; @Connect(JavaScript.class) public class JavaScriptManagerConnector extends AbstractExtensionConnector { - private Set currentNames = new HashSet(); + private Set currentNames = new HashSet<>(); @Override protected void init() { @@ -59,7 +59,7 @@ public class JavaScriptManagerConnector extends AbstractExtensionConnector { removeCallback(name); } - currentNames = new HashSet(newNames); + currentNames = new HashSet<>(newNames); for (String name : newNames) { addCallback(name); } diff --git a/client/src/main/java/com/vaadin/client/metadata/AsyncBundleLoader.java b/client/src/main/java/com/vaadin/client/metadata/AsyncBundleLoader.java index e9aebbd583..7217a291f8 100644 --- a/client/src/main/java/com/vaadin/client/metadata/AsyncBundleLoader.java +++ b/client/src/main/java/com/vaadin/client/metadata/AsyncBundleLoader.java @@ -30,7 +30,7 @@ public abstract class AsyncBundleLoader { private Throwable error = null; - private List callbacks = new ArrayList(); + private List callbacks = new ArrayList<>(); private final String packageName; diff --git a/client/src/main/java/com/vaadin/client/metadata/ConnectorBundleLoader.java b/client/src/main/java/com/vaadin/client/metadata/ConnectorBundleLoader.java index b6e1cc37fc..91e85305ca 100644 --- a/client/src/main/java/com/vaadin/client/metadata/ConnectorBundleLoader.java +++ b/client/src/main/java/com/vaadin/client/metadata/ConnectorBundleLoader.java @@ -143,7 +143,7 @@ public abstract class ConnectorBundleLoader { public abstract void init(); - protected List cvals = new ArrayList(); + protected List cvals = new ArrayList<>(); public void cval(String typeName) { if (!cvals.isEmpty()) { diff --git a/client/src/main/java/com/vaadin/client/metadata/TypeDataStore.java b/client/src/main/java/com/vaadin/client/metadata/TypeDataStore.java index 35e73082e1..f8d6475ed7 100644 --- a/client/src/main/java/com/vaadin/client/metadata/TypeDataStore.java +++ b/client/src/main/java/com/vaadin/client/metadata/TypeDataStore.java @@ -260,7 +260,7 @@ public class TypeDataStore { throws NoDataException { JsArrayObject propertiesArray = getPropertiesAsArray(type); int size = propertiesArray.size(); - ArrayList properties = new ArrayList(size); + ArrayList properties = new ArrayList<>(size); for (int i = 0; i < size; i++) { properties.add(propertiesArray.get(i)); } diff --git a/client/src/main/java/com/vaadin/client/renderers/ClickableRenderer.java b/client/src/main/java/com/vaadin/client/renderers/ClickableRenderer.java index 4fbc39b1d8..95eff8ba5e 100644 --- a/client/src/main/java/com/vaadin/client/renderers/ClickableRenderer.java +++ b/client/src/main/java/com/vaadin/client/renderers/ClickableRenderer.java @@ -152,7 +152,7 @@ public abstract class ClickableRenderer return null; } Cell cell = container.getCell(e); - EventCellReference cellReference = new EventCellReference( + EventCellReference cellReference = new EventCellReference<>( grid); // FIXME: Section is currently always body. Might be useful for the // future to have an actual check. diff --git a/client/src/main/java/com/vaadin/client/ui/AbstractConnector.java b/client/src/main/java/com/vaadin/client/ui/AbstractConnector.java index 77b9e4d07d..552e4eb424 100644 --- a/client/src/main/java/com/vaadin/client/ui/AbstractConnector.java +++ b/client/src/main/java/com/vaadin/client/ui/AbstractConnector.java @@ -306,7 +306,7 @@ public abstract class AbstractConnector if (handlers != null) { Profiler.enter("AbstractConnector.onStateChanged @OnStateChange"); - HashSet invokedMethods = new HashSet(); + HashSet invokedMethods = new HashSet<>(); JsArrayString propertyNames = handlers.getKeys(); for (int i = 0; i < propertyNames.length(); i++) { diff --git a/client/src/main/java/com/vaadin/client/ui/ShortcutActionHandler.java b/client/src/main/java/com/vaadin/client/ui/ShortcutActionHandler.java index b3838d54f0..703df0b96d 100644 --- a/client/src/main/java/com/vaadin/client/ui/ShortcutActionHandler.java +++ b/client/src/main/java/com/vaadin/client/ui/ShortcutActionHandler.java @@ -58,7 +58,7 @@ public class ShortcutActionHandler { ShortcutActionHandler getShortcutActionHandler(); } - private final ArrayList actions = new ArrayList(); + private final ArrayList actions = new ArrayList<>(); private ApplicationConnection client; private String paintableId; diff --git a/client/src/main/java/com/vaadin/client/ui/TouchScrollDelegate.java b/client/src/main/java/com/vaadin/client/ui/TouchScrollDelegate.java index 3eeffebaf8..7b22442474 100644 --- a/client/src/main/java/com/vaadin/client/ui/TouchScrollDelegate.java +++ b/client/src/main/java/com/vaadin/client/ui/TouchScrollDelegate.java @@ -419,7 +419,7 @@ public class TouchScrollDelegate implements NativePreviewHandler { public static ArrayList getElements(Element scrolledElement2) { NodeList childNodes = scrolledElement2.getChildNodes(); - ArrayList l = new ArrayList(); + ArrayList 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(Arrays.asList(elements)); + scrollableElements = new HashSet<>(Arrays.asList(elements)); } /** diff --git a/client/src/main/java/com/vaadin/client/ui/VAbstractSplitPanel.java b/client/src/main/java/com/vaadin/client/ui/VAbstractSplitPanel.java index ee0ba7e6ff..837b185f35 100644 --- a/client/src/main/java/com/vaadin/client/ui/VAbstractSplitPanel.java +++ b/client/src/main/java/com/vaadin/client/ui/VAbstractSplitPanel.java @@ -736,7 +736,7 @@ public abstract class VAbstractSplitPanel extends ComplexPanel { public static class SplitterMoveEvent extends GwtEvent { - public static final Type TYPE = new Type(); + public static final Type TYPE = new Type<>(); private Widget splitPanel; diff --git a/client/src/main/java/com/vaadin/client/ui/VAccordion.java b/client/src/main/java/com/vaadin/client/ui/VAccordion.java index f726eea594..73f48639f3 100644 --- a/client/src/main/java/com/vaadin/client/ui/VAccordion.java +++ b/client/src/main/java/com/vaadin/client/ui/VAccordion.java @@ -42,7 +42,7 @@ public class VAccordion extends VTabsheetBase { public static final String CLASSNAME = AccordionState.PRIMARY_STYLE_NAME; - private Set widgets = new HashSet(); + private Set widgets = new HashSet<>(); private StackItem openTab; diff --git a/client/src/main/java/com/vaadin/client/ui/VCustomLayout.java b/client/src/main/java/com/vaadin/client/ui/VCustomLayout.java index 82140a12fe..fa42637b55 100644 --- a/client/src/main/java/com/vaadin/client/ui/VCustomLayout.java +++ b/client/src/main/java/com/vaadin/client/ui/VCustomLayout.java @@ -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 locationToElement = new HashMap(); + private final HashMap locationToElement = new HashMap<>(); /** Location-name to contained widget map */ - final HashMap locationToWidget = new HashMap(); + final HashMap locationToWidget = new HashMap<>(); /** Widget to captionwrapper map */ - private final HashMap childWidgetToCaptionWrapper = new HashMap(); + private final HashMap childWidgetToCaptionWrapper = new HashMap<>(); /** * Unexecuted scripts loaded from the template. diff --git a/client/src/main/java/com/vaadin/client/ui/VDragAndDropWrapper.java b/client/src/main/java/com/vaadin/client/ui/VDragAndDropWrapper.java index 615a5da2f5..2b70569234 100644 --- a/client/src/main/java/com/vaadin/client/ui/VDragAndDropWrapper.java +++ b/client/src/main/java/com/vaadin/client/ui/VDragAndDropWrapper.java @@ -477,10 +477,10 @@ public class VDragAndDropWrapper extends VCustomComponent } /** For internal use only. May be removed or replaced in the future. */ - public List fileIds = new ArrayList(); + public List fileIds = new ArrayList<>(); /** For internal use only. May be removed or replaced in the future. */ - public List files = new ArrayList(); + public List files = new ArrayList<>(); private void queueFilePost(final int fileId, final VHtml5File file) { fileIds.add(fileId); diff --git a/client/src/main/java/com/vaadin/client/ui/VEmbedded.java b/client/src/main/java/com/vaadin/client/ui/VEmbedded.java index ddd2f85d5f..45037f72a8 100644 --- a/client/src/main/java/com/vaadin/client/ui/VEmbedded.java +++ b/client/src/main/java/com/vaadin/client/ui/VEmbedded.java @@ -206,7 +206,7 @@ public class VEmbedded extends HTML { * @return */ public static Map getParameters(UIDL uidl) { - Map parameters = new HashMap(); + Map parameters = new HashMap<>(); Iterator childIterator = uidl.getChildIterator(); while (childIterator.hasNext()) { diff --git a/client/src/main/java/com/vaadin/client/ui/VFlash.java b/client/src/main/java/com/vaadin/client/ui/VFlash.java index 4817552bae..650d4a05fc 100644 --- a/client/src/main/java/com/vaadin/client/ui/VFlash.java +++ b/client/src/main/java/com/vaadin/client/ui/VFlash.java @@ -32,7 +32,7 @@ public class VFlash extends HTML { protected String codetype; protected String standby; protected String archive; - protected Map embedParams = new HashMap(); + protected Map 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(params); + embedParams = new HashMap<>(params); needsRebuild = true; } } diff --git a/client/src/main/java/com/vaadin/client/ui/VFormLayout.java b/client/src/main/java/com/vaadin/client/ui/VFormLayout.java index 013fcbbc68..18d7d76d74 100644 --- a/client/src/main/java/com/vaadin/client/ui/VFormLayout.java +++ b/client/src/main/java/com/vaadin/client/ui/VFormLayout.java @@ -68,7 +68,7 @@ public class VFormLayout extends SimplePanel { */ private String[] getStylesFromState(AbstractComponentState state, boolean enabled) { - List styles = new ArrayList(); + List 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 widgetToCaption = new HashMap(); - private HashMap widgetToError = new HashMap(); + private HashMap widgetToCaption = new HashMap<>(); + private HashMap widgetToError = new HashMap<>(); public VFormLayoutTable() { DOM.setElementProperty(getElement(), "cellPadding", "0"); diff --git a/client/src/main/java/com/vaadin/client/ui/VGridLayout.java b/client/src/main/java/com/vaadin/client/ui/VGridLayout.java index 2d084f8ca0..f34c7eabde 100644 --- a/client/src/main/java/com/vaadin/client/ui/VGridLayout.java +++ b/client/src/main/java/com/vaadin/client/ui/VGridLayout.java @@ -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 widgetToCell = new HashMap(); + public HashMap 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 colSpans = new LinkedList(); - private LinkedList rowSpans = new LinkedList(); + private LinkedList colSpans = new LinkedList<>(); + private LinkedList rowSpans = new LinkedList<>(); private class SpanList { final int span; - List cells = new LinkedList(); + List cells = new LinkedList<>(); public SpanList(int span) { this.span = span; diff --git a/client/src/main/java/com/vaadin/client/ui/VMenuBar.java b/client/src/main/java/com/vaadin/client/ui/VMenuBar.java index f5e83d8550..d08301ec93 100644 --- a/client/src/main/java/com/vaadin/client/ui/VMenuBar.java +++ b/client/src/main/java/com/vaadin/client/ui/VMenuBar.java @@ -138,7 +138,7 @@ public class VMenuBar extends SimpleFocusablePanel public VMenuBar(boolean subMenu, VMenuBar parentMenu) { - items = new ArrayList(); + items = new ArrayList<>(); popup = null; visibleChildMenu = null; this.subMenu = subMenu; @@ -928,7 +928,7 @@ public class VMenuBar extends SimpleFocusablePanel } String currentStyles = super.getStyleName(); - List customStyles = new ArrayList(); + List 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 submenuItems = new LinkedList(); + Queue submenuItems = new LinkedList<>(); for (CustomMenuItem item : getItems()) { if (isItemNamed(item, subPart)) { return item.getElement(); diff --git a/client/src/main/java/com/vaadin/client/ui/VNotification.java b/client/src/main/java/com/vaadin/client/ui/VNotification.java index 1b530fe237..6042ff11d6 100644 --- a/client/src/main/java/com/vaadin/client/ui/VNotification.java +++ b/client/src/main/java/com/vaadin/client/ui/VNotification.java @@ -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 notifications = new ArrayList(); + private static final ArrayList 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(); + listeners = new ArrayList<>(); } listeners.add(listener); } diff --git a/client/src/main/java/com/vaadin/client/ui/VPopupView.java b/client/src/main/java/com/vaadin/client/ui/VPopupView.java index e8499a96c1..296cde28bc 100644 --- a/client/src/main/java/com/vaadin/client/ui/VPopupView.java +++ b/client/src/main/java/com/vaadin/client/ui/VPopupView.java @@ -240,7 +240,7 @@ public class VPopupView extends HTML private boolean hasHadMouseOver = false; private boolean hideOnMouseOut = true; - private final Set activeChildren = new HashSet(); + private final Set activeChildren = new HashSet<>(); private ShortcutActionHandler shortcutActionHandler; diff --git a/client/src/main/java/com/vaadin/client/ui/VTabsheetBase.java b/client/src/main/java/com/vaadin/client/ui/VTabsheetBase.java index 4ec65e889b..d52362afcc 100644 --- a/client/src/main/java/com/vaadin/client/ui/VTabsheetBase.java +++ b/client/src/main/java/com/vaadin/client/ui/VTabsheetBase.java @@ -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 tabKeys = new ArrayList(); + protected final ArrayList tabKeys = new ArrayList<>(); /** For internal use only. May be removed or replaced in the future. */ - protected Set disabledTabKeys = new HashSet(); + protected Set disabledTabKeys = new HashSet<>(); /** For internal use only. May be removed or replaced in the future. */ protected int activeTabIndex = 0; diff --git a/client/src/main/java/com/vaadin/client/ui/VWindow.java b/client/src/main/java/com/vaadin/client/ui/VWindow.java index c3d9e7eddf..e9767a6bac 100644 --- a/client/src/main/java/com/vaadin/client/ui/VWindow.java +++ b/client/src/main/java/com/vaadin/client/ui/VWindow.java @@ -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 windowOrder = new ArrayList(); + private static ArrayList windowOrder = new ArrayList<>(); private static boolean orderingDefered; diff --git a/client/src/main/java/com/vaadin/client/ui/dd/VDragEvent.java b/client/src/main/java/com/vaadin/client/ui/dd/VDragEvent.java index 211d5ab322..7d281186c4 100644 --- a/client/src/main/java/com/vaadin/client/ui/dd/VDragEvent.java +++ b/client/src/main/java/com/vaadin/client/ui/dd/VDragEvent.java @@ -52,7 +52,7 @@ public class VDragEvent { private int id; - private HashMap dropDetails = new HashMap(); + private HashMap dropDetails = new HashMap<>(); private Element elementOver; diff --git a/client/src/main/java/com/vaadin/client/ui/dd/VLazyInitItemIdentifiers.java b/client/src/main/java/com/vaadin/client/ui/dd/VLazyInitItemIdentifiers.java index 5f25f935ce..646853bca1 100644 --- a/client/src/main/java/com/vaadin/client/ui/dd/VLazyInitItemIdentifiers.java +++ b/client/src/main/java/com/vaadin/client/ui/dd/VLazyInitItemIdentifiers.java @@ -48,7 +48,7 @@ public class VLazyInitItemIdentifiers extends VAcceptCriterion { @Override public void handleResponse(boolean accepted, UIDL response) { - hashSet = new HashSet(); + hashSet = new HashSet<>(); String[] stringArrayAttribute = response .getStringArrayAttribute("allowedIds"); for (int i = 0; i < stringArrayAttribute.length; i++) { diff --git a/client/src/main/java/com/vaadin/client/ui/dd/VTransferable.java b/client/src/main/java/com/vaadin/client/ui/dd/VTransferable.java index 098811bb46..804d9c1bcb 100644 --- a/client/src/main/java/com/vaadin/client/ui/dd/VTransferable.java +++ b/client/src/main/java/com/vaadin/client/ui/dd/VTransferable.java @@ -30,7 +30,7 @@ public class VTransferable { private ComponentConnector component; - private final Map variables = new HashMap(); + private final Map variables = new HashMap<>(); /** * Returns the component from which the transferable is created (eg. a tree diff --git a/client/src/main/java/com/vaadin/client/ui/draganddropwrapper/DragAndDropWrapperConnector.java b/client/src/main/java/com/vaadin/client/ui/draganddropwrapper/DragAndDropWrapperConnector.java index 25908910cb..038d58afd0 100644 --- a/client/src/main/java/com/vaadin/client/ui/draganddropwrapper/DragAndDropWrapperConnector.java +++ b/client/src/main/java/com/vaadin/client/ui/draganddropwrapper/DragAndDropWrapperConnector.java @@ -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(); + getWidget().fileIdToReceiver = new HashMap<>(); } if ("".equals(receiverUrl)) { Integer id = Integer.parseInt(fileId); diff --git a/client/src/main/java/com/vaadin/client/ui/formlayout/FormLayoutConnector.java b/client/src/main/java/com/vaadin/client/ui/formlayout/FormLayoutConnector.java index eccec23877..ba1d79c776 100644 --- a/client/src/main/java/com/vaadin/client/ui/formlayout/FormLayoutConnector.java +++ b/client/src/main/java/com/vaadin/client/ui/formlayout/FormLayoutConnector.java @@ -121,7 +121,7 @@ public class FormLayoutConnector extends AbstractLayoutConnector targetWidth = Math.max(0, targetWidth); if (oldMaxWidths == null) { - oldMaxWidths = new HashMap(); + oldMaxWidths = new HashMap<>(); } for (ComponentConnector child : getChildComponents()) { diff --git a/client/src/main/java/com/vaadin/client/ui/layout/LayoutDependencyTree.java b/client/src/main/java/com/vaadin/client/ui/layout/LayoutDependencyTree.java index e80a6ee77f..03c7693979 100644 --- a/client/src/main/java/com/vaadin/client/ui/layout/LayoutDependencyTree.java +++ b/client/src/main/java/com/vaadin/client/ui/layout/LayoutDependencyTree.java @@ -725,7 +725,7 @@ public class LayoutDependencyTree { public Collection getMeasureTargets() { JsArrayString targetIds = getMeasureTargetsJsArray(); int length = targetIds.length(); - ArrayList targets = new ArrayList( + ArrayList targets = new ArrayList<>( length); ConnectorMap connectorMap = ConnectorMap.get(connection); diff --git a/client/src/main/java/com/vaadin/client/ui/menubar/MenuBar.java b/client/src/main/java/com/vaadin/client/ui/menubar/MenuBar.java index d410a07305..61ecb051d9 100644 --- a/client/src/main/java/com/vaadin/client/ui/menubar/MenuBar.java +++ b/client/src/main/java/com/vaadin/client/ui/menubar/MenuBar.java @@ -76,7 +76,7 @@ public class MenuBar extends Widget implements PopupListener { private final Element table; private final Element outer; - private final ArrayList items = new ArrayList(); + private final ArrayList items = new ArrayList<>(); private MenuBar parentMenu; private PopupPanel popup; private MenuItem selectedItem; diff --git a/client/src/main/java/com/vaadin/client/ui/menubar/MenuBarConnector.java b/client/src/main/java/com/vaadin/client/ui/menubar/MenuBarConnector.java index 6977ec7d61..cc8e3872ad 100644 --- a/client/src/main/java/com/vaadin/client/ui/menubar/MenuBarConnector.java +++ b/client/src/main/java/com/vaadin/client/ui/menubar/MenuBarConnector.java @@ -102,8 +102,8 @@ public class MenuBarConnector extends AbstractComponentConnector UIDL uidlItems = uidl.getChildUIDL(1); Iterator itr = uidlItems.getChildIterator(); - Stack> iteratorStack = new Stack>(); - Stack menuStack = new Stack(); + Stack> iteratorStack = new Stack<>(); + Stack menuStack = new Stack<>(); VMenuBar currentMenu = getWidget(); while (itr.hasNext()) { diff --git a/client/src/main/java/com/vaadin/client/ui/orderedlayout/VAbstractOrderedLayout.java b/client/src/main/java/com/vaadin/client/ui/orderedlayout/VAbstractOrderedLayout.java index 8a98f95e0c..1148ab90ad 100644 --- a/client/src/main/java/com/vaadin/client/ui/orderedlayout/VAbstractOrderedLayout.java +++ b/client/src/main/java/com/vaadin/client/ui/orderedlayout/VAbstractOrderedLayout.java @@ -47,7 +47,7 @@ public class VAbstractOrderedLayout extends FlowPanel { protected boolean definedHeight = false; - private Map widgetToSlot = new HashMap(); + private Map widgetToSlot = new HashMap<>(); private Element expandWrapper; diff --git a/client/src/main/java/com/vaadin/client/ui/popupview/PopupViewConnector.java b/client/src/main/java/com/vaadin/client/ui/popupview/PopupViewConnector.java index 1ee6e9b9f7..f0b42f76d9 100644 --- a/client/src/main/java/com/vaadin/client/ui/popupview/PopupViewConnector.java +++ b/client/src/main/java/com/vaadin/client/ui/popupview/PopupViewConnector.java @@ -40,7 +40,7 @@ public class PopupViewConnector extends AbstractHasComponentsConnector private boolean centerAfterLayout = false; - private final List handlerRegistration = new ArrayList(); + private final List handlerRegistration = new ArrayList<>(); @Override protected void init() { diff --git a/client/src/main/java/com/vaadin/client/ui/popupview/VisibilityChangeEvent.java b/client/src/main/java/com/vaadin/client/ui/popupview/VisibilityChangeEvent.java index 896ba82130..06380eef28 100644 --- a/client/src/main/java/com/vaadin/client/ui/popupview/VisibilityChangeEvent.java +++ b/client/src/main/java/com/vaadin/client/ui/popupview/VisibilityChangeEvent.java @@ -38,7 +38,7 @@ public class VisibilityChangeEvent extends GwtEvent { public static Type getType() { if (TYPE == null) { - TYPE = new Type(); + TYPE = new Type<>(); } return TYPE; } diff --git a/client/src/main/java/com/vaadin/client/ui/splitpanel/AbstractSplitPanelConnector.java b/client/src/main/java/com/vaadin/client/ui/splitpanel/AbstractSplitPanelConnector.java index fe9c119829..ec6b86880b 100644 --- a/client/src/main/java/com/vaadin/client/ui/splitpanel/AbstractSplitPanelConnector.java +++ b/client/src/main/java/com/vaadin/client/ui/splitpanel/AbstractSplitPanelConnector.java @@ -133,7 +133,7 @@ public abstract class AbstractSplitPanelConnector extends if (ComponentStateUtil.hasStyles(getState())) { getWidget().componentStyleNames = getState().styles; } else { - getWidget().componentStyleNames = new LinkedList(); + getWidget().componentStyleNames = new LinkedList<>(); } // Splitter updates diff --git a/client/src/main/java/com/vaadin/client/ui/tabsheet/TabsheetBaseConnector.java b/client/src/main/java/com/vaadin/client/ui/tabsheet/TabsheetBaseConnector.java index a5301abdf1..1bd721787c 100644 --- a/client/src/main/java/com/vaadin/client/ui/tabsheet/TabsheetBaseConnector.java +++ b/client/src/main/java/com/vaadin/client/ui/tabsheet/TabsheetBaseConnector.java @@ -56,7 +56,7 @@ public abstract class TabsheetBaseConnector getWidget().setEnabled(isEnabled()); // Widgets in the TabSheet before update - ArrayList oldWidgets = new ArrayList(); + ArrayList oldWidgets = new ArrayList<>(); for (Iterator iterator = getWidget() .getWidgetIterator(); iterator.hasNext();) { oldWidgets.add(iterator.next()); diff --git a/client/src/main/java/com/vaadin/client/ui/ui/UIConnector.java b/client/src/main/java/com/vaadin/client/ui/ui/UIConnector.java index 7c0df8761d..26f99bfb94 100644 --- a/client/src/main/java/com/vaadin/client/ui/ui/UIConnector.java +++ b/client/src/main/java/com/vaadin/client/ui/ui/UIConnector.java @@ -625,7 +625,7 @@ public class UIConnector extends AbstractSingleComponentContainerConnector * @return */ public List getSubWindows() { - ArrayList windows = new ArrayList(); + ArrayList windows = new ArrayList<>(); for (ComponentConnector child : getChildComponents()) { if (child instanceof WindowConnector) { windows.add((WindowConnector) child); diff --git a/client/src/main/java/com/vaadin/client/ui/window/WindowMoveEvent.java b/client/src/main/java/com/vaadin/client/ui/window/WindowMoveEvent.java index f5602f673e..c105b91a6c 100644 --- a/client/src/main/java/com/vaadin/client/ui/window/WindowMoveEvent.java +++ b/client/src/main/java/com/vaadin/client/ui/window/WindowMoveEvent.java @@ -25,7 +25,7 @@ import com.google.gwt.event.shared.GwtEvent; */ public class WindowMoveEvent extends GwtEvent { - private static final Type TYPE = new Type(); + private static final Type TYPE = new Type<>(); private final int newX; private final int newY; diff --git a/client/src/main/java/com/vaadin/client/widget/escalator/FlyweightRow.java b/client/src/main/java/com/vaadin/client/widget/escalator/FlyweightRow.java index a8bcf4d809..0105560a00 100644 --- a/client/src/main/java/com/vaadin/client/widget/escalator/FlyweightRow.java +++ b/client/src/main/java/com/vaadin/client/widget/escalator/FlyweightRow.java @@ -71,7 +71,7 @@ public class FlyweightRow implements Row { private CellIterator(final Collection cells, final boolean attached) { - this.cells = new ArrayList(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 cells = new ArrayList(); + private final List cells = new ArrayList<>(); public void setup(final TableRowElement e, final int row, double[] columnWidths) { diff --git a/client/src/main/java/com/vaadin/client/widget/escalator/RowVisibilityChangeEvent.java b/client/src/main/java/com/vaadin/client/widget/escalator/RowVisibilityChangeEvent.java index a36b591fd0..0bd2ed0b9c 100644 --- a/client/src/main/java/com/vaadin/client/widget/escalator/RowVisibilityChangeEvent.java +++ b/client/src/main/java/com/vaadin/client/widget/escalator/RowVisibilityChangeEvent.java @@ -30,7 +30,7 @@ public class RowVisibilityChangeEvent /** * The type of this event. */ - public static final Type TYPE = new Type(); + public static final Type TYPE = new Type<>(); private final Range visibleRows; diff --git a/client/src/main/java/com/vaadin/client/widget/escalator/events/RowHeightChangedEvent.java b/client/src/main/java/com/vaadin/client/widget/escalator/events/RowHeightChangedEvent.java index d6657b08d3..846b0ce723 100644 --- a/client/src/main/java/com/vaadin/client/widget/escalator/events/RowHeightChangedEvent.java +++ b/client/src/main/java/com/vaadin/client/widget/escalator/events/RowHeightChangedEvent.java @@ -29,7 +29,7 @@ public class RowHeightChangedEvent extends GwtEvent { /** * Handler type. */ - public final static Type TYPE = new Type(); + public final static Type TYPE = new Type<>(); public static final Type getType() { return TYPE; diff --git a/client/src/main/java/com/vaadin/client/widget/grid/DataAvailableEvent.java b/client/src/main/java/com/vaadin/client/widget/grid/DataAvailableEvent.java index 8441a16bc5..b1ed8757d2 100644 --- a/client/src/main/java/com/vaadin/client/widget/grid/DataAvailableEvent.java +++ b/client/src/main/java/com/vaadin/client/widget/grid/DataAvailableEvent.java @@ -27,7 +27,7 @@ import com.vaadin.shared.Range; public class DataAvailableEvent extends GwtEvent { private Range rowsAvailable; - public static final Type TYPE = new Type(); + public static final Type TYPE = new Type<>(); public DataAvailableEvent(Range rowsAvailable) { this.rowsAvailable = rowsAvailable; diff --git a/client/src/main/java/com/vaadin/client/widget/grid/EventCellReference.java b/client/src/main/java/com/vaadin/client/widget/grid/EventCellReference.java index 3fb266586b..a77f4ec86a 100644 --- a/client/src/main/java/com/vaadin/client/widget/grid/EventCellReference.java +++ b/client/src/main/java/com/vaadin/client/widget/grid/EventCellReference.java @@ -38,7 +38,7 @@ public class EventCellReference extends CellReference { private TableCellElement element; public EventCellReference(Grid grid) { - super(new RowReference(grid)); + super(new RowReference<>(grid)); } /** diff --git a/client/src/main/java/com/vaadin/client/widget/grid/datasources/ListDataSource.java b/client/src/main/java/com/vaadin/client/widget/grid/datasources/ListDataSource.java index 584e765127..b5b6f42f3a 100644 --- a/client/src/main/java/com/vaadin/client/widget/grid/datasources/ListDataSource.java +++ b/client/src/main/java/com/vaadin/client/widget/grid/datasources/ListDataSource.java @@ -344,7 +344,7 @@ public class ListDataSource implements DataSource { if (datasource == null) { throw new IllegalArgumentException("datasource cannot be null"); } - ds = new ArrayList(datasource); + ds = new ArrayList<>(datasource); wrapper = new ListWrapper(); } @@ -358,9 +358,9 @@ public class ListDataSource implements DataSource { */ public ListDataSource(T... rows) { if (rows == null) { - ds = new ArrayList(); + ds = new ArrayList<>(); } else { - ds = new ArrayList(Arrays.asList(rows)); + ds = new ArrayList<>(Arrays.asList(rows)); } wrapper = new ListWrapper(); } diff --git a/client/src/main/java/com/vaadin/client/widget/grid/datasources/ListSorter.java b/client/src/main/java/com/vaadin/client/widget/grid/datasources/ListSorter.java index ad68e94b87..14cb2e6523 100644 --- a/client/src/main/java/com/vaadin/client/widget/grid/datasources/ListSorter.java +++ b/client/src/main/java/com/vaadin/client/widget/grid/datasources/ListSorter.java @@ -50,7 +50,7 @@ public class ListSorter { } this.grid = grid; - comparators = new HashMap, Comparator>(); + comparators = new HashMap<>(); sortHandlerRegistration = grid.addSortHandler(new SortHandler() { @Override diff --git a/client/src/main/java/com/vaadin/client/widget/grid/events/ColumnReorderEvent.java b/client/src/main/java/com/vaadin/client/widget/grid/events/ColumnReorderEvent.java index d1e5e6fb99..72c0eb5878 100644 --- a/client/src/main/java/com/vaadin/client/widget/grid/events/ColumnReorderEvent.java +++ b/client/src/main/java/com/vaadin/client/widget/grid/events/ColumnReorderEvent.java @@ -31,7 +31,7 @@ public class ColumnReorderEvent extends GwtEvent> { /** * Handler type. */ - private final static Type> TYPE = new Type>(); + private final static Type> TYPE = new Type<>(); public static final Type> getType() { return TYPE; diff --git a/client/src/main/java/com/vaadin/client/widget/grid/events/ColumnResizeEvent.java b/client/src/main/java/com/vaadin/client/widget/grid/events/ColumnResizeEvent.java index bedec89519..abd369b175 100644 --- a/client/src/main/java/com/vaadin/client/widget/grid/events/ColumnResizeEvent.java +++ b/client/src/main/java/com/vaadin/client/widget/grid/events/ColumnResizeEvent.java @@ -32,7 +32,7 @@ public class ColumnResizeEvent extends GwtEvent> { /** * Handler type. */ - private final static Type> TYPE = new Type>(); + private final static Type> TYPE = new Type<>(); private Column column; diff --git a/client/src/main/java/com/vaadin/client/widget/grid/events/ColumnVisibilityChangeEvent.java b/client/src/main/java/com/vaadin/client/widget/grid/events/ColumnVisibilityChangeEvent.java index 7033c4c24b..5c7b88cc91 100644 --- a/client/src/main/java/com/vaadin/client/widget/grid/events/ColumnVisibilityChangeEvent.java +++ b/client/src/main/java/com/vaadin/client/widget/grid/events/ColumnVisibilityChangeEvent.java @@ -31,7 +31,7 @@ import com.vaadin.client.widgets.Grid.Column; public class ColumnVisibilityChangeEvent extends GwtEvent> { - private final static Type> TYPE = new Type>(); + private final static Type> TYPE = new Type<>(); public static final Type> getType() { return TYPE; diff --git a/client/src/main/java/com/vaadin/client/widget/grid/events/GridEnabledEvent.java b/client/src/main/java/com/vaadin/client/widget/grid/events/GridEnabledEvent.java index bb31a4d6a0..86c8e66af2 100644 --- a/client/src/main/java/com/vaadin/client/widget/grid/events/GridEnabledEvent.java +++ b/client/src/main/java/com/vaadin/client/widget/grid/events/GridEnabledEvent.java @@ -27,7 +27,7 @@ public class GridEnabledEvent extends GwtEvent { /** * The type of this event */ - public static final Type TYPE = new Type(); + public static final Type TYPE = new Type<>(); private final boolean enabled; public GridEnabledEvent(boolean enabled) { diff --git a/client/src/main/java/com/vaadin/client/widget/grid/events/ScrollEvent.java b/client/src/main/java/com/vaadin/client/widget/grid/events/ScrollEvent.java index 37e1125bb4..97cae2f890 100644 --- a/client/src/main/java/com/vaadin/client/widget/grid/events/ScrollEvent.java +++ b/client/src/main/java/com/vaadin/client/widget/grid/events/ScrollEvent.java @@ -26,7 +26,7 @@ import com.google.gwt.event.shared.GwtEvent; public class ScrollEvent extends GwtEvent { /** The type of this event */ - public static final Type TYPE = new Type(); + public static final Type TYPE = new Type<>(); @Override public Type getAssociatedType() { diff --git a/client/src/main/java/com/vaadin/client/widget/grid/events/SelectAllEvent.java b/client/src/main/java/com/vaadin/client/widget/grid/events/SelectAllEvent.java index 09885064ae..a21adfd2a8 100644 --- a/client/src/main/java/com/vaadin/client/widget/grid/events/SelectAllEvent.java +++ b/client/src/main/java/com/vaadin/client/widget/grid/events/SelectAllEvent.java @@ -30,7 +30,7 @@ public class SelectAllEvent extends GwtEvent> { /** * Handler type. */ - private final static Type> TYPE = new Type>();; + private final static Type> TYPE = new Type<>();; private SelectionModel.Multi selectionModel; diff --git a/client/src/main/java/com/vaadin/client/widget/grid/selection/MultiSelectionRenderer.java b/client/src/main/java/com/vaadin/client/widget/grid/selection/MultiSelectionRenderer.java index 293a0a62d4..2ae8b0579d 100644 --- a/client/src/main/java/com/vaadin/client/widget/grid/selection/MultiSelectionRenderer.java +++ b/client/src/main/java/com/vaadin/client/widget/grid/selection/MultiSelectionRenderer.java @@ -639,7 +639,7 @@ public class MultiSelectionRenderer @Override public Collection getConsumedEvents() { - final HashSet events = new HashSet(); + final HashSet events = new HashSet<>(); /* * this column's first interest is only to attach a NativePreventHandler diff --git a/client/src/main/java/com/vaadin/client/widget/grid/selection/SelectionEvent.java b/client/src/main/java/com/vaadin/client/widget/grid/selection/SelectionEvent.java index 9d016d2634..8219b8998c 100644 --- a/client/src/main/java/com/vaadin/client/widget/grid/selection/SelectionEvent.java +++ b/client/src/main/java/com/vaadin/client/widget/grid/selection/SelectionEvent.java @@ -32,7 +32,7 @@ import com.vaadin.client.widgets.Grid; @SuppressWarnings("rawtypes") public class SelectionEvent extends GwtEvent { - private static final Type eventType = new Type(); + private static final Type eventType = new Type<>(); private final Grid grid; private final List added; @@ -92,13 +92,13 @@ public class SelectionEvent extends GwtEvent { this.batched = batched; if (added != null) { - this.added = new ArrayList(added); + this.added = new ArrayList<>(added); } else { this.added = Collections.emptyList(); } if (removed != null) { - this.removed = new ArrayList(removed); + this.removed = new ArrayList<>(removed); } else { this.removed = Collections.emptyList(); } diff --git a/client/src/main/java/com/vaadin/client/widget/grid/selection/SelectionModelMulti.java b/client/src/main/java/com/vaadin/client/widget/grid/selection/SelectionModelMulti.java index 213bd24b67..3c395560a7 100644 --- a/client/src/main/java/com/vaadin/client/widget/grid/selection/SelectionModelMulti.java +++ b/client/src/main/java/com/vaadin/client/widget/grid/selection/SelectionModelMulti.java @@ -40,8 +40,8 @@ public class SelectionModelMulti extends AbstractRowHandleSelectionModel private Grid grid; private boolean batchStarted = false; - private final LinkedHashSet> selectionBatch = new LinkedHashSet>(); - private final LinkedHashSet> deselectionBatch = new LinkedHashSet>(); + private final LinkedHashSet> selectionBatch = new LinkedHashSet<>(); + private final LinkedHashSet> deselectionBatch = new LinkedHashSet<>(); /* Event handling for selection with space key */ private SpaceSelectHandler spaceSelectHandler; @@ -49,7 +49,7 @@ public class SelectionModelMulti extends AbstractRowHandleSelectionModel public SelectionModelMulti() { grid = null; renderer = null; - selectedRows = new LinkedHashSet>(); + selectedRows = new LinkedHashSet<>(); } @Override @@ -74,8 +74,8 @@ public class SelectionModelMulti extends AbstractRowHandleSelectionModel this.grid = grid; if (this.grid != null) { - spaceSelectHandler = new SpaceSelectHandler(grid); - this.renderer = new MultiSelectionRenderer(grid); + spaceSelectHandler = new SpaceSelectHandler<>(grid); + this.renderer = new MultiSelectionRenderer<>(grid); } else { spaceSelectHandler.removeHandler(); spaceSelectHandler = null; @@ -107,7 +107,7 @@ public class SelectionModelMulti extends AbstractRowHandleSelectionModel @SuppressWarnings("unchecked") final LinkedHashSet> selectedRowsClone = (LinkedHashSet>) selectedRows .clone(); - SelectionEvent event = new SelectionEvent(grid, null, + SelectionEvent event = new SelectionEvent<>(grid, null, getSelectedRows(), isBeingBatchSelected()); selectedRows.clear(); @@ -129,7 +129,7 @@ public class SelectionModelMulti extends AbstractRowHandleSelectionModel throw new IllegalArgumentException("Rows cannot be null"); } - Set added = new LinkedHashSet(); + Set added = new LinkedHashSet<>(); for (T row : rows) { RowHandle handle = grid.getDataSource().getHandle(row); @@ -139,7 +139,7 @@ public class SelectionModelMulti extends AbstractRowHandleSelectionModel } if (added.size() > 0) { - grid.fireEvent(new SelectionEvent(grid, added, null, + grid.fireEvent(new SelectionEvent<>(grid, added, null, isBeingBatchSelected())); return true; @@ -153,7 +153,7 @@ public class SelectionModelMulti extends AbstractRowHandleSelectionModel throw new IllegalArgumentException("Rows cannot be null"); } - Set removed = new LinkedHashSet(); + Set removed = new LinkedHashSet<>(); for (T row : rows) { RowHandle handle = grid.getDataSource().getHandle(row); @@ -163,7 +163,7 @@ public class SelectionModelMulti extends AbstractRowHandleSelectionModel } if (removed.size() > 0) { - grid.fireEvent(new SelectionEvent(grid, null, removed, + grid.fireEvent(new SelectionEvent<>(grid, null, removed, isBeingBatchSelected())); return true; } @@ -206,7 +206,7 @@ public class SelectionModelMulti extends AbstractRowHandleSelectionModel @Override public Collection getSelectedRows() { - Set selected = new LinkedHashSet(); + Set selected = new LinkedHashSet<>(); for (RowHandle handle : selectedRows) { selected.add(handle.getRow()); } @@ -244,7 +244,7 @@ public class SelectionModelMulti extends AbstractRowHandleSelectionModel } deselectionBatch.clear(); - grid.fireEvent(new SelectionEvent(grid, added, removed, + grid.fireEvent(new SelectionEvent<>(grid, added, removed, isBeingBatchSelected())); } @@ -264,7 +264,7 @@ public class SelectionModelMulti extends AbstractRowHandleSelectionModel } private ArrayList rowHandlesToRows(Collection> rowHandles) { - ArrayList rows = new ArrayList(rowHandles.size()); + ArrayList rows = new ArrayList<>(rowHandles.size()); for (RowHandle handle : rowHandles) { rows.add(handle.getRow()); } diff --git a/client/src/main/java/com/vaadin/client/widget/grid/selection/SelectionModelSingle.java b/client/src/main/java/com/vaadin/client/widget/grid/selection/SelectionModelSingle.java index 1e4d4538a8..1214e3f72b 100644 --- a/client/src/main/java/com/vaadin/client/widget/grid/selection/SelectionModelSingle.java +++ b/client/src/main/java/com/vaadin/client/widget/grid/selection/SelectionModelSingle.java @@ -66,8 +66,8 @@ public class SelectionModelSingle extends AbstractRowHandleSelectionModel this.grid = grid; if (this.grid != null) { - spaceSelectHandler = new SpaceSelectHandler(grid); - clickSelectHandler = new ClickSelectHandler(grid); + spaceSelectHandler = new SpaceSelectHandler<>(grid); + clickSelectHandler = new ClickSelectHandler<>(grid); updateHandlerDeselectAllowed(); } else { spaceSelectHandler.removeHandler(); @@ -86,7 +86,7 @@ public class SelectionModelSingle extends AbstractRowHandleSelectionModel T removed = getSelectedRow(); if (selectByHandle(grid.getDataSource().getHandle(row))) { - grid.fireEvent(new SelectionEvent(grid, row, removed, false)); + grid.fireEvent(new SelectionEvent<>(grid, row, removed, false)); return true; } @@ -102,7 +102,7 @@ public class SelectionModelSingle extends AbstractRowHandleSelectionModel if (isSelected(row)) { deselectByHandle(selectedRow); - grid.fireEvent(new SelectionEvent(grid, null, row, false)); + grid.fireEvent(new SelectionEvent<>(grid, null, row, false)); return true; } diff --git a/client/src/main/java/com/vaadin/client/widget/grid/sort/Sort.java b/client/src/main/java/com/vaadin/client/widget/grid/sort/Sort.java index cc42c61851..043bcfa4c7 100644 --- a/client/src/main/java/com/vaadin/client/widget/grid/sort/Sort.java +++ b/client/src/main/java/com/vaadin/client/widget/grid/sort/Sort.java @@ -141,7 +141,7 @@ public class Sort { */ public List build() { - List order = new ArrayList(count); + List order = new ArrayList<>(count); Sort s = this; for (int i = count - 1; i >= 0; --i) { diff --git a/client/src/main/java/com/vaadin/client/widget/grid/sort/SortEvent.java b/client/src/main/java/com/vaadin/client/widget/grid/sort/SortEvent.java index 6ccb88c134..660b635eb6 100644 --- a/client/src/main/java/com/vaadin/client/widget/grid/sort/SortEvent.java +++ b/client/src/main/java/com/vaadin/client/widget/grid/sort/SortEvent.java @@ -29,7 +29,7 @@ import com.vaadin.client.widgets.Grid; */ public class SortEvent extends GwtEvent> { - private static final Type> TYPE = new Type>(); + private static final Type> TYPE = new Type<>(); private final Grid grid; private final List order; diff --git a/client/src/main/java/com/vaadin/client/widgets/Escalator.java b/client/src/main/java/com/vaadin/client/widgets/Escalator.java index 35978b7cb0..564496e00a 100644 --- a/client/src/main/java/com/vaadin/client/widgets/Escalator.java +++ b/client/src/main/java/com/vaadin/client/widgets/Escalator.java @@ -388,7 +388,7 @@ public class Escalator extends Widget // The object to deal with one direction scrolling private class Movement { - final List speeds = new ArrayList(); + final List speeds = new ArrayList<>(); final ScrollbarBundle scroll; double position, offset, velocity, prevPos, prevTime, delta; boolean run, vertical; @@ -1277,7 +1277,7 @@ public class Escalator extends Widget * potentially need to set the widths for the cells for the * first time. */ - Map colWidths = new HashMap(); + Map colWidths = new HashMap<>(); for (int i = 0; i < getColumnConfiguration() .getColumnCount(); i++) { Double width = Double.valueOf( @@ -1307,7 +1307,7 @@ public class Escalator extends Widget final int visualIndex, final int numberOfRows) { assert isAttached() : "Can't paint rows if Escalator is not attached"; - final List addedRows = new ArrayList(); + final List addedRows = new ArrayList<>(); if (numberOfRows < 1) { return addedRows; @@ -2325,7 +2325,7 @@ public class Escalator extends Widget * * @see #sortDomElements() */ - private final LinkedList visualRowOrder = new LinkedList(); + private final LinkedList visualRowOrder = new LinkedList<>(); /** * The logical index of the topmost row. @@ -2792,7 +2792,7 @@ public class Escalator extends Widget * it's faster to just move idx[9] to the beginning. */ - final List removedRows = new ArrayList( + final List removedRows = new ArrayList<>( visualSourceRange.length()); for (int i = 0; i < visualSourceRange.length(); i++) { final TableRowElement tr = visualRowOrder @@ -3756,7 +3756,7 @@ public class Escalator extends Widget * the first child. */ - List orderedBodyRows = new ArrayList( + List orderedBodyRows = new ArrayList<>( visualRowOrder); Map spacers = body.spacerContainer .getSpacers(); @@ -4011,7 +4011,7 @@ public class Escalator extends Widget } } - private final List columns = new ArrayList(); + private final List columns = new ArrayList<>(); private int frozenColumns = 0; /* @@ -4209,7 +4209,7 @@ public class Escalator extends Widget if (header.getRowCount() > 0 || body.getRowCount() > 0 || footer.getRowCount() > 0) { - Map colWidths = new HashMap(); + Map colWidths = new HashMap<>(); Double width = Double.valueOf(Column.DEFAULT_COLUMN_WIDTH_PX); for (int i = index; i < index + numberOfColumns; i++) { Integer col = Integer.valueOf(i); @@ -4747,7 +4747,7 @@ public class Escalator extends Widget } } - private final TreeMap rowIndexToSpacer = new TreeMap(); + private final TreeMap rowIndexToSpacer = new TreeMap<>(); private SpacerUpdater spacerUpdater = SpacerUpdater.NULL; @@ -4885,7 +4885,7 @@ public class Escalator extends Widget } public Map getSpacers() { - return new HashMap(rowIndexToSpacer); + return new HashMap<>(rowIndexToSpacer); } /** @@ -4908,7 +4908,7 @@ public class Escalator extends Widget @SuppressWarnings("boxing") public Collection getSpacersForRowAndAfter( int logicalRowIndex) { - return new ArrayList( + return new ArrayList<>( rowIndexToSpacer.tailMap(logicalRowIndex, true).values()); } @@ -4936,7 +4936,7 @@ public class Escalator extends Widget public Collection getSpacersAfterPx(final double px, final SpacerInclusionStrategy strategy) { - ArrayList spacers = new ArrayList( + ArrayList spacers = new ArrayList<>( rowIndexToSpacer.values()); for (int i = 0; i < spacers.size(); i++) { @@ -5344,8 +5344,8 @@ public class Escalator extends Widget /** * A map containing cached values of an element's current top position. */ - private final Map elementTopPositionMap = new HashMap(); - private final Map elementLeftPositionMap = new HashMap(); + private final Map elementTopPositionMap = new HashMap<>(); + private final Map elementLeftPositionMap = new HashMap<>(); public void set(final Element e, final double x, final double y) { assert e != null : "Element was null"; diff --git a/client/src/main/java/com/vaadin/client/widgets/Grid.java b/client/src/main/java/com/vaadin/client/widgets/Grid.java index 85c6d48942..92dc0d7043 100644 --- a/client/src/main/java/com/vaadin/client/widgets/Grid.java +++ b/client/src/main/java/com/vaadin/client/widgets/Grid.java @@ -441,14 +441,14 @@ public class Grid extends ResizeComposite implements HasSelectionHandlers, */ public abstract static class StaticRow { - private Map, CELLTYPE> cells = new HashMap, CELLTYPE>(); + private Map, CELLTYPE> cells = new HashMap<>(); private StaticSection section; /** * Map from set of spanned columns to cell meta data. */ - private Map>, CELLTYPE> cellGroups = new HashMap>, CELLTYPE>(); + private Map>, CELLTYPE> cellGroups = new HashMap<>(); /** * A custom style name for the row or null if none is set. @@ -496,7 +496,7 @@ public class Grid extends ResizeComposite implements HasSelectionHandlers, "You can't merge less than 2 columns together."); } - HashSet> columnGroup = new HashSet>(); + HashSet> columnGroup = new HashSet<>(); // NOTE: this doesn't care about hidden columns, those are // filtered in calculateColspans() for (Column column : columns) { @@ -590,7 +590,7 @@ public class Grid extends ResizeComposite implements HasSelectionHandlers, private boolean checkMergedCellIsContinuous( Set> mergedCell) { // no matter if hidden or not, just check for continuous order - final List> columnOrder = new ArrayList>( + final List> columnOrder = new ArrayList<>( section.grid.getColumns()); if (!columnOrder.containsAll(mergedCell)) { @@ -660,7 +660,7 @@ public class Grid extends ResizeComposite implements HasSelectionHandlers, */ void detach() { // Avoid calling detach twice for a merged cell - HashSet cells = new HashSet(); + HashSet cells = new HashSet<>(); for (Column column : getSection().grid.getColumns()) { cells.add(getCell(column)); } @@ -672,7 +672,7 @@ public class Grid extends ResizeComposite implements HasSelectionHandlers, private Grid grid; - private List rows = new ArrayList(); + private List rows = new ArrayList<>(); private boolean visible = true; @@ -1336,8 +1336,8 @@ public class Grid extends ResizeComposite implements HasSelectionHandlers, // Should only be added to the DOM when there's a message to show private DivElement message = DivElement.as(DOM.createDiv()); - private Map, Widget> columnToWidget = new HashMap, Widget>(); - private List focusHandlers = new ArrayList(); + private Map, Widget> columnToWidget = new HashMap<>(); + private List focusHandlers = new ArrayList<>(); private boolean enabled = false; private State state = State.INACTIVE; @@ -1432,7 +1432,7 @@ public class Grid extends ResizeComposite implements HasSelectionHandlers, }; /** A set of all the columns that display an error flag. */ - private final Set> columnErrors = new HashSet>(); + private final Set> columnErrors = new HashSet<>(); private boolean buffered = true; /** Original position of editor */ @@ -1628,7 +1628,7 @@ public class Grid extends ResizeComposite implements HasSelectionHandlers, throw new IllegalStateException( "Cannot cancel edit: editor is not in edit mode"); } - handler.cancel(new EditorRequestImpl(grid, rowIndex, + handler.cancel(new EditorRequestImpl<>(grid, rowIndex, focusedColumnIndex, null)); doCancel(); } @@ -1674,7 +1674,7 @@ public class Grid extends ResizeComposite implements HasSelectionHandlers, state = State.SAVING; setButtonsEnabled(false); saveTimeout.schedule(SAVE_TIMEOUT_MS); - EditorRequest request = new EditorRequestImpl(grid, rowIndex, + EditorRequest request = new EditorRequestImpl<>(grid, rowIndex, focusedColumnIndex, saveRequestCallback); handler.save(request); updateSelectionCheckboxesAsNeeded(true); @@ -1738,7 +1738,7 @@ public class Grid extends ResizeComposite implements HasSelectionHandlers, if (state == State.ACTIVATING) { state = State.BINDING; bindTimeout.schedule(BIND_TIMEOUT_MS); - EditorRequest request = new EditorRequestImpl(grid, + EditorRequest request = new EditorRequestImpl<>(grid, rowIndex, columnIndex, bindRequestCallback); handler.bind(request); grid.getEscalator().setScrollLocked(Direction.VERTICAL, @@ -2269,7 +2269,7 @@ public class Grid extends ResizeComposite implements HasSelectionHandlers, extends KeyEvent { private Grid grid; - private final Type associatedType = new Type( + private final Type associatedType = new Type<>( getBrowserEventType(), this); private final CellReference targetCell; @@ -2329,7 +2329,7 @@ public class Grid extends ResizeComposite implements HasSelectionHandlers, private Grid grid; private final CellReference targetCell; - private final Type associatedType = new Type( + private final Type associatedType = new Type<>( getBrowserEventType(), this); public AbstractGridMouseEvent(Grid grid, @@ -2407,7 +2407,7 @@ public class Grid extends ResizeComposite implements HasSelectionHandlers, */ private static final double DETAILS_ROW_INITIAL_HEIGHT = 50; - private EventCellReference eventCell = new EventCellReference(this); + private EventCellReference eventCell = new EventCellReference<>(this); private GridKeyDownEvent keyDown = new GridKeyDownEvent(this, eventCell); private GridKeyUpEvent keyUp = new GridKeyUpEvent(this, eventCell); private GridKeyPressEvent keyPress = new GridKeyPressEvent(this, eventCell); @@ -2881,7 +2881,7 @@ public class Grid extends ResizeComposite implements HasSelectionHandlers, public void onValueChange( ValueChangeEvent event) { if (event.getValue()) { - fireEvent(new SelectAllEvent(model)); + fireEvent(new SelectAllEvent<>(model)); selected = true; } else { model.deselectAll(); @@ -3231,7 +3231,7 @@ public class Grid extends ResizeComposite implements HasSelectionHandlers, /* Step 1: Apply all column widths as they are. */ - Map selfWidths = new LinkedHashMap(); + Map selfWidths = new LinkedHashMap<>(); List> columns = getVisibleColumns(); for (int index = 0; index < columns.size(); index++) { selfWidths.put(index, columns.get(index).getWidth()); @@ -3245,7 +3245,7 @@ public class Grid extends ResizeComposite implements HasSelectionHandlers, * violated, fix it. */ - Map constrainedWidths = new LinkedHashMap(); + Map constrainedWidths = new LinkedHashMap<>(); for (int index = 0; index < columns.size(); index++) { Column column = columns.get(index); @@ -3270,9 +3270,9 @@ public class Grid extends ResizeComposite implements HasSelectionHandlers, boolean defaultExpandRatios = true; int totalRatios = 0; double reservedPixels = 0; - final Set> columnsToExpand = new HashSet>(); - List> nonFixedColumns = new ArrayList>(); - Map columnSizes = new HashMap(); + final Set> columnsToExpand = new HashSet<>(); + List> nonFixedColumns = new ArrayList<>(); + Map columnSizes = new HashMap<>(); final List> visibleColumns = getVisibleColumns(); /* @@ -3535,7 +3535,7 @@ public class Grid extends ResizeComposite implements HasSelectionHandlers, private static final String STRIPE_CLASSNAME = "stripe"; - private final Map elementToWidgetMap = new HashMap(); + private final Map elementToWidgetMap = new HashMap<>(); @Override public void init(Spacer spacer) { @@ -3917,7 +3917,7 @@ public class Grid extends ResizeComposite implements HasSelectionHandlers, private final class ColumnHider { /** Map from columns to their hiding toggles, component might change */ - private HashMap, MenuItem> columnToHidingToggleMap = new HashMap, MenuItem>(); + private HashMap, MenuItem> columnToHidingToggleMap = new HashMap<>(); /** * When column is being hidden with a toggle, do not refresh toggles for @@ -4016,7 +4016,7 @@ public class Grid extends ResizeComposite implements HasSelectionHandlers, /** * List of columns in the grid. Order defines the visible order. */ - private List> columns = new ArrayList>(); + private List> columns = new ArrayList<>(); /** * The datasource currently in use. Note: it is null @@ -4040,7 +4040,7 @@ public class Grid extends ResizeComposite implements HasSelectionHandlers, * Current sort order. The (private) sort() method reads this list to * determine the order in which to present rows. */ - private List sortOrder = new ArrayList(); + private List sortOrder = new ArrayList<>(); private Renderer selectColumnRenderer = null; @@ -4098,7 +4098,7 @@ public class Grid extends ResizeComposite implements HasSelectionHandlers, private DetailsGenerator detailsGenerator = DetailsGenerator.NULL; private GridSpacerUpdater gridSpacerUpdater = new GridSpacerUpdater(); /** A set keeping track of the indices of all currently open details */ - private Set visibleDetails = new HashSet(); + private Set visibleDetails = new HashSet<>(); private boolean columnReorderingAllowed; @@ -4148,7 +4148,7 @@ public class Grid extends ResizeComposite implements HasSelectionHandlers, * Map of possible drop positions for the column and the corresponding * column index. */ - private final TreeMap possibleDropPositions = new TreeMap(); + private final TreeMap possibleDropPositions = new TreeMap<>(); /** * Makes sure that drag cancel doesn't cause anything unwanted like sort */ @@ -4347,7 +4347,7 @@ public class Grid extends ResizeComposite implements HasSelectionHandlers, && latestColumnDropIndex != (draggedColumnIndex + colspan)) { List> columns = getColumns(); - List> reordered = new ArrayList>(); + List> reordered = new ArrayList<>(); if (draggedColumnIndex < latestColumnDropIndex) { reordered.addAll(columns.subList(0, draggedColumnIndex)); reordered.addAll( @@ -4475,8 +4475,8 @@ public class Grid extends ResizeComposite implements HasSelectionHandlers, int leftBound = -1; int rightBound = getColumnCount() + 1; - final HashSet unavailableColumnDropIndices = new HashSet(); - final List> rows = new ArrayList>(); + final HashSet unavailableColumnDropIndices = new HashSet<>(); + final List> rows = new ArrayList<>(); rows.addAll(header.getRows()); rows.addAll(footer.getRows()); for (StaticRow row : rows) { @@ -5062,7 +5062,7 @@ public class Grid extends ResizeComposite implements HasSelectionHandlers, grid.header.updateColSpans(); grid.footer.updateColSpans(); scheduleColumnWidthRecalculator(); - this.grid.fireEvent(new ColumnVisibilityChangeEvent(this, + this.grid.fireEvent(new ColumnVisibilityChangeEvent<>(this, hidden, userOriginated)); } } @@ -5725,7 +5725,7 @@ public class Grid extends ResizeComposite implements HasSelectionHandlers, if (c.getWidth() < 0) { c.setWidth(c.getWidthActual()); - fireEvent(new ColumnResizeEvent( + fireEvent(new ColumnResizeEvent<>( c)); } } @@ -5736,7 +5736,7 @@ public class Grid extends ResizeComposite implements HasSelectionHandlers, @Override public void onComplete() { - fireEvent(new ColumnResizeEvent(col)); + fireEvent(new ColumnResizeEvent<>(col)); WidgetUtil.setTextSelectionEnabled( getElement(), true); @@ -5818,7 +5818,7 @@ public class Grid extends ResizeComposite implements HasSelectionHandlers, escalator.getColumnConfiguration().setColumnWidth(colIndex, minWidth); - fireEvent(new ColumnResizeEvent(column)); + fireEvent(new ColumnResizeEvent<>(column)); } } @@ -6228,7 +6228,7 @@ public class Grid extends ResizeComposite implements HasSelectionHandlers, column.reapplyWidth(); // Sink all renderer events - Set events = new HashSet(); + Set events = new HashSet<>(); events.addAll(getConsumedEventsForRenderer(column.getRenderer())); if (column.isHidable()) { @@ -6321,7 +6321,7 @@ public class Grid extends ResizeComposite implements HasSelectionHandlers, */ public List> getColumns() { return Collections - .unmodifiableList(new ArrayList>(columns)); + .unmodifiableList(new ArrayList<>(columns)); } /** @@ -6333,7 +6333,7 @@ public class Grid extends ResizeComposite implements HasSelectionHandlers, * @return A unmodifiable list of the currently visible columns in the grid */ public List> getVisibleColumns() { - ArrayList> visible = new ArrayList>(); + ArrayList> visible = new ArrayList<>(); for (Column c : columns) { if (!c.isHidden()) { visible.add(c); @@ -6748,7 +6748,7 @@ public class Grid extends ResizeComposite implements HasSelectionHandlers, int oldSize = body.getRowCount(); // Hide all details. - Set oldDetails = new HashSet( + Set oldDetails = new HashSet<>( visibleDetails); for (int i : oldDetails) { setDetailsVisible(i, false); @@ -7122,7 +7122,7 @@ public class Grid extends ResizeComposite implements HasSelectionHandlers, } private Set getConsumedEventsForRenderer(Renderer renderer) { - Set events = new HashSet(); + Set events = new HashSet<>(); if (renderer instanceof ComplexRenderer) { Collection consumedEvents = ((ComplexRenderer) renderer) .getConsumedEvents(); @@ -7294,7 +7294,7 @@ public class Grid extends ResizeComposite implements HasSelectionHandlers, w = editor.getWidget(getColumn(editor.focusedColumnIndex)); } - EditorDomEvent editorEvent = new EditorDomEvent(event, + EditorDomEvent editorEvent = new EditorDomEvent<>(event, getEventCell(), w); return getEditor().getEventHandler().handleEvent(editorEvent); @@ -7365,8 +7365,8 @@ public class Grid extends ResizeComposite implements HasSelectionHandlers, private Point rowEventTouchStartingPoint; private CellStyleGenerator cellStyleGenerator; private RowStyleGenerator rowStyleGenerator; - private RowReference rowReference = new RowReference(this); - private CellReference cellReference = new CellReference(rowReference); + private RowReference rowReference = new RowReference<>(this); + private CellReference cellReference = new CellReference<>(rowReference); private RendererCellReference rendererCellReference = new RendererCellReference( (RowReference) rowReference); @@ -8187,7 +8187,7 @@ public class Grid extends ResizeComposite implements HasSelectionHandlers, */ private void sort(boolean userOriginated) { refreshHeader(); - fireEvent(new SortEvent(this, + fireEvent(new SortEvent<>(this, Collections.unmodifiableList(sortOrder), userOriginated)); } @@ -8269,7 +8269,7 @@ public class Grid extends ResizeComposite implements HasSelectionHandlers, // Trigger ComplexRenderer.destroy for old content conf.removeColumns(0, conf.getColumnCount()); - List> newOrder = new ArrayList>(); + List> newOrder = new ArrayList<>(); if (selectionColumn != null) { newOrder.add(selectionColumn); } @@ -8547,7 +8547,7 @@ public class Grid extends ResizeComposite implements HasSelectionHandlers, @Override protected void onDetach() { - Set details = new HashSet(visibleDetails); + Set details = new HashSet<>(visibleDetails); for (int row : details) { setDetailsVisible(row, false); } @@ -8957,7 +8957,7 @@ public class Grid extends ResizeComposite implements HasSelectionHandlers, if (container != null) { Cell cell = container.getCell(element); if (cell != null) { - EventCellReference cellRef = new EventCellReference(this); + EventCellReference cellRef = new EventCellReference<>(this); cellRef.set(cell, getSectionFromContainer(container)); return cellRef; } diff --git a/client/src/main/java/com/vaadin/client/widgets/Overlay.java b/client/src/main/java/com/vaadin/client/widgets/Overlay.java index 0b1d317a05..e6ce34b8a7 100644 --- a/client/src/main/java/com/vaadin/client/widgets/Overlay.java +++ b/client/src/main/java/com/vaadin/client/widgets/Overlay.java @@ -175,7 +175,7 @@ public class Overlay extends PopupPanel { */ private static final int POPUP_PANEL_ANIMATION_DURATION = 200; - private List runOnClose = new ArrayList(); + private List runOnClose = new ArrayList<>(); public Overlay() { super(); diff --git a/client/src/test/java/com/vaadin/client/DateTimeServiceTest.java b/client/src/test/java/com/vaadin/client/DateTimeServiceTest.java index 912abc412a..1329b7fdc9 100755 --- a/client/src/test/java/com/vaadin/client/DateTimeServiceTest.java +++ b/client/src/test/java/com/vaadin/client/DateTimeServiceTest.java @@ -12,7 +12,7 @@ public class DateTimeServiceTest { final long MILLISECONDS_PER_DAY = 24 * 3600 * 1000; - static Map isoWeekNumbers = new HashMap(); + static Map isoWeekNumbers = new HashMap<>(); static { isoWeekNumbers.put(getDate(2005, 02, 02), 5); diff --git a/client/src/test/java/com/vaadin/client/ui/grid/ListDataSourceTest.java b/client/src/test/java/com/vaadin/client/ui/grid/ListDataSourceTest.java index b3a4f24ebb..7d9bf530ce 100644 --- a/client/src/test/java/com/vaadin/client/ui/grid/ListDataSourceTest.java +++ b/client/src/test/java/com/vaadin/client/ui/grid/ListDataSourceTest.java @@ -32,7 +32,7 @@ public class ListDataSourceTest { @Test public void testDataSourceConstruction() throws Exception { - ListDataSource ds = new ListDataSource(0, 1, 2, 3); + ListDataSource ds = new ListDataSource<>(0, 1, 2, 3); assertEquals(4, ds.size()); assertEquals(0, (int) ds.getRow(0)); @@ -40,7 +40,7 @@ public class ListDataSourceTest { assertEquals(2, (int) ds.getRow(2)); assertEquals(3, (int) ds.getRow(3)); - ds = new ListDataSource(Arrays.asList(0, 1, 2, 3)); + ds = new ListDataSource<>(Arrays.asList(0, 1, 2, 3)); assertEquals(4, ds.size()); assertEquals(0, (int) ds.getRow(0)); @@ -52,7 +52,7 @@ public class ListDataSourceTest { @Test public void testListAddOperation() throws Exception { - ListDataSource ds = new ListDataSource(0, 1, 2, 3); + ListDataSource ds = new ListDataSource<>(0, 1, 2, 3); DataChangeHandler handler = EasyMock .createNiceMock(DataChangeHandler.class); @@ -76,7 +76,7 @@ public class ListDataSourceTest { @Test public void testListAddAllOperation() throws Exception { - ListDataSource ds = new ListDataSource(0, 1, 2, 3); + ListDataSource ds = new ListDataSource<>(0, 1, 2, 3); DataChangeHandler handler = EasyMock .createNiceMock(DataChangeHandler.class); @@ -102,7 +102,7 @@ public class ListDataSourceTest { @Test public void testListRemoveOperation() throws Exception { - ListDataSource ds = new ListDataSource(0, 1, 2, 3); + ListDataSource ds = new ListDataSource<>(0, 1, 2, 3); DataChangeHandler handler = EasyMock .createNiceMock(DataChangeHandler.class); @@ -124,7 +124,7 @@ public class ListDataSourceTest { @Test public void testListRemoveAllOperation() throws Exception { - ListDataSource ds = new ListDataSource(0, 1, 2, 3); + ListDataSource ds = new ListDataSource<>(0, 1, 2, 3); DataChangeHandler handler = EasyMock .createNiceMock(DataChangeHandler.class); @@ -144,7 +144,7 @@ public class ListDataSourceTest { @Test public void testListClearOperation() throws Exception { - ListDataSource ds = new ListDataSource(0, 1, 2, 3); + ListDataSource ds = new ListDataSource<>(0, 1, 2, 3); DataChangeHandler handler = EasyMock .createNiceMock(DataChangeHandler.class); @@ -162,19 +162,19 @@ public class ListDataSourceTest { @Test(expected = IllegalStateException.class) public void testFetchingNonExistantItem() { - ListDataSource ds = new ListDataSource(0, 1, 2, 3); + ListDataSource ds = new ListDataSource<>(0, 1, 2, 3); ds.ensureAvailability(5, 1); } @Test(expected = UnsupportedOperationException.class) public void testUnsupportedIteratorRemove() { - ListDataSource ds = new ListDataSource(0, 1, 2, 3); + ListDataSource ds = new ListDataSource<>(0, 1, 2, 3); ds.asList().iterator().remove(); } @Test public void sortColumn() { - ListDataSource ds = new ListDataSource(3, 4, 2, 3, 1); + ListDataSource ds = new ListDataSource<>(3, 4, 2, 3, 1); // TODO Should be simplified to sort(). No point in providing these // trivial comparators. diff --git a/server/src/main/java/com/vaadin/data/Result.java b/server/src/main/java/com/vaadin/data/Result.java index 7fb25bf9af..b82b3ff4e7 100644 --- a/server/src/main/java/com/vaadin/data/Result.java +++ b/server/src/main/java/com/vaadin/data/Result.java @@ -62,7 +62,7 @@ public interface Result extends Serializable { */ public static Result error(String message) { Objects.requireNonNull(message, "message cannot be null"); - return new SimpleResult(null, message); + return new SimpleResult<>(null, message); } /** diff --git a/server/src/main/java/com/vaadin/data/sort/Sort.java b/server/src/main/java/com/vaadin/data/sort/Sort.java index 63d152b001..fe082149e9 100644 --- a/server/src/main/java/com/vaadin/data/sort/Sort.java +++ b/server/src/main/java/com/vaadin/data/sort/Sort.java @@ -140,7 +140,7 @@ public class Sort implements Serializable { ++count; } - List order = new ArrayList(count); + List order = new ArrayList<>(count); s = this; do { diff --git a/server/src/main/java/com/vaadin/event/ActionManager.java b/server/src/main/java/com/vaadin/event/ActionManager.java index 98b1359337..b221d17511 100644 --- a/server/src/main/java/com/vaadin/event/ActionManager.java +++ b/server/src/main/java/com/vaadin/event/ActionManager.java @@ -98,7 +98,7 @@ public class ActionManager @Override public void addAction(T action) { if (ownActions == null) { - ownActions = new LinkedHashSet(); + ownActions = new LinkedHashSet<>(); } if (ownActions.add(action)) { requestRepaint(); @@ -123,7 +123,7 @@ public class ActionManager if (actionHandler != null) { if (actionHandlers == null) { - actionHandlers = new LinkedHashSet(); + actionHandlers = new LinkedHashSet<>(); } if (actionHandlers.add(actionHandler)) { @@ -165,7 +165,7 @@ public class ActionManager * removed but still exist on client side */ if (!actions.isEmpty() || clientHasActions) { - actionMapper = new KeyMapper(); + actionMapper = new KeyMapper<>(); paintTarget.addVariable((VariableOwner) viewer, "action", ""); paintTarget.startTag("actions"); @@ -240,7 +240,7 @@ public class ActionManager } private LinkedHashSet getActionSet(Object target, Object sender) { - LinkedHashSet actions = new LinkedHashSet(); + LinkedHashSet actions = new LinkedHashSet<>(); if (ownActions != null) { actions.addAll(ownActions); diff --git a/server/src/main/java/com/vaadin/event/EventRouter.java b/server/src/main/java/com/vaadin/event/EventRouter.java index 9e8051fed3..9ef6c8123b 100644 --- a/server/src/main/java/com/vaadin/event/EventRouter.java +++ b/server/src/main/java/com/vaadin/event/EventRouter.java @@ -52,7 +52,7 @@ public class EventRouter implements MethodEventSource { @Override public void addListener(Class eventType, Object object, Method method) { if (listenerList == null) { - listenerList = new LinkedHashSet(); + listenerList = new LinkedHashSet<>(); } listenerList.add(new ListenerMethod(eventType, object, method)); } @@ -66,7 +66,7 @@ public class EventRouter implements MethodEventSource { public void addListener(Class eventType, Object object, String methodName) { if (listenerList == null) { - listenerList = new LinkedHashSet(); + listenerList = new LinkedHashSet<>(); } listenerList.add(new ListenerMethod(eventType, object, methodName)); } @@ -232,7 +232,7 @@ public class EventRouter implements MethodEventSource { * are found. */ public Collection getListeners(Class eventType) { - List listeners = new ArrayList(); + List listeners = new ArrayList<>(); if (listenerList != null) { for (ListenerMethod lm : listenerList) { if (lm.isOrExtendsType(eventType)) { diff --git a/server/src/main/java/com/vaadin/event/SelectionEvent.java b/server/src/main/java/com/vaadin/event/SelectionEvent.java index f22f499893..b5a4d587e6 100644 --- a/server/src/main/java/com/vaadin/event/SelectionEvent.java +++ b/server/src/main/java/com/vaadin/event/SelectionEvent.java @@ -37,8 +37,8 @@ public class SelectionEvent extends EventObject { public SelectionEvent(Object source, Collection oldSelection, Collection newSelection) { super(source); - this.oldSelection = new LinkedHashSet(oldSelection); - this.newSelection = new LinkedHashSet(newSelection); + this.oldSelection = new LinkedHashSet<>(oldSelection); + this.newSelection = new LinkedHashSet<>(newSelection); } /** @@ -79,7 +79,7 @@ public class SelectionEvent extends EventObject { if (set2.isEmpty()) { return set1; } else { - LinkedHashSet set = new LinkedHashSet(set1); + LinkedHashSet set = new LinkedHashSet<>(set1); set.removeAll(set2); return set; } diff --git a/server/src/main/java/com/vaadin/event/TransferableImpl.java b/server/src/main/java/com/vaadin/event/TransferableImpl.java index fad6adf2eb..4da28176fc 100644 --- a/server/src/main/java/com/vaadin/event/TransferableImpl.java +++ b/server/src/main/java/com/vaadin/event/TransferableImpl.java @@ -27,7 +27,7 @@ import com.vaadin.ui.Component; * @since 6.3 */ public class TransferableImpl implements Transferable { - private Map rawVariables = new HashMap(); + private Map rawVariables = new HashMap<>(); private Component sourceComponent; public TransferableImpl(Component sourceComponent, diff --git a/server/src/main/java/com/vaadin/event/dd/TargetDetailsImpl.java b/server/src/main/java/com/vaadin/event/dd/TargetDetailsImpl.java index cce6029159..42bff9c007 100644 --- a/server/src/main/java/com/vaadin/event/dd/TargetDetailsImpl.java +++ b/server/src/main/java/com/vaadin/event/dd/TargetDetailsImpl.java @@ -30,7 +30,7 @@ import com.vaadin.shared.MouseEventDetails; @SuppressWarnings("serial") public class TargetDetailsImpl implements TargetDetails { - private HashMap data = new HashMap(); + private HashMap data = new HashMap<>(); private DropTarget dropTarget; protected TargetDetailsImpl(Map rawDropData) { diff --git a/server/src/main/java/com/vaadin/navigator/Navigator.java b/server/src/main/java/com/vaadin/navigator/Navigator.java index 5704457f72..13e3b4c2e7 100644 --- a/server/src/main/java/com/vaadin/navigator/Navigator.java +++ b/server/src/main/java/com/vaadin/navigator/Navigator.java @@ -374,8 +374,8 @@ public class Navigator implements Serializable { private NavigationStateManager stateManager; private ViewDisplay display; private View currentView = null; - private List listeners = new LinkedList(); - private List providers = new LinkedList(); + private List listeners = new LinkedList<>(); + private List providers = new LinkedList<>(); private String currentNavigationState = null; private ViewProvider errorProvider; @@ -722,7 +722,7 @@ public class Navigator implements Serializable { // a copy of the listener list is needed to avoid // ConcurrentModificationException as a listener can add/remove // listeners - for (ViewChangeListener l : new ArrayList( + for (ViewChangeListener l : new ArrayList<>( listeners)) { if (!l.beforeViewChange(event)) { return false; @@ -786,7 +786,7 @@ public class Navigator implements Serializable { // a copy of the listener list is needed to avoid // ConcurrentModificationException as a listener can add/remove // listeners - for (ViewChangeListener l : new ArrayList( + for (ViewChangeListener l : new ArrayList<>( listeners)) { l.afterViewChange(event); } diff --git a/server/src/main/java/com/vaadin/server/AbstractClientConnector.java b/server/src/main/java/com/vaadin/server/AbstractClientConnector.java index 676256fb5d..ea969bea2b 100644 --- a/server/src/main/java/com/vaadin/server/AbstractClientConnector.java +++ b/server/src/main/java/com/vaadin/server/AbstractClientConnector.java @@ -60,13 +60,13 @@ public abstract class AbstractClientConnector * A map from client to server RPC interface class name to the RPC call * manager that handles incoming RPC calls for that interface. */ - private Map> rpcManagerMap = new HashMap>(); + private Map> rpcManagerMap = new HashMap<>(); /** * A map from server to client RPC interface class to the RPC proxy that * sends ourgoing RPC calls for that interface. */ - private Map, ClientRpc> rpcProxyMap = new HashMap, ClientRpc>(); + private Map, ClientRpc> rpcProxyMap = new HashMap<>(); /** * Shared state object to be communicated from the server to the client when @@ -79,11 +79,11 @@ public abstract class AbstractClientConnector /** * Pending RPC method invocations to be sent. */ - private ArrayList pendingInvocations = new ArrayList(); + private ArrayList pendingInvocations = new ArrayList<>(); private String connectorId; - private ArrayList extensions = new ArrayList(); + private ArrayList extensions = new ArrayList<>(); /** * The EventRouter used for the event model. @@ -92,7 +92,7 @@ public abstract class AbstractClientConnector private ErrorHandler errorHandler = null; - private static final ConcurrentHashMap, Class> stateTypeCache = new ConcurrentHashMap, Class>(); + private static final ConcurrentHashMap, Class> stateTypeCache = new ConcurrentHashMap<>(); @Override public void addAttachListener(AttachListener listener) { @@ -170,7 +170,7 @@ public abstract class AbstractClientConnector protected void registerRpc(T implementation, Class rpcInterfaceType) { rpcManagerMap.put(rpcInterfaceType.getName(), - new ServerRpcManager(implementation, rpcInterfaceType)); + new ServerRpcManager<>(implementation, rpcInterfaceType)); } /** @@ -425,7 +425,7 @@ public abstract class AbstractClientConnector return Collections.emptyList(); } else { List result = pendingInvocations; - pendingInvocations = new ArrayList(); + pendingInvocations = new ArrayList<>(); return Collections.unmodifiableList(result); } } diff --git a/server/src/main/java/com/vaadin/server/AbstractErrorMessage.java b/server/src/main/java/com/vaadin/server/AbstractErrorMessage.java index 0bd00bae86..491462b53d 100644 --- a/server/src/main/java/com/vaadin/server/AbstractErrorMessage.java +++ b/server/src/main/java/com/vaadin/server/AbstractErrorMessage.java @@ -63,7 +63,7 @@ public abstract class AbstractErrorMessage implements ErrorMessage { */ private ErrorLevel level = ErrorLevel.ERROR; - private List causes = new ArrayList(); + private List causes = new ArrayList<>(); protected AbstractErrorMessage(String message) { this.message = message; diff --git a/server/src/main/java/com/vaadin/server/BootstrapHandler.java b/server/src/main/java/com/vaadin/server/BootstrapHandler.java index 359f878ad1..84ee3c2334 100644 --- a/server/src/main/java/com/vaadin/server/BootstrapHandler.java +++ b/server/src/main/java/com/vaadin/server/BootstrapHandler.java @@ -303,7 +303,7 @@ public abstract class BootstrapHandler extends SynchronizedRequestHandler { .getBootstrapResponse(); if (vaadinService.isStandalone(request)) { - Map headers = new LinkedHashMap(); + Map headers = new LinkedHashMap<>(); Document document = Document.createShell(""); BootstrapPageResponse pageResponse = new BootstrapPageResponse(this, request, context.getSession(), context.getUIClass(), diff --git a/server/src/main/java/com/vaadin/server/ComponentSizeValidator.java b/server/src/main/java/com/vaadin/server/ComponentSizeValidator.java index dcf47ba438..241aea2078 100644 --- a/server/src/main/java/com/vaadin/server/ComponentSizeValidator.java +++ b/server/src/main/java/com/vaadin/server/ComponentSizeValidator.java @@ -70,7 +70,7 @@ public class ComponentSizeValidator implements Serializable { parent.addError(error); } else { if (errors == null) { - errors = new LinkedList(); + errors = new LinkedList<>(); } errors.add(error); } @@ -168,7 +168,7 @@ public class ComponentSizeValidator implements Serializable { private final boolean invalidHeight; private final boolean invalidWidth; - private final Vector subErrors = new Vector(); + private final Vector subErrors = new Vector<>(); public InvalidLayout(Component component, boolean height, boolean width) { @@ -281,7 +281,7 @@ public class ComponentSizeValidator implements Serializable { private static Stack getHeightAttributes( Component component) { - Stack attributes = new Stack(); + Stack attributes = new Stack<>(); attributes .add(new ComponentInfo(component, getHeightString(component))); Component parent = component.getParent(); @@ -296,7 +296,7 @@ public class ComponentSizeValidator implements Serializable { private static Stack getWidthAttributes( Component component) { - Stack attributes = new Stack(); + Stack attributes = new Stack<>(); attributes.add(new ComponentInfo(component, getWidthString(component))); Component parent = component.getParent(); attributes.add(new ComponentInfo(parent, getWidthString(parent))); @@ -581,9 +581,9 @@ public class ComponentSizeValidator implements Serializable { } - private static Map creationLocations = new HashMap(); - private static Map widthLocations = new HashMap(); - private static Map heightLocations = new HashMap(); + private static Map creationLocations = new HashMap<>(); + private static Map widthLocations = new HashMap<>(); + private static Map heightLocations = new HashMap<>(); public static class FileLocation implements Serializable { public String method; diff --git a/server/src/main/java/com/vaadin/server/DownloadStream.java b/server/src/main/java/com/vaadin/server/DownloadStream.java index d67fbda8c2..a0a1334135 100644 --- a/server/src/main/java/com/vaadin/server/DownloadStream.java +++ b/server/src/main/java/com/vaadin/server/DownloadStream.java @@ -148,7 +148,7 @@ public class DownloadStream implements Serializable { */ public void setParameter(String name, String value) { if (params == null) { - params = new HashMap(); + params = new HashMap<>(); } params.put(name, value); } diff --git a/server/src/main/java/com/vaadin/server/GAEVaadinServlet.java b/server/src/main/java/com/vaadin/server/GAEVaadinServlet.java index aa3bccdb93..93a43829b3 100644 --- a/server/src/main/java/com/vaadin/server/GAEVaadinServlet.java +++ b/server/src/main/java/com/vaadin/server/GAEVaadinServlet.java @@ -428,7 +428,7 @@ public class GAEVaadinServlet extends VaadinServlet { getLogger().log(Level.INFO, "Vaadin cleanup deleting {0} expired Vaadin sessions.", entities.size()); - List keys = new ArrayList(); + List keys = new ArrayList<>(); for (Entity e : entities) { keys.add(e.getKey()); } @@ -448,7 +448,7 @@ public class GAEVaadinServlet extends VaadinServlet { getLogger().log(Level.INFO, "Vaadin cleanup deleting {0} expired appengine sessions.", entities.size()); - List keys = new ArrayList(); + List keys = new ArrayList<>(); for (Entity e : entities) { keys.add(e.getKey()); } diff --git a/server/src/main/java/com/vaadin/server/GlobalResourceHandler.java b/server/src/main/java/com/vaadin/server/GlobalResourceHandler.java index 62f3d33014..975d5475d1 100644 --- a/server/src/main/java/com/vaadin/server/GlobalResourceHandler.java +++ b/server/src/main/java/com/vaadin/server/GlobalResourceHandler.java @@ -49,15 +49,15 @@ public class GlobalResourceHandler implements RequestHandler { /** * Used to detect when a resource is no longer used by any connector. */ - private final Map> resourceUsers = new HashMap>(); + private final Map> resourceUsers = new HashMap<>(); /** * Used to find the resources that might not be needed any more when a * connector is unregistered. */ - private final Map> usedResources = new HashMap>(); + private final Map> usedResources = new HashMap<>(); - private final Map legacyResourceKeys = new HashMap(); - private final Map legacyResources = new HashMap(); + private final Map legacyResourceKeys = new HashMap<>(); + private final Map legacyResources = new HashMap<>(); private int nextLegacyId = 0; // APP/global/[uiid]/[type]/[id] @@ -173,7 +173,7 @@ public class GlobalResourceHandler implements RequestHandler { private void ensureInSet(Map> map, K key, V value) { Set set = map.get(key); if (set == null) { - set = new HashSet(); + set = new HashSet<>(); map.put(key, set); } set.add(value); diff --git a/server/src/main/java/com/vaadin/server/JavaScriptCallbackHelper.java b/server/src/main/java/com/vaadin/server/JavaScriptCallbackHelper.java index f4b8556385..cdd42c19da 100644 --- a/server/src/main/java/com/vaadin/server/JavaScriptCallbackHelper.java +++ b/server/src/main/java/com/vaadin/server/JavaScriptCallbackHelper.java @@ -49,7 +49,7 @@ public class JavaScriptCallbackHelper implements Serializable { JavaScriptCallbackRpc.class, "call", String.class, JsonArray.class); private AbstractClientConnector connector; - private Map callbacks = new HashMap(); + private Map callbacks = new HashMap<>(); private JavaScriptCallbackRpc javascriptCallbackRpc; public JavaScriptCallbackHelper(AbstractClientConnector connector) { @@ -109,7 +109,7 @@ public class JavaScriptCallbackHelper implements Serializable { .getRpcInterfaces(); String interfaceName = rpcInterfaceType.getName(); if (!rpcInterfaces.containsKey(interfaceName)) { - Set methodNames = new HashSet(); + Set methodNames = new HashSet<>(); for (Method method : rpcInterfaceType.getMethods()) { methodNames.add(method.getName()); diff --git a/server/src/main/java/com/vaadin/server/JsonCodec.java b/server/src/main/java/com/vaadin/server/JsonCodec.java index 2dae3ed03e..adf3e029ee 100644 --- a/server/src/main/java/com/vaadin/server/JsonCodec.java +++ b/server/src/main/java/com/vaadin/server/JsonCodec.java @@ -137,7 +137,7 @@ public class JsonCodec implements Serializable { public static Collection find(Class type) throws IntrospectionException { Field[] fields = type.getFields(); - Collection properties = new ArrayList( + Collection properties = new ArrayList<>( fields.length); for (Field field : fields) { if (!Modifier.isStatic(field.getModifiers())) { @@ -178,7 +178,7 @@ public class JsonCodec implements Serializable { public static Collection find(Class type) throws IntrospectionException { - Collection properties = new ArrayList(); + Collection properties = new ArrayList<>(); for (PropertyDescriptor pd : Introspector.getBeanInfo(type) .getPropertyDescriptors()) { @@ -204,17 +204,17 @@ public class JsonCodec implements Serializable { * happens to process Vaadin requests, so it must be protected from * corruption caused by concurrent access. */ - private static ConcurrentMap, Collection> typePropertyCache = new ConcurrentHashMap, Collection>(); + private static ConcurrentMap, Collection> typePropertyCache = new ConcurrentHashMap<>(); - private static Map, String> typeToTransportType = new HashMap, String>(); + private static Map, String> typeToTransportType = new HashMap<>(); /** * Note! This does not contain primitives. *

*/ - private static Map> transportTypeToType = new HashMap>(); + private static Map> transportTypeToType = new HashMap<>(); - private static Map, JSONSerializer> customSerializers = new HashMap, JSONSerializer>(); + private static Map, JSONSerializer> customSerializers = new HashMap<>(); static { customSerializers.put(Date.class, new DateSerializer()); } @@ -464,7 +464,7 @@ public class JsonCodec implements Serializable { // See #8906. JsonArray jsonArray = (JsonArray) jsonMap; if (jsonArray.length() == 0) { - return new HashMap(); + return new HashMap<>(); } } @@ -499,7 +499,7 @@ public class JsonCodec implements Serializable { assert (keys.length() == values.length()); - Map map = new HashMap( + Map map = new HashMap<>( keys.length() * 2); for (int i = 0; i < keys.length(); i++) { Object key = decodeInternalOrCustomType(keyType, keys.get(i), @@ -515,7 +515,7 @@ public class JsonCodec implements Serializable { private static Map decodeConnectorMap(Type valueType, JsonObject jsonMap, ConnectorTracker connectorTracker) { - Map map = new HashMap(); + Map map = new HashMap<>(); for (String key : jsonMap.keys()) { Object value = decodeInternalOrCustomType(valueType, @@ -531,7 +531,7 @@ public class JsonCodec implements Serializable { private static Map decodeStringMap(Type valueType, JsonObject jsonMap, ConnectorTracker connectorTracker) { - Map map = new HashMap(); + Map map = new HashMap<>(); for (String key : jsonMap.keys()) { Object value = decodeInternalOrCustomType(valueType, @@ -590,7 +590,7 @@ public class JsonCodec implements Serializable { boolean restrictToInternalTypes, JsonArray jsonArray, ConnectorTracker connectorTracker) { int arrayLength = jsonArray.length(); - List list = new ArrayList(arrayLength); + List list = new ArrayList<>(arrayLength); for (int i = 0; i < arrayLength; ++i) { // each entry always has two elements: type and value JsonValue encodedValue = jsonArray.get(i); @@ -604,7 +604,7 @@ public class JsonCodec implements Serializable { private static Set decodeSet(Type targetType, boolean restrictToInternalTypes, JsonArray jsonArray, ConnectorTracker connectorTracker) { - HashSet set = new HashSet(); + HashSet set = new HashSet<>(); set.addAll(decodeList(targetType, restrictToInternalTypes, jsonArray, connectorTracker)); return set; @@ -702,7 +702,7 @@ public class JsonCodec implements Serializable { if (cachedProperties != null) { return cachedProperties; } - Collection properties = new ArrayList(); + Collection properties = new ArrayList<>(); properties.addAll(MethodProperty.find(type)); properties.addAll(FieldProperty.find(type)); diff --git a/server/src/main/java/com/vaadin/server/JsonPaintTarget.java b/server/src/main/java/com/vaadin/server/JsonPaintTarget.java index 19f79b6507..4463fd1ab5 100644 --- a/server/src/main/java/com/vaadin/server/JsonPaintTarget.java +++ b/server/src/main/java/com/vaadin/server/JsonPaintTarget.java @@ -65,7 +65,7 @@ public class JsonPaintTarget implements PaintTarget { private int changes = 0; - private final Set usedResources = new HashSet(); + private final Set usedResources = new HashSet<>(); private boolean customLayoutArgumentsOpen = false; @@ -73,7 +73,7 @@ public class JsonPaintTarget implements PaintTarget { private boolean cacheEnabled = false; - private final Set> usedClientConnectors = new HashSet>(); + private final Set> usedClientConnectors = new HashSet<>(); /** * Creates a new JsonPaintTarget. @@ -96,11 +96,11 @@ public class JsonPaintTarget implements PaintTarget { uidlBuffer = new PrintWriter(outWriter); // Initialize tag-writing - mOpenTags = new Stack(); - openJsonTags = new Stack(); + mOpenTags = new Stack<>(); + openJsonTags = new Stack<>(); - openPaintables = new Stack(); - openPaintableTags = new Stack(); + openPaintables = new Stack<>(); + openPaintableTags = new Stack<>(); cacheEnabled = cachingRequired; } @@ -728,11 +728,11 @@ public class JsonPaintTarget implements PaintTarget { class JsonTag implements Serializable { boolean firstField = false; - Vector variables = new Vector(); + Vector variables = new Vector<>(); - Vector children = new Vector(); + Vector children = new Vector<>(); - Vector attr = new Vector(); + Vector attr = new Vector<>(); StringBuilder data = new StringBuilder(); diff --git a/server/src/main/java/com/vaadin/server/KeyMapper.java b/server/src/main/java/com/vaadin/server/KeyMapper.java index 389fcd8b66..54d85c4bce 100644 --- a/server/src/main/java/com/vaadin/server/KeyMapper.java +++ b/server/src/main/java/com/vaadin/server/KeyMapper.java @@ -32,9 +32,9 @@ public class KeyMapper implements DataKeyMapper, Serializable { private int lastKey = 0; - private final HashMap objectKeyMap = new HashMap(); + private final HashMap objectKeyMap = new HashMap<>(); - private final HashMap keyObjectMap = new HashMap(); + private final HashMap keyObjectMap = new HashMap<>(); /** * Gets key for an object. diff --git a/server/src/main/java/com/vaadin/server/LegacyApplication.java b/server/src/main/java/com/vaadin/server/LegacyApplication.java index 93f3da3d8f..210520cfaa 100644 --- a/server/src/main/java/com/vaadin/server/LegacyApplication.java +++ b/server/src/main/java/com/vaadin/server/LegacyApplication.java @@ -42,7 +42,7 @@ public abstract class LegacyApplication implements ErrorHandler { private LegacyWindow mainWindow; private String theme; - private Map legacyUINames = new HashMap(); + private Map legacyUINames = new HashMap<>(); private boolean isRunning = true; diff --git a/server/src/main/java/com/vaadin/server/LegacyCommunicationManager.java b/server/src/main/java/com/vaadin/server/LegacyCommunicationManager.java index 513f598b21..858f61d0c7 100644 --- a/server/src/main/java/com/vaadin/server/LegacyCommunicationManager.java +++ b/server/src/main/java/com/vaadin/server/LegacyCommunicationManager.java @@ -56,7 +56,7 @@ import elemental.json.JsonValue; public class LegacyCommunicationManager implements Serializable { // TODO Refactor (#11410) - private final HashMap uiToClientCache = new HashMap(); + private final HashMap uiToClientCache = new HashMap<>(); /** * The session this communication manager is used for @@ -67,7 +67,7 @@ public class LegacyCommunicationManager implements Serializable { private String requestThemeName; // TODO Refactor (#11413) - private Map> publishedFileContexts = new HashMap>(); + private Map> publishedFileContexts = new HashMap<>(); /** * TODO New constructor - document me! @@ -82,7 +82,7 @@ public class LegacyCommunicationManager implements Serializable { return session; } - private static final ConcurrentHashMap, JsonValue> referenceDiffStates = new ConcurrentHashMap, JsonValue>(); + private static final ConcurrentHashMap, JsonValue> referenceDiffStates = new ConcurrentHashMap<>(); /** * @deprecated As of 7.1. See #11411. @@ -307,7 +307,7 @@ public class LegacyCommunicationManager implements Serializable { } } - private final HashMap, Integer> typeToKey = new HashMap, Integer>(); + private final HashMap, Integer> typeToKey = new HashMap<>(); private int nextTypeKey = 0; /** @@ -338,7 +338,7 @@ public class LegacyCommunicationManager implements Serializable { @Deprecated public class ClientCache implements Serializable { - private final Set res = new HashSet(); + private final Set res = new HashSet<>(); /** * diff --git a/server/src/main/java/com/vaadin/server/Page.java b/server/src/main/java/com/vaadin/server/Page.java index 7142659fca..9330c08a28 100644 --- a/server/src/main/java/com/vaadin/server/Page.java +++ b/server/src/main/java/com/vaadin/server/Page.java @@ -273,7 +273,7 @@ public class Page implements Serializable { * Resources to be opened automatically on next repaint. The list is * automatically cleared when it has been sent to the client. */ - private final LinkedList openList = new LinkedList(); + private final LinkedList openList = new LinkedList<>(); /** * A list of notifications that are waiting to be sent to the client. @@ -388,9 +388,9 @@ public class Page implements Serializable { */ public static class Styles implements Serializable { - private LinkedHashSet injectedStyles = new LinkedHashSet(); + private LinkedHashSet injectedStyles = new LinkedHashSet<>(); - private LinkedHashSet pendingInjections = new LinkedHashSet(); + private LinkedHashSet pendingInjections = new LinkedHashSet<>(); private final UI ui; @@ -440,7 +440,7 @@ public class Page implements Serializable { if (target.isFullRepaint()) { injectedStyles.addAll(pendingInjections); pendingInjections = injectedStyles; - injectedStyles = new LinkedHashSet(); + injectedStyles = new LinkedHashSet<>(); } if (!pendingInjections.isEmpty()) { @@ -1161,7 +1161,7 @@ public class Page implements Serializable { */ private void addNotification(Notification notification) { if (notifications == null) { - notifications = new LinkedList(); + notifications = new LinkedList<>(); } notifications.add(notification); uI.markAsDirty(); diff --git a/server/src/main/java/com/vaadin/server/ServerRpcManager.java b/server/src/main/java/com/vaadin/server/ServerRpcManager.java index e1f5f79860..e9f8d9543e 100644 --- a/server/src/main/java/com/vaadin/server/ServerRpcManager.java +++ b/server/src/main/java/com/vaadin/server/ServerRpcManager.java @@ -69,7 +69,7 @@ public class ServerRpcManager implements Serializable { } - private static final Map, Class> boxedTypes = new HashMap, Class>(); + private static final Map, Class> boxedTypes = new HashMap<>(); static { try { Class[] boxClasses = new Class[] { Boolean.class, Byte.class, diff --git a/server/src/main/java/com/vaadin/server/ServerRpcMethodInvocation.java b/server/src/main/java/com/vaadin/server/ServerRpcMethodInvocation.java index 22bcd1bf6b..f4e2b4064d 100644 --- a/server/src/main/java/com/vaadin/server/ServerRpcMethodInvocation.java +++ b/server/src/main/java/com/vaadin/server/ServerRpcMethodInvocation.java @@ -24,7 +24,7 @@ import com.vaadin.shared.communication.ServerRpc; public class ServerRpcMethodInvocation extends MethodInvocation { - private static final Map invocationMethodCache = new ConcurrentHashMap( + private static final Map invocationMethodCache = new ConcurrentHashMap<>( 128, 0.75f, 1); private final Method method; diff --git a/server/src/main/java/com/vaadin/server/VaadinPortletSession.java b/server/src/main/java/com/vaadin/server/VaadinPortletSession.java index f431d08b7e..6a6cb429d3 100644 --- a/server/src/main/java/com/vaadin/server/VaadinPortletSession.java +++ b/server/src/main/java/com/vaadin/server/VaadinPortletSession.java @@ -64,13 +64,13 @@ import com.vaadin.util.CurrentInstance; @SuppressWarnings("serial") public class VaadinPortletSession extends VaadinSession { - private final Set portletListeners = new LinkedHashSet(); + private final Set portletListeners = new LinkedHashSet<>(); - private final Map eventActionDestinationMap = new HashMap(); - private final Map eventActionValueMap = new HashMap(); + private final Map eventActionDestinationMap = new HashMap<>(); + private final Map eventActionValueMap = new HashMap<>(); - private final Map sharedParameterActionNameMap = new HashMap(); - private final Map sharedParameterActionValueMap = new HashMap(); + private final Map sharedParameterActionNameMap = new HashMap<>(); + private final Map sharedParameterActionValueMap = new HashMap<>(); /** * Create a portlet service session for the given portlet service @@ -143,7 +143,7 @@ public class VaadinPortletSession extends VaadinSession { */ public void firePortletRenderRequest(UI uI, RenderRequest request, RenderResponse response) { - for (PortletListener l : new ArrayList( + for (PortletListener l : new ArrayList<>( portletListeners)) { l.handleRenderRequest(request, new RestrictedRenderResponse(response), uI); @@ -172,7 +172,7 @@ public class VaadinPortletSession extends VaadinSession { sharedParameterActionValueMap.remove(key); } else { // normal action request, notify listeners - for (PortletListener l : new ArrayList( + for (PortletListener l : new ArrayList<>( portletListeners)) { l.handleActionRequest(request, response, uI); } @@ -184,7 +184,7 @@ public class VaadinPortletSession extends VaadinSession { */ public void firePortletEventRequest(UI uI, EventRequest request, EventResponse response) { - for (PortletListener l : new ArrayList( + for (PortletListener l : new ArrayList<>( portletListeners)) { l.handleEventRequest(request, response, uI); } @@ -195,7 +195,7 @@ public class VaadinPortletSession extends VaadinSession { */ public void firePortletResourceRequest(UI uI, ResourceRequest request, ResourceResponse response) { - for (PortletListener l : new ArrayList( + for (PortletListener l : new ArrayList<>( portletListeners)) { l.handleResourceRequest(request, response, uI); } diff --git a/server/src/main/java/com/vaadin/server/VaadinService.java b/server/src/main/java/com/vaadin/server/VaadinService.java index 50e20a0389..922c7cfe52 100644 --- a/server/src/main/java/com/vaadin/server/VaadinService.java +++ b/server/src/main/java/com/vaadin/server/VaadinService.java @@ -209,7 +209,7 @@ public abstract class VaadinService implements Serializable { */ protected List createRequestHandlers() throws ServiceException { - ArrayList handlers = new ArrayList(); + ArrayList handlers = new ArrayList<>(); handlers.add(new SessionRequestHandler()); handlers.add(new PublishedFileHandler()); handlers.add(new HeartbeatHandler()); @@ -466,7 +466,7 @@ public abstract class VaadinService implements Serializable { if (session.getState() == State.OPEN) { closeSession(session); } - ArrayList uis = new ArrayList(session.getUIs()); + ArrayList uis = new ArrayList<>(session.getUIs()); for (final UI ui : uis) { ui.accessSynchronously(new Runnable() { @Override @@ -1050,7 +1050,7 @@ public abstract class VaadinService implements Serializable { // Stores all attributes (security key, reference to this context // instance) so they can be added to the new session Set attributeNames = oldSession.getAttributeNames(); - HashMap attrs = new HashMap( + HashMap attrs = new HashMap<>( attributeNames.size() * 2); for (String name : attributeNames) { Object value = oldSession.getAttribute(name); @@ -1190,7 +1190,7 @@ public abstract class VaadinService implements Serializable { * @param session */ private void removeClosedUIs(final VaadinSession session) { - ArrayList uis = new ArrayList(session.getUIs()); + ArrayList uis = new ArrayList<>(session.getUIs()); for (final UI ui : uis) { if (ui.isClosing()) { ui.accessSynchronously(new Runnable() { diff --git a/server/src/main/java/com/vaadin/server/VaadinServlet.java b/server/src/main/java/com/vaadin/server/VaadinServlet.java index e3402f6937..03d47b6693 100644 --- a/server/src/main/java/com/vaadin/server/VaadinServlet.java +++ b/server/src/main/java/com/vaadin/server/VaadinServlet.java @@ -87,7 +87,7 @@ public class VaadinServlet extends HttpServlet implements Constants { css = json.getString("css"); timestamp = Long.parseLong(json.getString("timestamp")); - sourceUris = new ArrayList(); + sourceUris = new ArrayList<>(); JsonArray uris = json.getArray("uris"); for (int i = 0; i < uris.length(); i++) { @@ -661,7 +661,7 @@ public class VaadinServlet extends HttpServlet implements Constants { return sb.toString(); } - private static final Collection CHAR_BLACKLIST = new HashSet( + private static final Collection CHAR_BLACKLIST = new HashSet<>( Arrays.asList(new Character[] { '&', '"', '\'', '<', '>', '(', ')', ';' })); @@ -678,7 +678,7 @@ public class VaadinServlet extends HttpServlet implements Constants { * Global cache of scss compilation results. This map is protected from * concurrent access by {@link #SCSS_MUTEX}. */ - private final Map scssCache = new HashMap(); + private final Map scssCache = new HashMap<>(); /** * Keeps track of whether a warning about not being able to persist cache diff --git a/server/src/main/java/com/vaadin/server/VaadinSession.java b/server/src/main/java/com/vaadin/server/VaadinSession.java index 8b503b9b37..d2cf4e740a 100644 --- a/server/src/main/java/com/vaadin/server/VaadinSession.java +++ b/server/src/main/java/com/vaadin/server/VaadinSession.java @@ -226,12 +226,12 @@ public class VaadinSession implements HttpSessionBindingListener, Serializable { @Deprecated private Object converterFactory; - private LinkedList requestHandlers = new LinkedList(); + private LinkedList requestHandlers = new LinkedList<>(); private int nextUIId = 0; - private Map uIs = new HashMap(); + private Map uIs = new HashMap<>(); - private final Map embedIdMap = new HashMap(); + private final Map embedIdMap = new HashMap<>(); private final EventRouter eventRouter = new EventRouter(); @@ -253,9 +253,9 @@ public class VaadinSession implements HttpSessionBindingListener, Serializable { private transient WrappedSession session; - private final Map attributes = new HashMap(); + private final Map attributes = new HashMap<>(); - private LinkedList uiProviders = new LinkedList(); + private LinkedList uiProviders = new LinkedList<>(); private transient VaadinService service; @@ -266,7 +266,7 @@ public class VaadinSession implements HttpSessionBindingListener, Serializable { * session is serialized as long as it doesn't happen while some other * thread has the lock. */ - private transient ConcurrentLinkedQueue pendingAccessQueue = new ConcurrentLinkedQueue(); + private transient ConcurrentLinkedQueue pendingAccessQueue = new ConcurrentLinkedQueue<>(); /** * Creates a new VaadinSession tied to a VaadinService. @@ -465,7 +465,7 @@ public class VaadinSession implements HttpSessionBindingListener, Serializable { */ public static Collection getAllSessions( HttpSession httpSession) { - Set sessions = new HashSet(); + Set sessions = new HashSet<>(); Enumeration attributeNames = httpSession.getAttributeNames(); while (attributeNames.hasMoreElements()) { @@ -1426,7 +1426,7 @@ public class VaadinSession implements HttpSessionBindingListener, Serializable { Map, CurrentInstance> old = CurrentInstance.setCurrent(this); try { stream.defaultReadObject(); - pendingAccessQueue = new ConcurrentLinkedQueue(); + pendingAccessQueue = new ConcurrentLinkedQueue<>(); } finally { CurrentInstance.restoreInstances(old); } diff --git a/server/src/main/java/com/vaadin/server/WrappedHttpSession.java b/server/src/main/java/com/vaadin/server/WrappedHttpSession.java index 781cdedc5c..39944fc7da 100644 --- a/server/src/main/java/com/vaadin/server/WrappedHttpSession.java +++ b/server/src/main/java/com/vaadin/server/WrappedHttpSession.java @@ -76,7 +76,7 @@ public class WrappedHttpSession implements WrappedSession { // Helper shared with WrappedPortletSession static Set enumerationToSet(Enumeration values) { - HashSet set = new HashSet(); + HashSet set = new HashSet<>(); while (values.hasMoreElements()) { set.add(values.nextElement()); } diff --git a/server/src/main/java/com/vaadin/server/communication/ClientRpcWriter.java b/server/src/main/java/com/vaadin/server/communication/ClientRpcWriter.java index 94755385eb..efa8cc3be9 100644 --- a/server/src/main/java/com/vaadin/server/communication/ClientRpcWriter.java +++ b/server/src/main/java/com/vaadin/server/communication/ClientRpcWriter.java @@ -116,7 +116,7 @@ public class ClientRpcWriter implements Serializable { */ private Collection collectPendingRpcCalls( Collection rpcPendingQueue) { - List pendingInvocations = new ArrayList(); + List pendingInvocations = new ArrayList<>(); for (ClientConnector connector : rpcPendingQueue) { List paintablePendingRpc = connector .retrievePendingRpcCalls(); @@ -124,7 +124,7 @@ public class ClientRpcWriter implements Serializable { List oldPendingRpc = pendingInvocations; int totalCalls = pendingInvocations.size() + paintablePendingRpc.size(); - pendingInvocations = new ArrayList( + pendingInvocations = new ArrayList<>( totalCalls); // merge two ordered comparable lists diff --git a/server/src/main/java/com/vaadin/server/communication/LegacyUidlWriter.java b/server/src/main/java/com/vaadin/server/communication/LegacyUidlWriter.java index 041c5e9e8b..498dcf5bf4 100644 --- a/server/src/main/java/com/vaadin/server/communication/LegacyUidlWriter.java +++ b/server/src/main/java/com/vaadin/server/communication/LegacyUidlWriter.java @@ -60,7 +60,7 @@ public class LegacyUidlWriter implements Serializable { Collection dirtyVisibleConnectors = ui .getConnectorTracker().getDirtyVisibleConnectors(); - List legacyComponents = new ArrayList( + List legacyComponents = new ArrayList<>( dirtyVisibleConnectors.size()); for (ClientConnector connector : dirtyVisibleConnectors) { // All Components that want to use paintContent must implement diff --git a/server/src/main/java/com/vaadin/server/communication/ServerRpcHandler.java b/server/src/main/java/com/vaadin/server/communication/ServerRpcHandler.java index c4160a92dd..8ec3503be0 100644 --- a/server/src/main/java/com/vaadin/server/communication/ServerRpcHandler.java +++ b/server/src/main/java/com/vaadin/server/communication/ServerRpcHandler.java @@ -334,7 +334,7 @@ public class ServerRpcHandler implements Serializable { try { ConnectorTracker connectorTracker = ui.getConnectorTracker(); - Set enabledConnectors = new HashSet(); + Set enabledConnectors = new HashSet<>(); List invocations = parseInvocations( ui.getConnectorTracker(), invocationsData, @@ -491,7 +491,7 @@ public class ServerRpcHandler implements Serializable { ConnectorTracker connectorTracker, JsonArray invocationsJson, int lastSyncIdSeenByClient) { int invocationCount = invocationsJson.length(); - ArrayList invocations = new ArrayList( + ArrayList invocations = new ArrayList<>( invocationCount); MethodInvocation previousInvocation = null; diff --git a/server/src/main/java/com/vaadin/server/communication/SessionRequestHandler.java b/server/src/main/java/com/vaadin/server/communication/SessionRequestHandler.java index 0a890282cd..85b1fda1bf 100644 --- a/server/src/main/java/com/vaadin/server/communication/SessionRequestHandler.java +++ b/server/src/main/java/com/vaadin/server/communication/SessionRequestHandler.java @@ -54,7 +54,7 @@ public class SessionRequestHandler implements RequestHandler { session.lock(); ArrayList requestHandlers; try { - requestHandlers = new ArrayList( + requestHandlers = new ArrayList<>( session.getRequestHandlers()); } finally { session.unlock(); diff --git a/server/src/main/java/com/vaadin/server/communication/SharedStateWriter.java b/server/src/main/java/com/vaadin/server/communication/SharedStateWriter.java index 1e0efb88ff..73b82fc877 100644 --- a/server/src/main/java/com/vaadin/server/communication/SharedStateWriter.java +++ b/server/src/main/java/com/vaadin/server/communication/SharedStateWriter.java @@ -58,7 +58,7 @@ public class SharedStateWriter implements Serializable { Collection dirtyVisibleConnectors = ui .getConnectorTracker().getDirtyVisibleConnectors(); - Set writtenConnectors = new HashSet(); + Set writtenConnectors = new HashSet<>(); JsonObject sharedStates = Json.createObject(); for (ClientConnector connector : dirtyVisibleConnectors) { // encode and send shared state diff --git a/server/src/main/java/com/vaadin/server/communication/UidlWriter.java b/server/src/main/java/com/vaadin/server/communication/UidlWriter.java index 3028475d1b..7132433963 100644 --- a/server/src/main/java/com/vaadin/server/communication/UidlWriter.java +++ b/server/src/main/java/com/vaadin/server/communication/UidlWriter.java @@ -80,7 +80,7 @@ public class UidlWriter implements Serializable { // to write out service.runPendingAccessTasks(session); - Set processedConnectors = new HashSet(); + Set processedConnectors = new HashSet<>(); LegacyCommunicationManager manager = session.getCommunicationManager(); ClientCache clientCache = manager.getClientCache(ui); @@ -90,7 +90,7 @@ public class UidlWriter implements Serializable { getLogger().log(Level.FINE, "* Creating response to client"); while (true) { - ArrayList connectorsToProcess = new ArrayList(); + ArrayList connectorsToProcess = new ArrayList<>(); for (ClientConnector c : uiConnectorTracker.getDirtyConnectors()) { if (!processedConnectors.contains(c) && LegacyCommunicationManager @@ -209,7 +209,7 @@ public class UidlWriter implements Serializable { .getUsedClientConnectors(); boolean typeMappingsOpen = false; - List> newConnectorTypes = new ArrayList>(); + List> newConnectorTypes = new ArrayList<>(); for (Class class1 : usedClientConnectors) { if (clientCache.cache(class1)) { @@ -284,8 +284,8 @@ public class UidlWriter implements Serializable { } }); - List scriptDependencies = new ArrayList(); - List styleDependencies = new ArrayList(); + List scriptDependencies = new ArrayList<>(); + List styleDependencies = new ArrayList<>(); for (Class class1 : newConnectorTypes) { JavaScript jsAnnotation = class1 diff --git a/server/src/main/java/com/vaadin/server/themeutils/SASSAddonImportFileCreator.java b/server/src/main/java/com/vaadin/server/themeutils/SASSAddonImportFileCreator.java index 2bb44f65dd..fe950b4318 100644 --- a/server/src/main/java/com/vaadin/server/themeutils/SASSAddonImportFileCreator.java +++ b/server/src/main/java/com/vaadin/server/themeutils/SASSAddonImportFileCreator.java @@ -100,7 +100,7 @@ public class SASSAddonImportFileCreator { // Sort addon styles so that CSS imports are first and SCSS import // last - List paths = new ArrayList(addonThemes.keySet()); + List paths = new ArrayList<>(addonThemes.keySet()); Collections.sort(paths, new Comparator() { @Override @@ -117,7 +117,7 @@ public class SASSAddonImportFileCreator { } }); - List mixins = new ArrayList(); + List mixins = new ArrayList<>(); for (String path : paths) { mixins.addAll( addImport(printStream, path, addonThemes.get(path))); @@ -142,7 +142,7 @@ public class SASSAddonImportFileCreator { // Add import comment printImportComment(stream, location); - List foundMixins = new ArrayList(); + List foundMixins = new ArrayList<>(); if (file.endsWith(".css")) { stream.print("@import url(\"../../../" + file + "\");\n"); diff --git a/server/src/main/java/com/vaadin/server/widgetsetutils/ClassPathExplorer.java b/server/src/main/java/com/vaadin/server/widgetsetutils/ClassPathExplorer.java index da5b692533..5d1bbbfa5f 100644 --- a/server/src/main/java/com/vaadin/server/widgetsetutils/ClassPathExplorer.java +++ b/server/src/main/java/com/vaadin/server/widgetsetutils/ClassPathExplorer.java @@ -145,8 +145,8 @@ public class ClassPathExplorer { */ public static LocationInfo getAvailableWidgetSetsAndStylesheets() { long start = System.currentTimeMillis(); - Map widgetsets = new HashMap(); - Map themes = new HashMap(); + Map widgetsets = new HashMap<>(); + Map themes = new HashMap<>(); Set keySet = classpathLocations.keySet(); for (String location : keySet) { searchForWidgetSetsAndAddonStyles(location, widgetsets, themes); @@ -298,7 +298,7 @@ public class ClassPathExplorer { */ private final static List getRawClasspathEntries() { // try to keep the order of the classpath - List locations = new ArrayList(); + List locations = new ArrayList<>(); String pathSep = System.getProperty("path.separator"); String classpath = System.getProperty("java.class.path"); @@ -338,7 +338,7 @@ public class ClassPathExplorer { List rawClasspathEntries) { long start = System.currentTimeMillis(); // try to keep the order of the classpath - Map locations = new LinkedHashMap(); + Map locations = new LinkedHashMap<>(); for (String classpathEntry : rawClasspathEntries) { File file = new File(classpathEntry); include(null, file, locations); @@ -520,7 +520,7 @@ public class ClassPathExplorer { public static URL getWidgetsetSourceDirectory(String widgetsetFileName) { if (debug) { debug("classpathLocations values:"); - ArrayList locations = new ArrayList( + ArrayList locations = new ArrayList<>( classpathLocations.keySet()); for (String location : locations) { debug(String.valueOf(classpathLocations.get(location))); diff --git a/server/src/main/java/com/vaadin/server/widgetsetutils/WidgetSetBuilder.java b/server/src/main/java/com/vaadin/server/widgetsetutils/WidgetSetBuilder.java index 645c15fc1a..f64b43092f 100644 --- a/server/src/main/java/com/vaadin/server/widgetsetutils/WidgetSetBuilder.java +++ b/server/src/main/java/com/vaadin/server/widgetsetutils/WidgetSetBuilder.java @@ -168,7 +168,7 @@ public class WidgetSetBuilder { private static Collection getCurrentInheritedWidgetsets( String content) { - HashSet hashSet = new HashSet(); + HashSet hashSet = new HashSet<>(); Pattern inheritsPattern = Pattern.compile(" name=\"([^\"]*)\""); Matcher matcher = inheritsPattern.matcher(content); diff --git a/server/src/main/java/com/vaadin/ui/AbsoluteLayout.java b/server/src/main/java/com/vaadin/ui/AbsoluteLayout.java index 59221fcd83..d435bc806b 100644 --- a/server/src/main/java/com/vaadin/ui/AbsoluteLayout.java +++ b/server/src/main/java/com/vaadin/ui/AbsoluteLayout.java @@ -63,7 +63,7 @@ public class AbsoluteLayout extends AbstractLayout } }; // Maps each component to a position - private LinkedHashMap componentToCoordinates = new LinkedHashMap(); + private LinkedHashMap componentToCoordinates = new LinkedHashMap<>(); /** * Creates an AbsoluteLayout with full size. @@ -191,7 +191,7 @@ public class AbsoluteLayout extends AbstractLayout // Map was supported. We cannot get the child // connectorId unless the component is attached to the application so // the String->String map cannot be populated in internal* either. - Map connectorToPosition = new HashMap(); + Map connectorToPosition = new HashMap<>(); for (Iterator ci = getComponentIterator(); ci.hasNext();) { Component c = ci.next(); connectorToPosition.put(c.getConnectorId(), diff --git a/server/src/main/java/com/vaadin/ui/AbstractComponent.java b/server/src/main/java/com/vaadin/ui/AbstractComponent.java index 536e831d87..a34b09e9d8 100644 --- a/server/src/main/java/com/vaadin/ui/AbstractComponent.java +++ b/server/src/main/java/com/vaadin/ui/AbstractComponent.java @@ -197,7 +197,7 @@ public abstract class AbstractComponent extends AbstractClientConnector return; } if (getState().styles == null) { - getState().styles = new ArrayList(); + getState().styles = new ArrayList<>(); } List styles = getState().styles; styles.clear(); @@ -232,7 +232,7 @@ public abstract class AbstractComponent extends AbstractClientConnector } if (getState().styles == null) { - getState().styles = new ArrayList(); + getState().styles = new ArrayList<>(); } List styles = getState().styles; if (!styles.contains(style)) { @@ -1027,7 +1027,7 @@ public abstract class AbstractComponent extends AbstractClientConnector } // check for unsupported attributes - Set supported = new HashSet(); + Set supported = new HashSet<>(); supported.addAll(getDefaultAttributes()); supported.addAll(getCustomAttributes()); for (Attribute a : attr) { @@ -1084,7 +1084,7 @@ public abstract class AbstractComponent extends AbstractClientConnector } } else { // remove responsive extensions - List extensions = new ArrayList( + List extensions = new ArrayList<>( getExtensions()); for (Extension e : extensions) { if (e instanceof Responsive) { @@ -1263,7 +1263,7 @@ public abstract class AbstractComponent extends AbstractClientConnector * implementation */ protected Collection getCustomAttributes() { - ArrayList l = new ArrayList( + ArrayList l = new ArrayList<>( Arrays.asList(customAttributes)); if (this instanceof Focusable) { l.add("tab-index"); diff --git a/server/src/main/java/com/vaadin/ui/AbstractComponentContainer.java b/server/src/main/java/com/vaadin/ui/AbstractComponentContainer.java index 4dacf2c64a..b5fe4e9bcd 100644 --- a/server/src/main/java/com/vaadin/ui/AbstractComponentContainer.java +++ b/server/src/main/java/com/vaadin/ui/AbstractComponentContainer.java @@ -62,7 +62,7 @@ public abstract class AbstractComponentContainer extends AbstractComponent */ @Override public void removeAllComponents() { - final LinkedList l = new LinkedList(); + final LinkedList l = new LinkedList<>(); // Adds all components for (final Iterator i = getComponentIterator(); i @@ -83,7 +83,7 @@ public abstract class AbstractComponentContainer extends AbstractComponent */ @Override public void moveComponentsFrom(ComponentContainer source) { - final LinkedList components = new LinkedList(); + final LinkedList components = new LinkedList<>(); for (final Iterator i = source.getComponentIterator(); i .hasNext();) { components.add(i.next()); @@ -301,7 +301,7 @@ public abstract class AbstractComponentContainer extends AbstractComponent : ComponentSizeValidator.checkWidths(component); if (!valid) { if (components == null) { - components = new HashSet(); + components = new HashSet<>(); } components.add(component); } diff --git a/server/src/main/java/com/vaadin/ui/AbstractMedia.java b/server/src/main/java/com/vaadin/ui/AbstractMedia.java index f24c3e5e08..f56f6a7f27 100644 --- a/server/src/main/java/com/vaadin/ui/AbstractMedia.java +++ b/server/src/main/java/com/vaadin/ui/AbstractMedia.java @@ -152,7 +152,7 @@ public abstract class AbstractMedia extends AbstractComponent { * @return The sources pointed to in this media. */ public List getSources() { - ArrayList sources = new ArrayList(); + ArrayList sources = new ArrayList<>(); for (URLReference ref : getState(false).sources) { sources.add(((ResourceReference) ref).getResource()); } diff --git a/server/src/main/java/com/vaadin/ui/AbstractOrderedLayout.java b/server/src/main/java/com/vaadin/ui/AbstractOrderedLayout.java index 453adb2579..331a0e72be 100644 --- a/server/src/main/java/com/vaadin/ui/AbstractOrderedLayout.java +++ b/server/src/main/java/com/vaadin/ui/AbstractOrderedLayout.java @@ -58,7 +58,7 @@ public abstract class AbstractOrderedLayout extends AbstractLayout /** * Custom layout slots containing the components. */ - protected LinkedList components = new LinkedList(); + protected LinkedList components = new LinkedList<>(); private Alignment defaultComponentAlignment = Alignment.TOP_LEFT; diff --git a/server/src/main/java/com/vaadin/ui/ConnectorTracker.java b/server/src/main/java/com/vaadin/ui/ConnectorTracker.java index d92d554cf5..fd2c0029d1 100644 --- a/server/src/main/java/com/vaadin/ui/ConnectorTracker.java +++ b/server/src/main/java/com/vaadin/ui/ConnectorTracker.java @@ -67,21 +67,21 @@ import elemental.json.JsonObject; */ public class ConnectorTracker implements Serializable { - private final HashMap connectorIdToConnector = new HashMap(); - private Set dirtyConnectors = new HashSet(); - private Set uninitializedConnectors = new HashSet(); + private final HashMap connectorIdToConnector = new HashMap<>(); + private Set dirtyConnectors = new HashSet<>(); + private Set uninitializedConnectors = new HashSet<>(); /** * Connectors that have been unregistered and should be cleaned up the next * time {@link #cleanConnectorMap()} is invoked unless they have been * registered again. */ - private final Set unregisteredConnectors = new HashSet(); + private final Set unregisteredConnectors = new HashSet<>(); private boolean writingResponse = false; private UI uI; - private transient Map diffStates = new HashMap(); + private transient Map diffStates = new HashMap<>(); /** Maps connectorIds to a map of named StreamVariables */ private Map> pidToNameToStreamVariable; @@ -96,7 +96,7 @@ public class ConnectorTracker implements Serializable { * @see #getCurrentSyncId() * @see #cleanConcurrentlyRemovedConnectorIds(long) */ - private TreeMap> syncIdToUnregisteredConnectorIds = new TreeMap>(); + private TreeMap> syncIdToUnregisteredConnectorIds = new TreeMap<>(); /** * Gets a logger for this class @@ -185,7 +185,7 @@ public class ConnectorTracker implements Serializable { Set unregisteredConnectorIds = syncIdToUnregisteredConnectorIds .get(currentSyncId); if (unregisteredConnectorIds == null) { - unregisteredConnectorIds = new HashSet(); + unregisteredConnectorIds = new HashSet<>(); syncIdToUnregisteredConnectorIds.put(currentSyncId, unregisteredConnectorIds); } @@ -438,10 +438,10 @@ public class ConnectorTracker implements Serializable { private boolean isHierarchyComplete() { boolean noErrors = true; - Set danglingConnectors = new HashSet( + Set danglingConnectors = new HashSet<>( connectorIdToConnector.values()); - LinkedList stack = new LinkedList(); + LinkedList stack = new LinkedList<>(); stack.add(uI); while (!stack.isEmpty()) { ClientConnector connector = stack.pop(); @@ -623,7 +623,7 @@ public class ConnectorTracker implements Serializable { */ public ArrayList getDirtyVisibleConnectors() { Collection dirtyConnectors = getDirtyConnectors(); - ArrayList dirtyVisibleConnectors = new ArrayList( + ArrayList dirtyVisibleConnectors = new ArrayList<>( dirtyConnectors.size()); for (ClientConnector c : dirtyConnectors) { if (LegacyCommunicationManager.isConnectorVisibleToClient(c)) { @@ -706,7 +706,7 @@ public class ConnectorTracker implements Serializable { out.defaultWriteObject(); // Convert JsonObjects in diff state to String representation as // JsonObject is not serializable - HashMap stringDiffStates = new HashMap( + HashMap stringDiffStates = new HashMap<>( diffStates.size() * 2); for (ClientConnector key : diffStates.keySet()) { stringDiffStates.put(key, diffStates.get(key).toString()); @@ -721,11 +721,11 @@ public class ConnectorTracker implements Serializable { // Read String versions of JsonObjects and parse into JsonObjects as // JsonObject is not serializable - diffStates = new HashMap(); + diffStates = new HashMap<>(); @SuppressWarnings("unchecked") HashMap stringDiffStates = (HashMap) in .readObject(); - diffStates = new HashMap( + diffStates = new HashMap<>( stringDiffStates.size() * 2); for (ClientConnector key : stringDiffStates.keySet()) { try { @@ -770,18 +770,18 @@ public class ConnectorTracker implements Serializable { StreamVariable variable) { assert getConnector(connectorId) != null; if (pidToNameToStreamVariable == null) { - pidToNameToStreamVariable = new HashMap>(); + pidToNameToStreamVariable = new HashMap<>(); } Map nameToStreamVariable = pidToNameToStreamVariable .get(connectorId); if (nameToStreamVariable == null) { - nameToStreamVariable = new HashMap(); + nameToStreamVariable = new HashMap<>(); pidToNameToStreamVariable.put(connectorId, nameToStreamVariable); } nameToStreamVariable.put(variableName, variable); if (streamVariableToSeckey == null) { - streamVariableToSeckey = new HashMap(); + streamVariableToSeckey = new HashMap<>(); } String seckey = streamVariableToSeckey.get(variable); if (seckey == null) { diff --git a/server/src/main/java/com/vaadin/ui/CssLayout.java b/server/src/main/java/com/vaadin/ui/CssLayout.java index 982c55cab2..381e7aa463 100644 --- a/server/src/main/java/com/vaadin/ui/CssLayout.java +++ b/server/src/main/java/com/vaadin/ui/CssLayout.java @@ -85,7 +85,7 @@ public class CssLayout extends AbstractLayout implements LayoutClickNotifier { /** * Custom layout slots containing the components. */ - protected LinkedList components = new LinkedList(); + protected LinkedList components = new LinkedList<>(); /** * Constructs an empty CssLayout. diff --git a/server/src/main/java/com/vaadin/ui/CustomLayout.java b/server/src/main/java/com/vaadin/ui/CustomLayout.java index 11ab9c2f0e..179969765d 100644 --- a/server/src/main/java/com/vaadin/ui/CustomLayout.java +++ b/server/src/main/java/com/vaadin/ui/CustomLayout.java @@ -67,7 +67,7 @@ public class CustomLayout extends AbstractLayout implements LegacyComponent { /** * Custom layout slots containing the components. */ - private final HashMap slots = new HashMap(); + private final HashMap slots = new HashMap<>(); /** * Default constructor only used by subclasses. Subclasses are responsible diff --git a/server/src/main/java/com/vaadin/ui/DragAndDropWrapper.java b/server/src/main/java/com/vaadin/ui/DragAndDropWrapper.java index 280f80ee21..deffa06631 100644 --- a/server/src/main/java/com/vaadin/ui/DragAndDropWrapper.java +++ b/server/src/main/java/com/vaadin/ui/DragAndDropWrapper.java @@ -120,7 +120,7 @@ public class DragAndDropWrapper extends CustomComponent } }; - private Map receivers = new HashMap(); + private Map receivers = new HashMap<>(); public class WrapperTargetDetails extends TargetDetailsImpl { @@ -191,11 +191,11 @@ public class DragAndDropWrapper extends CustomComponent COMPONENT_OTHER, } - private final Map html5DataFlavors = new LinkedHashMap(); + private final Map html5DataFlavors = new LinkedHashMap<>(); private DragStartMode dragStartMode = DragStartMode.NONE; private Component dragImageComponent = null; - private Set sentIds = new HashSet(); + private Set sentIds = new HashSet<>(); /** * This is an internal constructor. Use diff --git a/server/src/main/java/com/vaadin/ui/Embedded.java b/server/src/main/java/com/vaadin/ui/Embedded.java index 382b0d47c3..b0c7f1725b 100644 --- a/server/src/main/java/com/vaadin/ui/Embedded.java +++ b/server/src/main/java/com/vaadin/ui/Embedded.java @@ -88,7 +88,7 @@ public class Embedded extends AbstractComponent implements LegacyComponent { /** * Hash of object parameters. */ - private final Map parameters = new HashMap(); + private final Map parameters = new HashMap<>(); /** * Applet or other client side runnable properties. diff --git a/server/src/main/java/com/vaadin/ui/Flash.java b/server/src/main/java/com/vaadin/ui/Flash.java index c6eac450ef..faec5a83d9 100644 --- a/server/src/main/java/com/vaadin/ui/Flash.java +++ b/server/src/main/java/com/vaadin/ui/Flash.java @@ -201,7 +201,7 @@ public class Flash extends AbstractEmbedded { */ public void setParameter(String name, String value) { if (getState().embedParams == null) { - getState().embedParams = new HashMap(); + getState().embedParams = new HashMap<>(); } getState().embedParams.put(name, value); requestRepaint(); @@ -238,7 +238,7 @@ public class Flash extends AbstractEmbedded { super.writeDesign(design, designContext); // Parameters, in alphabetic order - ArrayList paramNames = new ArrayList(); + ArrayList paramNames = new ArrayList<>(); for (String param : getParameterNames()) { paramNames.add(param); } diff --git a/server/src/main/java/com/vaadin/ui/GridLayout.java b/server/src/main/java/com/vaadin/ui/GridLayout.java index 546a89cdfc..6e74071f65 100644 --- a/server/src/main/java/com/vaadin/ui/GridLayout.java +++ b/server/src/main/java/com/vaadin/ui/GridLayout.java @@ -97,10 +97,10 @@ public class GridLayout extends AbstractLayout */ private int cursorY = 0; - private final LinkedList components = new LinkedList(); + private final LinkedList components = new LinkedList<>(); - private Map columnExpandRatio = new HashMap(); - private Map rowExpandRatio = new HashMap(); + private Map columnExpandRatio = new HashMap<>(); + private Map rowExpandRatio = new HashMap<>(); private Alignment defaultComponentAlignment = Alignment.TOP_LEFT; /** @@ -1290,8 +1290,8 @@ public class GridLayout extends AbstractLayout setMargin(readMargin(design, getMargin(), designContext)); - List rowElements = new ArrayList(); - List> rows = new ArrayList>(); + List rowElements = new ArrayList<>(); + List> rows = new ArrayList<>(); // Prepare a 2D map for reading column contents for (Element e : design.children()) { if (e.tagName().equalsIgnoreCase("row")) { @@ -1301,8 +1301,8 @@ public class GridLayout extends AbstractLayout } } setRows(Math.max(rows.size(), 1)); - Map alignments = new HashMap(); - List columnExpandRatios = new ArrayList(); + Map alignments = new HashMap<>(); + List columnExpandRatios = new ArrayList<>(); for (int row = 0; row < rowElements.size(); ++row) { Element rowElement = rowElements.get(row); @@ -1386,7 +1386,7 @@ public class GridLayout extends AbstractLayout } // Reiterate through the 2D map and add components to GridLayout - Set visited = new HashSet(); + Set visited = new HashSet<>(); // Ignore any missing components visited.add(null); @@ -1457,7 +1457,7 @@ public class GridLayout extends AbstractLayout } // Go through the map and write only needed column tags - Set visited = new HashSet(); + Set visited = new HashSet<>(); // Skip the dummy placeholder visited.add(dummyComponent); diff --git a/server/src/main/java/com/vaadin/ui/JavaScript.java b/server/src/main/java/com/vaadin/ui/JavaScript.java index b51577c4ac..92320c6df1 100644 --- a/server/src/main/java/com/vaadin/ui/JavaScript.java +++ b/server/src/main/java/com/vaadin/ui/JavaScript.java @@ -38,7 +38,7 @@ import elemental.json.JsonException; * @since 7.0.0 */ public class JavaScript extends AbstractExtension { - private Map functions = new HashMap(); + private Map functions = new HashMap<>(); // Can not be defined in client package as this JSONArray is not available // in GWT diff --git a/server/src/main/java/com/vaadin/ui/LoginForm.java b/server/src/main/java/com/vaadin/ui/LoginForm.java index 9e986d34fb..fe31eb3d75 100644 --- a/server/src/main/java/com/vaadin/ui/LoginForm.java +++ b/server/src/main/java/com/vaadin/ui/LoginForm.java @@ -353,7 +353,7 @@ public class LoginForm extends AbstractSingleComponentContainer { * URL in the method or the password manager will not be triggered. */ private void login() { - HashMap params = new HashMap(); + HashMap params = new HashMap<>(); params.put("username", getUsernameField().getValue()); params.put("password", getPasswordField().getValue()); LoginEvent event = new LoginEvent(LoginForm.this, params); diff --git a/server/src/main/java/com/vaadin/ui/MenuBar.java b/server/src/main/java/com/vaadin/ui/MenuBar.java index db252b0619..24f2dd89b3 100644 --- a/server/src/main/java/com/vaadin/ui/MenuBar.java +++ b/server/src/main/java/com/vaadin/ui/MenuBar.java @@ -162,7 +162,7 @@ public class MenuBar extends AbstractComponent /** Deserialize changes received from client. */ @Override public void changeVariables(Object source, Map variables) { - Stack items = new Stack(); + Stack items = new Stack<>(); boolean found = false; if (variables.containsKey("clickedId")) { @@ -205,7 +205,7 @@ public class MenuBar extends AbstractComponent * Constructs an empty, horizontal menu */ public MenuBar() { - menuItems = new ArrayList(); + menuItems = new ArrayList<>(); setMoreMenuItem(null); } @@ -554,7 +554,7 @@ public class MenuBar extends AbstractComponent } if (itsChildren == null) { - itsChildren = new ArrayList(); + itsChildren = new ArrayList<>(); } MenuItem newItem = new MenuItem(caption, icon, command); @@ -1005,7 +1005,7 @@ public class MenuBar extends AbstractComponent } String caption = ""; - List subMenus = new ArrayList(); + List subMenus = new ArrayList<>(); for (Node node : menuElement.childNodes()) { if (node instanceof Element && ((Element) node).tagName().equals("menu")) { @@ -1051,7 +1051,7 @@ public class MenuBar extends AbstractComponent } if (!subMenus.isEmpty()) { - menu.itsChildren = new ArrayList(); + menu.itsChildren = new ArrayList<>(); } for (Element subMenu : subMenus) { diff --git a/server/src/main/java/com/vaadin/ui/TabSheet.java b/server/src/main/java/com/vaadin/ui/TabSheet.java index ff9e1813f6..a03b342ba0 100644 --- a/server/src/main/java/com/vaadin/ui/TabSheet.java +++ b/server/src/main/java/com/vaadin/ui/TabSheet.java @@ -106,12 +106,12 @@ public class TabSheet extends AbstractComponentContainer * there is a {@link Tab} object in tabs for each tab with meta-data about * the tab. */ - private final ArrayList components = new ArrayList(); + private final ArrayList components = new ArrayList<>(); /** * Map containing information related to the tabs (caption, icon etc). */ - private final HashMap tabs = new HashMap(); + private final HashMap tabs = new HashMap<>(); /** * Selected tab content component. @@ -122,7 +122,7 @@ public class TabSheet extends AbstractComponentContainer * Mapper between server-side component instances (tab contents) and keys * given to the client that identify tabs. */ - private final KeyMapper keyMapper = new KeyMapper(); + private final KeyMapper keyMapper = new KeyMapper<>(); /** * Handler to be called when a tab is closed. diff --git a/server/src/main/java/com/vaadin/ui/UI.java b/server/src/main/java/com/vaadin/ui/UI.java index 4454f96596..82bbea7039 100644 --- a/server/src/main/java/com/vaadin/ui/UI.java +++ b/server/src/main/java/com/vaadin/ui/UI.java @@ -116,7 +116,7 @@ public abstract class UI extends AbstractSingleComponentContainer /** * List of windows in this UI. */ - private final LinkedHashSet windows = new LinkedHashSet(); + private final LinkedHashSet windows = new LinkedHashSet<>(); /** * The component that should be scrolled into view after the next repaint. @@ -415,7 +415,7 @@ public abstract class UI extends AbstractSingleComponentContainer public Iterator iterator() { // TODO could directly create some kind of combined iterator instead of // creating a new ArrayList - ArrayList components = new ArrayList(); + ArrayList components = new ArrayList<>(); if (getContent() != null) { components.add(getContent()); diff --git a/server/src/main/java/com/vaadin/ui/Upload.java b/server/src/main/java/com/vaadin/ui/Upload.java index 915e2035fa..9077a35b95 100644 --- a/server/src/main/java/com/vaadin/ui/Upload.java +++ b/server/src/main/java/com/vaadin/ui/Upload.java @@ -783,7 +783,7 @@ public class Upload extends AbstractComponent */ public void addProgressListener(ProgressListener listener) { if (progressListeners == null) { - progressListeners = new LinkedHashSet(); + progressListeners = new LinkedHashSet<>(); } progressListeners.add(listener); } diff --git a/server/src/main/java/com/vaadin/ui/Window.java b/server/src/main/java/com/vaadin/ui/Window.java index 6ad8ef500b..c0eac75970 100644 --- a/server/src/main/java/com/vaadin/ui/Window.java +++ b/server/src/main/java/com/vaadin/ui/Window.java @@ -106,7 +106,7 @@ public class Window extends Panel /** * Holds registered CloseShortcut instances for query and later removal */ - private List closeShortcuts = new ArrayList( + private List closeShortcuts = new ArrayList<>( 4); /** @@ -1398,7 +1398,7 @@ public class Window extends Panel @Override protected void readDesignChildren(Elements children, DesignContext context) { - List descriptions = new ArrayList(); + List descriptions = new ArrayList<>(); Elements content = new Elements(); for (Element child : children) { diff --git a/server/src/main/java/com/vaadin/ui/declarative/DesignAttributeHandler.java b/server/src/main/java/com/vaadin/ui/declarative/DesignAttributeHandler.java index ba5c279ed1..a70ab256e1 100644 --- a/server/src/main/java/com/vaadin/ui/declarative/DesignAttributeHandler.java +++ b/server/src/main/java/com/vaadin/ui/declarative/DesignAttributeHandler.java @@ -55,7 +55,7 @@ public class DesignAttributeHandler implements Serializable { return Logger.getLogger(DesignAttributeHandler.class.getName()); } - private static Map, AttributeCacheEntry> cache = new ConcurrentHashMap, AttributeCacheEntry>(); + private static Map, AttributeCacheEntry> cache = new ConcurrentHashMap<>(); // translates string <-> object private static DesignFormatter FORMATTER = new DesignFormatter(); @@ -81,7 +81,7 @@ public class DesignAttributeHandler implements Serializable { for (Attribute a : attr.asList()) { attr.remove(a.getKey()); } - List children = new ArrayList(); + List children = new ArrayList<>(); children.addAll(design.childNodes()); for (Node node : children) { node.remove(); @@ -428,7 +428,7 @@ public class DesignAttributeHandler implements Serializable { * @author Vaadin Ltd */ private static class AttributeCacheEntry implements Serializable { - private Map accessMethods = new ConcurrentHashMap(); + private Map accessMethods = new ConcurrentHashMap<>(); private void addAttribute(String attribute, Method getter, Method setter) { @@ -439,7 +439,7 @@ public class DesignAttributeHandler implements Serializable { } private Collection getAttributes() { - ArrayList attributes = new ArrayList(); + ArrayList attributes = new ArrayList<>(); attributes.addAll(accessMethods.keySet()); return attributes; } diff --git a/server/src/main/java/com/vaadin/ui/declarative/DesignContext.java b/server/src/main/java/com/vaadin/ui/declarative/DesignContext.java index 505437d778..35145c45fb 100644 --- a/server/src/main/java/com/vaadin/ui/declarative/DesignContext.java +++ b/server/src/main/java/com/vaadin/ui/declarative/DesignContext.java @@ -64,7 +64,7 @@ public class DesignContext implements Serializable { private static final String VAADIN7_UI_PACKAGE = "com.vaadin.v7.ui"; // cache for object instances - private static Map, Component> instanceCache = new ConcurrentHashMap, Component>(); + private static Map, Component> instanceCache = new ConcurrentHashMap<>(); // The root component of the component hierarchy private Component rootComponent = null; @@ -74,20 +74,20 @@ public class DesignContext implements Serializable { public static final String CAPTION_ATTRIBUTE = "caption"; public static final String LOCAL_ID_ATTRIBUTE = "_id"; // Mappings from ids to components. Modified when reading from design. - private Map idToComponent = new HashMap(); - private Map localIdToComponent = new HashMap(); - private Map captionToComponent = new HashMap(); + private Map idToComponent = new HashMap<>(); + private Map localIdToComponent = new HashMap<>(); + private Map captionToComponent = new HashMap<>(); // Mapping from components to local ids. Accessed when writing to // design. Modified when reading from design. - private Map componentToLocalId = new HashMap(); + private Map componentToLocalId = new HashMap<>(); private Document doc; // required for calling createElement(String) // namespace mappings - private Map packageToPrefix = new HashMap(); - private Map prefixToPackage = new HashMap(); - private final Map> customAttributes = new HashMap>(); + private Map packageToPrefix = new HashMap<>(); + private Map prefixToPackage = new HashMap<>(); + private final Map> customAttributes = new HashMap<>(); // component creation listeners - private List listeners = new ArrayList(); + private List listeners = new ArrayList<>(); private ShouldWriteDataDelegate shouldWriteDataDelegate = ShouldWriteDataDelegate.DEFAULT; @@ -828,7 +828,7 @@ public class DesignContext implements Serializable { Map map = customAttributes.get(component); if (map == null) { customAttributes.put(component, - map = new HashMap()); + map = new HashMap<>()); } map.put(attribute, value); } diff --git a/server/src/main/java/com/vaadin/ui/declarative/DesignFormatter.java b/server/src/main/java/com/vaadin/ui/declarative/DesignFormatter.java index 0fcefe0a27..203954dd27 100644 --- a/server/src/main/java/com/vaadin/ui/declarative/DesignFormatter.java +++ b/server/src/main/java/com/vaadin/ui/declarative/DesignFormatter.java @@ -55,7 +55,7 @@ import com.vaadin.ui.declarative.converters.DesignToStringConverter; */ public class DesignFormatter implements Serializable { - private final Map, Converter> converterMap = new ConcurrentHashMap, Converter>(); + private final Map, Converter> converterMap = new ConcurrentHashMap<>(); private final Converter stringObjectConverter = new DesignObjectConverter(); /** diff --git a/server/src/main/java/com/vaadin/ui/declarative/FieldBinder.java b/server/src/main/java/com/vaadin/ui/declarative/FieldBinder.java index 25469b8cde..3d7dcc20d9 100644 --- a/server/src/main/java/com/vaadin/ui/declarative/FieldBinder.java +++ b/server/src/main/java/com/vaadin/ui/declarative/FieldBinder.java @@ -40,7 +40,7 @@ public class FieldBinder implements Serializable { // the instance containing the bound fields private Object bindTarget; // mapping between field names and Fields - private Map fieldMap = new HashMap(); + private Map fieldMap = new HashMap<>(); /** * Creates a new instance of LayoutFieldBinder. @@ -79,7 +79,7 @@ public class FieldBinder implements Serializable { * @return a collection of fields assignable to Component that are not bound */ public Collection getUnboundFields() throws FieldBindingException { - List unboundFields = new ArrayList(); + List unboundFields = new ArrayList<>(); for (Field f : fieldMap.values()) { try { Object value = getFieldValue(bindTarget, f); @@ -252,7 +252,7 @@ public class FieldBinder implements Serializable { */ protected static List getFields( Class searchClass) { - ArrayList memberFields = new ArrayList(); + ArrayList memberFields = new ArrayList<>(); for (java.lang.reflect.Field memberField : searchClass .getDeclaredFields()) { diff --git a/server/src/main/java/com/vaadin/ui/declarative/converters/DesignResourceConverter.java b/server/src/main/java/com/vaadin/ui/declarative/converters/DesignResourceConverter.java index cc9d6ac655..1efc382fcc 100644 --- a/server/src/main/java/com/vaadin/ui/declarative/converters/DesignResourceConverter.java +++ b/server/src/main/java/com/vaadin/ui/declarative/converters/DesignResourceConverter.java @@ -169,7 +169,7 @@ public class DesignResourceConverter implements Converter { return ((ExternalResource) value).getURL(); } - private static Map, ResourceConverterByProtocol> typeToConverter = new HashMap, ResourceConverterByProtocol>(); + private static Map, ResourceConverterByProtocol> typeToConverter = new HashMap<>(); static { typeToConverter.put(ExternalResource.class, HTTP); // ^ any of non-specialized would actually work diff --git a/server/src/main/java/com/vaadin/ui/declarative/converters/DesignShortcutActionConverter.java b/server/src/main/java/com/vaadin/ui/declarative/converters/DesignShortcutActionConverter.java index fdd61f0489..2468c29c8c 100644 --- a/server/src/main/java/com/vaadin/ui/declarative/converters/DesignShortcutActionConverter.java +++ b/server/src/main/java/com/vaadin/ui/declarative/converters/DesignShortcutActionConverter.java @@ -40,7 +40,7 @@ public class DesignShortcutActionConverter private final Map presentationMap; public DesignShortcutActionConverter() { - HashMap codes = new HashMap(); + HashMap codes = new HashMap<>(); // map modifiers codes.put(ModifierKey.ALT, "alt"); codes.put(ModifierKey.CTRL, "ctrl"); @@ -112,7 +112,7 @@ public class DesignShortcutActionConverter keyCodeMap = Collections.unmodifiableMap(codes); - HashMap presentations = new HashMap(); + HashMap presentations = new HashMap<>(); for (Entry entry : keyCodeMap.entrySet()) { presentations.put(entry.getValue(), entry.getKey()); } diff --git a/server/src/main/java/com/vaadin/ui/declarative/converters/ShortcutKeyMapper.java b/server/src/main/java/com/vaadin/ui/declarative/converters/ShortcutKeyMapper.java index 1862173aba..b1010d811d 100644 --- a/server/src/main/java/com/vaadin/ui/declarative/converters/ShortcutKeyMapper.java +++ b/server/src/main/java/com/vaadin/ui/declarative/converters/ShortcutKeyMapper.java @@ -54,8 +54,8 @@ public interface ShortcutKeyMapper extends Serializable { */ public static final ShortcutKeyMapper DEFAULT = new ShortcutKeyMapper() { - private final Map keyCodeMap = new ConcurrentHashMap(); - private final Map presentationMap = new ConcurrentHashMap(); + private final Map keyCodeMap = new ConcurrentHashMap<>(); + private final Map presentationMap = new ConcurrentHashMap<>(); { // map modifiers diff --git a/server/src/main/java/com/vaadin/util/ConnectorHelper.java b/server/src/main/java/com/vaadin/util/ConnectorHelper.java index 3cb6a1c425..5b5958175b 100644 --- a/server/src/main/java/com/vaadin/util/ConnectorHelper.java +++ b/server/src/main/java/com/vaadin/util/ConnectorHelper.java @@ -66,7 +66,7 @@ public class ConnectorHelper { */ public static void writeHierarchyInformation(ClientConnector connector, StringBuilder builder) { - LinkedList h = new LinkedList(); + LinkedList h = new LinkedList<>(); h.add(connector); ClientConnector parent = connector.getParent(); while (parent != null) { diff --git a/server/src/main/java/com/vaadin/util/CurrentInstance.java b/server/src/main/java/com/vaadin/util/CurrentInstance.java index be5300e915..f8d6af2a4c 100644 --- a/server/src/main/java/com/vaadin/util/CurrentInstance.java +++ b/server/src/main/java/com/vaadin/util/CurrentInstance.java @@ -72,7 +72,7 @@ public class CurrentInstance implements Serializable { return null; } - Map, CurrentInstance> value = new HashMap, CurrentInstance>(); + Map, CurrentInstance> value = new HashMap<>(); // Copy all inheritable values to child map for (Entry, CurrentInstance> e : parentValue.entrySet()) { @@ -86,7 +86,7 @@ public class CurrentInstance implements Serializable { }; private CurrentInstance(Object instance, boolean inheritable) { - this.instance = new WeakReference(instance); + this.instance = new WeakReference<>(instance); this.inheritable = inheritable; } @@ -200,7 +200,7 @@ public class CurrentInstance implements Serializable { } else { assert type.isInstance(instance) : "Invald instance type"; if (map == null) { - map = new HashMap, CurrentInstance>(); + map = new HashMap<>(); instances.set(map); } @@ -286,7 +286,7 @@ public class CurrentInstance implements Serializable { if (map == null) { return Collections.emptyMap(); } else { - Map, CurrentInstance> copy = new HashMap, CurrentInstance>(); + Map, CurrentInstance> copy = new HashMap<>(); boolean removeStale = false; for (Class c : map.keySet()) { CurrentInstance ci = map.get(c); @@ -338,7 +338,7 @@ public class CurrentInstance implements Serializable { */ public static Map, CurrentInstance> setCurrent( VaadinSession session) { - Map, CurrentInstance> old = new HashMap, CurrentInstance>(); + Map, CurrentInstance> old = new HashMap<>(); old.put(VaadinSession.class, set(VaadinSession.class, session, true)); VaadinService service = null; if (session != null) { diff --git a/server/src/main/java/com/vaadin/util/FileTypeResolver.java b/server/src/main/java/com/vaadin/util/FileTypeResolver.java index 7700ff9563..305bc1c5d7 100644 --- a/server/src/main/java/com/vaadin/util/FileTypeResolver.java +++ b/server/src/main/java/com/vaadin/util/FileTypeResolver.java @@ -210,12 +210,12 @@ public class FileTypeResolver implements Serializable { /** * File extension to MIME type mapping. All extensions are in lower case. */ - static private Hashtable extToMIMEMap = new Hashtable(); + static private Hashtable extToMIMEMap = new Hashtable<>(); /** * MIME type to Icon mapping. */ - static private Hashtable MIMEToIconMap = new Hashtable(); + static private Hashtable MIMEToIconMap = new Hashtable<>(); static { diff --git a/server/src/test/java/com/vaadin/data/ResultTest.java b/server/src/test/java/com/vaadin/data/ResultTest.java index 4ab9f8e291..2868f74565 100644 --- a/server/src/test/java/com/vaadin/data/ResultTest.java +++ b/server/src/test/java/com/vaadin/data/ResultTest.java @@ -91,7 +91,7 @@ public class ResultTest { @Override public Result flatMap(Function> mapper) { - return new SimpleResult(null, "bar"); + return new SimpleResult<>(null, "bar"); } }; Result mapResult = result.map(value -> { diff --git a/server/src/test/java/com/vaadin/server/DragAndDropServiceTest.java b/server/src/test/java/com/vaadin/server/DragAndDropServiceTest.java index 167606e19e..71e3782fcd 100644 --- a/server/src/test/java/com/vaadin/server/DragAndDropServiceTest.java +++ b/server/src/test/java/com/vaadin/server/DragAndDropServiceTest.java @@ -41,7 +41,7 @@ public class DragAndDropServiceTest { @Test public void changeVariables_isSourceConnectorEnabledCalled() { - final List levels = new ArrayList(); + final List levels = new ArrayList<>(); Logger.getLogger(DragAndDropService.class.getName()) .addHandler(new StreamHandler() { @Override @@ -49,7 +49,7 @@ public class DragAndDropServiceTest { levels.add(record.getLevel()); } }); - Map variables = new HashMap(); + Map variables = new HashMap<>(); final boolean[] isConnectorEnabledCalled = new boolean[1]; AbstractComponent component = new AbstractComponent() { @Override @@ -73,7 +73,7 @@ public class DragAndDropServiceTest { @Test public void changeVariables_isTargetConnectorEnabledCalled() { - final List levels = new ArrayList(); + final List levels = new ArrayList<>(); Logger.getLogger(DragAndDropService.class.getName()) .addHandler(new StreamHandler() { @Override @@ -81,7 +81,7 @@ public class DragAndDropServiceTest { levels.add(record.getLevel()); } }); - Map variables = new HashMap(); + Map variables = new HashMap<>(); TestDropTarget target = new TestDropTarget(); variables.put("dhowner", target); diff --git a/server/src/test/java/com/vaadin/server/JSONSerializerTest.java b/server/src/test/java/com/vaadin/server/JSONSerializerTest.java index d145c15329..bd60f8f6aa 100644 --- a/server/src/test/java/com/vaadin/server/JSONSerializerTest.java +++ b/server/src/test/java/com/vaadin/server/JSONSerializerTest.java @@ -48,7 +48,7 @@ public class JSONSerializerTest { public void testStringToBeanMapSerialization() throws Exception { Type mapType = getClass().getDeclaredField("stringToStateMap") .getGenericType(); - stringToStateMap = new HashMap(); + stringToStateMap = new HashMap<>(); AbstractSplitPanelState s = new AbstractSplitPanelState(); AbstractSplitPanelState s2 = new AbstractSplitPanelState(); s.caption = "State 1"; @@ -69,7 +69,7 @@ public class JSONSerializerTest { public void testBeanToStringMapSerialization() throws Exception { Type mapType = getClass().getDeclaredField("stateToStringMap") .getGenericType(); - stateToStringMap = new HashMap(); + stateToStringMap = new HashMap<>(); AbstractSplitPanelState s = new AbstractSplitPanelState(); AbstractSplitPanelState s2 = new AbstractSplitPanelState(); s.caption = "State 1"; diff --git a/server/src/test/java/com/vaadin/server/MockVaadinSession.java b/server/src/test/java/com/vaadin/server/MockVaadinSession.java index 1a3f949a46..04d516ecb4 100644 --- a/server/src/test/java/com/vaadin/server/MockVaadinSession.java +++ b/server/src/test/java/com/vaadin/server/MockVaadinSession.java @@ -31,7 +31,7 @@ public class MockVaadinSession extends VaadinSession { * chance of leaking memory if the session is not unlocked in the right way, * but it should be acceptable for testing use. */ - private static final ThreadLocal referenceKeeper = new ThreadLocal(); + private static final ThreadLocal referenceKeeper = new ThreadLocal<>(); public MockVaadinSession(VaadinService service) { super(service); diff --git a/server/src/test/java/com/vaadin/server/data/datasource/StrBean.java b/server/src/test/java/com/vaadin/server/data/datasource/StrBean.java index 6bb1e1bd1a..52d58be310 100644 --- a/server/src/test/java/com/vaadin/server/data/datasource/StrBean.java +++ b/server/src/test/java/com/vaadin/server/data/datasource/StrBean.java @@ -32,7 +32,7 @@ class StrBean implements Serializable { } public static List generateRandomBeans(int max) { - List data = new ArrayList(); + List data = new ArrayList<>(); Random r = new Random(13337); data.add(new StrBean("Xyz", 10, max)); for (int i = 0; i < max - 1; ++i) { diff --git a/server/src/test/java/com/vaadin/tests/VaadinClasses.java b/server/src/test/java/com/vaadin/tests/VaadinClasses.java index ba56fcee35..8c8fbaf7f1 100644 --- a/server/src/test/java/com/vaadin/tests/VaadinClasses.java +++ b/server/src/test/java/com/vaadin/tests/VaadinClasses.java @@ -133,7 +133,7 @@ public class VaadinClasses { private static List> findClasses(Class baseClass, String basePackage, String[] ignoredPackages) throws IOException { - List> classes = new ArrayList>(); + List> classes = new ArrayList<>(); String basePackageDirName = "/" + basePackage.replace('.', '/'); URL location = VaadinSession.class.getResource(basePackageDirName); if (location.getProtocol().equals("file")) { @@ -169,7 +169,7 @@ public class VaadinClasses { throws IOException { List> classes = findClasses(baseClass, basePackage, ignoredPackages); - List> classesNoTests = new ArrayList>(); + List> classesNoTests = new ArrayList<>(); for (Class clazz : classes) { if (!clazz.getName().contains("Test")) { boolean testPresent = false; diff --git a/server/src/test/java/com/vaadin/tests/design/ComponentFactoryTest.java b/server/src/test/java/com/vaadin/tests/design/ComponentFactoryTest.java index d978444c45..977a96f245 100644 --- a/server/src/test/java/com/vaadin/tests/design/ComponentFactoryTest.java +++ b/server/src/test/java/com/vaadin/tests/design/ComponentFactoryTest.java @@ -36,7 +36,7 @@ public class ComponentFactoryTest { private static final ComponentFactory defaultFactory = Design .getComponentFactory(); - private static final ThreadLocal currentComponentFactory = new ThreadLocal(); + private static final ThreadLocal currentComponentFactory = new ThreadLocal<>(); // Set static component factory that delegate to a thread local factory static { @@ -62,7 +62,7 @@ public class ComponentFactoryTest { @Test public void testComponentFactoryLogging() { - final List messages = new ArrayList(); + final List messages = new ArrayList<>(); currentComponentFactory.set(new ComponentFactory() { @Override public Component createComponent(String fullyQualifiedClassName, @@ -111,7 +111,7 @@ public class ComponentFactoryTest { @Test public void testGetDefaultInstanceUsesComponentFactory() { - final List classes = new ArrayList(); + final List classes = new ArrayList<>(); currentComponentFactory.set(new ComponentFactory() { @Override public Component createComponent(String fullyQualifiedClassName, diff --git a/server/src/test/java/com/vaadin/tests/design/ComponentMapperTest.java b/server/src/test/java/com/vaadin/tests/design/ComponentMapperTest.java index 5b4d2344e6..25062f76f4 100644 --- a/server/src/test/java/com/vaadin/tests/design/ComponentMapperTest.java +++ b/server/src/test/java/com/vaadin/tests/design/ComponentMapperTest.java @@ -33,7 +33,7 @@ public class ComponentMapperTest { private static final ComponentMapper defaultMapper = Design .getComponentMapper(); - private static final ThreadLocal currentMapper = new ThreadLocal(); + private static final ThreadLocal currentMapper = new ThreadLocal<>(); static { Design.setComponentMapper(new ComponentMapper() { diff --git a/server/src/test/java/com/vaadin/tests/design/DeclarativeTestBase.java b/server/src/test/java/com/vaadin/tests/design/DeclarativeTestBase.java index bfa0a61a49..e488c2f964 100644 --- a/server/src/test/java/com/vaadin/tests/design/DeclarativeTestBase.java +++ b/server/src/test/java/com/vaadin/tests/design/DeclarativeTestBase.java @@ -33,7 +33,7 @@ public abstract class DeclarativeTestBase private static boolean debug = false; - private final Map, EqualsAsserter> comparators = new HashMap, EqualsAsserter>(); + private final Map, EqualsAsserter> comparators = new HashMap<>(); private static EqualsAsserter standardEqualsComparator = new EqualsAsserter() { @Override diff --git a/server/src/test/java/com/vaadin/tests/design/DeclarativeTestBaseBase.java b/server/src/test/java/com/vaadin/tests/design/DeclarativeTestBaseBase.java index b01c1dc7a4..f0bcc8887a 100644 --- a/server/src/test/java/com/vaadin/tests/design/DeclarativeTestBaseBase.java +++ b/server/src/test/java/com/vaadin/tests/design/DeclarativeTestBaseBase.java @@ -136,7 +136,7 @@ public abstract class DeclarativeTestBaseBase { } private List> getComparators(Object o1) { - List> result = new ArrayList>(); + List> result = new ArrayList<>(); getComparators(o1.getClass(), result); return result; } @@ -169,7 +169,7 @@ public abstract class DeclarativeTestBaseBase { } public static class TestLogHandler { - final List messages = new ArrayList(); + final List messages = new ArrayList<>(); Handler handler = new Handler() { @Override public void publish(LogRecord record) { @@ -258,8 +258,8 @@ public abstract class DeclarativeTestBaseBase { * include close tags */ private String elementToHtml(Element producedElem, StringBuilder sb) { - HashSet booleanAttributes = new HashSet(); - ArrayList names = new ArrayList(); + HashSet booleanAttributes = new HashSet<>(); + ArrayList names = new ArrayList<>(); for (Attribute a : producedElem.attributes().asList()) { names.add(a.getKey()); if (a instanceof BooleanAttribute) { diff --git a/server/src/test/java/com/vaadin/tests/design/DesignFormatterTest.java b/server/src/test/java/com/vaadin/tests/design/DesignFormatterTest.java index b29ddcba7c..6b7ba963cc 100644 --- a/server/src/test/java/com/vaadin/tests/design/DesignFormatterTest.java +++ b/server/src/test/java/com/vaadin/tests/design/DesignFormatterTest.java @@ -361,7 +361,7 @@ public class DesignFormatterTest { && SharedUtil.equals(other.getIcon(), act.getIcon()) && act.getKeyCode() == other.getKeyCode() && act.getModifiers().length == other.getModifiers().length) { - HashSet thisSet = new HashSet( + HashSet thisSet = new HashSet<>( act.getModifiers().length); // this is a bit tricky comparison, but there is no nice way of // making int[] into a Set diff --git a/server/src/test/java/com/vaadin/tests/design/DesignReadInConstructorTest.java b/server/src/test/java/com/vaadin/tests/design/DesignReadInConstructorTest.java index 6c542a411e..86fb273841 100644 --- a/server/src/test/java/com/vaadin/tests/design/DesignReadInConstructorTest.java +++ b/server/src/test/java/com/vaadin/tests/design/DesignReadInConstructorTest.java @@ -55,7 +55,7 @@ public class DesignReadInConstructorTest { private void assertJsoupTreeEquals(Element expected, Element actual) { Assert.assertEquals(expected.tagName(), actual.tagName()); - Set keys = new HashSet(); + Set keys = new HashSet<>(); for (Attribute attr : expected.attributes().asList()) { keys.add(attr.getKey()); diff --git a/server/src/test/java/com/vaadin/tests/event/ShortcutActionTest.java b/server/src/test/java/com/vaadin/tests/event/ShortcutActionTest.java index 5b5028c81a..90bc775efa 100644 --- a/server/src/test/java/com/vaadin/tests/event/ShortcutActionTest.java +++ b/server/src/test/java/com/vaadin/tests/event/ShortcutActionTest.java @@ -39,7 +39,7 @@ public class ShortcutActionTest { @Test public void testHashCodeUniqueness() { - HashSet set = new HashSet(); + HashSet set = new HashSet<>(); for (String modifier : new String[] { "^", "&", "_", "&^", "&_", "_^", "&^_" }) { for (String key : KEYS) { @@ -98,7 +98,7 @@ public class ShortcutActionTest { && SharedUtil.equals(other.getIcon(), act.getIcon()) && act.getKeyCode() == other.getKeyCode() && act.getModifiers().length == other.getModifiers().length) { - HashSet thisSet = new HashSet( + HashSet thisSet = new HashSet<>( act.getModifiers().length); // this is a bit tricky comparison, but there is no nice way of // making int[] into a Set diff --git a/server/src/test/java/com/vaadin/tests/server/ClassesSerializableTest.java b/server/src/test/java/com/vaadin/tests/server/ClassesSerializableTest.java index 02e2e220a6..964ba585eb 100644 --- a/server/src/test/java/com/vaadin/tests/server/ClassesSerializableTest.java +++ b/server/src/test/java/com/vaadin/tests/server/ClassesSerializableTest.java @@ -93,12 +93,12 @@ public class ClassesSerializableTest { public void testClassesSerializable() throws Exception { List rawClasspathEntries = getRawClasspathEntries(); - List classes = new ArrayList(); + List classes = new ArrayList<>(); for (String location : rawClasspathEntries) { classes.addAll(findServerClasses(location)); } - ArrayList> nonSerializableClasses = new ArrayList>(); + ArrayList> nonSerializableClasses = new ArrayList<>(); for (String className : classes) { Class cls = Class.forName(className); // skip annotations and synthetic classes @@ -183,7 +183,7 @@ public class ClassesSerializableTest { // private final static List getRawClasspathEntries() { // try to keep the order of the classpath - List locations = new ArrayList(); + List locations = new ArrayList<>(); String pathSep = System.getProperty("path.separator"); String classpath = System.getProperty("java.class.path"); @@ -217,7 +217,7 @@ public class ClassesSerializableTest { */ private List findServerClasses(String classpathEntry) throws IOException { - Collection classes = new ArrayList(); + Collection classes = new ArrayList<>(); File file = new File(classpathEntry); if (file.isDirectory()) { @@ -229,7 +229,7 @@ public class ClassesSerializableTest { return Collections.emptyList(); } - List filteredClasses = new ArrayList(); + List filteredClasses = new ArrayList<>(); for (String className : classes) { boolean ok = false; for (String basePackage : BASE_PACKAGES) { @@ -267,7 +267,7 @@ public class ClassesSerializableTest { * @throws IOException */ private Collection findClassesInJar(File file) throws IOException { - Collection classes = new ArrayList(); + Collection classes = new ArrayList<>(); JarFile jar = new JarFile(file); Enumeration e = jar.entries(); @@ -307,7 +307,7 @@ public class ClassesSerializableTest { parentPackage += "."; } - Collection classNames = new ArrayList(); + Collection classNames = new ArrayList<>(); // add all directories recursively File[] files = parent.listFiles(); diff --git a/server/src/test/java/com/vaadin/tests/server/KeyMapperTest.java b/server/src/test/java/com/vaadin/tests/server/KeyMapperTest.java index 7ca3c61a55..5b882ac7b3 100644 --- a/server/src/test/java/com/vaadin/tests/server/KeyMapperTest.java +++ b/server/src/test/java/com/vaadin/tests/server/KeyMapperTest.java @@ -15,7 +15,7 @@ public class KeyMapperTest { @Test public void testAdd() { - KeyMapper mapper = new KeyMapper(); + KeyMapper mapper = new KeyMapper<>(); Object o1 = new Object(); Object o2 = new Object(); Object o3 = new Object(); @@ -47,7 +47,7 @@ public class KeyMapperTest { @Test public void testRemoveAll() { - KeyMapper mapper = new KeyMapper(); + KeyMapper mapper = new KeyMapper<>(); Object o1 = new Object(); Object o2 = new Object(); Object o3 = new Object(); @@ -65,7 +65,7 @@ public class KeyMapperTest { @Test public void testRemove() { - KeyMapper mapper = new KeyMapper(); + KeyMapper mapper = new KeyMapper<>(); Object o1 = new Object(); Object o2 = new Object(); Object o3 = new Object(); diff --git a/server/src/test/java/com/vaadin/tests/server/clientconnector/AttachDetachListenersTest.java b/server/src/test/java/com/vaadin/tests/server/clientconnector/AttachDetachListenersTest.java index e437708992..75ab52370d 100644 --- a/server/src/test/java/com/vaadin/tests/server/clientconnector/AttachDetachListenersTest.java +++ b/server/src/test/java/com/vaadin/tests/server/clientconnector/AttachDetachListenersTest.java @@ -174,7 +174,7 @@ public class AttachDetachListenersTest { } public static E eventEquals(E expected) { - EasyMock.reportMatcher(new EventEquals(expected)); + EasyMock.reportMatcher(new EventEquals<>(expected)); return null; } diff --git a/server/src/test/java/com/vaadin/tests/server/component/AbstractListenerMethodsTestBase.java b/server/src/test/java/com/vaadin/tests/server/component/AbstractListenerMethodsTestBase.java index b3a2842656..8f1c54ff6f 100644 --- a/server/src/test/java/com/vaadin/tests/server/component/AbstractListenerMethodsTestBase.java +++ b/server/src/test/java/com/vaadin/tests/server/component/AbstractListenerMethodsTestBase.java @@ -19,7 +19,7 @@ public abstract class AbstractListenerMethodsTestBase { } private static void findAllListenerMethods() { - Set> classes = new HashSet>(); + Set> classes = new HashSet<>(); for (Class c : VaadinClasses.getAllServerSideClasses()) { while (c != null && c.getName().startsWith("com.vaadin.")) { classes.add(c); diff --git a/server/src/test/java/com/vaadin/tests/server/component/FinalMethodTest.java b/server/src/test/java/com/vaadin/tests/server/component/FinalMethodTest.java index 6dd451ac2a..5519163012 100644 --- a/server/src/test/java/com/vaadin/tests/server/component/FinalMethodTest.java +++ b/server/src/test/java/com/vaadin/tests/server/component/FinalMethodTest.java @@ -22,7 +22,7 @@ public class FinalMethodTest { @Test public void testThatComponentsHaveNoFinalMethods() { - HashSet> tested = new HashSet>(); + HashSet> tested = new HashSet<>(); for (Class c : VaadinClasses.getComponents()) { ensureNoFinalMethods(c, tested); } diff --git a/server/src/test/java/com/vaadin/tests/server/component/StateGetDoesNotMarkDirtyTest.java b/server/src/test/java/com/vaadin/tests/server/component/StateGetDoesNotMarkDirtyTest.java index 07a7afbfe5..57647f1e6a 100644 --- a/server/src/test/java/com/vaadin/tests/server/component/StateGetDoesNotMarkDirtyTest.java +++ b/server/src/test/java/com/vaadin/tests/server/component/StateGetDoesNotMarkDirtyTest.java @@ -19,7 +19,7 @@ import com.vaadin.ui.UI; public class StateGetDoesNotMarkDirtyTest { - private Set excludedMethods = new HashSet(); + private Set excludedMethods = new HashSet<>(); @Before public void setUp() { @@ -33,7 +33,7 @@ public class StateGetDoesNotMarkDirtyTest { Component newInstance = construct(c); prepareMockUI(newInstance); - Set methods = new HashSet(); + Set methods = new HashSet<>(); methods.addAll(Arrays.asList(c.getMethods())); methods.addAll(Arrays.asList(c.getDeclaredMethods())); for (Method method : methods) { diff --git a/server/src/test/java/com/vaadin/tests/server/component/customlayout/CustomLayoutTest.java b/server/src/test/java/com/vaadin/tests/server/component/customlayout/CustomLayoutTest.java index 0f1905ea02..1c3b68e5fc 100644 --- a/server/src/test/java/com/vaadin/tests/server/component/customlayout/CustomLayoutTest.java +++ b/server/src/test/java/com/vaadin/tests/server/component/customlayout/CustomLayoutTest.java @@ -60,7 +60,7 @@ public class CustomLayoutTest { private Integer getBufferSize() throws IllegalAccessException { Field[] fields = CustomLayout.class.getDeclaredFields(); - List list = new ArrayList(fields.length); + List list = new ArrayList<>(fields.length); for (Field field : fields) { if ((field.getModifiers() & Modifier.STATIC) > 0) { list.add(field); diff --git a/server/src/test/java/com/vaadin/tests/server/component/datefield/ResolutionTest.java b/server/src/test/java/com/vaadin/tests/server/component/datefield/ResolutionTest.java index a23c60b106..2fb7702aeb 100644 --- a/server/src/test/java/com/vaadin/tests/server/component/datefield/ResolutionTest.java +++ b/server/src/test/java/com/vaadin/tests/server/component/datefield/ResolutionTest.java @@ -13,7 +13,7 @@ public class ResolutionTest { public void testResolutionHigherOrEqualToYear() { Iterable higherOrEqual = Resolution .getResolutionsHigherOrEqualTo(Resolution.YEAR); - ArrayList expected = new ArrayList(); + ArrayList expected = new ArrayList<>(); expected.add(Resolution.YEAR); TestUtil.assertIterableEquals(expected, higherOrEqual); } @@ -22,7 +22,7 @@ public class ResolutionTest { public void testResolutionHigherOrEqualToDay() { Iterable higherOrEqual = Resolution .getResolutionsHigherOrEqualTo(Resolution.DAY); - ArrayList expected = new ArrayList(); + ArrayList expected = new ArrayList<>(); expected.add(Resolution.DAY); expected.add(Resolution.MONTH); expected.add(Resolution.YEAR); @@ -34,7 +34,7 @@ public class ResolutionTest { public void testResolutionLowerThanDay() { Iterable higherOrEqual = Resolution .getResolutionsLowerThan(Resolution.DAY); - ArrayList expected = new ArrayList(); + ArrayList expected = new ArrayList<>(); expected.add(Resolution.HOUR); expected.add(Resolution.MINUTE); expected.add(Resolution.SECOND); @@ -46,7 +46,7 @@ public class ResolutionTest { public void testResolutionLowerThanSecond() { Iterable higherOrEqual = Resolution .getResolutionsLowerThan(Resolution.SECOND); - ArrayList expected = new ArrayList(); + ArrayList expected = new ArrayList<>(); TestUtil.assertIterableEquals(expected, higherOrEqual); } @@ -54,7 +54,7 @@ public class ResolutionTest { public void testResolutionLowerThanYear() { Iterable higherOrEqual = Resolution .getResolutionsLowerThan(Resolution.YEAR); - ArrayList expected = new ArrayList(); + ArrayList expected = new ArrayList<>(); expected.add(Resolution.MONTH); expected.add(Resolution.DAY); expected.add(Resolution.HOUR); diff --git a/server/src/test/java/com/vaadin/tests/server/component/menubar/MenuBarIdsTest.java b/server/src/test/java/com/vaadin/tests/server/component/menubar/MenuBarIdsTest.java index 105cf6660a..f42b9a5683 100644 --- a/server/src/test/java/com/vaadin/tests/server/component/menubar/MenuBarIdsTest.java +++ b/server/src/test/java/com/vaadin/tests/server/component/menubar/MenuBarIdsTest.java @@ -23,7 +23,7 @@ public class MenuBarIdsTest implements Command { private MenuItem menuFileOpen; private MenuItem menuFileSave; private MenuItem menuFileExit; - private Set menuItems = new HashSet(); + private Set menuItems = new HashSet<>(); private MenuBar menuBar; @@ -71,7 +71,7 @@ public class MenuBarIdsTest implements Command { private static void assertUniqueIds(MenuBar menuBar) { - Set ids = new HashSet(); + Set ids = new HashSet<>(); for (MenuItem item : menuBar.getItems()) { assertUniqueIds(ids, item); diff --git a/server/src/test/java/com/vaadin/tests/server/component/ui/CustomUIClassLoaderTest.java b/server/src/test/java/com/vaadin/tests/server/component/ui/CustomUIClassLoaderTest.java index a7392be3da..f7a78b34ec 100644 --- a/server/src/test/java/com/vaadin/tests/server/component/ui/CustomUIClassLoaderTest.java +++ b/server/src/test/java/com/vaadin/tests/server/component/ui/CustomUIClassLoaderTest.java @@ -37,7 +37,7 @@ public class CustomUIClassLoaderTest { */ public class LoggingClassLoader extends ClassLoader { - private List requestedClasses = new ArrayList(); + private List requestedClasses = new ArrayList<>(); @Override protected synchronized Class loadClass(String name, boolean resolve) diff --git a/server/src/test/java/com/vaadin/tests/server/components/WindowTest.java b/server/src/test/java/com/vaadin/tests/server/components/WindowTest.java index ed22870b59..a38ba9b0f9 100644 --- a/server/src/test/java/com/vaadin/tests/server/components/WindowTest.java +++ b/server/src/test/java/com/vaadin/tests/server/components/WindowTest.java @@ -80,14 +80,14 @@ public class WindowTest { } private void sendResize(Window window2) { - Map variables = new HashMap(); + Map variables = new HashMap<>(); variables.put("height", 1234); window.changeVariables(window, variables); } private static void sendClose(Window window) { - Map variables = new HashMap(); + Map variables = new HashMap<>(); variables.put("close", true); window.changeVariables(window, variables); } diff --git a/server/src/test/java/com/vaadin/tests/server/navigator/NavigatorTest.java b/server/src/test/java/com/vaadin/tests/server/navigator/NavigatorTest.java index 5f676cbcbd..c7bb725cc9 100644 --- a/server/src/test/java/com/vaadin/tests/server/navigator/NavigatorTest.java +++ b/server/src/test/java/com/vaadin/tests/server/navigator/NavigatorTest.java @@ -114,9 +114,9 @@ public class NavigatorTest { } public static class ViewChangeTestListener implements ViewChangeListener { - private final LinkedList referenceEvents = new LinkedList(); - private final LinkedList referenceIsCheck = new LinkedList(); - private final LinkedList checkReturnValues = new LinkedList(); + private final LinkedList referenceEvents = new LinkedList<>(); + private final LinkedList referenceIsCheck = new LinkedList<>(); + private final LinkedList checkReturnValues = new LinkedList<>(); public void addExpectedIsViewChangeAllowed(ViewChangeEvent event, boolean returnValue) { diff --git a/server/src/test/java/com/vaadin/tests/util/GraphVizClassHierarchyCreator.java b/server/src/test/java/com/vaadin/tests/util/GraphVizClassHierarchyCreator.java index d621c0d2b4..c322eb7ed8 100644 --- a/server/src/test/java/com/vaadin/tests/util/GraphVizClassHierarchyCreator.java +++ b/server/src/test/java/com/vaadin/tests/util/GraphVizClassHierarchyCreator.java @@ -26,12 +26,12 @@ public class GraphVizClassHierarchyCreator { StringBuilder sb = new StringBuilder(); - Set classesAndParents = new HashSet(); + Set classesAndParents = new HashSet<>(); for (Class cls : classes) { addClassAndParents(classesAndParents, cls, packageToInclude); } - Set interfaces = new HashSet(); + Set interfaces = new HashSet<>(); for (Object cls : classesAndParents.toArray()) { for (Class c : ((Class) cls).getInterfaces()) { addClassAndParentInterfaces(classesAndParents, c, diff --git a/server/src/test/java/com/vaadin/tests/util/MockDeploymentConfiguration.java b/server/src/test/java/com/vaadin/tests/util/MockDeploymentConfiguration.java index b4bf571fd0..e4665adf52 100644 --- a/server/src/test/java/com/vaadin/tests/util/MockDeploymentConfiguration.java +++ b/server/src/test/java/com/vaadin/tests/util/MockDeploymentConfiguration.java @@ -18,7 +18,7 @@ public class MockDeploymentConfiguration private boolean closeIdleSessions = false; private PushMode pushMode = PushMode.DISABLED; private Properties initParameters = new Properties(); - private Map applicationOrSystemProperty = new HashMap(); + private Map applicationOrSystemProperty = new HashMap<>(); private boolean syncIdCheckEnabled = true; private boolean sendUrlsAsParameters = true; diff --git a/server/src/test/java/com/vaadin/util/CurrentInstanceTest.java b/server/src/test/java/com/vaadin/util/CurrentInstanceTest.java index fefa615a91..0d698b19e8 100644 --- a/server/src/test/java/com/vaadin/util/CurrentInstanceTest.java +++ b/server/src/test/java/com/vaadin/util/CurrentInstanceTest.java @@ -223,7 +223,7 @@ public class CurrentInstanceTest { .setCurrent(session2); // Use weak ref to verify object is collected - WeakReference ref = new WeakReference( + WeakReference ref = new WeakReference<>( session1); session1 = null; diff --git a/shared/src/main/java/com/vaadin/shared/JavaScriptExtensionState.java b/shared/src/main/java/com/vaadin/shared/JavaScriptExtensionState.java index 52b8ce895d..a37e453835 100644 --- a/shared/src/main/java/com/vaadin/shared/JavaScriptExtensionState.java +++ b/shared/src/main/java/com/vaadin/shared/JavaScriptExtensionState.java @@ -26,8 +26,8 @@ import com.vaadin.shared.communication.SharedState; public class JavaScriptExtensionState extends SharedState implements JavaScriptConnectorState { - private Set callbackNames = new HashSet(); - private Map> rpcInterfaces = new HashMap>(); + private Set callbackNames = new HashSet<>(); + private Map> rpcInterfaces = new HashMap<>(); @Override public Set getCallbackNames() { diff --git a/shared/src/main/java/com/vaadin/shared/communication/LegacyChangeVariablesInvocation.java b/shared/src/main/java/com/vaadin/shared/communication/LegacyChangeVariablesInvocation.java index 818c292fa4..0e2dc2c841 100644 --- a/shared/src/main/java/com/vaadin/shared/communication/LegacyChangeVariablesInvocation.java +++ b/shared/src/main/java/com/vaadin/shared/communication/LegacyChangeVariablesInvocation.java @@ -21,7 +21,7 @@ import java.util.Map; import com.vaadin.shared.ApplicationConstants; public class LegacyChangeVariablesInvocation extends MethodInvocation { - private Map variableChanges = new HashMap(); + private Map variableChanges = new HashMap<>(); public LegacyChangeVariablesInvocation(String connectorId, String variableName, Object value) { diff --git a/shared/src/main/java/com/vaadin/shared/communication/SharedState.java b/shared/src/main/java/com/vaadin/shared/communication/SharedState.java index 6506d0a7ca..6b9c1045c5 100644 --- a/shared/src/main/java/com/vaadin/shared/communication/SharedState.java +++ b/shared/src/main/java/com/vaadin/shared/communication/SharedState.java @@ -59,7 +59,7 @@ public class SharedState implements Serializable { * com.vaadin.server.Resource) * @see com.vaadin.client.ui.AbstractConnector#getResourceUrl(String) */ - public Map resources = new HashMap(); + public Map resources = new HashMap<>(); public boolean enabled = true; /** diff --git a/shared/src/main/java/com/vaadin/shared/extension/javascriptmanager/JavaScriptManagerState.java b/shared/src/main/java/com/vaadin/shared/extension/javascriptmanager/JavaScriptManagerState.java index 15a89a6699..5abf858f42 100644 --- a/shared/src/main/java/com/vaadin/shared/extension/javascriptmanager/JavaScriptManagerState.java +++ b/shared/src/main/java/com/vaadin/shared/extension/javascriptmanager/JavaScriptManagerState.java @@ -22,5 +22,5 @@ import java.util.Set; import com.vaadin.shared.communication.SharedState; public class JavaScriptManagerState extends SharedState { - public Set names = new HashSet(); + public Set names = new HashSet<>(); } diff --git a/shared/src/main/java/com/vaadin/shared/ui/AbstractMediaState.java b/shared/src/main/java/com/vaadin/shared/ui/AbstractMediaState.java index 54ec61f93a..d7cddf566a 100644 --- a/shared/src/main/java/com/vaadin/shared/ui/AbstractMediaState.java +++ b/shared/src/main/java/com/vaadin/shared/ui/AbstractMediaState.java @@ -36,7 +36,7 @@ public class AbstractMediaState extends AbstractComponentState { @NoLayout public boolean muted; - public List sources = new ArrayList(); + public List sources = new ArrayList<>(); - public List sourceTypes = new ArrayList(); + public List sourceTypes = new ArrayList<>(); } diff --git a/shared/src/main/java/com/vaadin/shared/ui/BrowserWindowOpenerState.java b/shared/src/main/java/com/vaadin/shared/ui/BrowserWindowOpenerState.java index 25cee8a587..f1a4ea9be3 100644 --- a/shared/src/main/java/com/vaadin/shared/ui/BrowserWindowOpenerState.java +++ b/shared/src/main/java/com/vaadin/shared/ui/BrowserWindowOpenerState.java @@ -30,6 +30,6 @@ public class BrowserWindowOpenerState extends AbstractComponentState { public String uriFragment; - public Map parameters = new HashMap(); + public Map parameters = new HashMap<>(); } diff --git a/shared/src/main/java/com/vaadin/shared/ui/ComponentStateUtil.java b/shared/src/main/java/com/vaadin/shared/ui/ComponentStateUtil.java index e18060e3bc..a38b828471 100644 --- a/shared/src/main/java/com/vaadin/shared/ui/ComponentStateUtil.java +++ b/shared/src/main/java/com/vaadin/shared/ui/ComponentStateUtil.java @@ -78,7 +78,7 @@ public final class ComponentStateUtil implements Serializable { public static final void addRegisteredEventListener(SharedState state, String eventListenerId) { if (state.registeredEventListeners == null) { - state.registeredEventListeners = new HashSet(); + state.registeredEventListeners = new HashSet<>(); } state.registeredEventListeners.add(eventListenerId); } diff --git a/shared/src/main/java/com/vaadin/shared/ui/JavaScriptComponentState.java b/shared/src/main/java/com/vaadin/shared/ui/JavaScriptComponentState.java index 0cfecee087..cb65592516 100644 --- a/shared/src/main/java/com/vaadin/shared/ui/JavaScriptComponentState.java +++ b/shared/src/main/java/com/vaadin/shared/ui/JavaScriptComponentState.java @@ -27,8 +27,8 @@ import com.vaadin.shared.JavaScriptConnectorState; public class JavaScriptComponentState extends AbstractComponentState implements JavaScriptConnectorState { - private Set callbackNames = new HashSet(); - private Map> rpcInterfaces = new HashMap>(); + private Set callbackNames = new HashSet<>(); + private Map> rpcInterfaces = new HashMap<>(); @Override public Set getCallbackNames() { diff --git a/shared/src/main/java/com/vaadin/shared/ui/absolutelayout/AbsoluteLayoutState.java b/shared/src/main/java/com/vaadin/shared/ui/absolutelayout/AbsoluteLayoutState.java index a30482b4e7..f304ccad12 100644 --- a/shared/src/main/java/com/vaadin/shared/ui/absolutelayout/AbsoluteLayoutState.java +++ b/shared/src/main/java/com/vaadin/shared/ui/absolutelayout/AbsoluteLayoutState.java @@ -26,5 +26,5 @@ public class AbsoluteLayoutState extends AbstractLayoutState { } // Maps each component to a position - public Map connectorToCssPosition = new HashMap(); + public Map connectorToCssPosition = new HashMap<>(); } diff --git a/shared/src/main/java/com/vaadin/shared/ui/csslayout/CssLayoutState.java b/shared/src/main/java/com/vaadin/shared/ui/csslayout/CssLayoutState.java index 21c97a93f9..eefc280649 100644 --- a/shared/src/main/java/com/vaadin/shared/ui/csslayout/CssLayoutState.java +++ b/shared/src/main/java/com/vaadin/shared/ui/csslayout/CssLayoutState.java @@ -25,5 +25,5 @@ public class CssLayoutState extends AbstractLayoutState { { primaryStyleName = "v-csslayout"; } - public Map childCss = new HashMap(); + public Map childCss = new HashMap<>(); } diff --git a/shared/src/main/java/com/vaadin/shared/ui/customlayout/CustomLayoutState.java b/shared/src/main/java/com/vaadin/shared/ui/customlayout/CustomLayoutState.java index 982393b21b..184346b9b7 100644 --- a/shared/src/main/java/com/vaadin/shared/ui/customlayout/CustomLayoutState.java +++ b/shared/src/main/java/com/vaadin/shared/ui/customlayout/CustomLayoutState.java @@ -25,7 +25,7 @@ public class CustomLayoutState extends AbstractLayoutState { { primaryStyleName = "v-customlayout"; } - public Map childLocations = new HashMap(); + public Map childLocations = new HashMap<>(); public String templateContents; public String templateName; } diff --git a/shared/src/main/java/com/vaadin/shared/ui/datefield/Resolution.java b/shared/src/main/java/com/vaadin/shared/ui/datefield/Resolution.java index 344953d591..93dbb7ab83 100644 --- a/shared/src/main/java/com/vaadin/shared/ui/datefield/Resolution.java +++ b/shared/src/main/java/com/vaadin/shared/ui/datefield/Resolution.java @@ -56,7 +56,7 @@ public enum Resolution { */ public static Iterable getResolutionsHigherOrEqualTo( Resolution r) { - List resolutions = new ArrayList(); + List resolutions = new ArrayList<>(); Resolution[] values = Resolution.values(); for (int i = r.ordinal(); i < values.length; i++) { resolutions.add(values[i]); @@ -74,7 +74,7 @@ public enum Resolution { * @return An iterable for the resolutions lower than r */ public static List getResolutionsLowerThan(Resolution r) { - List resolutions = new ArrayList(); + List resolutions = new ArrayList<>(); Resolution[] values = Resolution.values(); for (int i = r.ordinal() - 1; i >= 0; i--) { resolutions.add(values[i]); diff --git a/shared/src/main/java/com/vaadin/shared/ui/grid/GridState.java b/shared/src/main/java/com/vaadin/shared/ui/grid/GridState.java index add8eb8938..15e17b5ab8 100644 --- a/shared/src/main/java/com/vaadin/shared/ui/grid/GridState.java +++ b/shared/src/main/java/com/vaadin/shared/ui/grid/GridState.java @@ -102,7 +102,7 @@ public class GridState extends TabIndexState { /** * Column order in grid. */ - public List columnOrder = new ArrayList(); + public List columnOrder = new ArrayList<>(); /** The number of frozen columns. */ @DelegateToWidget diff --git a/shared/src/main/java/com/vaadin/shared/ui/gridlayout/GridLayoutState.java b/shared/src/main/java/com/vaadin/shared/ui/gridlayout/GridLayoutState.java index 000e396e12..c38c76852a 100644 --- a/shared/src/main/java/com/vaadin/shared/ui/gridlayout/GridLayoutState.java +++ b/shared/src/main/java/com/vaadin/shared/ui/gridlayout/GridLayoutState.java @@ -36,9 +36,9 @@ public class GridLayoutState extends AbstractLayoutState { public int columns = 0; public int marginsBitmask = 0; // Set of indexes of implicitly Ratios rows and columns - public Set explicitRowRatios = new HashSet();; - public Set explicitColRatios = new HashSet(); - public Map childData = new HashMap(); + public Set explicitRowRatios = new HashSet<>();; + public Set explicitColRatios = new HashSet<>(); + public Map childData = new HashMap<>(); public boolean hideEmptyRowsAndColumns = false; public float[] rowExpand; public float[] colExpand; diff --git a/shared/src/main/java/com/vaadin/shared/ui/orderedlayout/AbstractOrderedLayoutState.java b/shared/src/main/java/com/vaadin/shared/ui/orderedlayout/AbstractOrderedLayoutState.java index a5d2d3a89c..fb8d4b9301 100644 --- a/shared/src/main/java/com/vaadin/shared/ui/orderedlayout/AbstractOrderedLayoutState.java +++ b/shared/src/main/java/com/vaadin/shared/ui/orderedlayout/AbstractOrderedLayoutState.java @@ -25,7 +25,7 @@ import com.vaadin.shared.ui.AlignmentInfo; public class AbstractOrderedLayoutState extends AbstractLayoutState { public boolean spacing = false; - public HashMap childData = new HashMap(); + public HashMap childData = new HashMap<>(); public int marginsBitmask = 0; diff --git a/shared/src/main/java/com/vaadin/shared/ui/tabsheet/TabsheetState.java b/shared/src/main/java/com/vaadin/shared/ui/tabsheet/TabsheetState.java index de39a63438..f1b01fc076 100644 --- a/shared/src/main/java/com/vaadin/shared/ui/tabsheet/TabsheetState.java +++ b/shared/src/main/java/com/vaadin/shared/ui/tabsheet/TabsheetState.java @@ -36,7 +36,7 @@ public class TabsheetState extends AbstractComponentState { @NoLayout public int tabIndex; - public List tabs = new ArrayList(); + public List tabs = new ArrayList<>(); /** true to show the tab bar, false to only show the contained component */ public boolean tabsVisible = true; diff --git a/shared/src/main/java/com/vaadin/shared/ui/ui/UIState.java b/shared/src/main/java/com/vaadin/shared/ui/ui/UIState.java index cc43ddb938..82054e1d30 100644 --- a/shared/src/main/java/com/vaadin/shared/ui/ui/UIState.java +++ b/shared/src/main/java/com/vaadin/shared/ui/ui/UIState.java @@ -32,7 +32,7 @@ public class UIState extends TabIndexState { // Informing users of assistive devices, that the content of this container // is announced automatically and does not need to be navigated into public String overlayContainerLabel = "This content is announced automatically and does not need to be navigated into."; - public Map notificationConfigurations = new HashMap(); + public Map notificationConfigurations = new HashMap<>(); { notificationConfigurations.put("error", new NotificationTypeConfiguration("Error: ", @@ -117,7 +117,7 @@ public class UIState extends TabIndexState { public boolean alwaysUseXhrForServerRequests = false; public PushMode mode = PushMode.DISABLED; public String pushUrl = null; - public Map parameters = new HashMap(); + public Map parameters = new HashMap<>(); { parameters.put(TRANSPORT_PARAM, Transport.WEBSOCKET.getIdentifier()); @@ -137,7 +137,7 @@ public class UIState extends TabIndexState { } public static class LocaleServiceState implements Serializable { - public List localeData = new ArrayList(); + public List localeData = new ArrayList<>(); } public static class LocaleData implements Serializable { diff --git a/uitest-common/src/main/java/com/vaadin/tests/tb3/AbstractTB3Test.java b/uitest-common/src/main/java/com/vaadin/tests/tb3/AbstractTB3Test.java index 1c9982886d..dbfda17bfd 100644 --- a/uitest-common/src/main/java/com/vaadin/tests/tb3/AbstractTB3Test.java +++ b/uitest-common/src/main/java/com/vaadin/tests/tb3/AbstractTB3Test.java @@ -260,7 +260,7 @@ public abstract class AbstractTB3Test extends ParallelTest { * {@link #isPush()}. */ protected void openTestURL(Class uiClass, String... parameters) { - openTestURL(uiClass, new HashSet(Arrays.asList(parameters))); + openTestURL(uiClass, new HashSet<>(Arrays.asList(parameters))); } private void openTestURL(Class uiClass, Set parameters) { @@ -979,7 +979,7 @@ public abstract class AbstractTB3Test extends ParallelTest { protected List getLogs() { VerticalLayoutElement log = $(VerticalLayoutElement.class).id("Log"); List logLabels = log.$(LabelElement.class).all(); - List logTexts = new ArrayList(); + List logTexts = new ArrayList<>(); for (LabelElement label : logLabels) { logTexts.add(label.getText()); diff --git a/uitest-common/src/main/java/com/vaadin/tests/tb3/MultiBrowserTest.java b/uitest-common/src/main/java/com/vaadin/tests/tb3/MultiBrowserTest.java index cef11a69bd..1193ba9334 100644 --- a/uitest-common/src/main/java/com/vaadin/tests/tb3/MultiBrowserTest.java +++ b/uitest-common/src/main/java/com/vaadin/tests/tb3/MultiBrowserTest.java @@ -97,7 +97,7 @@ public abstract class MultiBrowserTest extends PrivateTB3Configuration { protected List getBrowserCapabilities( Browser... browsers) { - List capabilities = new ArrayList(); + List capabilities = new ArrayList<>(); for (Browser browser : browsers) { capabilities.add(browser.getDesiredCapabilities()); } diff --git a/uitest-common/src/main/java/com/vaadin/tests/tb3/ParallelScheduler.java b/uitest-common/src/main/java/com/vaadin/tests/tb3/ParallelScheduler.java index 100ee83918..e270e26c53 100644 --- a/uitest-common/src/main/java/com/vaadin/tests/tb3/ParallelScheduler.java +++ b/uitest-common/src/main/java/com/vaadin/tests/tb3/ParallelScheduler.java @@ -31,7 +31,7 @@ import org.junit.runners.model.RunnerScheduler; * @author Vaadin Ltd */ public class ParallelScheduler implements RunnerScheduler { - private final List> fResults = new ArrayList>(); + private final List> fResults = new ArrayList<>(); private ExecutorService fService; /** diff --git a/uitest-common/src/main/java/com/vaadin/tests/tb3/ParameterizedTB3Runner.java b/uitest-common/src/main/java/com/vaadin/tests/tb3/ParameterizedTB3Runner.java index 83aba8a3f9..25261584d2 100644 --- a/uitest-common/src/main/java/com/vaadin/tests/tb3/ParameterizedTB3Runner.java +++ b/uitest-common/src/main/java/com/vaadin/tests/tb3/ParameterizedTB3Runner.java @@ -48,7 +48,7 @@ public class ParameterizedTB3Runner extends TB3Runner { protected List computeTestMethods() { List methods = super.computeTestMethods(); - Map> parameters = new LinkedHashMap>(); + Map> parameters = new LinkedHashMap<>(); // Find all @Parameters methods and invoke them to find out permutations @@ -108,7 +108,7 @@ public class ParameterizedTB3Runner extends TB3Runner { // Add method permutations for all @Parameters for (Method setter : parameters.keySet()) { - List newMethods = new ArrayList(); + List newMethods = new ArrayList<>(); for (FrameworkMethod m : methods) { if (!(m instanceof TBMethod)) { diff --git a/uitest-common/src/main/java/com/vaadin/tests/tb3/ScreenshotTB3Test.java b/uitest-common/src/main/java/com/vaadin/tests/tb3/ScreenshotTB3Test.java index aea24c6727..ffc4ec9043 100644 --- a/uitest-common/src/main/java/com/vaadin/tests/tb3/ScreenshotTB3Test.java +++ b/uitest-common/src/main/java/com/vaadin/tests/tb3/ScreenshotTB3Test.java @@ -98,7 +98,7 @@ public abstract class ScreenshotTB3Test extends AbstractTB3Test { */ @Before public void setupScreenComparisonParameters() { - screenshotFailures = new ArrayList(); + screenshotFailures = new ArrayList<>(); Parameters.setScreenshotErrorDirectory(getScreenshotErrorDirectory()); Parameters.setScreenshotReferenceDirectory( @@ -133,7 +133,7 @@ public abstract class ScreenshotTB3Test extends AbstractTB3Test { File mainReference = getScreenshotReferenceFile(identifier); List referenceFiles = findReferenceAndAlternatives(mainReference); - List failedReferenceFiles = new ArrayList(); + List failedReferenceFiles = new ArrayList<>(); for (File referenceFile : referenceFiles) { boolean match = false; @@ -275,7 +275,7 @@ public abstract class ScreenshotTB3Test extends AbstractTB3Test { * given files, including the given reference */ private List findReferenceAndAlternatives(File reference) { - List files = new ArrayList(); + List files = new ArrayList<>(); files.add(reference); File screenshotDir = reference.getParentFile(); diff --git a/uitest-common/src/main/java/com/vaadin/tests/tb3/TB3TestLocator.java b/uitest-common/src/main/java/com/vaadin/tests/tb3/TB3TestLocator.java index 5733ac4f27..8635477491 100644 --- a/uitest-common/src/main/java/com/vaadin/tests/tb3/TB3TestLocator.java +++ b/uitest-common/src/main/java/com/vaadin/tests/tb3/TB3TestLocator.java @@ -67,7 +67,7 @@ public class TB3TestLocator { */ protected List> findClasses(Class baseClass, String basePackage, String[] ignoredPackages) throws IOException { - List> classes = new ArrayList>(); + List> classes = new ArrayList<>(); String basePackageDirName = "/" + basePackage.replace('.', '/'); URL location = baseClass.getResource(basePackageDirName); if (location.getProtocol().equals("file")) { diff --git a/uitest/src/main/java/com/vaadin/launcher/ApplicationRunnerServlet.java b/uitest/src/main/java/com/vaadin/launcher/ApplicationRunnerServlet.java index b4ac8d5425..6108755058 100644 --- a/uitest/src/main/java/com/vaadin/launcher/ApplicationRunnerServlet.java +++ b/uitest/src/main/java/com/vaadin/launcher/ApplicationRunnerServlet.java @@ -100,9 +100,9 @@ public class ApplicationRunnerServlet extends LegacyVaadinServlet { * The name of the application class currently used. Only valid within one * request. */ - private LinkedHashSet defaultPackages = new LinkedHashSet(); + private LinkedHashSet defaultPackages = new LinkedHashSet<>(); - private transient final ThreadLocal request = new ThreadLocal(); + private transient final ThreadLocal request = new ThreadLocal<>(); @Override public void init(ServletConfig servletConfig) throws ServletException { @@ -339,7 +339,7 @@ public class ApplicationRunnerServlet extends LegacyVaadinServlet { File uitestDir = new File("uitest/src"); if (uitestDir.isDirectory()) { - LinkedList stack = new LinkedList(); + LinkedList stack = new LinkedList<>(); stack.add(uitestDir); long lastModifiedTimestamp = Long.MIN_VALUE; diff --git a/uitest/src/main/java/com/vaadin/launcher/DevelopmentServerLauncher.java b/uitest/src/main/java/com/vaadin/launcher/DevelopmentServerLauncher.java index d8319e6516..63ecc3c8db 100644 --- a/uitest/src/main/java/com/vaadin/launcher/DevelopmentServerLauncher.java +++ b/uitest/src/main/java/com/vaadin/launcher/DevelopmentServerLauncher.java @@ -217,7 +217,7 @@ public class DevelopmentServerLauncher { interval = Integer.parseInt(serverArgs.get("scaninterval")); } - List classFolders = new ArrayList(); + List classFolders = new ArrayList<>(); String[] paths = serverArgs.get("autoreload").split(","); if (paths.length == 1 && "all".equals(paths[0])) { ClassLoader cl = server.getClass().getClassLoader(); @@ -370,7 +370,7 @@ public class DevelopmentServerLauncher { * @return map of arguments key value pairs. */ protected static Map parseArguments(String[] args) { - final Map map = new HashMap(); + final Map map = new HashMap<>(); for (int i = 0; i < args.length; i++) { final int d = args[i].indexOf("="); if (d > 0 && d < args[i].length() && args[i].startsWith("--")) { diff --git a/uitest/src/main/java/com/vaadin/screenshotbrowser/ScreenshotBrowser.java b/uitest/src/main/java/com/vaadin/screenshotbrowser/ScreenshotBrowser.java index 857966af9c..419fe1213c 100644 --- a/uitest/src/main/java/com/vaadin/screenshotbrowser/ScreenshotBrowser.java +++ b/uitest/src/main/java/com/vaadin/screenshotbrowser/ScreenshotBrowser.java @@ -385,7 +385,7 @@ public class ScreenshotBrowser extends UI { } }); - BeanItemContainer container = new BeanItemContainer( + BeanItemContainer container = new BeanItemContainer<>( ComparisonFailure.class); for (File failure : failures) { container.addBean(new ComparisonFailure(failure)); diff --git a/uitest/src/main/java/com/vaadin/tests/Components.java b/uitest/src/main/java/com/vaadin/tests/Components.java index d16afa1232..eea70f6ad1 100644 --- a/uitest/src/main/java/com/vaadin/tests/Components.java +++ b/uitest/src/main/java/com/vaadin/tests/Components.java @@ -33,13 +33,13 @@ import com.vaadin.v7.ui.Tree.ItemStyleGenerator; public class Components extends LegacyApplication { private static final Object CAPTION = "c"; - private Map, String> tests = new HashMap, String>(); + private Map, String> tests = new HashMap<>(); private Tree naviTree; private HorizontalSplitPanel sp; private LegacyWindow mainWindow; private final Embedded applicationEmbedder = new Embedded(); private String baseUrl; - private List> componentsWithoutTests = new ArrayList>(); + private List> componentsWithoutTests = new ArrayList<>(); { for (Class c : VaadinClasses.getBasicComponentTests()) { @@ -49,7 +49,7 @@ public class Components extends LegacyApplication { List> componentsWithoutTest = VaadinClasses .getComponents(); - Set availableTests = new HashSet(); + Set availableTests = new HashSet<>(); for (String testName : tests.values()) { availableTests.add(testName); } diff --git a/uitest/src/main/java/com/vaadin/tests/ListenerOrder.java b/uitest/src/main/java/com/vaadin/tests/ListenerOrder.java index 915e120a7a..3e885f1078 100644 --- a/uitest/src/main/java/com/vaadin/tests/ListenerOrder.java +++ b/uitest/src/main/java/com/vaadin/tests/ListenerOrder.java @@ -24,7 +24,7 @@ public class ListenerOrder extends com.vaadin.server.LegacyApplication Select s1; - HashMap buttonListeners = new HashMap(); + HashMap buttonListeners = new HashMap<>(); @Override public void init() { diff --git a/uitest/src/main/java/com/vaadin/tests/OrderedLayoutSwapComponents.java b/uitest/src/main/java/com/vaadin/tests/OrderedLayoutSwapComponents.java index e6f0405bf4..0dbe05fdee 100644 --- a/uitest/src/main/java/com/vaadin/tests/OrderedLayoutSwapComponents.java +++ b/uitest/src/main/java/com/vaadin/tests/OrderedLayoutSwapComponents.java @@ -37,7 +37,7 @@ public class OrderedLayoutSwapComponents extends CustomComponent { private final AbstractOrderedLayout main; - ArrayList order = new ArrayList(); + ArrayList order = new ArrayList<>(); public OrderedLayoutSwapComponents() { diff --git a/uitest/src/main/java/com/vaadin/tests/StressComponentsInTable.java b/uitest/src/main/java/com/vaadin/tests/StressComponentsInTable.java index 3b045eb50b..3e17dc99f1 100644 --- a/uitest/src/main/java/com/vaadin/tests/StressComponentsInTable.java +++ b/uitest/src/main/java/com/vaadin/tests/StressComponentsInTable.java @@ -43,7 +43,7 @@ public class StressComponentsInTable extends CustomComponent { } t.addContainerProperty("button", Button.class, null); for (int i = 0; i < rows; i++) { - final Vector content = new Vector(); + final Vector content = new Vector<>(); for (int j = 0; j < cols; j++) { content.add(rndString()); } diff --git a/uitest/src/main/java/com/vaadin/tests/TestBench.java b/uitest/src/main/java/com/vaadin/tests/TestBench.java index f904925f1d..2f77086ed7 100644 --- a/uitest/src/main/java/com/vaadin/tests/TestBench.java +++ b/uitest/src/main/java/com/vaadin/tests/TestBench.java @@ -70,7 +70,7 @@ public class TestBench extends com.vaadin.server.LegacyApplication VerticalLayout bodyLayout = new VerticalLayout(); // TODO this could probably be a simple Set - HashMap, String> itemCaptions = new HashMap, String>(); + HashMap, String> itemCaptions = new HashMap<>(); @Override public void init() { @@ -278,7 +278,7 @@ public class TestBench extends com.vaadin.server.LegacyApplication */ public static List> getTestableClassesForPackage( String packageName) throws Exception { - final ArrayList directories = new ArrayList(); + final ArrayList directories = new ArrayList<>(); try { final ClassLoader cld = Thread.currentThread() .getContextClassLoader(); @@ -297,7 +297,7 @@ public class TestBench extends com.vaadin.server.LegacyApplication packageName + " does not appear to be a valid package."); } - final ArrayList> classes = new ArrayList>(); + final ArrayList> classes = new ArrayList<>(); // For every directory identified capture all the .class files for (final Iterator it = directories.iterator(); it.hasNext();) { final File directory = it.next(); diff --git a/uitest/src/main/java/com/vaadin/tests/TestForChildComponentRendering.java b/uitest/src/main/java/com/vaadin/tests/TestForChildComponentRendering.java index 27c93ad426..ce044db4a5 100644 --- a/uitest/src/main/java/com/vaadin/tests/TestForChildComponentRendering.java +++ b/uitest/src/main/java/com/vaadin/tests/TestForChildComponentRendering.java @@ -93,7 +93,7 @@ public class TestForChildComponentRendering extends CustomComponent { public void randomReorder() { final Iterator it = main.getComponentIterator(); - final ArrayList components = new ArrayList(); + final ArrayList components = new ArrayList<>(); while (it.hasNext()) { components.add(it.next()); } @@ -110,7 +110,7 @@ public class TestForChildComponentRendering extends CustomComponent { public void removeRandomComponent() { final Iterator it = main.getComponentIterator(); - final ArrayList components = new ArrayList(); + final ArrayList components = new ArrayList<>(); while (it.hasNext()) { components.add(it.next()); } diff --git a/uitest/src/main/java/com/vaadin/tests/TestForGridLayoutChildComponentRendering.java b/uitest/src/main/java/com/vaadin/tests/TestForGridLayoutChildComponentRendering.java index 3757a13829..eec5bcd27d 100644 --- a/uitest/src/main/java/com/vaadin/tests/TestForGridLayoutChildComponentRendering.java +++ b/uitest/src/main/java/com/vaadin/tests/TestForGridLayoutChildComponentRendering.java @@ -94,7 +94,7 @@ public class TestForGridLayoutChildComponentRendering extends CustomComponent { public void randomReorder() { final Iterator it = main.getComponentIterator(); - final ArrayList components = new ArrayList(); + final ArrayList components = new ArrayList<>(); while (it.hasNext()) { components.add(it.next()); } @@ -118,7 +118,7 @@ public class TestForGridLayoutChildComponentRendering extends CustomComponent { public void removeRandomComponent() { final Iterator it = main.getComponentIterator(); - final ArrayList components = new ArrayList(); + final ArrayList components = new ArrayList<>(); while (it.hasNext()) { components.add(it.next()); } diff --git a/uitest/src/main/java/com/vaadin/tests/TestForMultipleStyleNames.java b/uitest/src/main/java/com/vaadin/tests/TestForMultipleStyleNames.java index c1face8492..47bc0413b7 100644 --- a/uitest/src/main/java/com/vaadin/tests/TestForMultipleStyleNames.java +++ b/uitest/src/main/java/com/vaadin/tests/TestForMultipleStyleNames.java @@ -61,7 +61,7 @@ public class TestForMultipleStyleNames extends CustomComponent + " on the browser. Currently changes are" + " visible only by inspecting DOM.")); - styleNames2 = new ArrayList(); + styleNames2 = new ArrayList<>(); styleNames2.add("red"); styleNames2.add("bold"); @@ -82,7 +82,7 @@ public class TestForMultipleStyleNames extends CustomComponent final String currentStyle = l.getStyleName(); final String[] tmp = currentStyle.split(" "); - final ArrayList curStyles = new ArrayList(); + final ArrayList curStyles = new ArrayList<>(); for (int i = 0; i < tmp.length; i++) { if (tmp[i] != "") { curStyles.add(tmp[i]); diff --git a/uitest/src/main/java/com/vaadin/tests/TestForTablesInitialColumnWidthLogicRendering.java b/uitest/src/main/java/com/vaadin/tests/TestForTablesInitialColumnWidthLogicRendering.java index 0cb616d084..2d2131a235 100644 --- a/uitest/src/main/java/com/vaadin/tests/TestForTablesInitialColumnWidthLogicRendering.java +++ b/uitest/src/main/java/com/vaadin/tests/TestForTablesInitialColumnWidthLogicRendering.java @@ -135,7 +135,7 @@ public class TestForTablesInitialColumnWidthLogicRendering } t.addContainerProperty("button", Button.class, null); for (int i = 0; i < rows; i++) { - final Vector content = new Vector(); + final Vector content = new Vector<>(); for (int j = 0; j < cols; j++) { content.add(rndString()); } diff --git a/uitest/src/main/java/com/vaadin/tests/TestMethodProperty.java b/uitest/src/main/java/com/vaadin/tests/TestMethodProperty.java index 73da774a54..04e3104b79 100644 --- a/uitest/src/main/java/com/vaadin/tests/TestMethodProperty.java +++ b/uitest/src/main/java/com/vaadin/tests/TestMethodProperty.java @@ -11,7 +11,7 @@ public class TestMethodProperty { MyTest myTest = new MyTest(); - MethodProperty methodProperty2 = new MethodProperty( + MethodProperty methodProperty2 = new MethodProperty<>( Integer.TYPE, myTest, "getInt", "setInt", new Object[0], new Object[] { null }, 0); diff --git a/uitest/src/main/java/com/vaadin/tests/TestSelectAndDatefieldInDeepLayouts.java b/uitest/src/main/java/com/vaadin/tests/TestSelectAndDatefieldInDeepLayouts.java index 48287f6945..80dbee4cfb 100644 --- a/uitest/src/main/java/com/vaadin/tests/TestSelectAndDatefieldInDeepLayouts.java +++ b/uitest/src/main/java/com/vaadin/tests/TestSelectAndDatefieldInDeepLayouts.java @@ -103,7 +103,7 @@ public class TestSelectAndDatefieldInDeepLayouts extends CustomComponent { } private Collection getSelectOptions() { - final Collection opts = new Vector(3); + final Collection opts = new Vector<>(3); opts.add(getCaption("opt 1")); opts.add(getCaption("opt 2")); opts.add(getCaption("opt 3")); diff --git a/uitest/src/main/java/com/vaadin/tests/TestSizeableIncomponents.java b/uitest/src/main/java/com/vaadin/tests/TestSizeableIncomponents.java index 92dda09f97..6cde8350ed 100644 --- a/uitest/src/main/java/com/vaadin/tests/TestSizeableIncomponents.java +++ b/uitest/src/main/java/com/vaadin/tests/TestSizeableIncomponents.java @@ -233,7 +233,7 @@ public class TestSizeableIncomponents extends LegacyApplication { class Testable { private Class classToTest; - private ArrayList configurations = new ArrayList(); + private ArrayList configurations = new ArrayList<>(); Testable(Class c) { classToTest = c; diff --git a/uitest/src/main/java/com/vaadin/tests/UsingObjectsInSelect.java b/uitest/src/main/java/com/vaadin/tests/UsingObjectsInSelect.java index d2058fd886..28cfabbc43 100644 --- a/uitest/src/main/java/com/vaadin/tests/UsingObjectsInSelect.java +++ b/uitest/src/main/java/com/vaadin/tests/UsingObjectsInSelect.java @@ -35,7 +35,7 @@ public class UsingObjectsInSelect extends com.vaadin.server.LegacyApplication private final Label selectedTask = new Label("Selected task", ContentMode.HTML); - public LinkedList exampleTasks = new LinkedList(); + public LinkedList exampleTasks = new LinkedList<>(); public static Random random = new Random(1); diff --git a/uitest/src/main/java/com/vaadin/tests/VaadinClasses.java b/uitest/src/main/java/com/vaadin/tests/VaadinClasses.java index dc09e7cc0c..bee83d8e01 100644 --- a/uitest/src/main/java/com/vaadin/tests/VaadinClasses.java +++ b/uitest/src/main/java/com/vaadin/tests/VaadinClasses.java @@ -90,7 +90,7 @@ public class VaadinClasses { private static List> findClasses(Class baseClass, String basePackage, String[] ignoredPackages) throws IOException { - List> classes = new ArrayList>(); + List> classes = new ArrayList<>(); String basePackageDirName = "/" + basePackage.replace('.', '/'); URL location = VaadinSession.class.getResource(basePackageDirName); if (location.getProtocol().equals("file")) { diff --git a/uitest/src/main/java/com/vaadin/tests/accessibility/WindowWaiAriaRoles.java b/uitest/src/main/java/com/vaadin/tests/accessibility/WindowWaiAriaRoles.java index fae301860b..c2df4fe38e 100644 --- a/uitest/src/main/java/com/vaadin/tests/accessibility/WindowWaiAriaRoles.java +++ b/uitest/src/main/java/com/vaadin/tests/accessibility/WindowWaiAriaRoles.java @@ -31,7 +31,7 @@ import com.vaadin.ui.Window; * @author Vaadin Ltd */ public class WindowWaiAriaRoles extends AbstractTestUI { - Stack windows = new Stack(); + Stack windows = new Stack<>(); /* * (non-Javadoc) diff --git a/uitest/src/main/java/com/vaadin/tests/application/DetachOldUIOnReload.java b/uitest/src/main/java/com/vaadin/tests/application/DetachOldUIOnReload.java index 8ca03ca860..a93fadeba4 100644 --- a/uitest/src/main/java/com/vaadin/tests/application/DetachOldUIOnReload.java +++ b/uitest/src/main/java/com/vaadin/tests/application/DetachOldUIOnReload.java @@ -54,7 +54,7 @@ public class DetachOldUIOnReload extends AbstractTestUIWithLog { List messages = (List) getSession() .getAttribute(PERSISTENT_MESSAGES_ATTRIBUTE); if (messages == null) { - messages = new ArrayList(); + messages = new ArrayList<>(); if (storeIfNeeded) { getSession().setAttribute(PERSISTENT_MESSAGES_ATTRIBUTE, messages); diff --git a/uitest/src/main/java/com/vaadin/tests/components/AbstractComponentContainerTest.java b/uitest/src/main/java/com/vaadin/tests/components/AbstractComponentContainerTest.java index 5720834bd1..ef0a273172 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/AbstractComponentContainerTest.java +++ b/uitest/src/main/java/com/vaadin/tests/components/AbstractComponentContainerTest.java @@ -294,7 +294,7 @@ public abstract class AbstractComponentContainerTest> addCommands = new LinkedHashMap>(); + LinkedHashMap> addCommands = new LinkedHashMap<>(); addCommands.put("Button", addButtonCommand); addCommands.put("NativeButton", addNativeButtonCommand); addCommands.put("TextField", addTextFieldCommand); @@ -307,7 +307,7 @@ public abstract class AbstractComponentContainerTest noVerticalSize = new HashSet(); + HashSet noVerticalSize = new HashSet<>(); noVerticalSize.add("TextField"); noVerticalSize.add("Button"); diff --git a/uitest/src/main/java/com/vaadin/tests/components/AbstractComponentTest.java b/uitest/src/main/java/com/vaadin/tests/components/AbstractComponentTest.java index a3b432800c..2c51bd132d 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/AbstractComponentTest.java +++ b/uitest/src/main/java/com/vaadin/tests/components/AbstractComponentTest.java @@ -39,7 +39,7 @@ public abstract class AbstractComponentTest extends private static final Resource SELECTED_ICON = new ThemeResource( "../runo/icons/16/ok.png"); - private static final LinkedHashMap sizeOptions = new LinkedHashMap(); + private static final LinkedHashMap sizeOptions = new LinkedHashMap<>(); static { sizeOptions.put("auto", null); sizeOptions.put("50%", "50%"); @@ -61,13 +61,13 @@ public abstract class AbstractComponentTest extends // Used to determine if a menuItem should be selected and the other // unselected on click - private Set parentOfSelectableMenuItem = new HashSet(); + private Set parentOfSelectableMenuItem = new HashSet<>(); /** * Maps the category name to a menu item */ - private Map categoryToMenuItem = new HashMap(); - private Map menuItemToCategory = new HashMap(); + private Map categoryToMenuItem = new HashMap<>(); + private Map menuItemToCategory = new HashMap<>(); // Logging private Log log; @@ -292,7 +292,7 @@ public abstract class AbstractComponentTest extends createBlurListener(CATEGORY_LISTENERS); } if (Focusable.class.isAssignableFrom(getTestClass())) { - LinkedHashMap tabIndexes = new LinkedHashMap(); + LinkedHashMap tabIndexes = new LinkedHashMap<>(); tabIndexes.put("0", 0); tabIndexes.put("-1", -1); tabIndexes.put("10", 10); @@ -315,7 +315,7 @@ public abstract class AbstractComponentTest extends } private void createStyleNameSelect(String category) { - LinkedHashMap options = new LinkedHashMap(); + LinkedHashMap options = new LinkedHashMap<>(); options.put("-", null); options.put("Light blue background (background-lightblue)", "background-lightblue"); @@ -333,7 +333,7 @@ public abstract class AbstractComponentTest extends } private void createErrorMessageSelect(String category) { - LinkedHashMap options = new LinkedHashMap(); + LinkedHashMap options = new LinkedHashMap<>(); options.put("-", null); options.put(TEXT_SHORT, TEXT_SHORT); options.put("Medium", TEXT_MEDIUM); @@ -345,7 +345,7 @@ public abstract class AbstractComponentTest extends } private void createDescriptionSelect(String category) { - LinkedHashMap options = new LinkedHashMap(); + LinkedHashMap options = new LinkedHashMap<>(); options.put("-", null); options.put(TEXT_SHORT, TEXT_SHORT); options.put("Medium", TEXT_MEDIUM); @@ -363,7 +363,7 @@ public abstract class AbstractComponentTest extends } protected LinkedHashMap createCaptionOptions() { - LinkedHashMap options = new LinkedHashMap(); + LinkedHashMap options = new LinkedHashMap<>(); options.put("-", null); options.put("Short", TEXT_SHORT); options.put("Medium", TEXT_MEDIUM); @@ -394,7 +394,7 @@ public abstract class AbstractComponentTest extends } private void createIconSelect(String category) { - LinkedHashMap options = new LinkedHashMap(); + LinkedHashMap options = new LinkedHashMap<>(); options.put("-", null); options.put("16x16", ICON_16_USER_PNG_CACHEABLE); options.put("32x32", ICON_32_ATTENTION_PNG_CACHEABLE); @@ -404,7 +404,7 @@ public abstract class AbstractComponentTest extends } private void createLocaleSelect(String category) { - LinkedHashMap options = new LinkedHashMap(); + LinkedHashMap options = new LinkedHashMap<>(); options.put("-", null); options.put("fi_FI", new Locale("fi", "FI")); options.put("en_US", Locale.US); @@ -605,7 +605,7 @@ public abstract class AbstractComponentTest extends protected > void createSelectAction(String caption, String category, Class enumType, TYPE initialValue, com.vaadin.tests.components.ComponentTestCase.Command command) { - LinkedHashMap options = new LinkedHashMap(); + LinkedHashMap options = new LinkedHashMap<>(); for (TYPE value : EnumSet.allOf(enumType)) { options.put(value.toString(), value); } @@ -633,7 +633,7 @@ public abstract class AbstractComponentTest extends com.vaadin.tests.components.ComponentTestCase.Command command, boolean defaultValue) { - LinkedHashMap defaultValues = new LinkedHashMap(); + LinkedHashMap defaultValues = new LinkedHashMap<>(); for (String option : options.keySet()) { defaultValues.put(option, defaultValue); @@ -677,7 +677,7 @@ public abstract class AbstractComponentTest extends } protected LinkedHashMap createIntegerOptions(int max) { - LinkedHashMap options = new LinkedHashMap(); + LinkedHashMap options = new LinkedHashMap<>(); for (int i = 0; i <= 9 && i <= max; i++) { options.put(String.valueOf(i), i); } @@ -695,7 +695,7 @@ public abstract class AbstractComponentTest extends } protected LinkedHashMap createDoubleOptions(double max) { - LinkedHashMap options = new LinkedHashMap(); + LinkedHashMap options = new LinkedHashMap<>(); for (double d = 0; d <= max && d < 10; d += 0.5) { options.put(String.valueOf(d), d); } @@ -714,7 +714,7 @@ public abstract class AbstractComponentTest extends protected LinkedHashMap createIconOptions( boolean cacheable) { - LinkedHashMap options = new LinkedHashMap(); + LinkedHashMap options = new LinkedHashMap<>(); options.put("-", null); if (cacheable) { options.put("16x16", ICON_16_USER_PNG_CACHEABLE); diff --git a/uitest/src/main/java/com/vaadin/tests/components/AbstractComponentTestCase.java b/uitest/src/main/java/com/vaadin/tests/components/AbstractComponentTestCase.java index 3e25b01893..bdb1ff3f83 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/AbstractComponentTestCase.java +++ b/uitest/src/main/java/com/vaadin/tests/components/AbstractComponentTestCase.java @@ -35,7 +35,7 @@ public abstract class AbstractComponentTestCase protected static final ThemeResource ICON_64_EMAIL_REPLY_PNG_UNCACHEABLE = uncacheableThemeResource( "../runo/icons/64/email-reply.png"); - private List testComponents = new ArrayList(); + private List testComponents = new ArrayList<>(); abstract protected Class getTestClass(); diff --git a/uitest/src/main/java/com/vaadin/tests/components/AbstractLayoutTest.java b/uitest/src/main/java/com/vaadin/tests/components/AbstractLayoutTest.java index 525e28b41d..82fbaee568 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/AbstractLayoutTest.java +++ b/uitest/src/main/java/com/vaadin/tests/components/AbstractLayoutTest.java @@ -56,7 +56,7 @@ public abstract class AbstractLayoutTest } private void createMarginsSelect(String category) { - LinkedHashMap options = new LinkedHashMap(); + LinkedHashMap options = new LinkedHashMap<>(); options.put("off", new MarginInfo(false)); options.put("all", new MarginInfo(true)); options.put("left", new MarginInfo(false, false, false, true)); @@ -77,7 +77,7 @@ public abstract class AbstractLayoutTest String alignmentCategory = "Component alignment"; createCategory(alignmentCategory, category); - LinkedHashMap options = new LinkedHashMap(); + LinkedHashMap options = new LinkedHashMap<>(); options.put("Top left", Alignment.TOP_LEFT); options.put("Top center", Alignment.TOP_CENTER); options.put("Top right", Alignment.TOP_RIGHT); diff --git a/uitest/src/main/java/com/vaadin/tests/components/AbstractOrderedLayoutTest.java b/uitest/src/main/java/com/vaadin/tests/components/AbstractOrderedLayoutTest.java index b345414459..0e91dd9109 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/AbstractOrderedLayoutTest.java +++ b/uitest/src/main/java/com/vaadin/tests/components/AbstractOrderedLayoutTest.java @@ -55,7 +55,7 @@ public abstract class AbstractOrderedLayoutTest String expandRatioCategory = "Component expand ratio"; createCategory(expandRatioCategory, category); - LinkedHashMap options = new LinkedHashMap(); + LinkedHashMap options = new LinkedHashMap<>(); options.put("0", 0f); options.put("0.5", 0.5f); for (float f = 1; f <= 5; f++) { diff --git a/uitest/src/main/java/com/vaadin/tests/components/ComponentTestCase.java b/uitest/src/main/java/com/vaadin/tests/components/ComponentTestCase.java index 5c73c851a5..2786eb8558 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/ComponentTestCase.java +++ b/uitest/src/main/java/com/vaadin/tests/components/ComponentTestCase.java @@ -67,7 +67,7 @@ public abstract class ComponentTestCase * @return A List with actions to which more actions can be added. */ protected List createActions() { - ArrayList actions = new ArrayList(); + ArrayList actions = new ArrayList<>(); actions.add(createEnabledAction(true)); actions.add(createReadonlyAction(false)); diff --git a/uitest/src/main/java/com/vaadin/tests/components/ErrorMessages.java b/uitest/src/main/java/com/vaadin/tests/components/ErrorMessages.java index 59b1e86483..898c1014fc 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/ErrorMessages.java +++ b/uitest/src/main/java/com/vaadin/tests/components/ErrorMessages.java @@ -14,7 +14,7 @@ public class ErrorMessages extends TestBase { @Override protected void setup() { Button bb = new Button("Button with CompositeError"); - List errors = new ArrayList(); + List errors = new ArrayList<>(); errors.add(new UserError("Error 1")); errors.add(new UserError("Error 2")); bb.setComponentError(new CompositeErrorMessage(errors)); diff --git a/uitest/src/main/java/com/vaadin/tests/components/FileDownloaderUI.java b/uitest/src/main/java/com/vaadin/tests/components/FileDownloaderUI.java index 29c8ab5eaa..141ef664b4 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/FileDownloaderUI.java +++ b/uitest/src/main/java/com/vaadin/tests/components/FileDownloaderUI.java @@ -54,7 +54,7 @@ public class FileDownloaderUI extends AbstractTestUIWithLog { @Override protected void setup(VaadinRequest request) { - List> components = new ArrayList>(); + List> components = new ArrayList<>(); components.add(Button.class); components.add(NativeButton.class); components.add(CssLayout.class); diff --git a/uitest/src/main/java/com/vaadin/tests/components/HierarchicalContainerSorting.java b/uitest/src/main/java/com/vaadin/tests/components/HierarchicalContainerSorting.java index d42dce8512..7f633c307c 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/HierarchicalContainerSorting.java +++ b/uitest/src/main/java/com/vaadin/tests/components/HierarchicalContainerSorting.java @@ -80,7 +80,7 @@ public class HierarchicalContainerSorting extends TestBase { } private static int index = 0; - private static Map nameToId = new HashMap(); + private static Map nameToId = new HashMap<>(); public static void addItem(IndexedContainer container, String string, String parent) { diff --git a/uitest/src/main/java/com/vaadin/tests/components/abstractfield/AbstractComponentDataBindingTest.java b/uitest/src/main/java/com/vaadin/tests/components/abstractfield/AbstractComponentDataBindingTest.java index 763d7752b8..db6479bb0e 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/abstractfield/AbstractComponentDataBindingTest.java +++ b/uitest/src/main/java/com/vaadin/tests/components/abstractfield/AbstractComponentDataBindingTest.java @@ -65,7 +65,7 @@ public abstract class AbstractComponentDataBindingTest extends TestBase protected abstract void createFields(); - private Set fields = new HashSet(); + private Set fields = new HashSet<>(); @Override protected void addComponent(Component c) { diff --git a/uitest/src/main/java/com/vaadin/tests/components/abstractfield/AbstractFieldCommitWithInvalidValues.java b/uitest/src/main/java/com/vaadin/tests/components/abstractfield/AbstractFieldCommitWithInvalidValues.java index feaa1371ec..a9256e68e7 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/abstractfield/AbstractFieldCommitWithInvalidValues.java +++ b/uitest/src/main/java/com/vaadin/tests/components/abstractfield/AbstractFieldCommitWithInvalidValues.java @@ -26,7 +26,7 @@ public class AbstractFieldCommitWithInvalidValues extends TestBase { @Override protected void setup() { tf = new TextField("A field, must contain 1-2 chars", - new ObjectProperty("a")); + new ObjectProperty<>("a")); tf.addValidator( new StringLengthValidator("Invalid length", 1, 2, false)); tf.setBuffered(true); diff --git a/uitest/src/main/java/com/vaadin/tests/components/abstractfield/AbstractFieldDataSourceReadOnly.java b/uitest/src/main/java/com/vaadin/tests/components/abstractfield/AbstractFieldDataSourceReadOnly.java index 27f15cee3f..1f69c96be3 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/abstractfield/AbstractFieldDataSourceReadOnly.java +++ b/uitest/src/main/java/com/vaadin/tests/components/abstractfield/AbstractFieldDataSourceReadOnly.java @@ -10,7 +10,7 @@ import com.vaadin.v7.ui.TextField; public class AbstractFieldDataSourceReadOnly extends TestBase { private static class StateHolder { - private ObjectProperty textField = new ObjectProperty( + private ObjectProperty textField = new ObjectProperty<>( ""); public ObjectProperty getTextField() { diff --git a/uitest/src/main/java/com/vaadin/tests/components/abstractfield/DateFieldBackedByString.java b/uitest/src/main/java/com/vaadin/tests/components/abstractfield/DateFieldBackedByString.java index a3595b36b5..384b8be17a 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/abstractfield/DateFieldBackedByString.java +++ b/uitest/src/main/java/com/vaadin/tests/components/abstractfield/DateFieldBackedByString.java @@ -11,7 +11,7 @@ public class DateFieldBackedByString extends AbstractComponentDataBindingTest { DateField df = new DateField("Date field"); addComponent(df); df.setPropertyDataSource( - new com.vaadin.v7.data.util.ObjectProperty(s, + new com.vaadin.v7.data.util.ObjectProperty<>(s, String.class)); } diff --git a/uitest/src/main/java/com/vaadin/tests/components/abstractfield/DateFieldBasedOnLong.java b/uitest/src/main/java/com/vaadin/tests/components/abstractfield/DateFieldBasedOnLong.java index b4a2906576..b9fb03ad8f 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/abstractfield/DateFieldBasedOnLong.java +++ b/uitest/src/main/java/com/vaadin/tests/components/abstractfield/DateFieldBasedOnLong.java @@ -16,7 +16,7 @@ public class DateFieldBasedOnLong extends AbstractComponentDataBindingTest { protected void createFields() { PopupDateField pdf = new PopupDateField("DateField"); addComponent(pdf); - property = new ObjectProperty(l, Long.class); + property = new ObjectProperty<>(l, Long.class); pdf.setPropertyDataSource(property); property.setValue(new Date(2011 - 1900, 4, 6).getTime()); diff --git a/uitest/src/main/java/com/vaadin/tests/components/abstractfield/IntegerDoubleFieldsWithDataSource.java b/uitest/src/main/java/com/vaadin/tests/components/abstractfield/IntegerDoubleFieldsWithDataSource.java index f436c4aca3..d5b8bdbb68 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/abstractfield/IntegerDoubleFieldsWithDataSource.java +++ b/uitest/src/main/java/com/vaadin/tests/components/abstractfield/IntegerDoubleFieldsWithDataSource.java @@ -23,14 +23,14 @@ public class IntegerDoubleFieldsWithDataSource extends TestBase { tf = createIntegerTextField(); tf.setCaption("Enter a double"); - tf.setPropertyDataSource(new ObjectProperty(2.1)); + tf.setPropertyDataSource(new ObjectProperty<>(2.1)); tf.addValidator(new DoubleValidator("Must be a Double")); addComponent(tf); } private TextField createIntegerTextField() { final TextField tf = new TextField("Enter an integer"); - tf.setPropertyDataSource(new ObjectProperty(new Integer(2))); + tf.setPropertyDataSource(new ObjectProperty<>(new Integer(2))); tf.setImmediate(true); tf.addListener(new ValueChangeListener() { diff --git a/uitest/src/main/java/com/vaadin/tests/components/abstractfield/LegacyAbstractFieldTest.java b/uitest/src/main/java/com/vaadin/tests/components/abstractfield/LegacyAbstractFieldTest.java index 7829adf626..fd0e815ec9 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/abstractfield/LegacyAbstractFieldTest.java +++ b/uitest/src/main/java/com/vaadin/tests/components/abstractfield/LegacyAbstractFieldTest.java @@ -82,7 +82,7 @@ public abstract class LegacyAbstractFieldTest } private void createRequiredErrorSelect(String category) { - LinkedHashMap options = new LinkedHashMap(); + LinkedHashMap options = new LinkedHashMap<>(); options.put("-", null); options.put(TEXT_SHORT, TEXT_SHORT); options.put("Medium", TEXT_MEDIUM); @@ -191,7 +191,7 @@ public abstract class LegacyAbstractFieldTest protected void createSetTextValueAction(String category) { String subCategory = "Set text value"; createCategory(subCategory, category); - List values = new ArrayList(); + List values = new ArrayList<>(); values.add("Test"); values.add("A little longer value"); values.add( diff --git a/uitest/src/main/java/com/vaadin/tests/components/abstractfield/RequiredIndicatorForFieldsWithoutCaption.java b/uitest/src/main/java/com/vaadin/tests/components/abstractfield/RequiredIndicatorForFieldsWithoutCaption.java index 6cacd68b59..f8a237417b 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/abstractfield/RequiredIndicatorForFieldsWithoutCaption.java +++ b/uitest/src/main/java/com/vaadin/tests/components/abstractfield/RequiredIndicatorForFieldsWithoutCaption.java @@ -18,7 +18,7 @@ import com.vaadin.v7.ui.Field; import com.vaadin.v7.ui.TextField; public class RequiredIndicatorForFieldsWithoutCaption extends AbstractTestUI { - private Set fields = new HashSet(); + private Set fields = new HashSet<>(); @Override protected void setup(VaadinRequest request) { diff --git a/uitest/src/main/java/com/vaadin/tests/components/abstractfield/TextFieldConversions.java b/uitest/src/main/java/com/vaadin/tests/components/abstractfield/TextFieldConversions.java index 1158f677ff..4ee2eac6fd 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/abstractfield/TextFieldConversions.java +++ b/uitest/src/main/java/com/vaadin/tests/components/abstractfield/TextFieldConversions.java @@ -33,7 +33,7 @@ public class TextFieldConversions extends AbstractComponentDataBindingTest { @Override public void valueChange(ValueChangeEvent event) { - tf.setPropertyDataSource(new ObjectProperty(o, + tf.setPropertyDataSource(new ObjectProperty<>(o, (Class) dataType.getValue())); } }); diff --git a/uitest/src/main/java/com/vaadin/tests/components/accordion/RemoveTabs.java b/uitest/src/main/java/com/vaadin/tests/components/accordion/RemoveTabs.java index e82336c1e8..7ca7185500 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/accordion/RemoveTabs.java +++ b/uitest/src/main/java/com/vaadin/tests/components/accordion/RemoveTabs.java @@ -109,7 +109,7 @@ public class RemoveTabs extends TestBase { AbstractComponentContainer container = accordion; if (container != null) { - List c = new ArrayList(); + List c = new ArrayList<>(); Iterator i = container.iterator(); while (i.hasNext()) { Component comp = i.next(); diff --git a/uitest/src/main/java/com/vaadin/tests/components/beanitemcontainer/BeanItemContainerGenerator.java b/uitest/src/main/java/com/vaadin/tests/components/beanitemcontainer/BeanItemContainerGenerator.java index 2e5235c78b..6804983ed3 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/beanitemcontainer/BeanItemContainerGenerator.java +++ b/uitest/src/main/java/com/vaadin/tests/components/beanitemcontainer/BeanItemContainerGenerator.java @@ -14,7 +14,7 @@ public class BeanItemContainerGenerator { public static BeanItemContainer createContainer(int size, long seed) { - BeanItemContainer container = new BeanItemContainer( + BeanItemContainer container = new BeanItemContainer<>( TestBean.class); PortableRandom r = new PortableRandom(seed); for (int i = 0; i < size; i++) { diff --git a/uitest/src/main/java/com/vaadin/tests/components/beanitemcontainer/TestBeanItemContainerUsage.java b/uitest/src/main/java/com/vaadin/tests/components/beanitemcontainer/TestBeanItemContainerUsage.java index 8612e60475..36c086515f 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/beanitemcontainer/TestBeanItemContainerUsage.java +++ b/uitest/src/main/java/com/vaadin/tests/components/beanitemcontainer/TestBeanItemContainerUsage.java @@ -24,12 +24,12 @@ public class TestBeanItemContainerUsage extends TestBase { Table t = new Table("Table containing Persons"); t.setPageLength(5); t.setWidth("100%"); - List persons = new ArrayList(); + List persons = new ArrayList<>(); persons.add(new Person("Jones", "Birchman", 35)); persons.add(new Person("Marc", "Smith", 30)); persons.add(new Person("Greg", "Sandman", 75)); - BeanItemContainer bic = new BeanItemContainer(persons); + BeanItemContainer bic = new BeanItemContainer<>(persons); t.setContainerDataSource(bic); addComponent(t); diff --git a/uitest/src/main/java/com/vaadin/tests/components/calendar/BeanItemContainerTestUI.java b/uitest/src/main/java/com/vaadin/tests/components/calendar/BeanItemContainerTestUI.java index 0ca638fa19..e9d50a3a7e 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/calendar/BeanItemContainerTestUI.java +++ b/uitest/src/main/java/com/vaadin/tests/components/calendar/BeanItemContainerTestUI.java @@ -44,7 +44,7 @@ public class BeanItemContainerTestUI extends UI { private Table table; - private BeanItemContainer events = new BeanItemContainer( + private BeanItemContainer events = new BeanItemContainer<>( BasicEvent.class); @SuppressWarnings("deprecation") @@ -157,7 +157,7 @@ public class BeanItemContainerTestUI extends UI { fieldGroup.bind(startField, ContainerEventProvider.STARTDATE_PROPERTY); fieldGroup.bind(endField, ContainerEventProvider.ENDDATE_PROPERTY); - fieldGroup.setItemDataSource(new BeanItem(event, + fieldGroup.setItemDataSource(new BeanItem<>(event, Arrays.asList(ContainerEventProvider.CAPTION_PROPERTY, ContainerEventProvider.DESCRIPTION_PROPERTY, ContainerEventProvider.STARTDATE_PROPERTY, diff --git a/uitest/src/main/java/com/vaadin/tests/components/calendar/CalendarActionEventSource.java b/uitest/src/main/java/com/vaadin/tests/components/calendar/CalendarActionEventSource.java index 7218c29248..9eb409de45 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/calendar/CalendarActionEventSource.java +++ b/uitest/src/main/java/com/vaadin/tests/components/calendar/CalendarActionEventSource.java @@ -45,7 +45,7 @@ public class CalendarActionEventSource extends AbstractTestUI { public List getEvents( Date startDate, Date endDate) { - List events = new ArrayList(); + List events = new ArrayList<>(); CalendarEvent event = null; try { diff --git a/uitest/src/main/java/com/vaadin/tests/components/calendar/CalendarActionsMenuTest.java b/uitest/src/main/java/com/vaadin/tests/components/calendar/CalendarActionsMenuTest.java index 818eea0680..9fdf1e24d6 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/calendar/CalendarActionsMenuTest.java +++ b/uitest/src/main/java/com/vaadin/tests/components/calendar/CalendarActionsMenuTest.java @@ -49,7 +49,7 @@ public class CalendarActionsMenuTest extends AbstractTestUI { public List getEvents( Date startDate, Date endDate) { - List events = new ArrayList(); + List events = new ArrayList<>(); CalendarEvent event = null; try { diff --git a/uitest/src/main/java/com/vaadin/tests/components/calendar/CalendarHtmlInEvents.java b/uitest/src/main/java/com/vaadin/tests/components/calendar/CalendarHtmlInEvents.java index c3742e2797..8bb73fe14b 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/calendar/CalendarHtmlInEvents.java +++ b/uitest/src/main/java/com/vaadin/tests/components/calendar/CalendarHtmlInEvents.java @@ -72,7 +72,7 @@ public class CalendarHtmlInEvents extends AbstractTestUIWithLog { @Override public List getEvents(Date startDate, Date endDate) { Date d = startDate; - ArrayList events = new ArrayList(); + ArrayList events = new ArrayList<>(); while (d.before(endDate)) { BasicEvent ce = new BasicEvent(); ce.setAllDay(false); diff --git a/uitest/src/main/java/com/vaadin/tests/components/calendar/CalendarNotifications.java b/uitest/src/main/java/com/vaadin/tests/components/calendar/CalendarNotifications.java index 2ee8288ed3..7bd0bf1f88 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/calendar/CalendarNotifications.java +++ b/uitest/src/main/java/com/vaadin/tests/components/calendar/CalendarNotifications.java @@ -40,7 +40,7 @@ public class CalendarNotifications extends AbstractTestUIWithLog { private static class DummyEventProvider implements CalendarEventProvider { private int index; - private List events = new ArrayList(); + private List events = new ArrayList<>(); public void addEvent(Date date) { BasicEvent e = new BasicEvent(); diff --git a/uitest/src/main/java/com/vaadin/tests/components/calendar/CalendarResizeOverlappingEvents.java b/uitest/src/main/java/com/vaadin/tests/components/calendar/CalendarResizeOverlappingEvents.java index ef9761afb7..b7c2780ed8 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/calendar/CalendarResizeOverlappingEvents.java +++ b/uitest/src/main/java/com/vaadin/tests/components/calendar/CalendarResizeOverlappingEvents.java @@ -49,7 +49,7 @@ public class CalendarResizeOverlappingEvents extends AbstractTestUI { public List getEvents(Date startDate, Date endDate) { DateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); DateFormat dayFormat = new SimpleDateFormat("yyyy-MM-dd"); - List events = new ArrayList(); + List events = new ArrayList<>(); try { java.util.Calendar today = java.util.Calendar.getInstance(); diff --git a/uitest/src/main/java/com/vaadin/tests/components/calendar/NotificationTestUI.java b/uitest/src/main/java/com/vaadin/tests/components/calendar/NotificationTestUI.java index 8c14211e18..a5648abf19 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/calendar/NotificationTestUI.java +++ b/uitest/src/main/java/com/vaadin/tests/components/calendar/NotificationTestUI.java @@ -39,7 +39,7 @@ public class NotificationTestUI extends UI { private static class DummyEventProvider implements CalendarEventProvider { private int index; - private List events = new ArrayList(); + private List events = new ArrayList<>(); public void addEvent(Date date) { BasicEvent e = new BasicEvent(); diff --git a/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxClickIcon.java b/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxClickIcon.java index 7b47bed2c8..8cb6ab3ba8 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxClickIcon.java +++ b/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxClickIcon.java @@ -32,7 +32,7 @@ public class ComboBoxClickIcon extends AbstractTestUI { @Override protected void setup(VaadinRequest request) { - final List items = new ArrayList(); + final List items = new ArrayList<>(); items.add("A"); items.add("B"); items.add("C"); diff --git a/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxDuplicateCaption.java b/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxDuplicateCaption.java index c0316892d9..2a4d57c97f 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxDuplicateCaption.java +++ b/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxDuplicateCaption.java @@ -18,7 +18,7 @@ public class ComboBoxDuplicateCaption extends TestBase { @Override protected void setup() { - List list = new ArrayList(); + List list = new ArrayList<>(); Person p1 = new Person(); p1.setFirstName("John"); p1.setLastName("Doe"); @@ -29,7 +29,7 @@ public class ComboBoxDuplicateCaption extends TestBase { p2.setLastName("Doe"); list.add(p2); - BeanItemContainer container = new BeanItemContainer( + BeanItemContainer container = new BeanItemContainer<>( Person.class); container.addAll(list); diff --git a/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxes2.java b/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxes2.java index b92b6c18a6..172d930cb3 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxes2.java +++ b/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxes2.java @@ -68,7 +68,7 @@ public class ComboBoxes2 extends AbstractSelectTestCase { } private void createFilteringModeAction(String category) { - LinkedHashMap options = new LinkedHashMap(); + LinkedHashMap options = new LinkedHashMap<>(); options.put("Off", FilteringMode.OFF); options.put("Contains", FilteringMode.CONTAINS); options.put("Starts with", FilteringMode.STARTSWITH); @@ -79,7 +79,7 @@ public class ComboBoxes2 extends AbstractSelectTestCase { } private void createItemStyleGeneratorAction(String category) { - LinkedHashMap options = new LinkedHashMap(); + LinkedHashMap options = new LinkedHashMap<>(); options.put("-", null); options.put("Bold fives", new ItemStyleGenerator() { @Override @@ -96,7 +96,7 @@ public class ComboBoxes2 extends AbstractSelectTestCase { } private void createInputPromptAction(String category) { - LinkedHashMap options = new LinkedHashMap(); + LinkedHashMap options = new LinkedHashMap<>(); options.put("-", null); options.put("Enter a value", "Enter a value"); options.put("- Click here -", "- Click here -"); diff --git a/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboFocusBlurEvents.java b/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboFocusBlurEvents.java index 84141e0785..17a0405690 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboFocusBlurEvents.java +++ b/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboFocusBlurEvents.java @@ -20,7 +20,7 @@ public class ComboFocusBlurEvents extends TestBase { @Override protected void setup() { - List list = new ArrayList(); + List list = new ArrayList<>(); for (int i = 0; i < 100; i++) { list.add("Item " + i); } @@ -31,7 +31,7 @@ public class ComboFocusBlurEvents extends TestBase { cb.setDescription("Some Combobox"); addComponent(cb); - final ObjectProperty log = new ObjectProperty(""); + final ObjectProperty log = new ObjectProperty<>(""); cb.addFocusListener(new FieldEvents.FocusListener() { @Override diff --git a/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboPushTiming.java b/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboPushTiming.java index e6c70dafb6..18ac8ca8be 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboPushTiming.java +++ b/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboPushTiming.java @@ -26,7 +26,7 @@ public class ComboPushTiming extends TestBase { @Override protected void setup() { - List list = new ArrayList(); + List list = new ArrayList<>(); for (int i = 0; i < 100; i++) { list.add("Item " + i); } @@ -37,7 +37,7 @@ public class ComboPushTiming extends TestBase { cb.setDescription("Some Combobox"); addComponent(cb); - final ObjectProperty log = new ObjectProperty(""); + final ObjectProperty log = new ObjectProperty<>(""); cb.addFocusListener(new FieldEvents.FocusListener() { @Override diff --git a/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboboxMenuBarAutoopen.java b/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboboxMenuBarAutoopen.java index b60a08cd8b..83f94aac8b 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboboxMenuBarAutoopen.java +++ b/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboboxMenuBarAutoopen.java @@ -38,7 +38,7 @@ public class ComboboxMenuBarAutoopen extends AbstractTestUI { protected void setup(VaadinRequest request) { HorizontalLayout layout = new HorizontalLayout(); layout.setSpacing(true); - ArrayList options = new ArrayList(); + ArrayList options = new ArrayList<>(); options.add("1"); options.add("2"); options.add("3"); diff --git a/uitest/src/main/java/com/vaadin/tests/components/combobox/Comboboxes.java b/uitest/src/main/java/com/vaadin/tests/components/combobox/Comboboxes.java index e2da8be910..e5c4a33992 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/combobox/Comboboxes.java +++ b/uitest/src/main/java/com/vaadin/tests/components/combobox/Comboboxes.java @@ -126,7 +126,7 @@ public class Comboboxes extends ComponentTestCase { private Component createIconSelect() { - LinkedHashMap options = new LinkedHashMap(); + LinkedHashMap options = new LinkedHashMap<>(); options.put("", null); options.put("16x16", "../runo/icons/16/user.png"); options.put("32x32", "../runo/icons/32/attention.png"); diff --git a/uitest/src/main/java/com/vaadin/tests/components/datefield/CustomDateFormats.java b/uitest/src/main/java/com/vaadin/tests/components/datefield/CustomDateFormats.java index 2a231e6534..534c92d5f4 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/datefield/CustomDateFormats.java +++ b/uitest/src/main/java/com/vaadin/tests/components/datefield/CustomDateFormats.java @@ -132,7 +132,7 @@ public class CustomDateFormats extends TestBase { } - private Set usedDebugIds = new HashSet(); + private Set usedDebugIds = new HashSet<>(); private void addDateField(GridLayout gridLayout, String pattern, Locale locale, String expectedDateFormat) { diff --git a/uitest/src/main/java/com/vaadin/tests/components/datefield/DateFieldEmptyValid.java b/uitest/src/main/java/com/vaadin/tests/components/datefield/DateFieldEmptyValid.java index 2b660b8b0b..30a34e4fc4 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/datefield/DateFieldEmptyValid.java +++ b/uitest/src/main/java/com/vaadin/tests/components/datefield/DateFieldEmptyValid.java @@ -88,7 +88,7 @@ public class DateFieldEmptyValid extends TestBase { @SuppressWarnings("deprecation") public void buttonClick(ClickEvent event) { log.log("Setting new object property (5.6.2000) to datefield"); - ObjectProperty dfProp = new ObjectProperty( + ObjectProperty dfProp = new ObjectProperty<>( new Date(2000 - 1900, 6 - 1, 5), Date.class); df.setPropertyDataSource(dfProp); } @@ -105,7 +105,7 @@ public class DateFieldEmptyValid extends TestBase { @SuppressWarnings("deprecation") public void buttonClick(ClickEvent event) { log.log("Setting object property (with value null) to datefield and set value of property to 27.8.2005"); - ObjectProperty dfProp = new ObjectProperty(null, + ObjectProperty dfProp = new ObjectProperty<>(null, Date.class); df.setPropertyDataSource(dfProp); dfProp.setValue(new Date(2005 - 1900, 8 - 1, 27)); diff --git a/uitest/src/main/java/com/vaadin/tests/components/datefield/DateFieldRangeValidation.java b/uitest/src/main/java/com/vaadin/tests/components/datefield/DateFieldRangeValidation.java index c6422891fb..7a1717cdb6 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/datefield/DateFieldRangeValidation.java +++ b/uitest/src/main/java/com/vaadin/tests/components/datefield/DateFieldRangeValidation.java @@ -61,7 +61,7 @@ public class DateFieldRangeValidation extends TestBase { @Override protected void setup() { - BeanItem bi = new BeanItem(range); + BeanItem bi = new BeanItem<>(range); range.setFrom(new Date(2011 - 1900, 12 - 1, 4)); range.setTo(new Date(2011 - 1900, 12 - 1, 15)); diff --git a/uitest/src/main/java/com/vaadin/tests/components/datefield/DateFieldTest.java b/uitest/src/main/java/com/vaadin/tests/components/datefield/DateFieldTest.java index d8a165fa23..155ce35059 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/datefield/DateFieldTest.java +++ b/uitest/src/main/java/com/vaadin/tests/components/datefield/DateFieldTest.java @@ -42,7 +42,7 @@ public class DateFieldTest } private void createSetValueAction(String category) { - LinkedHashMap options = new LinkedHashMap(); + LinkedHashMap options = new LinkedHashMap<>(); options.put("(null)", null); options.put("(current time)", new Date()); Calendar c = Calendar.getInstance(new Locale("fi", "FI")); @@ -58,7 +58,7 @@ public class DateFieldTest } private void createDateFormatSelectAction(String category) { - LinkedHashMap options = new LinkedHashMap(); + LinkedHashMap options = new LinkedHashMap<>(); options.put("-", null); options.put("d M yyyy", "d M yyyy"); @@ -98,7 +98,7 @@ public class DateFieldTest } private void createResolutionSelectAction(String category) { - LinkedHashMap options = new LinkedHashMap(); + LinkedHashMap options = new LinkedHashMap<>(); options.put("Year", Resolution.YEAR); options.put("Month", Resolution.MONTH); options.put("Day", Resolution.DAY); diff --git a/uitest/src/main/java/com/vaadin/tests/components/datefield/DateFieldTimezone.java b/uitest/src/main/java/com/vaadin/tests/components/datefield/DateFieldTimezone.java index 33d1c659f0..69b331287b 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/datefield/DateFieldTimezone.java +++ b/uitest/src/main/java/com/vaadin/tests/components/datefield/DateFieldTimezone.java @@ -29,7 +29,7 @@ public class DateFieldTimezone extends TestBase { protected void setup() { dateField.setResolution(Resolution.SECOND); - ArrayList timeZoneCodes = new ArrayList(); + ArrayList timeZoneCodes = new ArrayList<>(); timeZoneCodes.add(nullValue); timeZoneCodes.addAll(Arrays.asList(TimeZone.getAvailableIDs())); ComboBox timezoneSelector = new ComboBox("Select time zone", diff --git a/uitest/src/main/java/com/vaadin/tests/components/datefield/InlineDateFields.java b/uitest/src/main/java/com/vaadin/tests/components/datefield/InlineDateFields.java index 669d691634..8136097040 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/datefield/InlineDateFields.java +++ b/uitest/src/main/java/com/vaadin/tests/components/datefield/InlineDateFields.java @@ -70,7 +70,7 @@ public class InlineDateFields extends ComponentTestCase { } private Component createResolutionSelectAction() { - LinkedHashMap options = new LinkedHashMap(); + LinkedHashMap options = new LinkedHashMap<>(); options.put("Year", Resolution.YEAR); options.put("Month", Resolution.MONTH); options.put("Day", Resolution.DAY); @@ -90,7 +90,7 @@ public class InlineDateFields extends ComponentTestCase { } private Component createLocaleSelectAction() { - LinkedHashMap options = new LinkedHashMap(); + LinkedHashMap options = new LinkedHashMap<>(); for (Locale locale : LOCALES) { options.put(locale.toString(), locale); } diff --git a/uitest/src/main/java/com/vaadin/tests/components/datefield/LegacyDateFieldTest.java b/uitest/src/main/java/com/vaadin/tests/components/datefield/LegacyDateFieldTest.java index 7f3b3872dc..8d42f1a561 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/datefield/LegacyDateFieldTest.java +++ b/uitest/src/main/java/com/vaadin/tests/components/datefield/LegacyDateFieldTest.java @@ -42,7 +42,7 @@ public class LegacyDateFieldTest } private void createSetValueAction(String category) { - LinkedHashMap options = new LinkedHashMap(); + LinkedHashMap options = new LinkedHashMap<>(); options.put("(null)", null); options.put("(current time)", new Date()); Calendar c = Calendar.getInstance(new Locale("fi", "FI")); @@ -58,7 +58,7 @@ public class LegacyDateFieldTest } private void createDateFormatSelectAction(String category) { - LinkedHashMap options = new LinkedHashMap(); + LinkedHashMap options = new LinkedHashMap<>(); options.put("-", null); options.put("d M yyyy", "d M yyyy"); @@ -98,7 +98,7 @@ public class LegacyDateFieldTest } private void createResolutionSelectAction(String category) { - LinkedHashMap options = new LinkedHashMap(); + LinkedHashMap options = new LinkedHashMap<>(); options.put("Year", Resolution.YEAR); options.put("Month", Resolution.MONTH); options.put("Day", Resolution.DAY); diff --git a/uitest/src/main/java/com/vaadin/tests/components/datefield/LegacyPopupDateFieldTest.java b/uitest/src/main/java/com/vaadin/tests/components/datefield/LegacyPopupDateFieldTest.java index 1ce55d97b7..bdc29c64bc 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/datefield/LegacyPopupDateFieldTest.java +++ b/uitest/src/main/java/com/vaadin/tests/components/datefield/LegacyPopupDateFieldTest.java @@ -21,7 +21,7 @@ public class LegacyPopupDateFieldTest } private void createInputPromptSelectAction(String category) { - LinkedHashMap options = new LinkedHashMap(); + LinkedHashMap options = new LinkedHashMap<>(); options.put("", null); options.put("Please enter date", "Please enter date"); options.put("åäöÅÄÖ", "åäöÅÄÖ"); diff --git a/uitest/src/main/java/com/vaadin/tests/components/datefield/PopupDateFieldTest.java b/uitest/src/main/java/com/vaadin/tests/components/datefield/PopupDateFieldTest.java index 6e3250a825..54a23b5666 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/datefield/PopupDateFieldTest.java +++ b/uitest/src/main/java/com/vaadin/tests/components/datefield/PopupDateFieldTest.java @@ -20,7 +20,7 @@ public class PopupDateFieldTest extends DateFieldTest { } private void createInputPromptSelectAction(String category) { - LinkedHashMap options = new LinkedHashMap(); + LinkedHashMap options = new LinkedHashMap<>(); options.put("", null); options.put("Please enter date", "Please enter date"); options.put("åäöÅÄÖ", "åäöÅÄÖ"); diff --git a/uitest/src/main/java/com/vaadin/tests/components/datefield/PopupDateFields.java b/uitest/src/main/java/com/vaadin/tests/components/datefield/PopupDateFields.java index 9bc567c0fc..60e90a8f1b 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/datefield/PopupDateFields.java +++ b/uitest/src/main/java/com/vaadin/tests/components/datefield/PopupDateFields.java @@ -66,7 +66,7 @@ public class PopupDateFields extends ComponentTestCase { } private Component createResolutionSelectAction() { - LinkedHashMap options = new LinkedHashMap(); + LinkedHashMap options = new LinkedHashMap<>(); options.put("Year", Resolution.YEAR); options.put("Month", Resolution.MONTH); options.put("Day", Resolution.DAY); @@ -86,7 +86,7 @@ public class PopupDateFields extends ComponentTestCase { } private Component createInputPromptSelectAction() { - LinkedHashMap options = new LinkedHashMap(); + LinkedHashMap options = new LinkedHashMap<>(); options.put("", null); options.put("Please enter date", "Please enter date"); options.put("åäöÅÄÖ", "åäöÅÄÖ"); diff --git a/uitest/src/main/java/com/vaadin/tests/components/datefield/RequiredInvalidDateField.java b/uitest/src/main/java/com/vaadin/tests/components/datefield/RequiredInvalidDateField.java index d4c48ac47e..29669e2a75 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/datefield/RequiredInvalidDateField.java +++ b/uitest/src/main/java/com/vaadin/tests/components/datefield/RequiredInvalidDateField.java @@ -54,7 +54,7 @@ public class RequiredInvalidDateField extends TestBase { }; // not required - Property dateProperty1 = new ObjectProperty(date); + Property dateProperty1 = new ObjectProperty<>(date); DateField dateField1 = new DateField("Not required", dateProperty1); dateField1.setLocale(new Locale("fi", "FI")); dateField1.setResolution(DateField.RESOLUTION_DAY); @@ -64,7 +64,7 @@ public class RequiredInvalidDateField extends TestBase { addComponent(dateField1); // required - Property dateProperty2 = new ObjectProperty(date); + Property dateProperty2 = new ObjectProperty<>(date); DateField dateField2 = new DateField("Required", dateProperty2); dateField2.setLocale(new Locale("fi", "FI")); dateField2.setResolution(DateField.RESOLUTION_DAY); diff --git a/uitest/src/main/java/com/vaadin/tests/components/datefield/ValueThroughProperty.java b/uitest/src/main/java/com/vaadin/tests/components/datefield/ValueThroughProperty.java index 98e94c49ee..e12004b515 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/datefield/ValueThroughProperty.java +++ b/uitest/src/main/java/com/vaadin/tests/components/datefield/ValueThroughProperty.java @@ -16,7 +16,7 @@ import com.vaadin.v7.ui.Label; import com.vaadin.v7.ui.PopupDateField; public class ValueThroughProperty extends TestBase { - private final Property dateProperty = new ObjectProperty(null, + private final Property dateProperty = new ObjectProperty<>(null, Date.class); @Override diff --git a/uitest/src/main/java/com/vaadin/tests/components/javascriptcomponent/BasicJavaScriptComponent.java b/uitest/src/main/java/com/vaadin/tests/components/javascriptcomponent/BasicJavaScriptComponent.java index f7db90acd9..0c8d2d8dd8 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/javascriptcomponent/BasicJavaScriptComponent.java +++ b/uitest/src/main/java/com/vaadin/tests/components/javascriptcomponent/BasicJavaScriptComponent.java @@ -48,7 +48,7 @@ public class BasicJavaScriptComponent extends AbstractTestUI { } public static class TestState extends JavaScriptComponentState { - private List messages = new ArrayList(); + private List messages = new ArrayList<>(); private URLReference url; public List getMessages() { diff --git a/uitest/src/main/java/com/vaadin/tests/components/label/LabelPropertySourceValue.java b/uitest/src/main/java/com/vaadin/tests/components/label/LabelPropertySourceValue.java index bbce7b7744..c51e24ceff 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/label/LabelPropertySourceValue.java +++ b/uitest/src/main/java/com/vaadin/tests/components/label/LabelPropertySourceValue.java @@ -19,7 +19,7 @@ public class LabelPropertySourceValue extends AbstractTestUI { button.addClickListener(new ClickListener() { @Override public void buttonClick(ClickEvent event) { - ObjectProperty p = new ObjectProperty( + ObjectProperty p = new ObjectProperty<>( "This text should appear on the label after clicking the button."); label.setPropertyDataSource(p); diff --git a/uitest/src/main/java/com/vaadin/tests/components/label/LabelTest.java b/uitest/src/main/java/com/vaadin/tests/components/label/LabelTest.java index 0fe39fb6b1..f81ed25db9 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/label/LabelTest.java +++ b/uitest/src/main/java/com/vaadin/tests/components/label/LabelTest.java @@ -41,7 +41,7 @@ public class LabelTest extends AbstractComponentTest