You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@netbeans.apache.org by bw...@apache.org on 2023/02/14 05:10:10 UTC
[netbeans] branch master updated: Removed a lot of compiler warnings (#5487)
This is an automated email from the ASF dual-hosted git repository.
bwalker pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git
The following commit(s) were added to refs/heads/master by this push:
new 55430b4c5c Removed a lot of compiler warnings (#5487)
55430b4c5c is described below
commit 55430b4c5cd94fd08e8c7c4d75c3358a2a2dc60e
Author: Andrei Briukhov <an...@gmail.com>
AuthorDate: Tue Feb 14 08:10:00 2023 +0300
Removed a lot of compiler warnings (#5487)
Inserted diamond in constructions like this:
ArrayList<Strings> = new ArrayList();
No any interfaces was changed
---
.../refactoring/NbMoveRefactoringPlugin.java | 4 +--
.../cordova/platforms/ios/IOSDebugTransport.java | 4 +--
.../modules/cordova/platforms/ios/PlistTest.java | 2 +-
.../j2ee/jboss4/customizer/CustomizerSupport.java | 2 +-
.../j2ee/weblogic9/j2ee/WLJ2eePlatformFactory.java | 2 +-
.../j2ee/weblogic9/ui/nodes/Customizer.java | 2 +-
.../metro/model/catalog/MetroSchemaCatalog.java | 2 +-
.../wsitconf/wsdlmodelext/WSITModelSupport.java | 4 +--
.../websvc/wsitconf/wsdlmodelext/ProfileTest.java | 2 +-
.../wsitmodelext/catalog/WSITSchemaCatalog.java | 2 +-
.../cloud/oracle/adm/VulnerabilityWorker.java | 16 ++++-----
.../deployment/devmodules/api/J2eePlatform.java | 2 +-
.../modules/j2ee/deployment/impl/Server.java | 2 +-
.../deployment/impl/ServerFileDistributor.java | 2 +-
.../j2ee/deployment/impl/ServerRegistry.java | 6 ++--
.../deployment/plugins/api/ServerProgress.java | 2 +-
.../wildfly/customizer/CustomizerSupport.java | 2 +-
.../payara/tooling/data/PayaraContainer.java | 2 +-
.../tomcat5/customizer/CustomizerSupport.java | 2 +-
.../org/netbeans/modules/tomcat5/util/Utils.java | 4 +--
.../netbeans/test/web/core/syntax/TestBase2.java | 2 +-
.../netbeans/modules/web/core/test/TestUtil.java | 2 +-
.../editor/index/ResourcesMappingModelTest.java | 2 +-
.../web/jsf/wizards/ManagedBeanPanelVisual.java | 2 +-
.../web/jsf/wizards/TemplatePanelVisual.java | 2 +-
.../web/jsf/refactoring/ModificationsTest.java | 2 +-
.../netbeans/modules/web/jspparser/TestUtil.java | 2 +-
.../modules/web/project/test/TestUtil.java | 2 +-
.../rest/wizard/fromdb/EjbFacadeGenerator.java | 2 +-
.../ide/ergonomics/fod/ConfigurationPanelTest.java | 4 +--
.../gradle/tooling/NbProjectInfoBuilder.java | 8 ++---
.../org/netbeans/api/debugger/ActionsManager.java | 2 +-
.../ui/repository/RepositoryComboSupport.java | 2 +-
.../db/sql/execute/ui/util/TestCaseContext.java | 2 +-
.../modules/db/explorer/node/RootNodeTest.java | 2 +-
.../editor/fold/FoldHierarchyTransactionImpl.java | 2 +-
.../netbeans/modules/editor/fold/FoldRegistry.java | 2 +-
.../netbeans/editor/ext/KeywordMatchGenerator.java | 2 +-
.../editor/impl/ComplexValueSettingsFactory.java | 2 +-
.../options/indentation/FormattingPanel.java | 2 +-
.../ProjectTemplateAttributesProviderTest.java | 2 +-
.../modules/refactoring/spi/RefactoringCommit.java | 2 +-
.../refactoring/spi/impl/PreviewManager.java | 2 +-
.../refactoring/spi/impl/RefactoringPanel.java | 2 +-
.../refactoring/spi/impl/UndoableWrapper.java | 2 +-
.../modules/debugger/ui/eval/CodeEvaluatorUI.java | 2 +-
.../org/netbeans/api/debugger/PropertiesTest.java | 2 +-
.../modules/terminal/T3_HardClose_Test.java | 8 ++---
.../modules/openfile/OpenFileDialogFilter.java | 2 +-
.../modules/xml/axi/impl/SchemaUpdate.java | 2 +-
.../modules/xml/dtd/grammar/DTDParser.java | 6 ++--
.../xml/schema/model/impl/RefactorVisitor.java | 2 +-
.../modules/xml/schema/model/SchemaTest.java | 16 ++++-----
.../xml/schema/model/impl/xdm/SyncTest.java | 2 +-
.../schema/model/visitor/FindUsageVisitorTest.java | 2 +-
.../wsdl/model/impl/ElementFactoryRegistry.java | 2 +-
.../modules/xml/wsdl/model/ImportTest.java | 6 ++--
.../xml/wsdl/model/readwrite/SimpleTest.java | 2 +-
.../modules/xml/xam/dom/AbstractDocumentModel.java | 2 +-
.../netbeans/modules/xml/xam/dom/ChangeInfo.java | 2 +-
.../src/org/netbeans/modules/xml/xdm/XDMModel.java | 2 +-
.../ant/hints/errors/EnablePreviewAntProj.java | 2 +-
.../modules/debugger/jpda/ui/SourcePath.java | 2 +-
.../jpda/ui/options/OptionsInitializer.java | 2 +-
.../debugger/jpda/ui/CloseSessionsTest.java | 2 +-
.../org/netbeans/modules/form/FormDesigner.java | 4 +--
.../modules/form/FormEditorCustomizer.java | 2 +-
.../modules/form/FormPropertyEditorManager.java | 2 +-
.../netbeans/modules/form/JavaCodeGenerator.java | 2 +-
.../form/editors/PrimitiveTypeArrayEditor.java | 2 +-
.../modules/form/layoutdesign/LayoutDesigner.java | 4 +--
.../modules/form/layoutdesign/LayoutFeeder.java | 2 +-
.../modules/form/layoutdesign/LayoutInterval.java | 2 +-
.../form/layoutdesign/LayoutOperations.java | 4 +--
.../modules/form/layoutdesign/VisualState.java | 2 +-
.../visualDevelopment/AddComponents_SWING.java | 2 +-
.../org/netbeans/modules/i18n/FileSelector.java | 2 +-
.../j2ee/jpa/verification/JPAProblemContext.java | 2 +-
.../completion/db/DBCompletionContextResolver.java | 2 +-
.../persistence/editor/completion/db/Schema.java | 2 +-
.../persistence/provider/DataNucleusProvider.java | 2 +-
.../jpacontroller/JpaControllerSetupPanel.java | 2 +-
.../modules/db/test/jdbcstub/ResultSetImpl.java | 4 +--
.../wizard/fromdb/TableClosureJoinTest.java | 2 +-
.../wizard/fromdb/TableClosureQueueTest.java | 4 +--
.../persistence/wizard/fromdb/TableSourceTest.java | 2 +-
.../unit/src/org/netbeans/test/stub/api/Stub.java | 2 +-
.../CreateConstructorNonDefaultConstructor.java | 2 +-
.../completion/data/CreateConstructorTest.java | 2 +-
.../data/CreateConstructorWithConstructors.java | 2 +-
.../CreateConstructorWithDefaultConstructor.java | 2 +-
.../java/editor/codegen/GetterSetterGenerator.java | 4 +--
.../CreateConstructorNonDefaultConstructor.java | 2 +-
.../completion/data/CreateConstructorTest.java | 2 +-
.../data/CreateConstructorWithConstructors.java | 2 +-
.../CreateConstructorWithDefaultConstructor.java | 2 +-
.../modules/java/freeform/ClasspathsTest.java | 2 +-
.../java/freeform/JavaProjectGeneratorTest.java | 10 +++---
.../infrastructure/EmbeddedHintsCollector.java | 2 +-
.../modules/java/hints/ui/InnerPanelSupport.java | 2 +-
.../java/hints/SuppressWarningsFixerTest/Test.java | 4 +--
.../modules/java/hints/errors/ErrorHintsTest.java | 2 +-
.../lsp/server/protocol/WorkspaceServiceImpl.java | 4 +--
.../ExtractSuperclassOrInterfaceRefactoring.java | 4 +--
.../project/LspBrokenReferencesImplTest.java | 2 +-
.../support/JavadocAndSourceRootDetectionTest.java | 4 +--
.../api/java/source/DocTreePathHandle.java | 2 +-
.../netbeans/api/java/source/ElementUtilities.java | 4 +--
.../org/netbeans/api/java/source/ScanUtils.java | 8 ++---
.../netbeans/api/java/source/TreePathHandle.java | 2 +-
.../org/netbeans/api/java/source/WorkingCopy.java | 2 +-
.../java/source/builder/CommentHandlerService.java | 2 +-
.../netbeans/api/java/source/ClassIndexTest.java | 2 +-
.../api/java/source/JavaSourceTaskFactoryTest.java | 2 +-
.../api/java/source/gen/FieldGroupTest.java | 2 +-
.../api/java/source/gen/MemberAdditionTest.java | 4 +--
.../modules/javawebstart/SignJarsTask.java | 2 +-
.../javawebstart/anttasks/SignJarsTask.java | 2 +-
.../modules/junit/AbstractTestGenerator.java | 10 +++---
.../modules/maven/hints/ui/SearchDependencyUI.java | 2 +-
.../maven/execute/MavenCommandLineExecutor.java | 2 +-
.../modules/maven/nodes/AddDependencyPanel.java | 2 +-
.../maven/queries/PomCompilerOptionsQueryImpl.java | 2 +-
.../performance/results/TestResultTest.java | 2 +-
.../modules/refactoring/java/RefactoringUtils.java | 10 +++---
.../java/plugins/ChangeParamsTransformer.java | 4 +--
.../java/plugins/MoveMembersTransformer.java | 2 +-
.../plugins/UseSuperTypeRefactoringPlugin.java | 2 +-
.../java/spi/JavaRefactoringPlugin.java | 2 +-
.../modules/refactoring/java/ui/PushDownPanel.java | 2 +-
.../ui/ReplaceConstructorWithBuilderPanel.java | 2 +-
.../utils/applications/NetBeansUtils.java | 2 +-
.../panels/netbeans/NbPreInstallSummaryPanel.java | 2 +-
.../sequences/netbeans/NbMainSequence.java | 2 +-
.../org/netbeans/installer/utils/FileUtils.java | 2 +-
.../php/editor/actions/FixUsesPerformer.java | 4 +--
.../php/editor/elements/TypeNameResolverImpl.java | 4 +--
.../php/editor/parser/PHPDocCommentParser.java | 4 +--
.../filebasedfs/fileobjects/ExternalTouchTest.java | 2 +-
.../src/org/netbeans/swing/etable/ETable.java | 2 +-
.../src/org/openide/util/actions/CookieAction.java | 2 +-
.../org/openide/util/lookup/InheritanceTree.java | 2 +-
.../unit/src/org/openide/util/WeakSetTest.java | 2 +-
.../netbeans/spi/actions/ContextActionTest.java | 2 +-
.../lib/profiler/charts/ChartComponent.java | 6 ++--
.../lib/profiler/charts/ChartSelectionManager.java | 10 +++---
.../lib/profiler/charts/PaintersModel.java | 2 +-
.../lib/profiler/charts/axis/TimeAxisUtils.java | 2 +-
.../charts/canvas/BufferedCanvasComponent.java | 2 +-
.../profiler/charts/swing/CrossBorderLayout.java | 2 +-
.../charts/xy/synchronous/SynchronousXYChart.java | 2 +-
.../xy/synchronous/SynchronousXYItemsModel.java | 6 ++--
.../org/netbeans/lib/profiler/ui/ResultsView.java | 4 +--
.../ui/charts/xy/ProfilerXYSelectionOverlay.java | 6 ++--
.../profiler/ui/components/FilterComponent.java | 6 ++--
.../profiler/ui/components/ProfilerToolbar.java | 2 +-
.../lib/profiler/ui/cpu/LiveCPUViewUpdater.java | 2 +-
.../lib/profiler/ui/cpu/ThreadsSelector.java | 4 +--
.../lib/profiler/ui/jdbc/JDBCTreeTableView.java | 2 +-
.../lib/profiler/ui/jdbc/LiveJDBCViewUpdater.java | 2 +-
.../lib/profiler/ui/jdbc/SQLFilterPanel.java | 10 +++---
.../lib/profiler/ui/memory/AllocTableView.java | 6 ++--
.../lib/profiler/ui/memory/AllocTreeTableView.java | 4 +--
.../profiler/ui/memory/LiveMemoryViewUpdater.java | 2 +-
.../lib/profiler/ui/memory/LivenessTableView.java | 12 +++----
.../profiler/ui/memory/LivenessTreeTableView.java | 4 +--
.../netbeans/lib/profiler/ui/results/DataView.java | 2 +-
.../lib/profiler/ui/results/PackageColorer.java | 2 +-
.../lib/profiler/ui/swing/FilteringToolbar.java | 2 +-
.../lib/profiler/ui/swing/MultiButtonGroup.java | 2 +-
.../lib/profiler/ui/swing/ProfilerColumnModel.java | 2 +-
.../lib/profiler/ui/swing/ProfilerPopup.java | 2 +-
.../lib/profiler/ui/swing/ProfilerTable.java | 4 +--
.../lib/profiler/ui/swing/ProfilerTreeTable.java | 2 +-
.../lib/profiler/ui/threads/NameStateRenderer.java | 2 +-
.../lib/profiler/ui/threads/ThreadsPanel.java | 4 +--
.../lib/profiler/ui/threads/ViewManager.java | 2 +-
.../netbeans/lib/profiler/classfile/ClassInfo.java | 2 +-
.../netbeans/lib/profiler/heap/DominatorTree.java | 2 +-
.../lib/profiler/instrumentation/Instrumentor.java | 2 +-
.../lib/profiler/results/cpu/CPUResultsDiff.java | 6 ++--
.../profiler/results/cpu/CPUResultsSnapshot.java | 8 ++---
.../results/cpu/CPUSamplingDataFrameProcessor.java | 8 ++---
.../lib/profiler/results/cpu/DiffCPUCCTNode.java | 6 ++--
.../results/cpu/DiffFlatProfileContainer.java | 4 +--
.../profiler/results/cpu/PrestimeCPUCCTNode.java | 4 +--
.../results/cpu/PrestimeCPUCCTNodeBacked.java | 2 +-
.../results/cpu/StackTraceSnapshotBuilder.java | 6 ++--
.../profiler/results/jdbc/JdbcGraphBuilder.java | 8 ++---
.../lib/profiler/results/jdbc/JdbcResultsDiff.java | 14 ++++----
.../profiler/results/jdbc/JdbcResultsSnapshot.java | 2 +-
.../lib/profiler/results/jdbc/SQLParser.java | 2 +-
.../lib/profiler/results/locks/LockCCTNode.java | 4 +--
.../profiler/results/locks/LockGraphBuilder.java | 14 ++++----
.../lib/profiler/results/locks/MonitorInfo.java | 10 +++---
.../lib/profiler/results/locks/ThreadInfo.java | 8 ++---
.../results/memory/AllocMemoryResultsDiff.java | 6 ++--
.../results/memory/DiffObjAllocCCTNode.java | 6 ++--
.../results/memory/DiffObjLivenessCCTNode.java | 6 ++--
.../results/memory/HeapHistogramManager.java | 6 ++--
.../results/memory/LivenessMemoryResultsDiff.java | 16 ++++-----
.../results/memory/MemoryResultsSnapshot.java | 2 +-
.../results/memory/PresoObjAllocCCTNode.java | 2 +-
.../results/memory/SampledMemoryResultsDiff.java | 6 ++--
.../tests/jfluid/perf/InstrumentationTest.java | 8 ++---
.../tests/jfluid/perf/InstrumentationTest.java | 8 ++---
.../modules/profiler/api/JavaPlatform.java | 2 +-
.../modules/profiler/api/ProfilerIDESettings.java | 2 +-
.../profiler/api/java/ExternalPackages.java | 6 ++--
.../profiler/heapwalk/ClassesListController.java | 2 +-
.../profiler/heapwalk/HeapWalkerManager.java | 4 +--
.../profiler/heapwalk/OverviewController.java | 4 +--
.../heapwalk/details/api/DetailsSupport.java | 6 ++--
.../heapwalk/details/jdk/IoDetailsProvider.java | 2 +-
.../heapwalk/details/jdk/ui/ComponentBuilders.java | 2 +-
.../heapwalk/details/jdk/ui/DataViewBuilders.java | 4 +--
.../profiler/heapwalk/model/HeapPatterns.java | 2 +-
.../profiler/heapwalk/ui/AnalysisControllerUI.java | 2 +-
.../profiler/nbimpl/project/ProjectUtilities.java | 2 +-
.../ppoints/GlobalProfilingPointsProcessor.java | 8 ++---
.../profiler/ppoints/ProfilingPointFactory.java | 2 +-
.../profiler/ppoints/ProfilingPointsManager.java | 42 +++++++++++-----------
.../ppoints/ResetResultsProfilingPoint.java | 2 +-
.../profiler/ppoints/StopwatchProfilingPoint.java | 2 +-
.../ppoints/TakeSnapshotProfilingPoint.java | 2 +-
.../ppoints/TimedTakeSnapshotProfilingPoint.java | 2 +-
.../TriggeredTakeSnapshotProfilingPoint.java | 2 +-
.../netbeans/modules/profiler/ppoints/Utils.java | 4 +--
.../profiler/ppoints/ui/ProfilingPointReport.java | 2 +-
.../ppoints/ui/ProfilingPointsWindowUI.java | 2 +-
.../profiler/ppoints/ui/ProjectSelector.java | 4 +--
.../profiler/snaptracer/TracerProgressObject.java | 4 +--
.../profiler/snaptracer/impl/IdeSnapshot.java | 4 +--
.../profiler/snaptracer/impl/TracerController.java | 6 ++--
.../profiler/snaptracer/impl/TracerModel.java | 16 ++++-----
.../snaptracer/impl/TracerSupportImpl.java | 4 +--
.../impl/options/TracerOptionsPanel.java | 2 +-
.../profiler/snaptracer/impl/swing/ColorIcon.java | 2 +-
.../snaptracer/impl/swing/DropdownButton.java | 2 +-
.../snaptracer/impl/timeline/TimelineAxis.java | 4 +--
.../snaptracer/impl/timeline/TimelineChart.java | 14 ++++----
.../snaptracer/impl/timeline/TimelineModel.java | 2 +-
.../impl/timeline/TimelineSelectionManager.java | 10 +++---
.../impl/timeline/TimelineSelectionOverlay.java | 18 +++++-----
.../snaptracer/impl/timeline/TimelineSupport.java | 18 +++++-----
.../impl/timeline/TimelineTooltipOverlay.java | 4 +--
.../modules/profiler/SampledCPUSnapshot.java | 4 +--
.../modules/profiler/SnapshotResultsWindow.java | 2 +-
.../profiler/actions/LoadSnapshotAction.java | 4 +--
.../modules/profiler/v2/ProfilerFeatures.java | 10 +++---
.../modules/profiler/v2/ProfilerPlugins.java | 4 +--
.../modules/profiler/v2/ProfilerSession.java | 2 +-
.../modules/profiler/v2/ProfilerWindow.java | 2 +-
.../profiler/v2/features/MethodsFeatureModes.java | 6 ++--
.../profiler/v2/features/ObjectsFeatureModes.java | 6 ++--
.../modules/profiler/v2/impl/ClassMethodList.java | 4 +--
.../profiler/v2/impl/ClassMethodSelector.java | 14 ++++----
.../modules/profiler/v2/impl/FeaturesView.java | 2 +-
.../profiler/v2/impl/SnapshotsWindowUI.java | 4 +--
.../modules/profiler/v2/ui/ProjectSelector.java | 4 +--
.../editor/CompletionContextFinder.java | 2 +-
.../modules/javascript2/editor/FileUtils.java | 4 +--
.../javascript2/editor/JsInstantRenamer.java | 2 +-
.../javascript2/editor/JsKeyStrokeHandler.java | 4 +--
.../javascript2/editor/JsStructureScanner.java | 2 +-
.../editor/navigation/DeclarationFinderImpl.java | 6 ++--
.../editor/JsFindLogicalRangesTest.java | 4 +--
.../modules/javascript2/model/api/ModelUtils.java | 6 ++--
.../editor/RequireFileCodeCompletionTest.java | 2 +-
.../editor/RequireJSCodeCompletionTest.java | 2 +-
.../editor/RequireJsDeclarationFinderTest.java | 2 +-
.../netbeans/modules/web/inspect/ui/Utilities.java | 4 +--
272 files changed, 523 insertions(+), 523 deletions(-)
diff --git a/apisupport/apisupport.refactoring/src/org/netbeans/modules/apisupport/refactoring/NbMoveRefactoringPlugin.java b/apisupport/apisupport.refactoring/src/org/netbeans/modules/apisupport/refactoring/NbMoveRefactoringPlugin.java
index a4f4bed9fe..f058065134 100644
--- a/apisupport/apisupport.refactoring/src/org/netbeans/modules/apisupport/refactoring/NbMoveRefactoringPlugin.java
+++ b/apisupport/apisupport.refactoring/src/org/netbeans/modules/apisupport/refactoring/NbMoveRefactoringPlugin.java
@@ -82,7 +82,7 @@ public class NbMoveRefactoringPlugin extends AbstractRefactoringPlugin {
private EditableManifest targetManifest;
private Map packagePostfix = new HashMap();
- ArrayList<FileObject> filesToMove = new ArrayList();
+ ArrayList<FileObject> filesToMove = new ArrayList<>();
HashMap<FileObject,ElementHandle> classes;
/**
@@ -647,7 +647,7 @@ public class NbMoveRefactoringPlugin extends AbstractRefactoringPlugin {
}
private void initClasses() {
- classes = new HashMap();
+ classes = new HashMap<>();
for (int i=0;i<filesToMove.size();i++) {
final int j = i;
try {
diff --git a/contrib/cordova.platforms.ios/src/org/netbeans/modules/cordova/platforms/ios/IOSDebugTransport.java b/contrib/cordova.platforms.ios/src/org/netbeans/modules/cordova/platforms/ios/IOSDebugTransport.java
index f63f81d4a2..298e49fb67 100644
--- a/contrib/cordova.platforms.ios/src/org/netbeans/modules/cordova/platforms/ios/IOSDebugTransport.java
+++ b/contrib/cordova.platforms.ios/src/org/netbeans/modules/cordova/platforms/ios/IOSDebugTransport.java
@@ -350,7 +350,7 @@ public abstract class IOSDebugTransport extends MobileDebugTransport implements
private class Tabs {
- private HashMap<String, TabDescriptor> map = new HashMap();
+ private HashMap<String, TabDescriptor> map = new HashMap<>();
private Object monitor = new Object();
private boolean inited = false;
@@ -365,7 +365,7 @@ public abstract class IOSDebugTransport extends MobileDebugTransport implements
}
boolean wasEmpty = map.isEmpty();
boolean connectionUrlFound = false;
- HashMap<String, TabDescriptor> currentMap = new HashMap();
+ HashMap<String, TabDescriptor> currentMap = new HashMap<>();
for (String s : listing.allKeys()) {
NSDictionary o = (NSDictionary) listing.objectForKey(s);
NSObject identifier = o.objectForKey("WIRPageIdentifierKey"); // NOI18N
diff --git a/contrib/cordova.platforms.ios/test/unit/src/org/netbeans/modules/cordova/platforms/ios/PlistTest.java b/contrib/cordova.platforms.ios/test/unit/src/org/netbeans/modules/cordova/platforms/ios/PlistTest.java
index a85884934d..ada59e545d 100644
--- a/contrib/cordova.platforms.ios/test/unit/src/org/netbeans/modules/cordova/platforms/ios/PlistTest.java
+++ b/contrib/cordova.platforms.ios/test/unit/src/org/netbeans/modules/cordova/platforms/ios/PlistTest.java
@@ -49,7 +49,7 @@ public class PlistTest {
class Tabs {
- private HashMap<String, TabDescriptor> map = new HashMap();
+ private HashMap<String, TabDescriptor> map = new HashMap<>();
public void update(InputStream is) throws Exception {
NSDictionary root = (NSDictionary) XMLPropertyListParser.parse(is);
diff --git a/contrib/j2ee.jboss4/src/org/netbeans/modules/j2ee/jboss4/customizer/CustomizerSupport.java b/contrib/j2ee.jboss4/src/org/netbeans/modules/j2ee/jboss4/customizer/CustomizerSupport.java
index d6c8c6fe64..c64e12fa90 100644
--- a/contrib/j2ee.jboss4/src/org/netbeans/modules/j2ee/jboss4/customizer/CustomizerSupport.java
+++ b/contrib/j2ee.jboss4/src/org/netbeans/modules/j2ee/jboss4/customizer/CustomizerSupport.java
@@ -151,7 +151,7 @@ public final class CustomizerSupport {
* @return A tokenization of the specified path into the list of URLs.
*/
public static List<URL> tokenizePath(String path) {
- List<URL> l = new ArrayList();
+ List<URL> l = new ArrayList<>();
StringTokenizer tok = new StringTokenizer(path, ":;", true); // NOI18N
char dosHack = '\0';
char lastDelim = '\0';
diff --git a/contrib/j2ee.weblogic9/src/org/netbeans/modules/j2ee/weblogic9/j2ee/WLJ2eePlatformFactory.java b/contrib/j2ee.weblogic9/src/org/netbeans/modules/j2ee/weblogic9/j2ee/WLJ2eePlatformFactory.java
index 35980db45f..2f9a1db254 100644
--- a/contrib/j2ee.weblogic9/src/org/netbeans/modules/j2ee/weblogic9/j2ee/WLJ2eePlatformFactory.java
+++ b/contrib/j2ee.weblogic9/src/org/netbeans/modules/j2ee/weblogic9/j2ee/WLJ2eePlatformFactory.java
@@ -755,7 +755,7 @@ public class WLJ2eePlatformFactory extends J2eePlatformFactory {
library.setContent(J2eeLibraryTypeProvider.VOLUME_TYPE_CLASSPATH, list);
File j2eeDoc = InstalledFileLocator.getDefault().locate(J2EE_API_DOC, null, false);
if (j2eeDoc != null) {
- list = new ArrayList();
+ list = new ArrayList<>();
addFileToList(list, j2eeDoc);
library.setContent(J2eeLibraryTypeProvider.VOLUME_TYPE_JAVADOC, list);
}
diff --git a/contrib/j2ee.weblogic9/src/org/netbeans/modules/j2ee/weblogic9/ui/nodes/Customizer.java b/contrib/j2ee.weblogic9/src/org/netbeans/modules/j2ee/weblogic9/ui/nodes/Customizer.java
index 068897efc6..ddf5b56b3c 100644
--- a/contrib/j2ee.weblogic9/src/org/netbeans/modules/j2ee/weblogic9/ui/nodes/Customizer.java
+++ b/contrib/j2ee.weblogic9/src/org/netbeans/modules/j2ee/weblogic9/ui/nodes/Customizer.java
@@ -204,7 +204,7 @@ public class Customizer extends JTabbedPane {
private synchronized List getData() {
if (data == null) {
- data = new ArrayList();
+ data = new ArrayList<>();
LibraryImplementation[] libImpl = platform.getLibraries();
for (int i = 0; i < libImpl.length; i++) {
data.addAll(libImpl[i].getContent(type));
diff --git a/contrib/websvc.metro.model/src/org/netbeans/modules/websvc/metro/model/catalog/MetroSchemaCatalog.java b/contrib/websvc.metro.model/src/org/netbeans/modules/websvc/metro/model/catalog/MetroSchemaCatalog.java
index 536096c39b..5604831b22 100644
--- a/contrib/websvc.metro.model/src/org/netbeans/modules/websvc/metro/model/catalog/MetroSchemaCatalog.java
+++ b/contrib/websvc.metro.model/src/org/netbeans/modules/websvc/metro/model/catalog/MetroSchemaCatalog.java
@@ -66,7 +66,7 @@ public class MetroSchemaCatalog implements CatalogReader, CatalogDescriptor2, En
private synchronized Map<String, String> getLocalSchemaDefs() {
if (localSchemaDefs == null) {
- localSchemaDefs = new HashMap();
+ localSchemaDefs = new HashMap<>();
localSchemaDefs.putAll(getSchemaLocations(true));
}
return localSchemaDefs;
diff --git a/contrib/websvc.wsitconf/src/org/netbeans/modules/websvc/wsitconf/wsdlmodelext/WSITModelSupport.java b/contrib/websvc.wsitconf/src/org/netbeans/modules/websvc/wsitconf/wsdlmodelext/WSITModelSupport.java
index f8fa6cd9df..c00444670d 100644
--- a/contrib/websvc.wsitconf/src/org/netbeans/modules/websvc/wsitconf/wsdlmodelext/WSITModelSupport.java
+++ b/contrib/websvc.wsitconf/src/org/netbeans/modules/websvc/wsitconf/wsdlmodelext/WSITModelSupport.java
@@ -677,7 +677,7 @@ public class WSITModelSupport {
}
public static synchronized void save(WSDLModel model) {
- Set<FileObject> traversedModels = new HashSet();
+ Set<FileObject> traversedModels = new HashSet<>();
save(model, traversedModels);
}
@@ -788,7 +788,7 @@ public class WSITModelSupport {
// STS
boolean sts = ProprietarySecurityPolicyModelHelper.isSTSEnabled(b);
- List<ServiceProviderElement> sProviderElems = new ArrayList();
+ List<ServiceProviderElement> sProviderElems = new ArrayList<>();
String issuer = null;
String contract = null;
String lifetime = null;
diff --git a/contrib/websvc.wsitconf/test/unit/src/org/netbeans/modules/websvc/wsitconf/wsdlmodelext/ProfileTest.java b/contrib/websvc.wsitconf/test/unit/src/org/netbeans/modules/websvc/wsitconf/wsdlmodelext/ProfileTest.java
index 49b51424cc..4f9d364be2 100644
--- a/contrib/websvc.wsitconf/test/unit/src/org/netbeans/modules/websvc/wsitconf/wsdlmodelext/ProfileTest.java
+++ b/contrib/websvc.wsitconf/test/unit/src/org/netbeans/modules/websvc/wsitconf/wsdlmodelext/ProfileTest.java
@@ -66,7 +66,7 @@ public class ProfileTest extends NbTestCase {
for (ConfigVersion cfgV : ConfigVersion.values()) {
String cfgStr = ConfigVersion.CONFIG_1_0.equals(cfgV) ? "10-" : "13-";
- ArrayList<String> profiles = new ArrayList();
+ ArrayList<String> profiles = new ArrayList<>();
PolicyModelHelper.setConfigVersion(b, cfgV, null);
for (SecurityProfile sP : secProfiles) {
if (sP.isProfileSupported(null, b, false)) {
diff --git a/contrib/websvc.wsitmodelext/src/org/netbeans/modules/websvc/wsitmodelext/catalog/WSITSchemaCatalog.java b/contrib/websvc.wsitmodelext/src/org/netbeans/modules/websvc/wsitmodelext/catalog/WSITSchemaCatalog.java
index 91a45ea64b..04d87fc90f 100644
--- a/contrib/websvc.wsitmodelext/src/org/netbeans/modules/websvc/wsitmodelext/catalog/WSITSchemaCatalog.java
+++ b/contrib/websvc.wsitmodelext/src/org/netbeans/modules/websvc/wsitmodelext/catalog/WSITSchemaCatalog.java
@@ -81,7 +81,7 @@ public class WSITSchemaCatalog implements CatalogReader, CatalogDescriptor2, Ent
private synchronized Map<String, String> getLocalSchemaDefs() {
if (localSchemaDefs == null) {
- localSchemaDefs = new HashMap();
+ localSchemaDefs = new HashMap<>();
localSchemaDefs.putAll(Addressing10QName.ADDRESS.getSchemaLocations(true));
localSchemaDefs.putAll(Addressing10WsdlQName.USINGADDRESSING.getSchemaLocations(true));
localSchemaDefs.putAll(Addressing13WsdlQName.ADDRESSING.getSchemaLocations(true));
diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/adm/VulnerabilityWorker.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/adm/VulnerabilityWorker.java
index 5e36f3e822..af1b373e61 100644
--- a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/adm/VulnerabilityWorker.java
+++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/adm/VulnerabilityWorker.java
@@ -114,7 +114,7 @@ public class VulnerabilityWorker implements ErrorProvider{
private static final String GOV_DETAIL_URL = "https://nvd.nist.gov/vuln/detail/";
// @GuardedBy(self)
- private static final HashMap<Project, CacheItem> cache = new HashMap();
+ private static final HashMap<Project, CacheItem> cache = new HashMap<>();
// @GuardedBy(class)
private static VulnerabilityWorker instance;
@@ -160,7 +160,7 @@ public class VulnerabilityWorker implements ErrorProvider{
public Map<String, Dependency> getDependencyMap() {
if (dependencyMap == null) {
- dependencyMap = new HashMap();
+ dependencyMap = new HashMap<>();
buildDependecyMap(dependencyResult.getRoot(), dependencyMap);
}
return dependencyMap;
@@ -179,7 +179,7 @@ public class VulnerabilityWorker implements ErrorProvider{
if (getAudit().getIsSuccess()) {
return Collections.EMPTY_SET;
}
- Set<FileObject> result = new HashSet();
+ Set<FileObject> result = new HashSet<>();
for (ApplicationDependencyVulnerabilitySummary v: getVulnerabilities()){
List<Vulnerability> vulnerabilities = v.getVulnerabilities();
if (!vulnerabilities.isEmpty()) {
@@ -276,7 +276,7 @@ public class VulnerabilityWorker implements ErrorProvider{
return null;
}
- List<Diagnostic> result = new ArrayList();
+ List<Diagnostic> result = new ArrayList<>();
for (ApplicationDependencyVulnerabilitySummary v: getVulnerabilities()){
List<Vulnerability> vulnerabilities = v.getVulnerabilities();
if (!vulnerabilities.isEmpty()) {
@@ -401,7 +401,7 @@ public class VulnerabilityWorker implements ErrorProvider{
private String doFindVulnerability(Project project, String compartmentId, String knowledgeBaseId, String projectDisplayName, AuditOptions auditOptions,
ProgressHandle progressHandle, AtomicBoolean remoteCall) throws AuditException {
- List<ApplicationDependency> result = new ArrayList();
+ List<ApplicationDependency> result = new ArrayList<>();
CacheItem cacheItem = null;
VulnerabilityReport savedAudit = null;
@@ -504,7 +504,7 @@ public class VulnerabilityWorker implements ErrorProvider{
cache.put(project, cacheItem);
}
- Set<FileObject> problematicFiles = new HashSet();
+ Set<FileObject> problematicFiles = new HashSet<>();
problematicFiles.addAll(cacheItem.getProblematicFiles());
String message;
@@ -545,7 +545,7 @@ public class VulnerabilityWorker implements ErrorProvider{
builder.gav(gav);
builder.nodeId(Integer.toString(n));
- List<String> childrenNodeIds = new ArrayList(dependency.getChildren().size());
+ List<String> childrenNodeIds = new ArrayList<>(dependency.getChildren().size());
for (Dependency childDependency : dependency.getChildren()) {
int cid = convert(childDependency, gavIndex, result);
childrenNodeIds.add(Integer.toString(cid));
@@ -640,7 +640,7 @@ public class VulnerabilityWorker implements ErrorProvider{
@Override
public List<? extends Diagnostic> computeErrors(Context context) {
- List<Diagnostic> result = new ArrayList();
+ List<Diagnostic> result = new ArrayList<>();
Collection<CacheItem> items;
synchronized (cache) {
diff --git a/enterprise/j2eeserver/src/org/netbeans/modules/j2ee/deployment/devmodules/api/J2eePlatform.java b/enterprise/j2eeserver/src/org/netbeans/modules/j2ee/deployment/devmodules/api/J2eePlatform.java
index a4037a521b..5261a0da88 100644
--- a/enterprise/j2eeserver/src/org/netbeans/modules/j2ee/deployment/devmodules/api/J2eePlatform.java
+++ b/enterprise/j2eeserver/src/org/netbeans/modules/j2ee/deployment/devmodules/api/J2eePlatform.java
@@ -285,7 +285,7 @@ public final class J2eePlatform implements Lookup.Provider {
}
private List<File> getClasspath(LibraryImplementation[] libraries) {
- List<File> classpath = new ArrayList();
+ List<File> classpath = new ArrayList<>();
for (int i = 0; i < libraries.length; i++) {
List classpathList = libraries[i].getContent(J2eeLibraryTypeProvider.VOLUME_TYPE_CLASSPATH);
for (Iterator iter = classpathList.iterator(); iter.hasNext();) {
diff --git a/enterprise/j2eeserver/src/org/netbeans/modules/j2ee/deployment/impl/Server.java b/enterprise/j2eeserver/src/org/netbeans/modules/j2ee/deployment/impl/Server.java
index 5056ed31ea..c3f63e4706 100644
--- a/enterprise/j2eeserver/src/org/netbeans/modules/j2ee/deployment/impl/Server.java
+++ b/enterprise/j2eeserver/src/org/netbeans/modules/j2ee/deployment/impl/Server.java
@@ -303,7 +303,7 @@ public class Server implements Node.Cookie {
private Map<String, String[]> deployConfigDescriptorMap;
private final void initDeploymentConfigurationFileList(FileObject fo) {
- deployConfigDescriptorMap = new HashMap();
+ deployConfigDescriptorMap = new HashMap<>();
FileObject deplFNames = fo.getFileObject(LAYER_DEPLOYMENT_FILE_NAMES);
if (deplFNames != null) {
FileObject mTypes [] = deplFNames.getChildren();
diff --git a/enterprise/j2eeserver/src/org/netbeans/modules/j2ee/deployment/impl/ServerFileDistributor.java b/enterprise/j2eeserver/src/org/netbeans/modules/j2ee/deployment/impl/ServerFileDistributor.java
index d2acb2a4e0..c3e73c86b6 100644
--- a/enterprise/j2eeserver/src/org/netbeans/modules/j2ee/deployment/impl/ServerFileDistributor.java
+++ b/enterprise/j2eeserver/src/org/netbeans/modules/j2ee/deployment/impl/ServerFileDistributor.java
@@ -83,7 +83,7 @@ public class ServerFileDistributor extends ServerProgress {
private static Map<J2eeModule.Type, List<String>> j2eeTypeMap = null;
static synchronized List getDescriptorPath(J2eeModule module) {
if (j2eeTypeMap == null) {
- j2eeTypeMap = new HashMap();
+ j2eeTypeMap = new HashMap<>();
j2eeTypeMap.put(J2eeModule.Type.EJB,
Arrays.asList(new String[]{J2eeModule.EJBJAR_XML, J2eeModule.EJBSERVICES_XML}));
j2eeTypeMap.put(J2eeModule.Type.WAR,
diff --git a/enterprise/j2eeserver/src/org/netbeans/modules/j2ee/deployment/impl/ServerRegistry.java b/enterprise/j2eeserver/src/org/netbeans/modules/j2ee/deployment/impl/ServerRegistry.java
index ba49a5b049..96942d52b8 100644
--- a/enterprise/j2eeserver/src/org/netbeans/modules/j2ee/deployment/impl/ServerRegistry.java
+++ b/enterprise/j2eeserver/src/org/netbeans/modules/j2ee/deployment/impl/ServerRegistry.java
@@ -513,7 +513,7 @@ public final class ServerRegistry implements java.io.Serializable {
return Collections.<String, String>emptyMap();
}
- Map<String,String> properties = new HashMap(initialProperties);
+ Map<String,String> properties = new HashMap<>(initialProperties);
properties.remove(InstanceProperties.URL_ATTR);
properties.remove(InstanceProperties.USERNAME_ATTR);
properties.remove(InstanceProperties.PASSWORD_ATTR);
@@ -593,9 +593,9 @@ public final class ServerRegistry implements java.io.Serializable {
if (configNamesByType != null) {
return;
}
- configNamesByType = new HashMap();
+ configNamesByType = new HashMap<>();
for (int i = 0 ; i < ALL_TYPES.length; i++) {
- Set<String> configNames = new HashSet();
+ Set<String> configNames = new HashSet<>();
for (Iterator j=servers.values().iterator(); j.hasNext();) {
Server s = (Server) j.next();
String[] paths = s.getDeploymentPlanFiles(ALL_TYPES[i]);
diff --git a/enterprise/j2eeserver/src/org/netbeans/modules/j2ee/deployment/plugins/api/ServerProgress.java b/enterprise/j2eeserver/src/org/netbeans/modules/j2ee/deployment/plugins/api/ServerProgress.java
index 3d9f0c94b2..9a9c9aec61 100644
--- a/enterprise/j2eeserver/src/org/netbeans/modules/j2ee/deployment/plugins/api/ServerProgress.java
+++ b/enterprise/j2eeserver/src/org/netbeans/modules/j2ee/deployment/plugins/api/ServerProgress.java
@@ -49,7 +49,7 @@ import javax.enterprise.deploy.spi.exceptions.OperationUnsupportedException;
public class ServerProgress implements ProgressObject {
private Object server;
- private List<ProgressListener> listeners = new CopyOnWriteArrayList();
+ private List<ProgressListener> listeners = new CopyOnWriteArrayList<>();
private DeploymentStatus status;
/** Creates a new instance of StartServerProgress */
diff --git a/enterprise/javaee.wildfly/src/org/netbeans/modules/javaee/wildfly/customizer/CustomizerSupport.java b/enterprise/javaee.wildfly/src/org/netbeans/modules/javaee/wildfly/customizer/CustomizerSupport.java
index a968d224ae..3a79282efe 100644
--- a/enterprise/javaee.wildfly/src/org/netbeans/modules/javaee/wildfly/customizer/CustomizerSupport.java
+++ b/enterprise/javaee.wildfly/src/org/netbeans/modules/javaee/wildfly/customizer/CustomizerSupport.java
@@ -151,7 +151,7 @@ public final class CustomizerSupport {
* @return A tokenization of the specified path into the list of URLs.
*/
public static List<URL> tokenizePath(String path) {
- List<URL> l = new ArrayList();
+ List<URL> l = new ArrayList<>();
StringTokenizer tok = new StringTokenizer(path, ":;", true); // NOI18N
char dosHack = '\0';
char lastDelim = '\0';
diff --git a/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/data/PayaraContainer.java b/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/data/PayaraContainer.java
index 755e9f69aa..91386800b5 100644
--- a/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/data/PayaraContainer.java
+++ b/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/data/PayaraContainer.java
@@ -81,7 +81,7 @@ public enum PayaraContainer implements Comparator<PayaraContainer> {
* conversion.
*/
private static final Map<String, PayaraContainer> stringValuesMap
- = new HashMap(2 * values().length);
+ = new HashMap<>(2 * values().length);
// Initialize backward String conversion Map.
static {
diff --git a/enterprise/tomcat5/src/org/netbeans/modules/tomcat5/customizer/CustomizerSupport.java b/enterprise/tomcat5/src/org/netbeans/modules/tomcat5/customizer/CustomizerSupport.java
index 5b4a5f16ac..c38ff3e17f 100644
--- a/enterprise/tomcat5/src/org/netbeans/modules/tomcat5/customizer/CustomizerSupport.java
+++ b/enterprise/tomcat5/src/org/netbeans/modules/tomcat5/customizer/CustomizerSupport.java
@@ -151,7 +151,7 @@ public final class CustomizerSupport {
* @return A tokenization of the specified path into the list of URLs.
*/
public static List<URL> tokenizePath(String path) {
- List<URL> l = new ArrayList();
+ List<URL> l = new ArrayList<>();
StringTokenizer tok = new StringTokenizer(path, ":;", true); // NOI18N
char dosHack = '\0';
char lastDelim = '\0';
diff --git a/enterprise/tomcat5/src/org/netbeans/modules/tomcat5/util/Utils.java b/enterprise/tomcat5/src/org/netbeans/modules/tomcat5/util/Utils.java
index ed47e5f41f..a088932e22 100644
--- a/enterprise/tomcat5/src/org/netbeans/modules/tomcat5/util/Utils.java
+++ b/enterprise/tomcat5/src/org/netbeans/modules/tomcat5/util/Utils.java
@@ -78,7 +78,7 @@ public final class Utils {
if (text == null || !text.startsWith("HTTP/")) { // NOI18N
return false; // not an http response
}
- Map<String, List<String>> headerFileds = new HashMap();
+ Map<String, List<String>> headerFileds = new HashMap<>();
while ((text = in.readLine()) != null && text.length() > 0) {
int colon = text.indexOf(":");
if (colon <= 0) {
@@ -88,7 +88,7 @@ public final class Utils {
String value = text.substring(colon + 1).trim();
List<String> list = headerFileds.get(name);
if (list == null) {
- list = new ArrayList();
+ list = new ArrayList<>();
headerFileds.put(name, list);
}
list.add(value);
diff --git a/enterprise/web.core.syntax/test/unit/src/org/netbeans/test/web/core/syntax/TestBase2.java b/enterprise/web.core.syntax/test/unit/src/org/netbeans/test/web/core/syntax/TestBase2.java
index 701a46bc4b..44706af29d 100644
--- a/enterprise/web.core.syntax/test/unit/src/org/netbeans/test/web/core/syntax/TestBase2.java
+++ b/enterprise/web.core.syntax/test/unit/src/org/netbeans/test/web/core/syntax/TestBase2.java
@@ -74,7 +74,7 @@ public class TestBase2 extends CslTestBase {
public final void initParserJARs() throws MalformedURLException {
String path = System.getProperty("jsp.parser.jars");
String[] paths = PropertyUtils.tokenizePath(path);
- List<URL> list = new ArrayList();
+ List<URL> list = new ArrayList<>();
for (int i = 0; i< paths.length; i++) {
String token = paths[i];
File f = new File(token);
diff --git a/enterprise/web.core/test/unit/src/org/netbeans/modules/web/core/test/TestUtil.java b/enterprise/web.core/test/unit/src/org/netbeans/modules/web/core/test/TestUtil.java
index f170c95f49..433c73638e 100644
--- a/enterprise/web.core/test/unit/src/org/netbeans/modules/web/core/test/TestUtil.java
+++ b/enterprise/web.core/test/unit/src/org/netbeans/modules/web/core/test/TestUtil.java
@@ -175,7 +175,7 @@ public final class TestUtil extends ProxyLookup {
System.gc();
}
- private static final Map<FileObject,Integer> loadCount = new WeakHashMap();
+ private static final Map<FileObject,Integer> loadCount = new WeakHashMap<>();
/**
* Check how many times {@link ProjectFactory#loadProject} has been called
diff --git a/enterprise/web.jsf.editor/test/unit/src/org/netbeans/modules/web/jsf/editor/index/ResourcesMappingModelTest.java b/enterprise/web.jsf.editor/test/unit/src/org/netbeans/modules/web/jsf/editor/index/ResourcesMappingModelTest.java
index 83be08c460..79fc6ec5d1 100644
--- a/enterprise/web.jsf.editor/test/unit/src/org/netbeans/modules/web/jsf/editor/index/ResourcesMappingModelTest.java
+++ b/enterprise/web.jsf.editor/test/unit/src/org/netbeans/modules/web/jsf/editor/index/ResourcesMappingModelTest.java
@@ -37,7 +37,7 @@ public class ResourcesMappingModelTest extends NbTestCase {
@Test
public void testParseResourceFromString() throws Exception {
String resString = "stylesheet@test.css:;script@file.js:jsLib";
- List<ResourcesMappingModel.Resource> resources = new ArrayList(ResourcesMappingModel.parseResourcesFromString(resString));
+ List<ResourcesMappingModel.Resource> resources = new ArrayList<>(ResourcesMappingModel.parseResourcesFromString(resString));
assertEquals(2, resources.size());
ResourcesMappingModel.Resource res1 = resources.get(0);
diff --git a/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/wizards/ManagedBeanPanelVisual.java b/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/wizards/ManagedBeanPanelVisual.java
index 01414b217f..e197749f9e 100644
--- a/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/wizards/ManagedBeanPanelVisual.java
+++ b/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/wizards/ManagedBeanPanelVisual.java
@@ -341,7 +341,7 @@ public class ManagedBeanPanelVisual extends javax.swing.JPanel implements HelpCt
return new HelpCtx("org.netbeans.modules.web.jsf.wizards.ManagedBeanPanelVisual");
}
- private final Set<ChangeListener> listeners = new HashSet(1);
+ private final Set<ChangeListener> listeners = new HashSet<>(1);
public final void addChangeListener(ChangeListener l) {
synchronized (listeners) {
diff --git a/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/wizards/TemplatePanelVisual.java b/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/wizards/TemplatePanelVisual.java
index c2d79d5ff5..faef1ca936 100644
--- a/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/wizards/TemplatePanelVisual.java
+++ b/enterprise/web.jsf/src/org/netbeans/modules/web/jsf/wizards/TemplatePanelVisual.java
@@ -37,7 +37,7 @@ public class TemplatePanelVisual extends javax.swing.JPanel implements HelpCtx.P
private static final long serialVersionUID = 1L;
private static final String RESOURCES_FOLDER="org/netbeans/modules/web/jsf/facelets/resources/templates/"; //NOI18N
- private final Map<Integer, JRadioButton> templateButtonMapping = new HashMap();
+ private final Map<Integer, JRadioButton> templateButtonMapping = new HashMap<>();
/** Creates new form TemplatePanelVisual */
public TemplatePanelVisual() {
diff --git a/enterprise/web.jsf/test/unit/src/org/netbeans/modules/web/jsf/refactoring/ModificationsTest.java b/enterprise/web.jsf/test/unit/src/org/netbeans/modules/web/jsf/refactoring/ModificationsTest.java
index 06a897fa13..590f39a0d0 100644
--- a/enterprise/web.jsf/test/unit/src/org/netbeans/modules/web/jsf/refactoring/ModificationsTest.java
+++ b/enterprise/web.jsf/test/unit/src/org/netbeans/modules/web/jsf/refactoring/ModificationsTest.java
@@ -81,7 +81,7 @@ public class ModificationsTest extends NbTestCase {
File outFile = new File(getWorkDir(), "faces-modification.xml");
FileWriter fWriter = new FileWriter(outFile);
modifications.addDifference(fileObject, difference);
- List<Difference> differences = new LinkedList();
+ List<Difference> differences = new LinkedList<>();
differences.add(difference);
modifications.commit(fileObject, differences, fWriter);
fWriter.close();
diff --git a/enterprise/web.jspparser/test/unit/src/org/netbeans/modules/web/jspparser/TestUtil.java b/enterprise/web.jspparser/test/unit/src/org/netbeans/modules/web/jspparser/TestUtil.java
index b9e6788f07..4940fe301e 100644
--- a/enterprise/web.jspparser/test/unit/src/org/netbeans/modules/web/jspparser/TestUtil.java
+++ b/enterprise/web.jspparser/test/unit/src/org/netbeans/modules/web/jspparser/TestUtil.java
@@ -218,7 +218,7 @@ public final class TestUtil extends ProxyLookup {
public static List<URL> getJARs(String propertyName) throws MalformedURLException {
String path = System.getProperty(propertyName);
String[] paths = PropertyUtils.tokenizePath(path);
- List<URL> list = new ArrayList();
+ List<URL> list = new ArrayList<>();
for (int i = 0; i< paths.length; i++) {
String token = paths[i];
File f = new File(token);
diff --git a/enterprise/web.project/test/unit/src/org/netbeans/modules/web/project/test/TestUtil.java b/enterprise/web.project/test/unit/src/org/netbeans/modules/web/project/test/TestUtil.java
index 982a45d73c..ad8645c50b 100644
--- a/enterprise/web.project/test/unit/src/org/netbeans/modules/web/project/test/TestUtil.java
+++ b/enterprise/web.project/test/unit/src/org/netbeans/modules/web/project/test/TestUtil.java
@@ -152,7 +152,7 @@ public final class TestUtil extends ProxyLookup {
System.gc();
}
- private static final Map<FileObject,Integer> loadCount = new WeakHashMap();
+ private static final Map<FileObject,Integer> loadCount = new WeakHashMap<>();
/**
* Check how many times {@link ProjectFactory#loadProject} has been called
diff --git a/enterprise/websvc.rest/src/org/netbeans/modules/websvc/rest/wizard/fromdb/EjbFacadeGenerator.java b/enterprise/websvc.rest/src/org/netbeans/modules/websvc/rest/wizard/fromdb/EjbFacadeGenerator.java
index 615d0f6e64..627e79a21f 100644
--- a/enterprise/websvc.rest/src/org/netbeans/modules/websvc/rest/wizard/fromdb/EjbFacadeGenerator.java
+++ b/enterprise/websvc.rest/src/org/netbeans/modules/websvc/rest/wizard/fromdb/EjbFacadeGenerator.java
@@ -158,7 +158,7 @@ public class EjbFacadeGenerator implements FacadeGenerator {
List<GenerationOptions> methodOptions =
getAbstractFacadeMethodOptions(entityNames,
genericsTypeName, "entity"); //NOI18N
- List<Tree> members = new ArrayList();
+ List<Tree> members = new ArrayList<>();
String entityClassVar = "entityClass"; //NOI18N
Tree classObjectTree = genUtils.createType("java.lang.Class<" +
genericsTypeName + ">", classElement); //NOI18N
diff --git a/ergonomics/ide.ergonomics/test/unit/src/org/netbeans/modules/ide/ergonomics/fod/ConfigurationPanelTest.java b/ergonomics/ide.ergonomics/test/unit/src/org/netbeans/modules/ide/ergonomics/fod/ConfigurationPanelTest.java
index 7972c94d80..4543eb4f51 100644
--- a/ergonomics/ide.ergonomics/test/unit/src/org/netbeans/modules/ide/ergonomics/fod/ConfigurationPanelTest.java
+++ b/ergonomics/ide.ergonomics/test/unit/src/org/netbeans/modules/ide/ergonomics/fod/ConfigurationPanelTest.java
@@ -86,7 +86,7 @@ public class ConfigurationPanelTest extends NbTestCase {
assertNotNull(texts);
assertFalse(texts.isEmpty());
- List<String> expected = new ArrayList();
+ List<String> expected = new ArrayList<>();
expected.add("Required");
assertEquals(expected, texts);
@@ -94,7 +94,7 @@ public class ConfigurationPanelTest extends NbTestCase {
assertNotNull(texts);
assertFalse(texts.isEmpty());
- expected = new ArrayList();
+ expected = new ArrayList<>();
expected.add("Recommended");
assertEquals(expected, texts);
diff --git a/extide/gradle/netbeans-gradle-tooling/src/main/java/org/netbeans/modules/gradle/tooling/NbProjectInfoBuilder.java b/extide/gradle/netbeans-gradle-tooling/src/main/java/org/netbeans/modules/gradle/tooling/NbProjectInfoBuilder.java
index 65dbd72e66..b63c2f4f52 100644
--- a/extide/gradle/netbeans-gradle-tooling/src/main/java/org/netbeans/modules/gradle/tooling/NbProjectInfoBuilder.java
+++ b/extide/gradle/netbeans-gradle-tooling/src/main/java/org/netbeans/modules/gradle/tooling/NbProjectInfoBuilder.java
@@ -1298,10 +1298,10 @@ class NbProjectInfoBuilder {
}
private void detectDependencies(NbProjectInfoModel model) {
- Set<ComponentIdentifier> ids = new HashSet();
- Map<String, File> projects = new HashMap();
- Map<String, String> unresolvedProblems = new HashMap();
- Map<String, Set<File>> resolvedJvmArtifacts = new HashMap();
+ Set<ComponentIdentifier> ids = new HashSet<>();
+ Map<String, File> projects = new HashMap<>();
+ Map<String, String> unresolvedProblems = new HashMap<>();
+ Map<String, Set<File>> resolvedJvmArtifacts = new HashMap<>();
Set<Configuration> visibleConfigurations = configurationsToSave();
Map<String, String> projectIds = new HashMap<>();
diff --git a/ide/api.debugger/src/org/netbeans/api/debugger/ActionsManager.java b/ide/api.debugger/src/org/netbeans/api/debugger/ActionsManager.java
index ac16138c60..cbf40f4d8f 100644
--- a/ide/api.debugger/src/org/netbeans/api/debugger/ActionsManager.java
+++ b/ide/api.debugger/src/org/netbeans/api/debugger/ActionsManager.java
@@ -638,7 +638,7 @@ public final class ActionsManager {
}
l.destroy ();
}
- lazyListeners = new ArrayList ();
+ lazyListeners = new ArrayList<>();
}
}
synchronized (actionProvidersLock) {
diff --git a/ide/bugtracking/src/org/netbeans/modules/bugtracking/ui/repository/RepositoryComboSupport.java b/ide/bugtracking/src/org/netbeans/modules/bugtracking/ui/repository/RepositoryComboSupport.java
index 35d362b53d..1cfd03f3fb 100644
--- a/ide/bugtracking/src/org/netbeans/modules/bugtracking/ui/repository/RepositoryComboSupport.java
+++ b/ide/bugtracking/src/org/netbeans/modules/bugtracking/ui/repository/RepositoryComboSupport.java
@@ -651,7 +651,7 @@ public final class RepositoryComboSupport implements ItemListener, Runnable {
pingNBRepository(refFile);
}
Collection<RepositoryImpl> repoImpls = RepositoryRegistry.getInstance().getKnownRepositories(true);
- List<Repository> repos = new ArrayList(repoImpls.size());
+ List<Repository> repos = new ArrayList<>(repoImpls.size());
for (RepositoryImpl impl : repoImpls) {
boolean hidden = hideLocalRepository && BugtrackingManager.isLocalConnectorID(impl.getConnectorId());
if ( !hidden &&
diff --git a/ide/db.core/test/unit/src/org/netbeans/modules/db/sql/execute/ui/util/TestCaseContext.java b/ide/db.core/test/unit/src/org/netbeans/modules/db/sql/execute/ui/util/TestCaseContext.java
index 2158f4609e..ad6a39ce34 100644
--- a/ide/db.core/test/unit/src/org/netbeans/modules/db/sql/execute/ui/util/TestCaseContext.java
+++ b/ide/db.core/test/unit/src/org/netbeans/modules/db/sql/execute/ui/util/TestCaseContext.java
@@ -106,7 +106,7 @@ public class TestCaseContext {
private String[] parseContent(File f) throws Exception{
BufferedReader br=new BufferedReader(new InputStreamReader(new FileInputStream(f.getAbsolutePath())));
- List array=new ArrayList();
+ List<String> array=new ArrayList<>();
String s=null;
while((s=br.readLine())!=null){
array.add(s);
diff --git a/ide/db/test/unit/src/org/netbeans/modules/db/explorer/node/RootNodeTest.java b/ide/db/test/unit/src/org/netbeans/modules/db/explorer/node/RootNodeTest.java
index eba37dc967..2690052c93 100644
--- a/ide/db/test/unit/src/org/netbeans/modules/db/explorer/node/RootNodeTest.java
+++ b/ide/db/test/unit/src/org/netbeans/modules/db/explorer/node/RootNodeTest.java
@@ -99,7 +99,7 @@ public class RootNodeTest extends TestCase {
RootNode rootNode = RootNode.instance();
- List<? extends Node> children = new ArrayList(rootNode.getChildNodesSync());
+ List<? extends Node> children = new ArrayList<>(rootNode.getChildNodesSync());
assertEquals("A1", children.get(1).getDisplayName());
assertEquals("B2",
diff --git a/ide/editor.fold/src/org/netbeans/modules/editor/fold/FoldHierarchyTransactionImpl.java b/ide/editor.fold/src/org/netbeans/modules/editor/fold/FoldHierarchyTransactionImpl.java
index cd6fc8c145..ba690466fd 100644
--- a/ide/editor.fold/src/org/netbeans/modules/editor/fold/FoldHierarchyTransactionImpl.java
+++ b/ide/editor.fold/src/org/netbeans/modules/editor/fold/FoldHierarchyTransactionImpl.java
@@ -1263,7 +1263,7 @@ public final class FoldHierarchyTransactionImpl {
}
}
if (reinsertSet == null) {
- reinsertSet = new LinkedHashSet();
+ reinsertSet = new LinkedHashSet<>();
}
if (bl) {
if (f.getFoldCount() > 0 || f.getParent() != null) {
diff --git a/ide/editor.fold/src/org/netbeans/modules/editor/fold/FoldRegistry.java b/ide/editor.fold/src/org/netbeans/modules/editor/fold/FoldRegistry.java
index f74cecdae5..6b1f8cb0fb 100644
--- a/ide/editor.fold/src/org/netbeans/modules/editor/fold/FoldRegistry.java
+++ b/ide/editor.fold/src/org/netbeans/modules/editor/fold/FoldRegistry.java
@@ -79,7 +79,7 @@ public final class FoldRegistry {
this.enumType = enumType;
}
- private static volatile Reference<FoldRegistry> INSTANCE = new WeakReference(null);
+ private static volatile Reference<FoldRegistry> INSTANCE = new WeakReference<>(null);
public static FoldRegistry get() {
FoldRegistry fr = INSTANCE.get();
diff --git a/ide/editor.lib/src/org/netbeans/editor/ext/KeywordMatchGenerator.java b/ide/editor.lib/src/org/netbeans/editor/ext/KeywordMatchGenerator.java
index 57cf7f7083..339d42bb23 100644
--- a/ide/editor.lib/src/org/netbeans/editor/ext/KeywordMatchGenerator.java
+++ b/ide/editor.lib/src/org/netbeans/editor/ext/KeywordMatchGenerator.java
@@ -133,7 +133,7 @@ public class KeywordMatchGenerator {
/** Parse the keywords from a string */
private void parseKeywords(String s) {
- ArrayList keyList = new ArrayList();
+ ArrayList<String> keyList = new ArrayList<>();
StringTokenizer strTok = new StringTokenizer(s);
try {
diff --git a/ide/editor/src/org/netbeans/modules/editor/impl/ComplexValueSettingsFactory.java b/ide/editor/src/org/netbeans/modules/editor/impl/ComplexValueSettingsFactory.java
index c50401c6dd..d5d15bbd07 100644
--- a/ide/editor/src/org/netbeans/modules/editor/impl/ComplexValueSettingsFactory.java
+++ b/ide/editor/src/org/netbeans/modules/editor/impl/ComplexValueSettingsFactory.java
@@ -92,7 +92,7 @@ public final class ComplexValueSettingsFactory {
String handle = prefs.get(NbEditorDocument.INDENT_ENGINE, null);
if (handle != null && handle.indexOf('.') == -1) { //NOI18N
// looks like Lookup handle from previous version
- Lookup.Template<IndentEngine> query = new Lookup.Template(IndentEngine.class, handle, null);
+ Lookup.Template<IndentEngine> query = new Lookup.Template<>(IndentEngine.class, handle, null);
Collection<? extends IndentEngine> all = Lookup.getDefault().lookup(query).allInstances();
if (!all.isEmpty()) {
eng = all.iterator().next();
diff --git a/ide/options.editor/src/org/netbeans/modules/options/indentation/FormattingPanel.java b/ide/options.editor/src/org/netbeans/modules/options/indentation/FormattingPanel.java
index a3b31c5fb1..3737798fe9 100644
--- a/ide/options.editor/src/org/netbeans/modules/options/indentation/FormattingPanel.java
+++ b/ide/options.editor/src/org/netbeans/modules/options/indentation/FormattingPanel.java
@@ -142,7 +142,7 @@ public final class FormattingPanel extends JPanel implements PropertyChangeListe
public void propertyChange(PropertyChangeEvent evt) {
if (evt.getPropertyName() == null || CustomizerSelector.PROP_MIMETYPE.equals(evt.getPropertyName())) {
- DefaultComboBoxModel<PreferencesCustomizer> model = new DefaultComboBoxModel();
+ DefaultComboBoxModel<PreferencesCustomizer> model = new DefaultComboBoxModel<>();
List<? extends PreferencesCustomizer> nue = selector.getCustomizers(selector.getSelectedMimeType());
int preSelectIndex = 0;
int idx = 0;
diff --git a/ide/projectuiapi/test/unit/src/org/netbeans/modules/project/uiapi/ProjectTemplateAttributesProviderTest.java b/ide/projectuiapi/test/unit/src/org/netbeans/modules/project/uiapi/ProjectTemplateAttributesProviderTest.java
index 7af7172654..108c9c2a22 100644
--- a/ide/projectuiapi/test/unit/src/org/netbeans/modules/project/uiapi/ProjectTemplateAttributesProviderTest.java
+++ b/ide/projectuiapi/test/unit/src/org/netbeans/modules/project/uiapi/ProjectTemplateAttributesProviderTest.java
@@ -89,7 +89,7 @@ public class ProjectTemplateAttributesProviderTest extends NbTestCase {
Project prj = ProjectManager.getDefault().findProject(projdir);
FileObject folder = projdir.getFileObject("nbproject");
FileObject template = FileUtil.toFileObject(getDataDir()).getFileObject("file.txt");
- Map<String, Object> init = new HashMap();
+ Map<String, Object> init = new HashMap<>();
init.put("mama", "se raduje");
FileObject result = FileBuilder.createFromTemplate(template, folder, "honza", init, FileBuilder.Mode.FORMAT);
diff --git a/ide/refactoring.api/src/org/netbeans/modules/refactoring/spi/RefactoringCommit.java b/ide/refactoring.api/src/org/netbeans/modules/refactoring/spi/RefactoringCommit.java
index 7672da7e12..e04a389509 100644
--- a/ide/refactoring.api/src/org/netbeans/modules/refactoring/spi/RefactoringCommit.java
+++ b/ide/refactoring.api/src/org/netbeans/modules/refactoring/spi/RefactoringCommit.java
@@ -53,7 +53,7 @@ import org.openide.util.Exceptions;
* @return collection of FileObjects
*/
@NonNull Collection<? extends FileObject> getModifiedFiles() {
- ArrayList<FileObject> result = new ArrayList();
+ ArrayList<FileObject> result = new ArrayList<>();
for (ModificationResult modification:results) {
result.addAll(modification.getModifiedFileObjects());
}
diff --git a/ide/refactoring.api/src/org/netbeans/modules/refactoring/spi/impl/PreviewManager.java b/ide/refactoring.api/src/org/netbeans/modules/refactoring/spi/impl/PreviewManager.java
index c9c9ddd776..339477c85b 100644
--- a/ide/refactoring.api/src/org/netbeans/modules/refactoring/spi/impl/PreviewManager.java
+++ b/ide/refactoring.api/src/org/netbeans/modules/refactoring/spi/impl/PreviewManager.java
@@ -65,7 +65,7 @@ public class PreviewManager {
}
private static PreviewManager manager;
- private WeakHashMap<RefactoringPanel, HashMap<FileObject, Pair>> map = new WeakHashMap();
+ private WeakHashMap<RefactoringPanel, HashMap<FileObject, Pair>> map = new WeakHashMap<>();
private PreviewManager() {
}
diff --git a/ide/refactoring.api/src/org/netbeans/modules/refactoring/spi/impl/RefactoringPanel.java b/ide/refactoring.api/src/org/netbeans/modules/refactoring/spi/impl/RefactoringPanel.java
index 78c497649d..0e08ca8d07 100644
--- a/ide/refactoring.api/src/org/netbeans/modules/refactoring/spi/impl/RefactoringPanel.java
+++ b/ide/refactoring.api/src/org/netbeans/modules/refactoring/spi/impl/RefactoringPanel.java
@@ -955,7 +955,7 @@ public class RefactoringPanel extends JPanel implements FiltersManagerImpl.Filte
}
private Set<FileObject> getModifiedFileObjects() {
- Set<FileObject> result = new HashSet();
+ Set<FileObject> result = new HashSet<>();
for (DataObject dob: DataObject.getRegistry().getModified()) {
result.add(dob.getPrimaryFile());
}
diff --git a/ide/refactoring.api/src/org/netbeans/modules/refactoring/spi/impl/UndoableWrapper.java b/ide/refactoring.api/src/org/netbeans/modules/refactoring/spi/impl/UndoableWrapper.java
index d37082227c..201050136f 100644
--- a/ide/refactoring.api/src/org/netbeans/modules/refactoring/spi/impl/UndoableWrapper.java
+++ b/ide/refactoring.api/src/org/netbeans/modules/refactoring/spi/impl/UndoableWrapper.java
@@ -47,7 +47,7 @@ import org.openide.util.Exceptions;
public class UndoableWrapper implements UndoableEditWrapper {
private AtomicBoolean active = new AtomicBoolean();
- private Map<BaseDocument, UndoableEditDelegate> docToFirst = new HashMap();
+ private Map<BaseDocument, UndoableEditDelegate> docToFirst = new HashMap<>();
private RefactoringSession session;
public UndoableWrapper() {
diff --git a/ide/spi.debugger.ui/src/org/netbeans/modules/debugger/ui/eval/CodeEvaluatorUI.java b/ide/spi.debugger.ui/src/org/netbeans/modules/debugger/ui/eval/CodeEvaluatorUI.java
index a1ab1dbc8b..2331389305 100644
--- a/ide/spi.debugger.ui/src/org/netbeans/modules/debugger/ui/eval/CodeEvaluatorUI.java
+++ b/ide/spi.debugger.ui/src/org/netbeans/modules/debugger/ui/eval/CodeEvaluatorUI.java
@@ -79,7 +79,7 @@ public class CodeEvaluatorUI extends TopComponent implements HelpCtx.Provider,
// Solves the problem with calling getText() in non-AWT thread.
private volatile String codeText = "";
//private History history;
- private Reference<EvaluatorService> debuggerRef = new WeakReference(null);
+ private Reference<EvaluatorService> debuggerRef = new WeakReference<>(null);
private final DbgManagerListener dbgManagerListener;
//private TopComponent resultView;
private final JButton dropDownButton;
diff --git a/ide/spi.debugger.ui/test/unit/src/org/netbeans/api/debugger/PropertiesTest.java b/ide/spi.debugger.ui/test/unit/src/org/netbeans/api/debugger/PropertiesTest.java
index 3a614bdb7c..a63e57ad7f 100644
--- a/ide/spi.debugger.ui/test/unit/src/org/netbeans/api/debugger/PropertiesTest.java
+++ b/ide/spi.debugger.ui/test/unit/src/org/netbeans/api/debugger/PropertiesTest.java
@@ -162,7 +162,7 @@ public class PropertiesTest extends TestCase {
// First test that the properties can be collected:
Properties p = Properties.getDefault();
p = p.getProperties("listening");
- WeakReference<? extends Properties> pRef = new WeakReference(p);
+ WeakReference<? extends Properties> pRef = new WeakReference<>(p);
p = null;
System.gc();
NbTestCase.assertGC("The Properties are not collected.", pRef);
diff --git a/ide/terminal.nb/test/unit/src/org/netbeans/modules/terminal/T3_HardClose_Test.java b/ide/terminal.nb/test/unit/src/org/netbeans/modules/terminal/T3_HardClose_Test.java
index f19321772f..05a9885072 100644
--- a/ide/terminal.nb/test/unit/src/org/netbeans/modules/terminal/T3_HardClose_Test.java
+++ b/ide/terminal.nb/test/unit/src/org/netbeans/modules/terminal/T3_HardClose_Test.java
@@ -109,16 +109,16 @@ public class T3_HardClose_Test extends TestSupport {
termRef = new WeakReference(IOTerm.term(io));
}
- Reference<InputOutput> ioRef = new WeakReference(io);
+ Reference<InputOutput> ioRef = new WeakReference<>(io);
io = null;
- Reference<Action> actionRef = new WeakReference(dummyAction);
+ Reference<Action> actionRef = new WeakReference<>(dummyAction);
dummyAction = null;
- Reference<PropertyChangeListener> pclRef = new WeakReference(pcl);
+ Reference<PropertyChangeListener> pclRef = new WeakReference<>(pcl);
pcl = null;
- Reference<VetoableChangeListener> vclRef = new WeakReference(vcl);
+ Reference<VetoableChangeListener> vclRef = new WeakReference<>(vcl);
vcl = null;
diff --git a/ide/utilities/src/org/netbeans/modules/openfile/OpenFileDialogFilter.java b/ide/utilities/src/org/netbeans/modules/openfile/OpenFileDialogFilter.java
index 01ba1aad30..8e4ef91c5d 100644
--- a/ide/utilities/src/org/netbeans/modules/openfile/OpenFileDialogFilter.java
+++ b/ide/utilities/src/org/netbeans/modules/openfile/OpenFileDialogFilter.java
@@ -271,7 +271,7 @@ public abstract class OpenFileDialogFilter extends FileFilter {
@Override
public String[] getSuffixes() {
- ArrayList<String> suffixList = new ArrayList();
+ ArrayList<String> suffixList = new ArrayList<>();
for(String extension : getFilter().getExtensions()) {
suffixList.add(EXTENSION_SEPARATOR + extension);
}
diff --git a/ide/xml.axi/src/org/netbeans/modules/xml/axi/impl/SchemaUpdate.java b/ide/xml.axi/src/org/netbeans/modules/xml/axi/impl/SchemaUpdate.java
index bb24b5935f..9f02e2eb8e 100644
--- a/ide/xml.axi/src/org/netbeans/modules/xml/axi/impl/SchemaUpdate.java
+++ b/ide/xml.axi/src/org/netbeans/modules/xml/axi/impl/SchemaUpdate.java
@@ -61,7 +61,7 @@ public class SchemaUpdate {
if(key != null) {
List<AXIComponent> items = uniqueMap.get(key);
if(items == null) {
- items = new ArrayList();
+ items = new ArrayList<>();
uniqueMap.put(key, items);
}
items.add(key);
diff --git a/ide/xml.core/src/org/netbeans/modules/xml/dtd/grammar/DTDParser.java b/ide/xml.core/src/org/netbeans/modules/xml/dtd/grammar/DTDParser.java
index 3d12a5c598..d77c2db2cf 100644
--- a/ide/xml.core/src/org/netbeans/modules/xml/dtd/grammar/DTDParser.java
+++ b/ide/xml.core/src/org/netbeans/modules/xml/dtd/grammar/DTDParser.java
@@ -132,10 +132,10 @@ public class DTDParser {
models = new HashMap();
notations = new TreeSet<>();
entities = new TreeSet<>();
- anys = new HashSet();
+ anys = new HashSet<>();
enums = new HashMap();
attrDefaults = new HashMap();
- emptyElements = new HashSet();
+ emptyElements = new HashSet<>();
dtd = new DTDGrammar(elements, models, attrs, attrDefaults, enums, entities, notations, emptyElements);
}
@@ -243,7 +243,7 @@ public class DTDParser {
private class EntityResolverWrapper implements EntityResolver {
private EntityResolver resolver;
- private ArrayList<String> resolvedSystemIds = new ArrayList(3);
+ private ArrayList<String> resolvedSystemIds = new ArrayList<>(3);
public EntityResolverWrapper(EntityResolver resolver) {
this.resolver = resolver;
diff --git a/ide/xml.schema.model/src/org/netbeans/modules/xml/schema/model/impl/RefactorVisitor.java b/ide/xml.schema.model/src/org/netbeans/modules/xml/schema/model/impl/RefactorVisitor.java
index 052ebc6678..a439275a9b 100644
--- a/ide/xml.schema.model/src/org/netbeans/modules/xml/schema/model/impl/RefactorVisitor.java
+++ b/ide/xml.schema.model/src/org/netbeans/modules/xml/schema/model/impl/RefactorVisitor.java
@@ -226,7 +226,7 @@ class RefactorVisitor extends DefaultSchemaVisitor {
NamedComponentReference<GlobalSimpleType> ref = createReference(GlobalSimpleType.class, u);
if (ref != null) {
ArrayList<NamedComponentReference<GlobalSimpleType>> members =
- new ArrayList(u.getMemberTypes());
+ new ArrayList<>(u.getMemberTypes());
for (int i=0; i<members.size(); i++) {
if (members.get(i).getRefString().indexOf(oldName) > -1) {
members.remove(i);
diff --git a/ide/xml.schema.model/test/unit/src/org/netbeans/modules/xml/schema/model/SchemaTest.java b/ide/xml.schema.model/test/unit/src/org/netbeans/modules/xml/schema/model/SchemaTest.java
index c24a24ffec..4a6f3745f9 100644
--- a/ide/xml.schema.model/test/unit/src/org/netbeans/modules/xml/schema/model/SchemaTest.java
+++ b/ide/xml.schema.model/test/unit/src/org/netbeans/modules/xml/schema/model/SchemaTest.java
@@ -66,7 +66,7 @@ public class SchemaTest extends TestCase {
public void testReadElements() throws Exception {
- ArrayList<GlobalElement> elements = new ArrayList(schema.getElements());
+ ArrayList<GlobalElement> elements = new ArrayList<>(schema.getElements());
assertEquals("Schema.getElements", 2, elements.size());
assertEquals("Schema.getElements(1)", "comment", elements.get(1).getName());
}
@@ -111,7 +111,7 @@ public class SchemaTest extends TestCase {
assertEquals("testGetBlockDefaultEffective.0", "#all", schema.getBlockDefaultEffective().toString());
- ArrayList<GlobalComplexType> types = new ArrayList(schema.getComplexTypes());
+ ArrayList<GlobalComplexType> types = new ArrayList<>(schema.getComplexTypes());
GlobalComplexType typePurchaseOrder = null;
if (types.get(0).getName().equals("PurchaseOrderType")) {
typePurchaseOrder = types.get(0);
@@ -199,7 +199,7 @@ public class SchemaTest extends TestCase {
}
public void testGetComplexTypes() {
- ArrayList<GlobalComplexType> types = new ArrayList(schema.getComplexTypes());
+ ArrayList<GlobalComplexType> types = new ArrayList<>(schema.getComplexTypes());
GlobalComplexType typePurchaseOrder = null;
if (types.get(0).getName().equals("PurchaseOrderType")) {
typePurchaseOrder = types.get(0);
@@ -211,7 +211,7 @@ public class SchemaTest extends TestCase {
Sequence seq = (Sequence) ctd;
assertEquals("getComplexTypes:PurchaseOrder:sequence count", 3, seq.getChildren().size());
- ArrayList<SchemaComponent> elements = new ArrayList(seq.getChildren());
+ ArrayList<SchemaComponent> elements = new ArrayList<>(seq.getChildren());
assertTrue("getComplexTypes:PurchaseOrder:sequence.element(0).name", elements.get(0) instanceof LocalElement);
LocalElement e = (LocalElement) elements.get(1);
assertNotNull("getComplexTypes:PurchaseOrder:billTo type null", e.getType());
@@ -287,8 +287,8 @@ public class SchemaTest extends TestCase {
model.endTransaction();
model.startTransaction();
- ArrayList<GlobalComplexType> types = new ArrayList(schema.getComplexTypes());
- ArrayList<GlobalElement> elements = new ArrayList(schema.getElements());
+ ArrayList<GlobalComplexType> types = new ArrayList<>(schema.getComplexTypes());
+ ArrayList<GlobalElement> elements = new ArrayList<>(schema.getElements());
GlobalElement element = elements.get(0);
if(element.getName().equals("purchaseOrder")) {
@@ -325,8 +325,8 @@ public class SchemaTest extends TestCase {
int initialCount = schema.getElements().size();
model.startTransaction();
- ArrayList<GlobalComplexType> types = new ArrayList(schema.getComplexTypes());
- ArrayList<GlobalElement> elements = new ArrayList(schema.getElements());
+ ArrayList<GlobalComplexType> types = new ArrayList<>(schema.getComplexTypes());
+ ArrayList<GlobalElement> elements = new ArrayList<>(schema.getElements());
GlobalElement element = elements.get(0);
if(element.getName().equals("purchaseOrder")) {
diff --git a/ide/xml.schema.model/test/unit/src/org/netbeans/modules/xml/schema/model/impl/xdm/SyncTest.java b/ide/xml.schema.model/test/unit/src/org/netbeans/modules/xml/schema/model/impl/xdm/SyncTest.java
index 7cdebb0fe7..a6f78d7d35 100644
--- a/ide/xml.schema.model/test/unit/src/org/netbeans/modules/xml/schema/model/impl/xdm/SyncTest.java
+++ b/ide/xml.schema.model/test/unit/src/org/netbeans/modules/xml/schema/model/impl/xdm/SyncTest.java
@@ -387,7 +387,7 @@ public class SyncTest extends TestCase {
UndoManager ur = new UndoManager();
model.addUndoableEditListener(ur);
- ArrayList<GlobalComplexType> types = new ArrayList(model.getSchema().getComplexTypes());
+ ArrayList<GlobalComplexType> types = new ArrayList<>(model.getSchema().getComplexTypes());
GlobalComplexType type = types.get(1);
assertEquals("USAddress", type.getName());
Sequence seq = (Sequence) type.getDefinition();
diff --git a/ide/xml.schema.model/test/unit/src/org/netbeans/modules/xml/schema/model/visitor/FindUsageVisitorTest.java b/ide/xml.schema.model/test/unit/src/org/netbeans/modules/xml/schema/model/visitor/FindUsageVisitorTest.java
index 283aec803f..2d87ef9089 100644
--- a/ide/xml.schema.model/test/unit/src/org/netbeans/modules/xml/schema/model/visitor/FindUsageVisitorTest.java
+++ b/ide/xml.schema.model/test/unit/src/org/netbeans/modules/xml/schema/model/visitor/FindUsageVisitorTest.java
@@ -70,7 +70,7 @@ public class FindUsageVisitorTest extends TestCase {
SchemaModel model = Util.loadSchemaModel(TEST_XSD);
schema = model.getSchema();
- Collection<GlobalType> types = new ArrayList(schema.getComplexTypes());
+ Collection<GlobalType> types = new ArrayList<>(schema.getComplexTypes());
types.addAll(schema.getSimpleTypes());
for(GlobalType type : types) {
if(type.getName().equals(FIND_USAGE_FOR_TYPE)) {
diff --git a/ide/xml.wsdl.model/src/org/netbeans/modules/xml/wsdl/model/impl/ElementFactoryRegistry.java b/ide/xml.wsdl.model/src/org/netbeans/modules/xml/wsdl/model/impl/ElementFactoryRegistry.java
index 60ab89a0b6..babc8bf8d0 100644
--- a/ide/xml.wsdl.model/src/org/netbeans/modules/xml/wsdl/model/impl/ElementFactoryRegistry.java
+++ b/ide/xml.wsdl.model/src/org/netbeans/modules/xml/wsdl/model/impl/ElementFactoryRegistry.java
@@ -140,7 +140,7 @@ public class ElementFactoryRegistry {
public void addEmbeddedModelQNames(AbstractDocumentModel embeddedModel) {
if (knownEmbeddedModelTypes == null) {
- knownEmbeddedModelTypes = new HashSet();
+ knownEmbeddedModelTypes = new HashSet<>();
}
if (! knownEmbeddedModelTypes.contains(embeddedModel.getClass())) {
knownQNames().addAll(embeddedModel.getQNames());
diff --git a/ide/xml.wsdl.model/test/unit/src/org/netbeans/modules/xml/wsdl/model/ImportTest.java b/ide/xml.wsdl.model/test/unit/src/org/netbeans/modules/xml/wsdl/model/ImportTest.java
index 394169833b..2348e53dd0 100644
--- a/ide/xml.wsdl.model/test/unit/src/org/netbeans/modules/xml/wsdl/model/ImportTest.java
+++ b/ide/xml.wsdl.model/test/unit/src/org/netbeans/modules/xml/wsdl/model/ImportTest.java
@@ -95,7 +95,7 @@ public class ImportTest extends TestCase {
NamespaceLocation.PO.refreshResourceFile();
WSDLModel model = TestCatalogModel.getDefault().getWSDLModel(NamespaceLocation.TESTOP);
Definitions d = model.getDefinitions();
- List<Message> messages = new ArrayList(d.getMessages());
+ List<Message> messages = new ArrayList<>(d.getMessages());
Message m1 = messages.get(0);
NamedComponentReference<GlobalType> type = m1.getParts().iterator().next().getType();
@@ -109,7 +109,7 @@ public class ImportTest extends TestCase {
NamespaceLocation.PO_1.refreshResourceFile();
WSDLModel model = TestCatalogModel.getDefault().getWSDLModel(NamespaceLocation.TESTIMPORT);
Definitions d = model.getDefinitions();
- List<Message> messages = new ArrayList(d.getMessages());
+ List<Message> messages = new ArrayList<>(d.getMessages());
Message m1 = messages.get(0);
GlobalElement ge = m1.getParts().iterator().next().getElement().get();
assertEquals("purchaseOrder", ge.getName());
@@ -118,7 +118,7 @@ public class ImportTest extends TestCase {
public void testXsdTypeWithoutImport() throws Exception {
WSDLModel model = TestCatalogModel.getDefault().getWSDLModel(NamespaceLocation.ECHO);
Definitions d = model.getDefinitions();
- List<Message> messages = new ArrayList(d.getMessages());
+ List<Message> messages = new ArrayList<>(d.getMessages());
Message m1 = messages.get(0);
assertEquals("message_0", m1.getName());
Part part = m1.getParts().iterator().next();
diff --git a/ide/xml.wsdl.model/test/unit/src/org/netbeans/modules/xml/wsdl/model/readwrite/SimpleTest.java b/ide/xml.wsdl.model/test/unit/src/org/netbeans/modules/xml/wsdl/model/readwrite/SimpleTest.java
index 875db688b7..1cd893196f 100644
--- a/ide/xml.wsdl.model/test/unit/src/org/netbeans/modules/xml/wsdl/model/readwrite/SimpleTest.java
+++ b/ide/xml.wsdl.model/test/unit/src/org/netbeans/modules/xml/wsdl/model/readwrite/SimpleTest.java
@@ -206,7 +206,7 @@ public class SimpleTest extends NbTestCase {
String prefix = acm.getPeer().getPrefix();
assertTrue("wsdl prefix is not null or empty: "+prefix, prefix == null || prefix.equals(""));
assertEquals("read.message.name", "HelloServiceSEI_sayHelloResponse", m.getName());
- List<Part> parts = new ArrayList(m.getParts());
+ List<Part> parts = new ArrayList<>(m.getParts());
assertEquals("read.message.part.name", "result", parts.iterator().next().getName());
assertEquals("string", parts.get(0).getType().get().getName());
diff --git a/ide/xml.xam/src/org/netbeans/modules/xml/xam/dom/AbstractDocumentModel.java b/ide/xml.xam/src/org/netbeans/modules/xml/xam/dom/AbstractDocumentModel.java
index 60bc733065..b4ab142436 100644
--- a/ide/xml.xam/src/org/netbeans/modules/xml/xam/dom/AbstractDocumentModel.java
+++ b/ide/xml.xam/src/org/netbeans/modules/xml/xam/dom/AbstractDocumentModel.java
@@ -366,7 +366,7 @@ public abstract class AbstractDocumentModel<T extends DocumentComponent<T>>
}
protected void firePropertyChangedEvents(SyncUnit unit, Element oldElement) {
- Set<String> propertyNames = new HashSet(unit.getRemovedAttributes().keySet());
+ Set<String> propertyNames = new HashSet<>(unit.getRemovedAttributes().keySet());
propertyNames.addAll(unit.getAddedAttributes().keySet());
for (String name : propertyNames) {
Attr oldAttr = unit.getRemovedAttributes().get(name);
diff --git a/ide/xml.xam/src/org/netbeans/modules/xml/xam/dom/ChangeInfo.java b/ide/xml.xam/src/org/netbeans/modules/xml/xam/dom/ChangeInfo.java
index b2b121bb5e..c19d650144 100644
--- a/ide/xml.xam/src/org/netbeans/modules/xml/xam/dom/ChangeInfo.java
+++ b/ide/xml.xam/src/org/netbeans/modules/xml/xam/dom/ChangeInfo.java
@@ -79,7 +79,7 @@ public class ChangeInfo {
return rootToParent;
}
public List<Element> getParentToRootPath() {
- ArrayList<Element> ret = new ArrayList(rootToParent);
+ ArrayList<Element> ret = new ArrayList<>(rootToParent);
Collections.reverse(ret);
return ret;
}
diff --git a/ide/xml.xdm/src/org/netbeans/modules/xml/xdm/XDMModel.java b/ide/xml.xdm/src/org/netbeans/modules/xml/xdm/XDMModel.java
index 004412ff2e..2b42de6695 100644
--- a/ide/xml.xdm/src/org/netbeans/modules/xml/xdm/XDMModel.java
+++ b/ide/xml.xdm/src/org/netbeans/modules/xml/xdm/XDMModel.java
@@ -409,7 +409,7 @@ public class XDMModel {
assert ancestors.size() > 0;
Element root = (Element) (ancestors.size() == 1 ?
parent : ancestors.get(ancestors.size()-2));
- List<Node> parentAndAncestors = new ArrayList(ancestors);
+ List<Node> parentAndAncestors = new ArrayList<>(ancestors);
parentAndAncestors.add(0, parent);
consolidateAttributePrefix(parentAndAncestors, newNode);
NamedNodeMap nnm = newNode.getAttributes();
diff --git a/java/ant.hints/src/org/netbeans/modules/ant/hints/errors/EnablePreviewAntProj.java b/java/ant.hints/src/org/netbeans/modules/ant/hints/errors/EnablePreviewAntProj.java
index ab555521ba..ce88520028 100644
--- a/java/ant.hints/src/org/netbeans/modules/ant/hints/errors/EnablePreviewAntProj.java
+++ b/java/ant.hints/src/org/netbeans/modules/ant/hints/errors/EnablePreviewAntProj.java
@@ -203,7 +203,7 @@ public class EnablePreviewAntProj implements ErrorRule<Void> {
if (prjDir == null) {
return false;
}
- List<FileObject> antProjectFiles = new ArrayList();
+ List<FileObject> antProjectFiles = new ArrayList<>();
antProjectFiles.add(prjDir.getFileObject("build.xml")); // NOI18N
antProjectFiles.add(prjDir.getFileObject("nbproject/project.properties")); // NOI18N
antProjectFiles.add(prjDir.getFileObject("nbproject/project.xml")); // NOI18N
diff --git a/java/debugger.jpda.ui/src/org/netbeans/modules/debugger/jpda/ui/SourcePath.java b/java/debugger.jpda.ui/src/org/netbeans/modules/debugger/jpda/ui/SourcePath.java
index 9fd49cb697..17596d01f7 100644
--- a/java/debugger.jpda.ui/src/org/netbeans/modules/debugger/jpda/ui/SourcePath.java
+++ b/java/debugger.jpda.ui/src/org/netbeans/modules/debugger/jpda/ui/SourcePath.java
@@ -635,7 +635,7 @@ public class SourcePath {
boolean isNewLineExp = false;
if (lastOperations != null && lastOperations.size() > 0) {
if (annotations == null) {
- annotations = new ArrayList();
+ annotations = new ArrayList<>();
}
isNewLineExp = currentOperation == null;
for (int i = 0; i < lastOperations.size(); i++) {
diff --git a/java/debugger.jpda.ui/src/org/netbeans/modules/debugger/jpda/ui/options/OptionsInitializer.java b/java/debugger.jpda.ui/src/org/netbeans/modules/debugger/jpda/ui/options/OptionsInitializer.java
index 404c806bd6..cb8becec3c 100644
--- a/java/debugger.jpda.ui/src/org/netbeans/modules/debugger/jpda/ui/options/OptionsInitializer.java
+++ b/java/debugger.jpda.ui/src/org/netbeans/modules/debugger/jpda/ui/options/OptionsInitializer.java
@@ -52,7 +52,7 @@ public class OptionsInitializer implements Initializer {
return allFilters;
}
if (CLASS_FILTERS_ENABLED.equals(propertyName)) {
- Set<String> enabled = new HashSet();
+ Set<String> enabled = new HashSet<>();
fillClassFilters(enabled, true);
return enabled;
}
diff --git a/java/debugger.jpda.ui/test/qa-functional/src/org/netbeans/modules/debugger/jpda/ui/CloseSessionsTest.java b/java/debugger.jpda.ui/test/qa-functional/src/org/netbeans/modules/debugger/jpda/ui/CloseSessionsTest.java
index 73727aee19..dc64b30f62 100644
--- a/java/debugger.jpda.ui/test/qa-functional/src/org/netbeans/modules/debugger/jpda/ui/CloseSessionsTest.java
+++ b/java/debugger.jpda.ui/test/qa-functional/src/org/netbeans/modules/debugger/jpda/ui/CloseSessionsTest.java
@@ -96,7 +96,7 @@ public class CloseSessionsTest extends DebuggerTestCase {
.getCurrentSession()
.lookup(null, JPDADebugger.class);
JPDADebugger debugger = list.get(0);
- WeakReference<? extends JPDADebugger> debuggerRef = new WeakReference(debugger);
+ WeakReference<? extends JPDADebugger> debuggerRef = new WeakReference<>(debugger);
//finish debugging
Utilities.endAllSessions();
diff --git a/java/form/src/org/netbeans/modules/form/FormDesigner.java b/java/form/src/org/netbeans/modules/form/FormDesigner.java
index 79a4f36a0f..9a832ee4b3 100644
--- a/java/form/src/org/netbeans/modules/form/FormDesigner.java
+++ b/java/form/src/org/netbeans/modules/form/FormDesigner.java
@@ -1173,7 +1173,7 @@ public class FormDesigner {
return;
}
Node[] nodes = getSelectedNodes();
- List<RADComponent> components = new ArrayList(nodes.length);
+ List<RADComponent> components = new ArrayList<>(nodes.length);
for (Node n : nodes) {
FormCookie formCookie = n.getCookie(FormCookie.class);
if (formCookie != null) {
@@ -2690,7 +2690,7 @@ public class FormDesigner {
}
private FormModelEvent[] sortEvents(FormModelEvent[] events) {
- LinkedList<FormModelEvent> l = new LinkedList();
+ LinkedList<FormModelEvent> l = new LinkedList<>();
for (FormModelEvent event : events) {
l.add(event);
if (event.getContainer() instanceof RADVisualContainer) {
diff --git a/java/form/src/org/netbeans/modules/form/FormEditorCustomizer.java b/java/form/src/org/netbeans/modules/form/FormEditorCustomizer.java
index 522578da8a..1c48e4533c 100644
--- a/java/form/src/org/netbeans/modules/form/FormEditorCustomizer.java
+++ b/java/form/src/org/netbeans/modules/form/FormEditorCustomizer.java
@@ -279,7 +279,7 @@ public final class FormEditorCustomizer extends JPanel implements ActionListene
if (FormUtils.getPresetValue("OPTIONS_"+key+"_HIDDEN", false)) { // NOI18N
for (Component comp : components) {
if (brandedInvisibleComponents == null) {
- brandedInvisibleComponents = new HashSet();
+ brandedInvisibleComponents = new HashSet<>();
}
brandedInvisibleComponents.add(comp);
}
diff --git a/java/form/src/org/netbeans/modules/form/FormPropertyEditorManager.java b/java/form/src/org/netbeans/modules/form/FormPropertyEditorManager.java
index 89cebb35da..b03d46c9b0 100644
--- a/java/form/src/org/netbeans/modules/form/FormPropertyEditorManager.java
+++ b/java/form/src/org/netbeans/modules/form/FormPropertyEditorManager.java
@@ -267,7 +267,7 @@ public final class FormPropertyEditorManager {
private static Map<Class,Class> getEditorClassCache(String key) {
if (editorClassCache == null) {
- editorClassCache = new HashMap();
+ editorClassCache = new HashMap<>();
}
Map<Class, Class> classCache = editorClassCache.get(key);
if (classCache == null) {
diff --git a/java/form/src/org/netbeans/modules/form/JavaCodeGenerator.java b/java/form/src/org/netbeans/modules/form/JavaCodeGenerator.java
index 29296e094a..4496933c5a 100644
--- a/java/form/src/org/netbeans/modules/form/JavaCodeGenerator.java
+++ b/java/form/src/org/netbeans/modules/form/JavaCodeGenerator.java
@@ -3499,7 +3499,7 @@ class JavaCodeGenerator extends CodeGenerator {
}
private void importFQNs(boolean handleInitComponents, boolean handleVariables, String... eventHandlers) {
- List<int[]> list = new ArrayList();
+ List<int[]> list = new ArrayList<>();
if (handleInitComponents) {
SimpleSection initComponentsSection = formEditor.getInitComponentSection();
int[] span = formEditor.getFormJavaSource().getMethodSpan("initComponents"); // NOI18N
diff --git a/java/form/src/org/netbeans/modules/form/editors/PrimitiveTypeArrayEditor.java b/java/form/src/org/netbeans/modules/form/editors/PrimitiveTypeArrayEditor.java
index 2446adcc9e..e1f12b8bdf 100644
--- a/java/form/src/org/netbeans/modules/form/editors/PrimitiveTypeArrayEditor.java
+++ b/java/form/src/org/netbeans/modules/form/editors/PrimitiveTypeArrayEditor.java
@@ -66,7 +66,7 @@ public class PrimitiveTypeArrayEditor extends PropertyEditorSupport
String tempVal = ""; // NOI18N
char prevChar = ' '; // NOI18N
char prevPrevChar = ' '; // NOI18N
- ArrayList<String> list = new ArrayList();
+ ArrayList<String> list = new ArrayList<>();
for (int i = 0; i < body.length(); i++) {
char actChar = body.charAt(i);
diff --git a/java/form/src/org/netbeans/modules/form/layoutdesign/LayoutDesigner.java b/java/form/src/org/netbeans/modules/form/layoutdesign/LayoutDesigner.java
index 9a4ddd6759..c869fcc565 100644
--- a/java/form/src/org/netbeans/modules/form/layoutdesign/LayoutDesigner.java
+++ b/java/form/src/org/netbeans/modules/form/layoutdesign/LayoutDesigner.java
@@ -362,7 +362,7 @@ public final class LayoutDesigner implements LayoutConstants {
* @return List of Ids of components that can be dragged together
*/
public List<String> getDraggableComponents(List<String> componentIds) {
- List<LayoutComponent> components = new ArrayList(componentIds.size());
+ List<LayoutComponent> components = new ArrayList<>(componentIds.size());
for (String compId : componentIds) {
LayoutComponent comp = layoutModel.getLayoutComponent(compId);
if (comp != null) {
@@ -3821,7 +3821,7 @@ public final class LayoutDesigner implements LayoutConstants {
}
private void removeComponents(LayoutComponent[] components, boolean fromModel) {
- Set<LayoutComponent> conts = new HashSet();
+ Set<LayoutComponent> conts = new HashSet<>();
for (LayoutComponent comp : components) {
if (comp != null) {
if (logTestCode() && fromModel) {
diff --git a/java/form/src/org/netbeans/modules/form/layoutdesign/LayoutFeeder.java b/java/form/src/org/netbeans/modules/form/layoutdesign/LayoutFeeder.java
index 496b04b3c2..8ac7c5d09d 100644
--- a/java/form/src/org/netbeans/modules/form/layoutdesign/LayoutFeeder.java
+++ b/java/form/src/org/netbeans/modules/form/layoutdesign/LayoutFeeder.java
@@ -3852,7 +3852,7 @@ class LayoutFeeder implements LayoutConstants {
}
if (gaps[LEADING] != null && gaps[TRAILING] != null) {
if (unifyGaps == null) {
- unifyGaps = new ArrayList();
+ unifyGaps = new ArrayList<>();
}
unifyGaps.add(gaps);
}
diff --git a/java/form/src/org/netbeans/modules/form/layoutdesign/LayoutInterval.java b/java/form/src/org/netbeans/modules/form/layoutdesign/LayoutInterval.java
index 7a27dae596..963416278b 100644
--- a/java/form/src/org/netbeans/modules/form/layoutdesign/LayoutInterval.java
+++ b/java/form/src/org/netbeans/modules/form/layoutdesign/LayoutInterval.java
@@ -1275,7 +1275,7 @@ public final class LayoutInterval implements LayoutConstants {
static void prepareDiagnostics() {
cleanDiagnostics();
- removedIntervalsMap = new HashMap();
+ removedIntervalsMap = new HashMap<>();
}
static void cleanDiagnostics() {
diff --git a/java/form/src/org/netbeans/modules/form/layoutdesign/LayoutOperations.java b/java/form/src/org/netbeans/modules/form/layoutdesign/LayoutOperations.java
index a6d30ced0a..12618a4918 100644
--- a/java/form/src/org/netbeans/modules/form/layoutdesign/LayoutOperations.java
+++ b/java/form/src/org/netbeans/modules/form/layoutdesign/LayoutOperations.java
@@ -1317,8 +1317,8 @@ class LayoutOperations implements LayoutConstants {
int commonGapLeadingSize = Integer.MIN_VALUE;
int commonGapTrailingSize = Integer.MIN_VALUE;
boolean mayNeedSecondPass = false;
- List<LayoutInterval> reduceToZeroGapsLeading = new LinkedList();
- List<LayoutInterval> reduceToZeroGapsTrailing = new LinkedList();
+ List<LayoutInterval> reduceToZeroGapsLeading = new LinkedList<>();
+ List<LayoutInterval> reduceToZeroGapsTrailing = new LinkedList<>();
for (int i=0; i < group.getSubIntervalCount(); i++) {
LayoutInterval li = group.getSubInterval(i);
diff --git a/java/form/src/org/netbeans/modules/form/layoutdesign/VisualState.java b/java/form/src/org/netbeans/modules/form/layoutdesign/VisualState.java
index 639e3ad972..a2cbff599e 100644
--- a/java/form/src/org/netbeans/modules/form/layoutdesign/VisualState.java
+++ b/java/form/src/org/netbeans/modules/form/layoutdesign/VisualState.java
@@ -400,7 +400,7 @@ public class VisualState implements LayoutConstants {
// Assuming collectResizingDiffs has already been done.
void updateToActualSize(LayoutInterval group, int dimension, int sizeUpdate) {
- Set<LayoutInterval> defaultCandidates = new HashSet();
+ Set<LayoutInterval> defaultCandidates = new HashSet<>();
updateToActualSize(group, dimension, sizeUpdate, defaultCandidates);
if (sizeUpdate == 1 && !defaultCandidates.isEmpty()) {
// There are some candidates (i.e. "active" intervals with ATTR_FLEX_SIZEDEF
diff --git a/java/form/test/qa-functional/src/org/netbeans/qa/form/visualDevelopment/AddComponents_SWING.java b/java/form/test/qa-functional/src/org/netbeans/qa/form/visualDevelopment/AddComponents_SWING.java
index 842d7d4e0e..ff38c28f43 100644
--- a/java/form/test/qa-functional/src/org/netbeans/qa/form/visualDevelopment/AddComponents_SWING.java
+++ b/java/form/test/qa-functional/src/org/netbeans/qa/form/visualDevelopment/AddComponents_SWING.java
@@ -91,7 +91,7 @@ public class AddComponents_SWING extends ExtJellyTestCase {
*/
public void testAddAndCompile() {
String categoryName = "Swing Controls";
- ArrayList<String> code=new ArrayList();
+ ArrayList<String> code=new ArrayList<>();
pto = new ProjectsTabOperator();
ProjectRootNode prn = pto.getProjectRootNode(DATA_PROJECT_NAME);
prn.select();
diff --git a/java/i18n/src/org/netbeans/modules/i18n/FileSelector.java b/java/i18n/src/org/netbeans/modules/i18n/FileSelector.java
index b54fe32be0..cb025cc294 100644
--- a/java/i18n/src/org/netbeans/modules/i18n/FileSelector.java
+++ b/java/i18n/src/org/netbeans/modules/i18n/FileSelector.java
@@ -131,7 +131,7 @@ public class FileSelector extends JPanel implements PropertyChangeListener, Expl
}
String packageName = cp.getResourceName(fo.getParent());
Node root = manager.getRootContext();
- List<String> path = new ArrayList();
+ List<String> path = new ArrayList<>();
for (FileObject fo2 : cp.getRoots()) {
if (FileUtil.isParentOf(fo2, fo)) {
path.add(fo2.getName());
diff --git a/java/j2ee.jpa.verification/src/org/netbeans/modules/j2ee/jpa/verification/JPAProblemContext.java b/java/j2ee.jpa.verification/src/org/netbeans/modules/j2ee/jpa/verification/JPAProblemContext.java
index 3ea0001406..046ac01884 100644
--- a/java/j2ee.jpa.verification/src/org/netbeans/modules/j2ee/jpa/verification/JPAProblemContext.java
+++ b/java/j2ee.jpa.verification/src/org/netbeans/modules/j2ee/jpa/verification/JPAProblemContext.java
@@ -106,7 +106,7 @@ public class JPAProblemContext extends ProblemContext {
public void addCancelListener(CancelListener aThis) {
if(cListeners == null) {
- cListeners = new HashSet();
+ cListeners = new HashSet<>();
}
synchronized(cListenersLock) {
cListeners.add(aThis);
diff --git a/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/editor/completion/db/DBCompletionContextResolver.java b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/editor/completion/db/DBCompletionContextResolver.java
index d5a76c5954..169c6c52ec 100644
--- a/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/editor/completion/db/DBCompletionContextResolver.java
+++ b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/editor/completion/db/DBCompletionContextResolver.java
@@ -132,7 +132,7 @@ public class DBCompletionContextResolver implements CompletionContextResolver {
} else {
//Database connection not established ->
//put 'connect' CC item
- result = new ArrayList();
+ result = new ArrayList<>();
result.add(new JPACompletionItem.NoConnectionElementItem(dbconn));
return result;
}
diff --git a/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/editor/completion/db/Schema.java b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/editor/completion/db/Schema.java
index 860fd57fa1..b67a410d24 100644
--- a/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/editor/completion/db/Schema.java
+++ b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/editor/completion/db/Schema.java
@@ -107,7 +107,7 @@ public class Schema {
}
private Set<String> getTableNamesByType(String type) throws SQLException {
- Set<String> result = new TreeSet();
+ Set<String> result = new TreeSet<>();
try (ResultSet rs = provider.getMetaData().getTables(catalog.getName(), name, "%", new String[] { type })) { // NOI18N
while (rs.next()) {
diff --git a/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/provider/DataNucleusProvider.java b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/provider/DataNucleusProvider.java
index 5e5b0ef92f..b43445c088 100644
--- a/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/provider/DataNucleusProvider.java
+++ b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/provider/DataNucleusProvider.java
@@ -87,7 +87,7 @@ class DataNucleusProvider extends Provider{
@Override
public Map getDefaultVendorSpecificProperties() {
- Hashtable<String,String> properties = new Hashtable();
+ Hashtable<String,String> properties = new Hashtable<>();
properties.put("datanucleus.NontransactionalRead", "true"); //NOI18N
properties.put("datanucleus.NontransactionalWrite", "true"); //NOI18N
properties.put("datanucleus.ConnectionURL", "appengine"); //NOI18N
diff --git a/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/wizard/jpacontroller/JpaControllerSetupPanel.java b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/wizard/jpacontroller/JpaControllerSetupPanel.java
index 209bc602c8..d22df54aef 100644
--- a/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/wizard/jpacontroller/JpaControllerSetupPanel.java
+++ b/java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/wizard/jpacontroller/JpaControllerSetupPanel.java
@@ -71,7 +71,7 @@ final class JpaControllerSetupPanel implements WizardDescriptor.Panel, WizardDes
return component.valid(wizardDescriptor);
}
- private final Set<ChangeListener> listeners = new HashSet(1);
+ private final Set<ChangeListener> listeners = new HashSet<>(1);
@Override
public final void addChangeListener(ChangeListener l) {
diff --git a/java/j2ee.persistence/test/unit/src/org/netbeans/modules/db/test/jdbcstub/ResultSetImpl.java b/java/j2ee.persistence/test/unit/src/org/netbeans/modules/db/test/jdbcstub/ResultSetImpl.java
index 31aeb6b4e9..0b622fbb24 100644
--- a/java/j2ee.persistence/test/unit/src/org/netbeans/modules/db/test/jdbcstub/ResultSetImpl.java
+++ b/java/j2ee.persistence/test/unit/src/org/netbeans/modules/db/test/jdbcstub/ResultSetImpl.java
@@ -33,7 +33,7 @@ import org.netbeans.test.stub.api.StubDelegate;
public class ResultSetImpl extends StubDelegate {
private List<Object> columns;
- private Map<String, Iterator> names2iterators = new HashMap();
+ private Map<String, Iterator> names2iterators = new HashMap<>();
private Map<String, Object> names2values; // current row values
public ResultSetImpl(List columns) {
@@ -51,7 +51,7 @@ public class ResultSetImpl extends StubDelegate {
if (names2values != null) {
names2values.clear();
} else {
- names2values = new HashMap();
+ names2values = new HashMap<>();
}
Iterator it = names2iterators.entrySet().iterator();
diff --git a/java/j2ee.persistence/test/unit/src/org/netbeans/modules/j2ee/persistence/wizard/fromdb/TableClosureJoinTest.java b/java/j2ee.persistence/test/unit/src/org/netbeans/modules/j2ee/persistence/wizard/fromdb/TableClosureJoinTest.java
index 09a1e7c3fc..3adb9cf2cc 100644
--- a/java/j2ee.persistence/test/unit/src/org/netbeans/modules/j2ee/persistence/wizard/fromdb/TableClosureJoinTest.java
+++ b/java/j2ee.persistence/test/unit/src/org/netbeans/modules/j2ee/persistence/wizard/fromdb/TableClosureJoinTest.java
@@ -176,7 +176,7 @@ public class TableClosureJoinTest extends TestCase {
* table, but should not mark STUDENT_TEACHER as a join (referenced) table.
*/
public void testNeverAddingAlreadySelectedTablesAsJoinTables() {
- HashSet<Table> tables = new HashSet();
+ HashSet<Table> tables = new HashSet<>();
tables.add(provider.getTableByName("ROOM"));
tables.add(provider.getTableByName("STUDENT"));
tables.add(provider.getTableByName("STUDENT_TEACHER"));
diff --git a/java/j2ee.persistence/test/unit/src/org/netbeans/modules/j2ee/persistence/wizard/fromdb/TableClosureQueueTest.java b/java/j2ee.persistence/test/unit/src/org/netbeans/modules/j2ee/persistence/wizard/fromdb/TableClosureQueueTest.java
index db5a6687b3..0c587a2f0f 100644
--- a/java/j2ee.persistence/test/unit/src/org/netbeans/modules/j2ee/persistence/wizard/fromdb/TableClosureQueueTest.java
+++ b/java/j2ee.persistence/test/unit/src/org/netbeans/modules/j2ee/persistence/wizard/fromdb/TableClosureQueueTest.java
@@ -33,9 +33,9 @@ import org.netbeans.modules.j2ee.persistence.wizard.fromdb.TableClosure.Queue;
public class TableClosureQueueTest extends TestCase {
public void testInitialElements() {
- Set<String> initial = new HashSet(Arrays.asList("a", "b"));
+ Set<String> initial = new HashSet<>(Arrays.asList("a", "b"));
Queue<String> queue = new Queue<>(initial);
- Set<String> dequeued = new HashSet();
+ Set<String> dequeued = new HashSet<>();
while (!queue.isEmpty()) {
dequeued.add(queue.poll());
}
diff --git a/java/j2ee.persistence/test/unit/src/org/netbeans/modules/j2ee/persistence/wizard/fromdb/TableSourceTest.java b/java/j2ee.persistence/test/unit/src/org/netbeans/modules/j2ee/persistence/wizard/fromdb/TableSourceTest.java
index 4138d98d95..8072871f1b 100644
--- a/java/j2ee.persistence/test/unit/src/org/netbeans/modules/j2ee/persistence/wizard/fromdb/TableSourceTest.java
+++ b/java/j2ee.persistence/test/unit/src/org/netbeans/modules/j2ee/persistence/wizard/fromdb/TableSourceTest.java
@@ -44,7 +44,7 @@ public class TableSourceTest extends NbTestCase {
assertSame(source, TableSource.get(project));
- Reference<Project> projectRef = new WeakReference(project);
+ Reference<Project> projectRef = new WeakReference<>(project);
project = null;
assertGC("Should be possible to GC project", projectRef);
}
diff --git a/java/j2ee.persistence/test/unit/src/org/netbeans/test/stub/api/Stub.java b/java/j2ee.persistence/test/unit/src/org/netbeans/test/stub/api/Stub.java
index 2b7890e87d..c0815f5d65 100644
--- a/java/j2ee.persistence/test/unit/src/org/netbeans/test/stub/api/Stub.java
+++ b/java/j2ee.persistence/test/unit/src/org/netbeans/test/stub/api/Stub.java
@@ -70,7 +70,7 @@ public final class Stub {
private static final class DefaultStubImplementation implements StubImplementation {
- private static final Map<Object, StubDelegate> STUB_TO_DELEGATE = new WeakHashMap();
+ private static final Map<Object, StubDelegate> STUB_TO_DELEGATE = new WeakHashMap<>();
@Override
public Object create(Class[] intfs) {
diff --git a/java/java.completion/test/unit/data/org/netbeans/modules/java/completion/data/CreateConstructorNonDefaultConstructor.java b/java/java.completion/test/unit/data/org/netbeans/modules/java/completion/data/CreateConstructorNonDefaultConstructor.java
index a9e9e3d832..a4694aed66 100644
--- a/java/java.completion/test/unit/data/org/netbeans/modules/java/completion/data/CreateConstructorNonDefaultConstructor.java
+++ b/java/java.completion/test/unit/data/org/netbeans/modules/java/completion/data/CreateConstructorNonDefaultConstructor.java
@@ -37,7 +37,7 @@ public class Test {
private byte a;
private Map<String, Set<String>> map1;
- private Map<String, Set<String>> map2 = new HashMap();
+ private Map<String, Set<String>> map2 = new HashMap<>();
public X(byte a, Map<String, Set<String>> map1) {}
diff --git a/java/java.completion/test/unit/data/org/netbeans/modules/java/completion/data/CreateConstructorTest.java b/java/java.completion/test/unit/data/org/netbeans/modules/java/completion/data/CreateConstructorTest.java
index d7ba836bd8..d792a0965d 100644
--- a/java/java.completion/test/unit/data/org/netbeans/modules/java/completion/data/CreateConstructorTest.java
+++ b/java/java.completion/test/unit/data/org/netbeans/modules/java/completion/data/CreateConstructorTest.java
@@ -35,7 +35,7 @@ public class Test {
private byte a;
private Map<String, Set<String>> map1;
- private Map<String, Set<String>> map2 = new HashMap();
+ private Map<String, Set<String>> map2 = new HashMap<>();
public void run() {
}
diff --git a/java/java.completion/test/unit/data/org/netbeans/modules/java/completion/data/CreateConstructorWithConstructors.java b/java/java.completion/test/unit/data/org/netbeans/modules/java/completion/data/CreateConstructorWithConstructors.java
index 7ecaabe4ca..125852e7d9 100644
--- a/java/java.completion/test/unit/data/org/netbeans/modules/java/completion/data/CreateConstructorWithConstructors.java
+++ b/java/java.completion/test/unit/data/org/netbeans/modules/java/completion/data/CreateConstructorWithConstructors.java
@@ -38,7 +38,7 @@ public class Test {
private byte a;
private Map<String, Set<String>> map1;
- private Map<String, Set<String>> map2 = new HashMap();
+ private Map<String, Set<String>> map2 = new HashMap<>();
public X() {}
public X(byte a, Map<String, Set<String>> map1) {}
diff --git a/java/java.completion/test/unit/data/org/netbeans/modules/java/completion/data/CreateConstructorWithDefaultConstructor.java b/java/java.completion/test/unit/data/org/netbeans/modules/java/completion/data/CreateConstructorWithDefaultConstructor.java
index d73d89beef..b7a6acd0d1 100644
--- a/java/java.completion/test/unit/data/org/netbeans/modules/java/completion/data/CreateConstructorWithDefaultConstructor.java
+++ b/java/java.completion/test/unit/data/org/netbeans/modules/java/completion/data/CreateConstructorWithDefaultConstructor.java
@@ -37,7 +37,7 @@ public class Test {
private byte a;
private Map<String, Set<String>> map1;
- private Map<String, Set<String>> map2 = new HashMap();
+ private Map<String, Set<String>> map2 = new HashMap<>();
public X() {}
diff --git a/java/java.editor/src/org/netbeans/modules/java/editor/codegen/GetterSetterGenerator.java b/java/java.editor/src/org/netbeans/modules/java/editor/codegen/GetterSetterGenerator.java
index dffcd25bc5..34f9b97dbc 100644
--- a/java/java.editor/src/org/netbeans/modules/java/editor/codegen/GetterSetterGenerator.java
+++ b/java/java.editor/src/org/netbeans/modules/java/editor/codegen/GetterSetterGenerator.java
@@ -245,8 +245,8 @@ public class GetterSetterGenerator implements CodeGenerator {
private void performEncapsulate(final List<ElementHandle<? extends Element>> variables) {
try {
JavaSource js = JavaSource.forDocument(component.getDocument());
- final List<String> getters = new ArrayList();
- final List<String> setters = new ArrayList();
+ final List<String> getters = new ArrayList<>();
+ final List<String> setters = new ArrayList<>();
final List<TreePathHandle> handles = new ArrayList<>(variables.size());
js.runUserActionTask(new Task<CompilationController>() {
diff --git a/java/java.editor/test/unit/data/org/netbeans/modules/java/editor/completion/data/CreateConstructorNonDefaultConstructor.java b/java/java.editor/test/unit/data/org/netbeans/modules/java/editor/completion/data/CreateConstructorNonDefaultConstructor.java
index 0cefc11c01..76516eb0eb 100644
--- a/java/java.editor/test/unit/data/org/netbeans/modules/java/editor/completion/data/CreateConstructorNonDefaultConstructor.java
+++ b/java/java.editor/test/unit/data/org/netbeans/modules/java/editor/completion/data/CreateConstructorNonDefaultConstructor.java
@@ -18,7 +18,7 @@ public class Test {
private byte a;
private Map<String, Set<String>> map1;
- private Map<String, Set<String>> map2 = new HashMap();
+ private Map<String, Set<String>> map2 = new HashMap<>();
public X(byte a, Map<String, Set<String>> map1) {}
diff --git a/java/java.editor/test/unit/data/org/netbeans/modules/java/editor/completion/data/CreateConstructorTest.java b/java/java.editor/test/unit/data/org/netbeans/modules/java/editor/completion/data/CreateConstructorTest.java
index 73ff1d24b1..a1e1a1286c 100644
--- a/java/java.editor/test/unit/data/org/netbeans/modules/java/editor/completion/data/CreateConstructorTest.java
+++ b/java/java.editor/test/unit/data/org/netbeans/modules/java/editor/completion/data/CreateConstructorTest.java
@@ -16,7 +16,7 @@ public class Test {
private byte a;
private Map<String, Set<String>> map1;
- private Map<String, Set<String>> map2 = new HashMap();
+ private Map<String, Set<String>> map2 = new HashMap<>();
public void run() {
}
diff --git a/java/java.editor/test/unit/data/org/netbeans/modules/java/editor/completion/data/CreateConstructorWithConstructors.java b/java/java.editor/test/unit/data/org/netbeans/modules/java/editor/completion/data/CreateConstructorWithConstructors.java
index e073838fb4..31f120055d 100644
--- a/java/java.editor/test/unit/data/org/netbeans/modules/java/editor/completion/data/CreateConstructorWithConstructors.java
+++ b/java/java.editor/test/unit/data/org/netbeans/modules/java/editor/completion/data/CreateConstructorWithConstructors.java
@@ -19,7 +19,7 @@ public class Test {
private byte a;
private Map<String, Set<String>> map1;
- private Map<String, Set<String>> map2 = new HashMap();
+ private Map<String, Set<String>> map2 = new HashMap<>();
public X() {}
public X(byte a, Map<String, Set<String>> map1) {}
diff --git a/java/java.editor/test/unit/data/org/netbeans/modules/java/editor/completion/data/CreateConstructorWithDefaultConstructor.java b/java/java.editor/test/unit/data/org/netbeans/modules/java/editor/completion/data/CreateConstructorWithDefaultConstructor.java
index 9d44ea3819..f7b2c2925a 100644
--- a/java/java.editor/test/unit/data/org/netbeans/modules/java/editor/completion/data/CreateConstructorWithDefaultConstructor.java
+++ b/java/java.editor/test/unit/data/org/netbeans/modules/java/editor/completion/data/CreateConstructorWithDefaultConstructor.java
@@ -18,7 +18,7 @@ public class Test {
private byte a;
private Map<String, Set<String>> map1;
- private Map<String, Set<String>> map2 = new HashMap();
+ private Map<String, Set<String>> map2 = new HashMap<>();
public X() {}
diff --git a/java/java.freeform/test/unit/src/org/netbeans/modules/java/freeform/ClasspathsTest.java b/java/java.freeform/test/unit/src/org/netbeans/modules/java/freeform/ClasspathsTest.java
index 15aca001c7..2317d448fa 100644
--- a/java/java.freeform/test/unit/src/org/netbeans/modules/java/freeform/ClasspathsTest.java
+++ b/java/java.freeform/test/unit/src/org/netbeans/modules/java/freeform/ClasspathsTest.java
@@ -323,7 +323,7 @@ public class ClasspathsTest extends TestBase {
closed.setAccessible(true);
closed.invoke(hook);
compile = gpr.getPaths(ClassPath.COMPILE);
- expected = new HashSet();
+ expected = new HashSet<>();
assertEquals("correct set of COMPILE classpaths", expected, compile);
}
diff --git a/java/java.freeform/test/unit/src/org/netbeans/modules/java/freeform/JavaProjectGeneratorTest.java b/java/java.freeform/test/unit/src/org/netbeans/modules/java/freeform/JavaProjectGeneratorTest.java
index 73bfaa3282..b524ebccf6 100644
--- a/java/java.freeform/test/unit/src/org/netbeans/modules/java/freeform/JavaProjectGeneratorTest.java
+++ b/java/java.freeform/test/unit/src/org/netbeans/modules/java/freeform/JavaProjectGeneratorTest.java
@@ -694,7 +694,7 @@ public class JavaProjectGeneratorTest extends NbTestCase {
// check that all data are correctly persisted
- List<JavaCompilationUnit> units = new ArrayList();
+ List<JavaCompilationUnit> units = new ArrayList<>();
JavaProjectGenerator.JavaCompilationUnit cu = new JavaProjectGenerator.JavaCompilationUnit();
cu.packageRoots = new ArrayList();
cu.packageRoots.add("pkgroot1");
@@ -769,7 +769,7 @@ public class JavaProjectGeneratorTest extends NbTestCase {
// test updating
- units = new ArrayList();
+ units = new ArrayList<>();
cu = new JavaProjectGenerator.JavaCompilationUnit();
cu.packageRoots = new ArrayList();
cu.packageRoots.add("foo-package-root");
@@ -805,7 +805,7 @@ public class JavaProjectGeneratorTest extends NbTestCase {
assertNotNull("Project was not created", p);
assertEquals("Project folder is incorrect", base, p.getProjectDirectory());
// Start with a /1-friendly data set.
- List<JavaProjectGenerator.JavaCompilationUnit> units = new ArrayList();
+ List<JavaProjectGenerator.JavaCompilationUnit> units = new ArrayList<>();
JavaProjectGenerator.JavaCompilationUnit cu = new JavaProjectGenerator.JavaCompilationUnit();
cu.packageRoots = new ArrayList();
cu.packageRoots.add("pkgroot1");
@@ -825,7 +825,7 @@ public class JavaProjectGeneratorTest extends NbTestCase {
new String[] {"pkgroot1"});
ProjectManager.getDefault().saveAllProjects();
// Now check that setting isTests = true on that element forces a /2 save.
- units = new ArrayList();
+ units = new ArrayList<>();
cu = new JavaProjectGenerator.JavaCompilationUnit();
cu.packageRoots = new ArrayList();
cu.packageRoots.add("pkgroot1");
@@ -848,7 +848,7 @@ public class JavaProjectGeneratorTest extends NbTestCase {
ProjectManager.getDefault().saveAllProjects();
// Now try fresh save of /2-requiring data (using javadoc).
assertTrue("removed /2 data", aux.removeConfigurationFragment(JavaProjectNature.EL_JAVA, JavaProjectNature.NS_JAVA_2, true));
- units = new ArrayList();
+ units = new ArrayList<>();
cu = new JavaProjectGenerator.JavaCompilationUnit();
cu.packageRoots = new ArrayList();
cu.packageRoots.add("pkgroot1");
diff --git a/java/java.hints/src/org/netbeans/modules/java/hints/infrastructure/EmbeddedHintsCollector.java b/java/java.hints/src/org/netbeans/modules/java/hints/infrastructure/EmbeddedHintsCollector.java
index f27e712623..5aa6044b25 100644
--- a/java/java.hints/src/org/netbeans/modules/java/hints/infrastructure/EmbeddedHintsCollector.java
+++ b/java/java.hints/src/org/netbeans/modules/java/hints/infrastructure/EmbeddedHintsCollector.java
@@ -46,7 +46,7 @@ import org.netbeans.spi.editor.hints.HintsController;
*/
public class EmbeddedHintsCollector extends JavaParserResultTask<Parser.Result> {
- private static final Map<Snapshot, List<ErrorDescription>> hints = new WeakHashMap();
+ private static final Map<Snapshot, List<ErrorDescription>> hints = new WeakHashMap<>();
public static void setAnnotations(Snapshot snap, List<ErrorDescription> descs) {
if (snap.getMimePath().size() == 1) {
diff --git a/java/java.hints/src/org/netbeans/modules/java/hints/ui/InnerPanelSupport.java b/java/java.hints/src/org/netbeans/modules/java/hints/ui/InnerPanelSupport.java
index 10c9c6af76..031d17e403 100644
--- a/java/java.hints/src/org/netbeans/modules/java/hints/ui/InnerPanelSupport.java
+++ b/java/java.hints/src/org/netbeans/modules/java/hints/ui/InnerPanelSupport.java
@@ -93,7 +93,7 @@ public class InnerPanelSupport {
public static void enablePanel(JPanel panel, boolean enable) {
panel.setEnabled(enable);
List<Component> contents = getAllComponents(panel);
- List<Component> enabled = new ArrayList(contents.size() / 2);
+ List<Component> enabled = new ArrayList<>(contents.size() / 2);
if (enable) {
List<Runnable> reCheck = new ArrayList<>(3);
diff --git a/java/java.hints/test/unit/data/org/netbeans/test/java/hints/SuppressWarningsFixerTest/Test.java b/java/java.hints/test/unit/data/org/netbeans/test/java/hints/SuppressWarningsFixerTest/Test.java
index b7fa4a6cb4..6b7b450b56 100644
--- a/java/java.hints/test/unit/data/org/netbeans/test/java/hints/SuppressWarningsFixerTest/Test.java
+++ b/java/java.hints/test/unit/data/org/netbeans/test/java/hints/SuppressWarningsFixerTest/Test.java
@@ -5,10 +5,10 @@ import java.util.List;
public class Test {
- private List<String> l = new ArrayList();
+ private List<String> l = new ArrayList<>();
{
- l = new ArrayList();
+ l = new ArrayList<>();
}
private void test1() {
diff --git a/java/java.hints/test/unit/src/org/netbeans/modules/java/hints/errors/ErrorHintsTest.java b/java/java.hints/test/unit/src/org/netbeans/modules/java/hints/errors/ErrorHintsTest.java
index 3dbeb4b28c..f72c5b8510 100644
--- a/java/java.hints/test/unit/src/org/netbeans/modules/java/hints/errors/ErrorHintsTest.java
+++ b/java/java.hints/test/unit/src/org/netbeans/modules/java/hints/errors/ErrorHintsTest.java
@@ -99,7 +99,7 @@ public class ErrorHintsTest extends HintsTestBase {
}
private List<ElementHandle<? extends Element>> findElementHandles(CompilationInfo info, String... specs) {
- List<ElementHandle<? extends Element>> result = new ArrayList(specs.length);
+ List<ElementHandle<? extends Element>> result = new ArrayList<>(specs.length);
for (String spec : specs) {
Element el = info.getElementUtilities().findElement(spec);
if (el != null) {
diff --git a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/WorkspaceServiceImpl.java b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/WorkspaceServiceImpl.java
index e73d65d0f1..1a4464573e 100644
--- a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/WorkspaceServiceImpl.java
+++ b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/WorkspaceServiceImpl.java
@@ -667,7 +667,7 @@ public final class WorkspaceServiceImpl implements WorkspaceService, LanguageCli
}
public CompletableFuture<LspProjectInfo[]> process() {
- List<FileObject> files = new ArrayList();
+ List<FileObject> files = new ArrayList<>();
for (URL u : locations) {
FileObject f = URLMapper.findFileObject(u);
if (f != null) {
@@ -750,7 +750,7 @@ public final class WorkspaceServiceImpl implements WorkspaceService, LanguageCli
}
CompletableFuture<LspProjectInfo[]> finalizeInfos() {
- List<LspProjectInfo> list = new ArrayList();
+ List<LspProjectInfo> list = new ArrayList<>();
for (URL u : locations) {
FileObject f = URLMapper.findFileObject(u);
Project owner = FileOwnerQuery.getOwner(f);
diff --git a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/refactoring/ExtractSuperclassOrInterfaceRefactoring.java b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/refactoring/ExtractSuperclassOrInterfaceRefactoring.java
index 9db08e12fc..4303235dbd 100644
--- a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/refactoring/ExtractSuperclassOrInterfaceRefactoring.java
+++ b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/refactoring/ExtractSuperclassOrInterfaceRefactoring.java
@@ -125,8 +125,8 @@ public final class ExtractSuperclassOrInterfaceRefactoring extends CodeRefactori
return Collections.emptyList();
}
SourcePositions sourcePositions = info.getTrees().getSourcePositions();
- List<QuickPickItem> members = new ArrayList();
- List<QuickPickItem> allMembers = new ArrayList();
+ List<QuickPickItem> members = new ArrayList<>();
+ List<QuickPickItem> allMembers = new ArrayList<>();
ClassTree sourceTree = (ClassTree) path.getLeaf();
for (Tree member : sourceTree.getMembers()) {
TreePath memberTreePath = new TreePath(path, member);
diff --git a/java/java.lsp.server/test/unit/src/org/netbeans/modules/java/lsp/server/project/LspBrokenReferencesImplTest.java b/java/java.lsp.server/test/unit/src/org/netbeans/modules/java/lsp/server/project/LspBrokenReferencesImplTest.java
index cb189985b5..2cd5739b0b 100644
--- a/java/java.lsp.server/test/unit/src/org/netbeans/modules/java/lsp/server/project/LspBrokenReferencesImplTest.java
+++ b/java/java.lsp.server/test/unit/src/org/netbeans/modules/java/lsp/server/project/LspBrokenReferencesImplTest.java
@@ -149,7 +149,7 @@ public class LspBrokenReferencesImplTest extends NbTestCase {
final TestedImpl tested = new TestedImpl();
final AtomicBoolean resolveCalled = new AtomicBoolean(false);
- final AtomicReference<ProjectProblemsProvider.ProjectProblem> ref = new AtomicReference();
+ final AtomicReference<ProjectProblemsProvider.ProjectProblem> ref = new AtomicReference<>();
/**
* Fills in 'ref'
diff --git a/java/java.project/test/unit/src/org/netbeans/spi/java/project/support/JavadocAndSourceRootDetectionTest.java b/java/java.project/test/unit/src/org/netbeans/spi/java/project/support/JavadocAndSourceRootDetectionTest.java
index 5d17096d57..baac170c0b 100644
--- a/java/java.project/test/unit/src/org/netbeans/spi/java/project/support/JavadocAndSourceRootDetectionTest.java
+++ b/java/java.project/test/unit/src/org/netbeans/spi/java/project/support/JavadocAndSourceRootDetectionTest.java
@@ -135,8 +135,8 @@ public class JavadocAndSourceRootDetectionTest extends NbTestCase {
TestFileUtils.writeFile(root2,"org/me/Test2.java","package org.me; class Test2{}");
TestFileUtils.writeFile(root3,"org/me/Test3.java","package org.me; class Test3{}");
TestFileUtils.writeFile(root4,"org/me/Test4.java","package org.me; class Test4{}");
- final List<FileObject> result = new ArrayList(JavadocAndSourceRootDetection.findSourceRoots(wd, null));
- final List<FileObject> expected = new ArrayList(Arrays.asList(
+ final List<FileObject> result = new ArrayList<>(JavadocAndSourceRootDetection.findSourceRoots(wd, null));
+ final List<FileObject> expected = new ArrayList<>(Arrays.asList(
root1,
root2,
root3,
diff --git a/java/java.source.base/src/org/netbeans/api/java/source/DocTreePathHandle.java b/java/java.source.base/src/org/netbeans/api/java/source/DocTreePathHandle.java
index 45798e2b62..3b78be19f7 100644
--- a/java/java.source.base/src/org/netbeans/api/java/source/DocTreePathHandle.java
+++ b/java/java.source.base/src/org/netbeans/api/java/source/DocTreePathHandle.java
@@ -350,7 +350,7 @@ public final class DocTreePathHandle {
static class KindPath {
- private ArrayList<DocTree.Kind> kindPath = new ArrayList();
+ private ArrayList<DocTree.Kind> kindPath = new ArrayList<>();
KindPath(DocTreePath treePath) {
while (treePath != null) {
diff --git a/java/java.source.base/src/org/netbeans/api/java/source/ElementUtilities.java b/java/java.source.base/src/org/netbeans/api/java/source/ElementUtilities.java
index f2ab1fa6ca..bc70661580 100644
--- a/java/java.source.base/src/org/netbeans/api/java/source/ElementUtilities.java
+++ b/java/java.source.base/src/org/netbeans/api/java/source/ElementUtilities.java
@@ -313,8 +313,8 @@ public final class ElementUtilities {
Elements elements = JavacElements.instance(ctx);
Types types = JavacTypes.instance(ctx);
TypeElement cls;
- Deque<Scope> outerScopes = new ArrayDeque();
- Deque<Map> visibleEls = new ArrayDeque();
+ Deque<Scope> outerScopes = new ArrayDeque<>();
+ Deque<Map> visibleEls = new ArrayDeque<>();
Element current = null;
while (scope != null) {
diff --git a/java/java.source.base/src/org/netbeans/api/java/source/ScanUtils.java b/java/java.source.base/src/org/netbeans/api/java/source/ScanUtils.java
index ebd42a61a7..253d0b6026 100644
--- a/java/java.source.base/src/org/netbeans/api/java/source/ScanUtils.java
+++ b/java/java.source.base/src/org/netbeans/api/java/source/ScanUtils.java
@@ -94,7 +94,7 @@ public final class ScanUtils {
Parameters.notNull("src", src);
Parameters.notNull("uat", uat);
- AtomicReference<Throwable> status = new AtomicReference(null);
+ AtomicReference<Throwable> status = new AtomicReference<>(null);
Future<Void> f = postJavaTask(src, uat, status);
Throwable t = status.get();
@@ -128,7 +128,7 @@ public final class ScanUtils {
Parameters.notNull("src", src);
Parameters.notNull("task", task);
- AtomicReference<Throwable> status = new AtomicReference(null);
+ AtomicReference<Throwable> status = new AtomicReference<>(null);
Future<Void> f = postUserTask(src, task, status);
Throwable t = status.get();
@@ -164,7 +164,7 @@ public final class ScanUtils {
if (SwingUtilities.isEventDispatchThread()) {
throw new IllegalStateException("Illegal to call within EDT");
}
- AtomicReference<Throwable> status = new AtomicReference(null);
+ AtomicReference<Throwable> status = new AtomicReference<>(null);
Future<Void> f = postJavaTask(src, uat, status);
if (f.isDone()) {
return;
@@ -220,7 +220,7 @@ public final class ScanUtils {
if (SwingUtilities.isEventDispatchThread()) {
throw new IllegalStateException("Illegal to call within EDT");
}
- AtomicReference<Throwable> status = new AtomicReference(null);
+ AtomicReference<Throwable> status = new AtomicReference<>(null);
Future<Void> f = postUserTask(src, task, status);
if (f.isDone()) {
Throwable t = status.get();
diff --git a/java/java.source.base/src/org/netbeans/api/java/source/TreePathHandle.java b/java/java.source.base/src/org/netbeans/api/java/source/TreePathHandle.java
index b1a025350c..74562e5092 100644
--- a/java/java.source.base/src/org/netbeans/api/java/source/TreePathHandle.java
+++ b/java/java.source.base/src/org/netbeans/api/java/source/TreePathHandle.java
@@ -608,7 +608,7 @@ public final class TreePathHandle {
}
static class KindPath {
- private ArrayList<Tree.Kind> kindPath = new ArrayList();
+ private ArrayList<Tree.Kind> kindPath = new ArrayList<>();
KindPath(TreePath treePath) {
while (treePath != null) {
diff --git a/java/java.source.base/src/org/netbeans/api/java/source/WorkingCopy.java b/java/java.source.base/src/org/netbeans/api/java/source/WorkingCopy.java
index 3a7aff6191..0511a35a1a 100644
--- a/java/java.source.base/src/org/netbeans/api/java/source/WorkingCopy.java
+++ b/java/java.source.base/src/org/netbeans/api/java/source/WorkingCopy.java
@@ -950,7 +950,7 @@ public class WorkingCopy extends CompilationController {
if (textChanges.isEmpty()) {
return;
}
- List<Diff> orderedDiffs = new ArrayList(textChanges);
+ List<Diff> orderedDiffs = new ArrayList<>(textChanges);
Collections.sort(orderedDiffs, new Comparator<Diff>() {
@Override
public int compare(Diff o1, Diff o2) {
diff --git a/java/java.source.base/src/org/netbeans/modules/java/source/builder/CommentHandlerService.java b/java/java.source.base/src/org/netbeans/modules/java/source/builder/CommentHandlerService.java
index ee393cf296..3fbdf79fce 100644
--- a/java/java.source.base/src/org/netbeans/modules/java/source/builder/CommentHandlerService.java
+++ b/java/java.source.base/src/org/netbeans/modules/java/source/builder/CommentHandlerService.java
@@ -178,7 +178,7 @@ public class CommentHandlerService implements CommentHandler {
private static class CopyEntry {
private Tree target;
private RelativePosition pos;
- private Collection<Comment> comments = new ArrayList();
+ private Collection<Comment> comments = new ArrayList<>();
}
/**
diff --git a/java/java.source.base/test/unit/src/org/netbeans/api/java/source/ClassIndexTest.java b/java/java.source.base/test/unit/src/org/netbeans/api/java/source/ClassIndexTest.java
index dc8ad0456e..aacf8e84d8 100644
--- a/java/java.source.base/test/unit/src/org/netbeans/api/java/source/ClassIndexTest.java
+++ b/java/java.source.base/test/unit/src/org/netbeans/api/java/source/ClassIndexTest.java
@@ -600,7 +600,7 @@ public class ClassIndexTest extends NbTestCase {
}
private void assertElementHandles(final String[] expected, final Set<ElementHandle<TypeElement>> result) {
- final Set<String> expSet = new HashSet(Arrays.asList(expected));
+ final Set<String> expSet = new HashSet<>(Arrays.asList(expected));
for (ElementHandle<TypeElement> handle : result) {
if (!expSet.remove(handle.getQualifiedName())) {
throw new AssertionError("Expected: " + Arrays.toString(expected) +" Result: " + result);
diff --git a/java/java.source.base/test/unit/src/org/netbeans/api/java/source/JavaSourceTaskFactoryTest.java b/java/java.source.base/test/unit/src/org/netbeans/api/java/source/JavaSourceTaskFactoryTest.java
index 44c2828d2e..9005bc0d3d 100644
--- a/java/java.source.base/test/unit/src/org/netbeans/api/java/source/JavaSourceTaskFactoryTest.java
+++ b/java/java.source.base/test/unit/src/org/netbeans/api/java/source/JavaSourceTaskFactoryTest.java
@@ -67,7 +67,7 @@ public class JavaSourceTaskFactoryTest extends NbTestCase {
private List<FileObject> files;
private List<FileObject> filesWithTasks = new ArrayList<FileObject>();
- private Map<FileObject, CancellableTask<CompilationInfo>> file2Task = new HashMap();
+ private Map<FileObject, CancellableTask<CompilationInfo>> file2Task = new HashMap<>();
private Map<FileObject, CancellableTask<CompilationInfo>> addedTasks = new HashMap<FileObject, CancellableTask<CompilationInfo>>();
private Map<FileObject, CancellableTask<CompilationInfo>> removedTasks = new HashMap<FileObject, CancellableTask<CompilationInfo>>();
diff --git a/java/java.source.base/test/unit/src/org/netbeans/api/java/source/gen/FieldGroupTest.java b/java/java.source.base/test/unit/src/org/netbeans/api/java/source/gen/FieldGroupTest.java
index 034238456a..1f49cea212 100644
--- a/java/java.source.base/test/unit/src/org/netbeans/api/java/source/gen/FieldGroupTest.java
+++ b/java/java.source.base/test/unit/src/org/netbeans/api/java/source/gen/FieldGroupTest.java
@@ -1497,7 +1497,7 @@ public class FieldGroupTest extends GeneratorTestMDRCompat {
List<? extends StatementTree> stmts = mt.getBody().getStatements();
TreeMaker mk = wc.getTreeMaker();
- List<StatementTree> newStats = new ArrayList(4);
+ List<StatementTree> newStats = new ArrayList<>(4);
VariableTree aDecl = (VariableTree)stmts.get(0);
newStats.add(stmts.get(0)); // int a,
newStats.add(stmts.get(1)); // int b,
diff --git a/java/java.source.base/test/unit/src/org/netbeans/api/java/source/gen/MemberAdditionTest.java b/java/java.source.base/test/unit/src/org/netbeans/api/java/source/gen/MemberAdditionTest.java
index b7c0179bc8..322df5e94a 100644
--- a/java/java.source.base/test/unit/src/org/netbeans/api/java/source/gen/MemberAdditionTest.java
+++ b/java/java.source.base/test/unit/src/org/netbeans/api/java/source/gen/MemberAdditionTest.java
@@ -264,8 +264,8 @@ public class MemberAdditionTest extends NbTestCase {
Set<Modifier> mods = EnumSet.of(Modifier.PUBLIC);
//create body:
- List<StatementTree> statements = new ArrayList();
- List<VariableTree> arguments = new ArrayList();
+ List<StatementTree> statements = new ArrayList<>();
+ List<VariableTree> arguments = new ArrayList<>();
for (VariableElement ve : fields) {
AssignmentTree a = make.Assignment(make.MemberSelect(make.Identifier("this"), ve.getSimpleName()), make.Identifier(ve.getSimpleName()));
diff --git a/java/javawebstart/AntTasks/src/org/netbeans/modules/javawebstart/SignJarsTask.java b/java/javawebstart/AntTasks/src/org/netbeans/modules/javawebstart/SignJarsTask.java
index 5fc75dfdfa..00b8f19532 100644
--- a/java/javawebstart/AntTasks/src/org/netbeans/modules/javawebstart/SignJarsTask.java
+++ b/java/javawebstart/AntTasks/src/org/netbeans/modules/javawebstart/SignJarsTask.java
@@ -106,7 +106,7 @@ public class SignJarsTask extends Task {
public void execute() throws BuildException {
- Map<Set<String>,List<File>> signersMap = new HashMap(); // Set<signerName> -> List<jarPath>
+ Map<Set<String>,List<File>> signersMap = new HashMap<>(); // Set<signerName> -> List<jarPath>
List<File> files2sign = new ArrayList<File>();
List<File> alreadySigned = new ArrayList<File>();
diff --git a/java/javawebstart/AntTasks/src/org/netbeans/modules/javawebstart/anttasks/SignJarsTask.java b/java/javawebstart/AntTasks/src/org/netbeans/modules/javawebstart/anttasks/SignJarsTask.java
index 8b5129b3fb..203bfae281 100644
--- a/java/javawebstart/AntTasks/src/org/netbeans/modules/javawebstart/anttasks/SignJarsTask.java
+++ b/java/javawebstart/AntTasks/src/org/netbeans/modules/javawebstart/anttasks/SignJarsTask.java
@@ -132,7 +132,7 @@ public class SignJarsTask extends Task {
@Override
public void execute() throws BuildException {
- Map<Set<String>,List<File>> signersMap = new HashMap(); // Set<signerName> -> List<jarPath>
+ Map<Set<String>,List<File>> signersMap = new HashMap<>(); // Set<signerName> -> List<jarPath>
List<File> files2sign = new ArrayList<File>();
List<File> alreadySigned = new ArrayList<File>();
diff --git a/java/junit/src/org/netbeans/modules/junit/AbstractTestGenerator.java b/java/junit/src/org/netbeans/modules/junit/AbstractTestGenerator.java
index 92bf2e60ea..e6bf217602 100644
--- a/java/junit/src/org/netbeans/modules/junit/AbstractTestGenerator.java
+++ b/java/junit/src/org/netbeans/modules/junit/AbstractTestGenerator.java
@@ -556,7 +556,7 @@ abstract class AbstractTestGenerator implements CancellableTask<WorkingCopy>{
final TreeMaker maker = workingCopy.getTreeMaker();
List<? extends VariableElement> defaultCtorParams
- = new ArrayList(superCtorParams);
+ = new ArrayList<>(superCtorParams);
List<ExpressionTree> throwsList =
(superConstructor != null)
@@ -596,7 +596,7 @@ abstract class AbstractTestGenerator implements CancellableTask<WorkingCopy>{
return Collections.emptyList();
}
- List<ExpressionTree> result = new ArrayList(params.size());
+ List<ExpressionTree> result = new ArrayList<>(params.size());
for (VariableElement param : params) {
result.add(getDefaultValue(maker, param.asType()));
}
@@ -702,7 +702,7 @@ abstract class AbstractTestGenerator implements CancellableTask<WorkingCopy>{
return Collections.singletonList(makeCopy(typeParams.get(0), maker));
}
- List<TypeParameterTree> result = new ArrayList(size);
+ List<TypeParameterTree> result = new ArrayList<>(size);
for (TypeParameterElement typeParam : typeParams) {
result.add(makeCopy(typeParam, maker));
}
@@ -721,7 +721,7 @@ abstract class AbstractTestGenerator implements CancellableTask<WorkingCopy>{
return Collections.singletonList(makeCopy(params.get(0), maker));
}
- List<VariableTree> result = new ArrayList(size);
+ List<VariableTree> result = new ArrayList<>(size);
for (VariableElement param : params) {
result.add(makeCopy(param, maker));
}
@@ -759,7 +759,7 @@ abstract class AbstractTestGenerator implements CancellableTask<WorkingCopy>{
? Collections.<ExpressionTree>emptyList()
: Collections.singletonList((ExpressionTree) maker.Type(bound));
} else {
- List<ExpressionTree> result = new ArrayList(size);
+ List<ExpressionTree> result = new ArrayList<>(size);
for (DeclaredType type : typeList) {
result.add((ExpressionTree) maker.Type(type));
}
diff --git a/java/maven.hints/src/org/netbeans/modules/maven/hints/ui/SearchDependencyUI.java b/java/maven.hints/src/org/netbeans/modules/maven/hints/ui/SearchDependencyUI.java
index ffe4cb79ed..8efd3dec62 100644
--- a/java/maven.hints/src/org/netbeans/modules/maven/hints/ui/SearchDependencyUI.java
+++ b/java/maven.hints/src/org/netbeans/modules/maven/hints/ui/SearchDependencyUI.java
@@ -363,7 +363,7 @@ public class SearchDependencyUI extends javax.swing.JPanel implements ExplorerMa
}
private void refreshList() {
- List<Node> keys = new ArrayList();
+ List<Node> keys = new ArrayList<>();
for (Node node : myNodes) {
keys.add(node);
}
diff --git a/java/maven/src/org/netbeans/modules/maven/execute/MavenCommandLineExecutor.java b/java/maven/src/org/netbeans/modules/maven/execute/MavenCommandLineExecutor.java
index da5362821c..d6dafe18fc 100644
--- a/java/maven/src/org/netbeans/modules/maven/execute/MavenCommandLineExecutor.java
+++ b/java/maven/src/org/netbeans/modules/maven/execute/MavenCommandLineExecutor.java
@@ -935,7 +935,7 @@ public class MavenCommandLineExecutor extends AbstractMavenExecutor {
}
private File checkAvailability(String ver, VersionRange vr, InputOutput ioput) {
- ArrayList<String> all = new ArrayList(MavenSettings.getDefault().getUserDefinedMavenRuntimes());
+ ArrayList<String> all = new ArrayList<>(MavenSettings.getDefault().getUserDefinedMavenRuntimes());
//TODO this could be slow? but is it slower than downloading stuff?
//is there a faster way? or can we somehow log the findings after first attempt?
DefaultArtifactVersion candidate = null;
diff --git a/java/maven/src/org/netbeans/modules/maven/nodes/AddDependencyPanel.java b/java/maven/src/org/netbeans/modules/maven/nodes/AddDependencyPanel.java
index 9bcb75caac..3f86da7bbc 100644
--- a/java/maven/src/org/netbeans/modules/maven/nodes/AddDependencyPanel.java
+++ b/java/maven/src/org/netbeans/modules/maven/nodes/AddDependencyPanel.java
@@ -1002,7 +1002,7 @@ public class AddDependencyPanel extends javax.swing.JPanel {
}
private void refreshList() {
- List<Node> keys = new ArrayList();
+ List<Node> keys = new ArrayList<>();
for (Node node : myNodes) {
keys.add(node);
}
diff --git a/java/maven/src/org/netbeans/modules/maven/queries/PomCompilerOptionsQueryImpl.java b/java/maven/src/org/netbeans/modules/maven/queries/PomCompilerOptionsQueryImpl.java
index bb3d228686..317c6e746b 100644
--- a/java/maven/src/org/netbeans/modules/maven/queries/PomCompilerOptionsQueryImpl.java
+++ b/java/maven/src/org/netbeans/modules/maven/queries/PomCompilerOptionsQueryImpl.java
@@ -105,7 +105,7 @@ public final class PomCompilerOptionsQueryImpl implements CompilerOptionsQueryIm
private List<String> createArguments() {
String[] compilerArgs = PluginPropertyUtils.getPluginPropertyList(proj, Constants.GROUP_APACHE_PLUGINS, Constants.PLUGIN_COMPILER, "compilerArgs", "arg", null); // NOI18N
if (compilerArgs != null) {
- List<String> args = new ArrayList();
+ List<String> args = new ArrayList<>();
for (String compilerArg : compilerArgs) {
if ((compilerArg != null) && (!compilerArg.isEmpty())) {
args.add(compilerArg);
diff --git a/java/performance/benchmarks/test/reports/test/src/org/netbeans/performance/results/TestResultTest.java b/java/performance/benchmarks/test/reports/test/src/org/netbeans/performance/results/TestResultTest.java
index c4170ac906..38a791b0dc 100644
--- a/java/performance/benchmarks/test/reports/test/src/org/netbeans/performance/results/TestResultTest.java
+++ b/java/performance/benchmarks/test/reports/test/src/org/netbeans/performance/results/TestResultTest.java
@@ -72,7 +72,7 @@ public class TestResultTest extends TestCase {
result = TestResult.computeStatistics(values);
assertEquals("wrong count", 0.0, result.getAverage());
- values = new ArrayList();
+ values = new ArrayList<>();
values.add(1);
result = TestResult.computeStatistics(values);
assertEquals("wrong average", 1.0, result.getAverage());
diff --git a/java/refactoring.java/src/org/netbeans/modules/refactoring/java/RefactoringUtils.java b/java/refactoring.java/src/org/netbeans/modules/refactoring/java/RefactoringUtils.java
index aff4e5dfc7..6d91852826 100644
--- a/java/refactoring.java/src/org/netbeans/modules/refactoring/java/RefactoringUtils.java
+++ b/java/refactoring.java/src/org/netbeans/modules/refactoring/java/RefactoringUtils.java
@@ -156,7 +156,7 @@ public class RefactoringUtils {
*/
@Deprecated
public static Collection<ExecutableElement> getOverridingMethods(ExecutableElement e, CompilationInfo info, AtomicBoolean cancel) {
- Collection<ExecutableElement> result = new ArrayList();
+ Collection<ExecutableElement> result = new ArrayList<>();
TypeElement parentType = (TypeElement) e.getEnclosingElement();
Set<ElementHandle<TypeElement>> subTypes = getImplementorsAsHandles(info.getClasspathInfo().getClassIndex(), info.getClasspathInfo(), parentType, cancel);
for (ElementHandle<TypeElement> subTypeHandle : subTypes) {
@@ -509,7 +509,7 @@ public class RefactoringUtils {
}
private static Collection<TypeElement> typesToElements(Collection<? extends TypeMirror> types, CompilationInfo info) {
- Collection<TypeElement> result = new HashSet();
+ Collection<TypeElement> result = new HashSet<>();
for (TypeMirror tm : types) {
result.add(typeToElement(tm, info));
}
@@ -517,7 +517,7 @@ public class RefactoringUtils {
}
public static Collection<FileObject> elementsToFile(Collection<? extends Element> elements, ClasspathInfo cpInfo) {
- Collection<FileObject> result = new HashSet();
+ Collection<FileObject> result = new HashSet<>();
for (Element handle : elements) {
result.add(SourceUtils.getFile(handle, cpInfo));
}
@@ -596,8 +596,8 @@ public class RefactoringUtils {
@SuppressWarnings("CollectionContainsUrl")
public static ClasspathInfo getClasspathInfoFor(boolean dependencies, boolean backSource, FileObject... files) {
assert files.length > 0;
- Set<URL> dependentSourceRoots = new HashSet();
- Set<URL> dependentCompileRoots = new HashSet();
+ Set<URL> dependentSourceRoots = new HashSet<>();
+ Set<URL> dependentCompileRoots = new HashSet<>();
ClassPath nullPath = ClassPathSupport.createClassPath(new FileObject[0]);
ClassPath boot = null;
ClassPath moduleBoot = null;
diff --git a/java/refactoring.java/src/org/netbeans/modules/refactoring/java/plugins/ChangeParamsTransformer.java b/java/refactoring.java/src/org/netbeans/modules/refactoring/java/plugins/ChangeParamsTransformer.java
index 921f0e9259..25344464af 100644
--- a/java/refactoring.java/src/org/netbeans/modules/refactoring/java/plugins/ChangeParamsTransformer.java
+++ b/java/refactoring.java/src/org/netbeans/modules/refactoring/java/plugins/ChangeParamsTransformer.java
@@ -374,7 +374,7 @@ public class ChangeParamsTransformer extends RefactoringVisitor {
}
private List<ExpressionTree> getNewCompatibleArguments(List<? extends VariableTree> parameters) {
- List<ExpressionTree> arguments = new ArrayList();
+ List<ExpressionTree> arguments = new ArrayList<>();
ParameterInfo[] pi = paramInfos;
for (int i = 0; i < pi.length; i++) {
int originalIndex = pi[i].getOriginalIndex();
@@ -432,7 +432,7 @@ public class ChangeParamsTransformer extends RefactoringVisitor {
}
private List<ExpressionTree> getNewArguments(List<? extends ExpressionTree> currentArguments, boolean passThrough, ExecutableElement method) {
- List<ExpressionTree> arguments = new ArrayList();
+ List<ExpressionTree> arguments = new ArrayList<>();
ParameterInfo[] pi = paramInfos;
for (int i = 0; i < pi.length; i++) {
int originalIndex = pi[i].getOriginalIndex();
diff --git a/java/refactoring.java/src/org/netbeans/modules/refactoring/java/plugins/MoveMembersTransformer.java b/java/refactoring.java/src/org/netbeans/modules/refactoring/java/plugins/MoveMembersTransformer.java
index b62e5bd9e0..193d347144 100644
--- a/java/refactoring.java/src/org/netbeans/modules/refactoring/java/plugins/MoveMembersTransformer.java
+++ b/java/refactoring.java/src/org/netbeans/modules/refactoring/java/plugins/MoveMembersTransformer.java
@@ -312,7 +312,7 @@ public class MoveMembersTransformer extends RefactoringVisitor {
TreePath enclosingClassPath = JavaRefactoringUtils.findEnclosingClass(workingCopy, currentPath, true, true, true, true, true);
Element enclosingElement = workingCopy.getTrees().getElement(enclosingClassPath);
- final LinkedList<ExpressionTree> arguments = new LinkedList(node.getArguments());
+ final LinkedList<ExpressionTree> arguments = new LinkedList<>(node.getArguments());
ExpressionTree newMethodSelect;
if (el.getModifiers().contains(Modifier.STATIC)) {
diff --git a/java/refactoring.java/src/org/netbeans/modules/refactoring/java/plugins/UseSuperTypeRefactoringPlugin.java b/java/refactoring.java/src/org/netbeans/modules/refactoring/java/plugins/UseSuperTypeRefactoringPlugin.java
index 1ffd44d995..8a455f2538 100644
--- a/java/refactoring.java/src/org/netbeans/modules/refactoring/java/plugins/UseSuperTypeRefactoringPlugin.java
+++ b/java/refactoring.java/src/org/netbeans/modules/refactoring/java/plugins/UseSuperTypeRefactoringPlugin.java
@@ -383,7 +383,7 @@ public class UseSuperTypeRefactoringPlugin extends JavaRefactoringPlugin {
TypeMirror supTypeErasure = types.erasure(superTypeElement.asType());
DeclaredType varType = (DeclaredType) varElement.asType();
TypeMirror theType = null;
- List<TypeMirror> supertypes = new LinkedList(types.directSupertypes(varType));
+ List<TypeMirror> supertypes = new LinkedList<>(types.directSupertypes(varType));
while(!supertypes.isEmpty()) {
TypeMirror supertype = supertypes.remove(0);
if(types.isSameType(types.erasure(supertype), supTypeErasure)) {
diff --git a/java/refactoring.java/src/org/netbeans/modules/refactoring/java/spi/JavaRefactoringPlugin.java b/java/refactoring.java/src/org/netbeans/modules/refactoring/java/spi/JavaRefactoringPlugin.java
index 9f796bf93a..2c9ce51100 100644
--- a/java/refactoring.java/src/org/netbeans/modules/refactoring/java/spi/JavaRefactoringPlugin.java
+++ b/java/refactoring.java/src/org/netbeans/modules/refactoring/java/spi/JavaRefactoringPlugin.java
@@ -89,7 +89,7 @@ public abstract class JavaRefactoringPlugin extends ProgressProviderAdapter impl
}
private static Collection<org.netbeans.modules.refactoring.spi.ModificationResult> createJavaModifications(Collection<ModificationResult> modifications) {
- LinkedList<org.netbeans.modules.refactoring.spi.ModificationResult> result = new LinkedList();
+ LinkedList<org.netbeans.modules.refactoring.spi.ModificationResult> result = new LinkedList<>();
for (ModificationResult r:modifications) {
result.add(new JavaModificationResult(r));
}
diff --git a/java/refactoring.java/src/org/netbeans/modules/refactoring/java/ui/PushDownPanel.java b/java/refactoring.java/src/org/netbeans/modules/refactoring/java/ui/PushDownPanel.java
index 129d22f2e9..7bdf509f46 100644
--- a/java/refactoring.java/src/org/netbeans/modules/refactoring/java/ui/PushDownPanel.java
+++ b/java/refactoring.java/src/org/netbeans/modules/refactoring/java/ui/PushDownPanel.java
@@ -224,7 +224,7 @@ public class PushDownPanel extends JPanel implements CustomRefactoringPanel {
@Override
public void run(CompilationController controller) throws Exception {
controller.toPhase(JavaSource.Phase.RESOLVED);
- List<MemberInfo<? extends ElementHandle<? extends Element>>> l = new ArrayList();
+ List<MemberInfo<? extends ElementHandle<? extends Element>>> l = new ArrayList<>();
TypeElement sourceTypeElement = (TypeElement) handle.resolveElement(controller);
for (TypeMirror tm:sourceTypeElement.getInterfaces()) {
l.add(MemberInfo.create(RefactoringUtils.typeToElement(tm, controller), controller, MemberInfo.Group.IMPLEMENTS));
diff --git a/java/refactoring.java/src/org/netbeans/modules/refactoring/java/ui/ReplaceConstructorWithBuilderPanel.java b/java/refactoring.java/src/org/netbeans/modules/refactoring/java/ui/ReplaceConstructorWithBuilderPanel.java
index 4ab1916510..dab9564777 100644
--- a/java/refactoring.java/src/org/netbeans/modules/refactoring/java/ui/ReplaceConstructorWithBuilderPanel.java
+++ b/java/refactoring.java/src/org/netbeans/modules/refactoring/java/ui/ReplaceConstructorWithBuilderPanel.java
@@ -249,7 +249,7 @@ public class ReplaceConstructorWithBuilderPanel extends javax.swing.JPanel imple
}
public List<ReplaceConstructorWithBuilderRefactoring.Setter> getSetters() {
- List<ReplaceConstructorWithBuilderRefactoring.Setter> result = new ArrayList();
+ List<ReplaceConstructorWithBuilderRefactoring.Setter> result = new ArrayList<>();
int size = parameterTypes.size();
for (int i = 0; i < size; i++) {
final String name = (String) ((DefaultTableModel) paramTable.getModel()).getValueAt(i, 0);
diff --git a/nbbuild/installer/engine/src/org/netbeans/installer/utils/applications/NetBeansUtils.java b/nbbuild/installer/engine/src/org/netbeans/installer/utils/applications/NetBeansUtils.java
index 9135644cbd..384fb14821 100644
--- a/nbbuild/installer/engine/src/org/netbeans/installer/utils/applications/NetBeansUtils.java
+++ b/nbbuild/installer/engine/src/org/netbeans/installer/utils/applications/NetBeansUtils.java
@@ -136,7 +136,7 @@ public class NetBeansUtils {
}
final List<String> ids =
- new LinkedList(Arrays.asList(id.split(PACK_ID_SEPARATOR)));
+ new LinkedList<>(Arrays.asList(id.split(PACK_ID_SEPARATOR)));
boolean packAdded = false;
for (int i = 1; i < ids.size(); i++) {
diff --git a/nbbuild/installer/engine/src/org/netbeans/installer/wizard/components/panels/netbeans/NbPreInstallSummaryPanel.java b/nbbuild/installer/engine/src/org/netbeans/installer/wizard/components/panels/netbeans/NbPreInstallSummaryPanel.java
index 04c4a1187d..0dc0ad7221 100644
--- a/nbbuild/installer/engine/src/org/netbeans/installer/wizard/components/panels/netbeans/NbPreInstallSummaryPanel.java
+++ b/nbbuild/installer/engine/src/org/netbeans/installer/wizard/components/panels/netbeans/NbPreInstallSummaryPanel.java
@@ -682,7 +682,7 @@ public class NbPreInstallSummaryPanel extends ErrorMessagePanel {
for(String location: locations) {
if(new File(location).equals(product.getInstallationLocation())) {
final NbiCheckBox checkbox = new NbiCheckBox();
- final Pair<Product, NbiCheckBox> pair = new Pair(product, checkbox);
+ final Pair<Product, NbiCheckBox> pair = new Pair<>(product, checkbox);
productCheckboxList.add(pair);
checkbox.setText(pair.getFirst().getDisplayName());
checkbox.setBorder(new EmptyBorder(0, 0, 0, 0));
diff --git a/nbbuild/installer/engine/src/org/netbeans/installer/wizard/components/sequences/netbeans/NbMainSequence.java b/nbbuild/installer/engine/src/org/netbeans/installer/wizard/components/sequences/netbeans/NbMainSequence.java
index db300cd308..6176800c7f 100644
--- a/nbbuild/installer/engine/src/org/netbeans/installer/wizard/components/sequences/netbeans/NbMainSequence.java
+++ b/nbbuild/installer/engine/src/org/netbeans/installer/wizard/components/sequences/netbeans/NbMainSequence.java
@@ -389,7 +389,7 @@ public class NbMainSequence extends WizardSequence {
}
private ExecutionResults runIDE(List<String> commandsBase, File nbInstallLocation, boolean checkForUpdate, CompositeProgress compositeProgress) throws IOException {
- List<String> commands = new ArrayList(commandsBase);
+ List<String> commands = new ArrayList<>(commandsBase);
String title = null;
if (checkForUpdate) {
diff --git a/nbi/engine/src/org/netbeans/installer/utils/FileUtils.java b/nbi/engine/src/org/netbeans/installer/utils/FileUtils.java
index 4b1b1165c4..155c729139 100644
--- a/nbi/engine/src/org/netbeans/installer/utils/FileUtils.java
+++ b/nbi/engine/src/org/netbeans/installer/utils/FileUtils.java
@@ -321,7 +321,7 @@ public final class FileUtils {
public static Set<File> getRecursiveFileSet(
final File file) throws IOException {
- Set<File> fileSet = new HashSet();
+ Set<File> fileSet = new HashSet<>();
if (file != null && exists(file)) {
computeRecursiveFileSet(file,fileSet);
diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/actions/FixUsesPerformer.java b/php/php.editor/src/org/netbeans/modules/php/editor/actions/FixUsesPerformer.java
index 2370b4cb77..809ccbd85a 100644
--- a/php/php.editor/src/org/netbeans/modules/php/editor/actions/FixUsesPerformer.java
+++ b/php/php.editor/src/org/netbeans/modules/php/editor/actions/FixUsesPerformer.java
@@ -511,8 +511,8 @@ public class FixUsesPerformer {
//~ inner classes
private static class CheckVisitor extends DefaultVisitor {
- private List<DeclareStatement> declareStatements = new ArrayList();
- private List<NamespaceDeclaration> globalNamespaceDeclarations = new ArrayList();
+ private List<DeclareStatement> declareStatements = new ArrayList<>();
+ private List<NamespaceDeclaration> globalNamespaceDeclarations = new ArrayList<>();
public List<DeclareStatement> getDeclareStatements() {
return Collections.unmodifiableList(declareStatements);
diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/elements/TypeNameResolverImpl.java b/php/php.editor/src/org/netbeans/modules/php/editor/elements/TypeNameResolverImpl.java
index ef26f8436b..d3d818ec9f 100644
--- a/php/php.editor/src/org/netbeans/modules/php/editor/elements/TypeNameResolverImpl.java
+++ b/php/php.editor/src/org/netbeans/modules/php/editor/elements/TypeNameResolverImpl.java
@@ -212,7 +212,7 @@ public abstract class TypeNameResolverImpl implements TypeNameResolver {
private QualifiedName resolveForMatchedUseScope(final QualifiedName qualifiedName, final UseScope matchedUseScope) {
QualifiedName result = qualifiedName;
- final ArrayList<String> segments = new ArrayList();
+ final ArrayList<String> segments = new ArrayList<>();
for (StringTokenizer st = new StringTokenizer(matchedUseScope.getName(), NamespaceDeclarationInfo.NAMESPACE_SEPARATOR); st.hasMoreTokens();) {
String token = st.nextToken();
segments.add(token);
@@ -360,7 +360,7 @@ public abstract class TypeNameResolverImpl implements TypeNameResolver {
}
private static List<String> createSegments(final UseScope matchedUseElement) {
- List<String> segments = new ArrayList();
+ List<String> segments = new ArrayList<>();
for (StringTokenizer st = new StringTokenizer(matchedUseElement.getName(), NamespaceDeclarationInfo.NAMESPACE_SEPARATOR); st.hasMoreTokens();) {
String token = st.nextToken();
if (st.hasMoreTokens()) {
diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/parser/PHPDocCommentParser.java b/php/php.editor/src/org/netbeans/modules/php/editor/parser/PHPDocCommentParser.java
index 3f3a7c91c2..160df03925 100644
--- a/php/php.editor/src/org/netbeans/modules/php/editor/parser/PHPDocCommentParser.java
+++ b/php/php.editor/src/org/netbeans/modules/php/editor/parser/PHPDocCommentParser.java
@@ -349,7 +349,7 @@ public class PHPDocCommentParser {
}
private List<PHPDocVarTypeTag> findMethodParams(String description, int startOfDescription) {
- List<PHPDocVarTypeTag> result = new ArrayList();
+ List<PHPDocVarTypeTag> result = new ArrayList<>();
int position = startOfDescription;
ParametersExtractor parametersExtractor = ParametersExtractorImpl.create();
String parameters = parametersExtractor.extract(description);
@@ -439,7 +439,7 @@ public class PHPDocCommentParser {
private static String composeDescription(String[] tokens) {
assert tokens.length > 0;
- List<String> tokenList = new ArrayList(Arrays.asList(tokens));
+ List<String> tokenList = new ArrayList<>(Arrays.asList(tokens));
tokenList.remove(0); // remove annotation name
return StringUtils.implode(tokenList, " ");
}
diff --git a/platform/masterfs/test/unit/src/org/netbeans/modules/masterfs/filebasedfs/fileobjects/ExternalTouchTest.java b/platform/masterfs/test/unit/src/org/netbeans/modules/masterfs/filebasedfs/fileobjects/ExternalTouchTest.java
index 5468f2722c..b6802811d6 100644
--- a/platform/masterfs/test/unit/src/org/netbeans/modules/masterfs/filebasedfs/fileobjects/ExternalTouchTest.java
+++ b/platform/masterfs/test/unit/src/org/netbeans/modules/masterfs/filebasedfs/fileobjects/ExternalTouchTest.java
@@ -215,7 +215,7 @@ public class ExternalTouchTest extends NbTestCase {
sub = obj.getParent().getParent();
fsub = FileUtil.toFile(sub);
- WeakReference<Object> ref = new WeakReference(obj);
+ WeakReference<Object> ref = new WeakReference<>(obj);
obj = null;
assertGC("File object can disappear", ref);
}
diff --git a/platform/o.n.swing.outline/src/org/netbeans/swing/etable/ETable.java b/platform/o.n.swing.outline/src/org/netbeans/swing/etable/ETable.java
index 1e6ac1016d..28a802021b 100644
--- a/platform/o.n.swing.outline/src/org/netbeans/swing/etable/ETable.java
+++ b/platform/o.n.swing.outline/src/org/netbeans/swing/etable/ETable.java
@@ -2366,7 +2366,7 @@ public class ETable extends JTable {
}
private ComboBoxModel<String> getSearchComboModel() {
- DefaultComboBoxModel<String> result = new DefaultComboBoxModel();
+ DefaultComboBoxModel<String> result = new DefaultComboBoxModel<>();
for (Enumeration<TableColumn> en = getColumnModel().getColumns(); en.hasMoreElements(); ) {
TableColumn column = en.nextElement();
if (column instanceof ETableColumn) {
diff --git a/platform/openide.nodes/src/org/openide/util/actions/CookieAction.java b/platform/openide.nodes/src/org/openide/util/actions/CookieAction.java
index d617745f7b..f92815b963 100644
--- a/platform/openide.nodes/src/org/openide/util/actions/CookieAction.java
+++ b/platform/openide.nodes/src/org/openide/util/actions/CookieAction.java
@@ -164,7 +164,7 @@ public abstract class CookieAction extends NodeAction {
for (Class<?> cookie : cookies) {
// test for supported cookies
@SuppressWarnings("unchecked")
- Lookup.Template<?> templ = new Lookup.Template(cookie);
+ Lookup.Template<?> templ = new Lookup.Template<>(cookie);
if (n.getLookup().lookupItem(templ) != null) {
ret++;
diff --git a/platform/openide.util.lookup/src/org/openide/util/lookup/InheritanceTree.java b/platform/openide.util.lookup/src/org/openide/util/lookup/InheritanceTree.java
index 29140e6b40..56a4cbccf6 100644
--- a/platform/openide.util.lookup/src/org/openide/util/lookup/InheritanceTree.java
+++ b/platform/openide.util.lookup/src/org/openide/util/lookup/InheritanceTree.java
@@ -768,7 +768,7 @@ implements Serializable, AbstractLookup.Storage<ArrayList<Class>> {
Map.Entry entry = (Map.Entry) it.next();
Object value = entry.getValue();
- HashMap<?,?> retain = new HashMap(retainItems);
+ HashMap<?,?> retain = new HashMap<>(retainItems);
Iterator elems;
boolean multi = value instanceof Collection;
diff --git a/platform/openide.util/test/unit/src/org/openide/util/WeakSetTest.java b/platform/openide.util/test/unit/src/org/openide/util/WeakSetTest.java
index a34fa80426..e62dd6b351 100644
--- a/platform/openide.util/test/unit/src/org/openide/util/WeakSetTest.java
+++ b/platform/openide.util/test/unit/src/org/openide/util/WeakSetTest.java
@@ -273,7 +273,7 @@ public class WeakSetTest extends NbTestCase {
set.remove(arr[0]);
assertFalse(second.equals(set));
String s = "GCing " + arr[0];
- Reference<Object> r = new WeakReference(arr[0]);
+ Reference<Object> r = new WeakReference<>(arr[0]);
arr[0] = null;
NbTestCase.assertGC(s, r);
assertEquals(second, set);
diff --git a/platform/spi.actions/test/unit/src/org/netbeans/spi/actions/ContextActionTest.java b/platform/spi.actions/test/unit/src/org/netbeans/spi/actions/ContextActionTest.java
index ad6cc8e96c..65c7f14788 100644
--- a/platform/spi.actions/test/unit/src/org/netbeans/spi/actions/ContextActionTest.java
+++ b/platform/spi.actions/test/unit/src/org/netbeans/spi/actions/ContextActionTest.java
@@ -739,7 +739,7 @@ public class ContextActionTest extends NbTestCase {
}
a.removePropertyChangeListener(pcl);
//diagnostics
- Reference<PCL> pclRef = new WeakReference(pcl);
+ Reference<PCL> pclRef = new WeakReference<>(pcl);
pcl = null;
assertGC("PCL still alive", pclRef, rootsHint);
diff --git a/profiler/lib.profiler.charts/src/org/netbeans/lib/profiler/charts/ChartComponent.java b/profiler/lib.profiler.charts/src/org/netbeans/lib/profiler/charts/ChartComponent.java
index e7a356e153..4a7c9c146a 100644
--- a/profiler/lib.profiler.charts/src/org/netbeans/lib/profiler/charts/ChartComponent.java
+++ b/profiler/lib.profiler.charts/src/org/netbeans/lib/profiler/charts/ChartComponent.java
@@ -492,7 +492,7 @@ public class ChartComponent extends InteractiveCanvasComponent {
}
protected void itemsRemoved(List<ChartItem> removedItems) {
- List<ItemPainter> painters = new ArrayList(removedItems.size());
+ List<ItemPainter> painters = new ArrayList<>(removedItems.size());
// Try to resolve painters for all removed items
for (ChartItem item : removedItems) {
@@ -532,7 +532,7 @@ public class ChartComponent extends InteractiveCanvasComponent {
protected void itemsChanged(List<ChartItemChange> itemChanges) {
// Resolve painters for changedItems
- List<ItemPainter> painters = new ArrayList(itemChanges.size());
+ List<ItemPainter> painters = new ArrayList<>(itemChanges.size());
for (ChartItemChange change : itemChanges)
painters.add(paintersModel.getPainter(change.getItem()));
@@ -587,7 +587,7 @@ public class ChartComponent extends InteractiveCanvasComponent {
}
protected void paintersChanged(List<ItemPainter> changedPainters) {
- Set<ChartItem> changedItems = new HashSet();
+ Set<ChartItem> changedItems = new HashSet<>();
// Update chart size
LongRect oldBounds = new LongRect(dataBounds);
diff --git a/profiler/lib.profiler.charts/src/org/netbeans/lib/profiler/charts/ChartSelectionManager.java b/profiler/lib.profiler.charts/src/org/netbeans/lib/profiler/charts/ChartSelectionManager.java
index 381ecc3f4c..495a1f32c2 100644
--- a/profiler/lib.profiler.charts/src/org/netbeans/lib/profiler/charts/ChartSelectionManager.java
+++ b/profiler/lib.profiler.charts/src/org/netbeans/lib/profiler/charts/ChartSelectionManager.java
@@ -166,8 +166,8 @@ class ChartSelectionManager implements ChartSelectionModel {
highlightedSelection = new ArrayList(items);
fireHighlightedItemsChanged(items, items, Collections.EMPTY_LIST);
} else {
- List<ItemSelection> addedItems = new ArrayList();
- List<ItemSelection> removedItems = new ArrayList();
+ List<ItemSelection> addedItems = new ArrayList<>();
+ List<ItemSelection> removedItems = new ArrayList<>();
for (ItemSelection item : items)
if (!highlightedSelection.contains(item)) addedItems.add(item);
@@ -196,8 +196,8 @@ class ChartSelectionManager implements ChartSelectionModel {
selectedSelection = new ArrayList(items);
fireSelectedItemsChanged(items, items, Collections.EMPTY_LIST);
} else {
- List<ItemSelection> addedItems = new ArrayList();
- List<ItemSelection> removedItems = new ArrayList();
+ List<ItemSelection> addedItems = new ArrayList<>();
+ List<ItemSelection> removedItems = new ArrayList<>();
for (ItemSelection item : items)
if (!selectedSelection.contains(item)) addedItems.add(item);
@@ -271,7 +271,7 @@ class ChartSelectionManager implements ChartSelectionModel {
PaintersModel paintersModel = chart.getPaintersModel();
int itemsCount = itemsModel.getItemsCount();
- List<ItemSelection> closestSelection = new ArrayList(itemsCount);
+ List<ItemSelection> closestSelection = new ArrayList<>(itemsCount);
for (int i = 0; i < itemsCount; i++) {
ChartItem item = itemsModel.getItem(i);
diff --git a/profiler/lib.profiler.charts/src/org/netbeans/lib/profiler/charts/PaintersModel.java b/profiler/lib.profiler.charts/src/org/netbeans/lib/profiler/charts/PaintersModel.java
index 9f0b20a3e7..b0f0bd53d4 100644
--- a/profiler/lib.profiler.charts/src/org/netbeans/lib/profiler/charts/PaintersModel.java
+++ b/profiler/lib.profiler.charts/src/org/netbeans/lib/profiler/charts/PaintersModel.java
@@ -76,7 +76,7 @@ public interface PaintersModel {
public Default() {
- painters = new HashMap();
+ painters = new HashMap<>();
}
public Default(ChartItem[] items, ItemPainter[] painters) {
diff --git a/profiler/lib.profiler.charts/src/org/netbeans/lib/profiler/charts/axis/TimeAxisUtils.java b/profiler/lib.profiler.charts/src/org/netbeans/lib/profiler/charts/axis/TimeAxisUtils.java
index 6985bc400a..f55ecbf473 100644
--- a/profiler/lib.profiler.charts/src/org/netbeans/lib/profiler/charts/axis/TimeAxisUtils.java
+++ b/profiler/lib.profiler.charts/src/org/netbeans/lib/profiler/charts/axis/TimeAxisUtils.java
@@ -63,7 +63,7 @@ public class TimeAxisUtils {
public static final String TIME_DATE_FORMAT = "{0}, {1}";
private static final String PATTERN_CHARS = "GyMwWDdFEaHkKhmsSzZ"; // NOI18N
- private static final Map<String, Format> FORMATS = new HashMap();
+ private static final Map<String, Format> FORMATS = new HashMap<>();
private static final Calendar c1 = Calendar.getInstance();
private static final Calendar c2 = Calendar.getInstance();
diff --git a/profiler/lib.profiler.charts/src/org/netbeans/lib/profiler/charts/canvas/BufferedCanvasComponent.java b/profiler/lib.profiler.charts/src/org/netbeans/lib/profiler/charts/canvas/BufferedCanvasComponent.java
index c366e8bfd2..d2e7a15cfc 100644
--- a/profiler/lib.profiler.charts/src/org/netbeans/lib/profiler/charts/canvas/BufferedCanvasComponent.java
+++ b/profiler/lib.profiler.charts/src/org/netbeans/lib/profiler/charts/canvas/BufferedCanvasComponent.java
@@ -80,7 +80,7 @@ public abstract class BufferedCanvasComponent extends JComponent {
private float accelerationPriority = .5f;
private Image offscreenImage = null;
- private WeakReference<Image> offscreenImageReference = new WeakReference(offscreenImage);
+ private WeakReference<Image> offscreenImageReference = new WeakReference<>(offscreenImage);
private Rectangle invalidOffscreenArea = new Rectangle();
diff --git a/profiler/lib.profiler.charts/src/org/netbeans/lib/profiler/charts/swing/CrossBorderLayout.java b/profiler/lib.profiler.charts/src/org/netbeans/lib/profiler/charts/swing/CrossBorderLayout.java
index 65a14e8115..17b69109f1 100644
--- a/profiler/lib.profiler.charts/src/org/netbeans/lib/profiler/charts/swing/CrossBorderLayout.java
+++ b/profiler/lib.profiler.charts/src/org/netbeans/lib/profiler/charts/swing/CrossBorderLayout.java
@@ -44,7 +44,7 @@ public class CrossBorderLayout implements LayoutManager2 {
private static final int NONE = Integer.MIN_VALUE;
- private Map<Component, Integer[]> map = new HashMap();
+ private Map<Component, Integer[]> map = new HashMap<>();
private Component north;
private Component west;
diff --git a/profiler/lib.profiler.charts/src/org/netbeans/lib/profiler/charts/xy/synchronous/SynchronousXYChart.java b/profiler/lib.profiler.charts/src/org/netbeans/lib/profiler/charts/xy/synchronous/SynchronousXYChart.java
index 1f46757247..2af28961ff 100644
--- a/profiler/lib.profiler.charts/src/org/netbeans/lib/profiler/charts/xy/synchronous/SynchronousXYChart.java
+++ b/profiler/lib.profiler.charts/src/org/netbeans/lib/profiler/charts/xy/synchronous/SynchronousXYChart.java
@@ -61,7 +61,7 @@ public class SynchronousXYChart extends ChartComponent {
timeline = itemsModel.getTimeline();
- indexesCache = new HashMap();
+ indexesCache = new HashMap<>();
firstVisibleIndex = VISIBLE_NONE;
lastVisibleIndex = VISIBLE_NONE;
diff --git a/profiler/lib.profiler.charts/src/org/netbeans/lib/profiler/charts/xy/synchronous/SynchronousXYItemsModel.java b/profiler/lib.profiler.charts/src/org/netbeans/lib/profiler/charts/xy/synchronous/SynchronousXYItemsModel.java
index b9047da34a..9deb8a5b7d 100644
--- a/profiler/lib.profiler.charts/src/org/netbeans/lib/profiler/charts/xy/synchronous/SynchronousXYItemsModel.java
+++ b/profiler/lib.profiler.charts/src/org/netbeans/lib/profiler/charts/xy/synchronous/SynchronousXYItemsModel.java
@@ -33,7 +33,7 @@ import org.netbeans.lib.profiler.charts.ChartItem;
*/
public class SynchronousXYItemsModel extends ItemsModel.Abstract {
- private final ArrayList<SynchronousXYItem> items = new ArrayList();
+ private final ArrayList<SynchronousXYItem> items = new ArrayList<>();
private final Timeline timeline;
@@ -76,7 +76,7 @@ public class SynchronousXYItemsModel extends ItemsModel.Abstract {
public final void valuesAdded() {
// Update values
- List<ChartItemChange> itemChanges = new ArrayList(items.size());
+ List<ChartItemChange> itemChanges = new ArrayList<>(items.size());
for (SynchronousXYItem item : items) itemChanges.add(item.valuesChanged());
fireItemsChanged(itemChanges);
@@ -100,7 +100,7 @@ public class SynchronousXYItemsModel extends ItemsModel.Abstract {
public final void valuesReset() {
// Update values
- List<ChartItemChange> itemChanges = new ArrayList(items.size());
+ List<ChartItemChange> itemChanges = new ArrayList<>(items.size());
for (SynchronousXYItem item : items) itemChanges.add(item.valuesChanged());
fireItemsChanged(itemChanges);
}
diff --git a/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/ResultsView.java b/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/ResultsView.java
index 62b0da6495..e8709fdd3a 100644
--- a/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/ResultsView.java
+++ b/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/ResultsView.java
@@ -38,7 +38,7 @@ public class ResultsView extends JPanel {
private Component mainToolbar;
private Component currentToolbar;
- private final List<Component> toolbars = new ArrayList();
+ private final List<Component> toolbars = new ArrayList<>();
private JTabbedPane tabs;
@@ -47,7 +47,7 @@ public class ResultsView extends JPanel {
private Icon firstIcon;
private String firstDescription;
- private final Set<ChangeListener> listeners = new HashSet();
+ private final Set<ChangeListener> listeners = new HashSet<>();
public ResultsView() {
diff --git a/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/charts/xy/ProfilerXYSelectionOverlay.java b/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/charts/xy/ProfilerXYSelectionOverlay.java
index a74550944c..2648575c62 100644
--- a/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/charts/xy/ProfilerXYSelectionOverlay.java
+++ b/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/charts/xy/ProfilerXYSelectionOverlay.java
@@ -65,7 +65,7 @@ public class ProfilerXYSelectionOverlay extends ChartOverlay {
public ProfilerXYSelectionOverlay() {
configurationListener = new ConfigurationListener();
selectionListener = new SelectionListener();
- selectedValues = new HashSet();
+ selectedValues = new HashSet<>();
initDefaultValues();
}
@@ -174,7 +174,7 @@ public class ProfilerXYSelectionOverlay extends ChartOverlay {
int shiftX, int shiftY) {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
- Set<Point> oldSelectedValues = new HashSet(selectedValues);
+ Set<Point> oldSelectedValues = new HashSet<>(selectedValues);
updateSelectedValues(selectedValues, chart.getSelectionModel().getHighlightedItems(), chart);
vLineBoundsChanged(oldSelectedValues, selectedValues);
}
@@ -193,7 +193,7 @@ public class ProfilerXYSelectionOverlay extends ChartOverlay {
public void highlightedItemsChanged(List<ItemSelection> currentItems,
List<ItemSelection> addedItems, List<ItemSelection> removedItems) {
- Set<Point> oldSelectedValues = new HashSet(selectedValues);
+ Set<Point> oldSelectedValues = new HashSet<>(selectedValues);
updateSelectedValues(selectedValues, currentItems, chart);
vLineBoundsChanged(oldSelectedValues, selectedValues);
}
diff --git a/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/components/FilterComponent.java b/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/components/FilterComponent.java
index 5198e8d8a3..3c9156f5c4 100644
--- a/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/components/FilterComponent.java
+++ b/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/components/FilterComponent.java
@@ -100,9 +100,9 @@ public abstract class FilterComponent implements CommonConstants {
private static final String FILTER_EMPTY = ""; // NOI18N
- private final Set<ChangeListener> listeners = new HashSet();
- private final List<String> filterTypeNames = new ArrayList();
- private final List<Integer> filterTypes = new ArrayList();
+ private final Set<ChangeListener> listeners = new HashSet<>();
+ private final List<String> filterTypeNames = new ArrayList<>();
+ private final List<Integer> filterTypes = new ArrayList<>();
private final boolean toLowerCase;
private String filterValue = FILTER_EMPTY;
diff --git a/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/components/ProfilerToolbar.java b/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/components/ProfilerToolbar.java
index f5e400d1bf..3008eca1ca 100644
--- a/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/components/ProfilerToolbar.java
+++ b/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/components/ProfilerToolbar.java
@@ -243,7 +243,7 @@ public abstract class ProfilerToolbar {
}
protected List<Component> components(Container aContainer) {
- List<Component> l = new ArrayList();
+ List<Component> l = new ArrayList<>();
for (int i = 0; i < aContainer.getComponentCount(); i++) {
Component c = aContainer.getComponent(i);
diff --git a/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/cpu/LiveCPUViewUpdater.java b/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/cpu/LiveCPUViewUpdater.java
index 758c8310c9..8697adebc8 100644
--- a/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/cpu/LiveCPUViewUpdater.java
+++ b/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/cpu/LiveCPUViewUpdater.java
@@ -98,7 +98,7 @@ public class LiveCPUViewUpdater {
@ServiceProvider(service=CPUCCTProvider.Listener.class)
public static class CCTHandler implements CPUCCTProvider.Listener {
- private final List<LiveCPUViewUpdater> updaters = new ArrayList();
+ private final List<LiveCPUViewUpdater> updaters = new ArrayList<>();
public static CCTHandler registerUpdater(LiveCPUViewUpdater updater) {
diff --git a/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/cpu/ThreadsSelector.java b/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/cpu/ThreadsSelector.java
index 4a94709dc2..ee07cd4073 100644
--- a/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/cpu/ThreadsSelector.java
+++ b/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/cpu/ThreadsSelector.java
@@ -77,7 +77,7 @@ public abstract class ThreadsSelector extends PopupButton {
// -----
- private final Set<Integer> selection = new HashSet();
+ private final Set<Integer> selection = new HashSet<>();
private boolean displayAllThreads = true;
private boolean mergeSelectedThreads = false;
@@ -122,7 +122,7 @@ public abstract class ThreadsSelector extends PopupButton {
UIUtils.runInEventDispatchThread(new Runnable() {
public void run() {
if (displayAllThreads) {
- Set<Integer> threads = new HashSet();
+ Set<Integer> threads = new HashSet<>();
CPUResultsSnapshot snapshot = getSnapshot();
if (snapshot != null)
for (int i = 0; i < snapshot.getNThreads(); i++)
diff --git a/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/jdbc/JDBCTreeTableView.java b/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/jdbc/JDBCTreeTableView.java
index 2eb119e060..d7534ef447 100644
--- a/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/jdbc/JDBCTreeTableView.java
+++ b/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/jdbc/JDBCTreeTableView.java
@@ -92,7 +92,7 @@ abstract class JDBCTreeTableView extends JDBCView {
long[] _nTotalAllocObjects = newData.getInvocationsPerSelectId();
long[] _totalAllocObjectsSize = newData.getTimePerSelectId();
- List<PresoObjAllocCCTNode> nodes = new ArrayList();
+ List<PresoObjAllocCCTNode> nodes = new ArrayList<>();
long totalObjects = 0;
long _totalObjects = 0;
diff --git a/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/jdbc/LiveJDBCViewUpdater.java b/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/jdbc/LiveJDBCViewUpdater.java
index 291ae81d3a..0ea5504866 100644
--- a/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/jdbc/LiveJDBCViewUpdater.java
+++ b/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/jdbc/LiveJDBCViewUpdater.java
@@ -98,7 +98,7 @@ public class LiveJDBCViewUpdater {
@ServiceProvider(service=JdbcCCTProvider.Listener.class)
public static class CCTHandler implements JdbcCCTProvider.Listener {
- private final List<LiveJDBCViewUpdater> updaters = new ArrayList();
+ private final List<LiveJDBCViewUpdater> updaters = new ArrayList<>();
public static CCTHandler registerUpdater(LiveJDBCViewUpdater updater) {
diff --git a/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/jdbc/SQLFilterPanel.java b/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/jdbc/SQLFilterPanel.java
index 21ffdacb88..3753d26665 100644
--- a/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/jdbc/SQLFilterPanel.java
+++ b/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/jdbc/SQLFilterPanel.java
@@ -158,7 +158,7 @@ abstract class SQLFilterPanel extends JPanel {
PopupButton commands = new PopupButton(" " + COMMANDS_DROPDOWN + " ") { // NOI18N
protected void populatePopup(JPopupMenu popup) {
- List<String> commands = new ArrayList(getCommands());
+ List<String> commands = new ArrayList<>(getCommands());
if (commands.isEmpty()) {
JLabel l = new JLabel(COMMANDS_NOTAVAILABLE);
l.setBorder(BorderFactory.createEmptyBorder(9, 6, 9, 6));
@@ -189,7 +189,7 @@ abstract class SQLFilterPanel extends JPanel {
PopupButton tables = new PopupButton(" " + TABLES_DROPDOWN + " ") { // NOI18N
protected void displayPopup() {
- Set<String> tablesSet = new HashSet(getTables());
+ Set<String> tablesSet = new HashSet<>(getTables());
if (tablesSet.isEmpty()) {
super.displayPopup();
} else {
@@ -298,9 +298,9 @@ abstract class SQLFilterPanel extends JPanel {
String filter = ""; // NOI18N
- final Set<String> commands = new HashSet();
- final Set<String> tables = new HashSet();
- final Set<Integer> statements = new HashSet();
+ final Set<String> commands = new HashSet<>();
+ final Set<String> tables = new HashSet<>();
+ final Set<Integer> statements = new HashSet<>();
void set(Configuration o) {
filter = o.filter;
diff --git a/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/memory/AllocTableView.java b/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/memory/AllocTableView.java
index 6fbfe1740d..ad4d1906c9 100644
--- a/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/memory/AllocTableView.java
+++ b/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/memory/AllocTableView.java
@@ -141,9 +141,9 @@ abstract class AllocTableView extends MemoryView {
} else { // new snapshot or live results
filterZeroItems = false;
- List<String> fClassNames = new ArrayList();
- List<Integer> fTotalAllocObjects = new ArrayList();
- List<Long> fTotalAllocObjectsSize = new ArrayList();
+ List<String> fClassNames = new ArrayList<>();
+ List<Integer> fTotalAllocObjects = new ArrayList<>();
+ List<Long> fTotalAllocObjectsSize = new ArrayList<>();
for (int i = 0; i < _nTrackedItems; i++) {
if (filter.passes(_classNames[i].replace('.', '/'))) { // NOI18N
diff --git a/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/memory/AllocTreeTableView.java b/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/memory/AllocTreeTableView.java
index 63b14ebc1f..19c20b3abf 100644
--- a/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/memory/AllocTreeTableView.java
+++ b/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/memory/AllocTreeTableView.java
@@ -194,8 +194,8 @@ abstract class AllocTreeTableView extends MemoryView {
int _nTrackedItems = Math.min(_snapshot.getNProfiledClasses(), _classNames.length);
_nTrackedItems = Math.min(_nTrackedItems, _nTotalAllocObjects.length);
- List<PresoObjAllocCCTNode> nodes = new ArrayList();
- final Map<TreeNode, ClientUtils.SourceCodeSelection> _nodesMap = new HashMap();
+ List<PresoObjAllocCCTNode> nodes = new ArrayList<>();
+ final Map<TreeNode, ClientUtils.SourceCodeSelection> _nodesMap = new HashMap<>();
long totalObjects = 0;
long _totalObjects = 0;
diff --git a/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/memory/LiveMemoryViewUpdater.java b/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/memory/LiveMemoryViewUpdater.java
index 46ed6f66a0..466e4cb89b 100644
--- a/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/memory/LiveMemoryViewUpdater.java
+++ b/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/memory/LiveMemoryViewUpdater.java
@@ -115,7 +115,7 @@ public class LiveMemoryViewUpdater {
@ServiceProvider(service=MemoryCCTProvider.Listener.class)
public static final class CCTHandler implements MemoryCCTProvider.Listener {
- private final List<LiveMemoryViewUpdater> updaters = new ArrayList();
+ private final List<LiveMemoryViewUpdater> updaters = new ArrayList<>();
public static CCTHandler registerUpdater(LiveMemoryViewUpdater updater) {
diff --git a/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/memory/LivenessTableView.java b/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/memory/LivenessTableView.java
index 0d93483dc1..382a1933a6 100644
--- a/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/memory/LivenessTableView.java
+++ b/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/memory/LivenessTableView.java
@@ -183,12 +183,12 @@ abstract class LivenessTableView extends MemoryView {
} else { // new snapshot or live results
filterZeroItems = false;
- List<String> fClassNames = new ArrayList();
- List<Integer> fTrackedLiveObjects = new ArrayList();
- List<Long> fTrackedLiveObjectsSize = new ArrayList();
- List<Long> fTrackedAllocObjects = new ArrayList();
- List<Float> fAvgObjectAge = new ArrayList();
- List<Integer> fMaxSurvGen = new ArrayList();
+ List<String> fClassNames = new ArrayList<>();
+ List<Integer> fTrackedLiveObjects = new ArrayList<>();
+ List<Long> fTrackedLiveObjectsSize = new ArrayList<>();
+ List<Long> fTrackedAllocObjects = new ArrayList<>();
+ List<Float> fAvgObjectAge = new ArrayList<>();
+ List<Integer> fMaxSurvGen = new ArrayList<>();
// List<Integer> fTotalAllocObjects = new ArrayList();
for (int i = 0; i < _nTrackedItems; i++) {
diff --git a/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/memory/LivenessTreeTableView.java b/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/memory/LivenessTreeTableView.java
index ec81dcf98d..e79060cf90 100644
--- a/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/memory/LivenessTreeTableView.java
+++ b/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/memory/LivenessTreeTableView.java
@@ -206,8 +206,8 @@ abstract class LivenessTreeTableView extends MemoryView {
int _nTrackedItems = Math.min(_snapshot.getNProfiledClasses(), _classNames.length);
_nTrackedItems = Math.min(_nTrackedItems, _nTotalAllocObjects.length);
- List<PresoObjLivenessCCTNode> nodes = new ArrayList();
- final Map<TreeNode, ClientUtils.SourceCodeSelection> _nodesMap = new HashMap();
+ List<PresoObjLivenessCCTNode> nodes = new ArrayList<>();
+ final Map<TreeNode, ClientUtils.SourceCodeSelection> _nodesMap = new HashMap<>();
long totalLiveBytes = 0;
long _totalLiveBytes = 0;
diff --git a/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/results/DataView.java b/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/results/DataView.java
index 19f646e70f..741df046e7 100644
--- a/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/results/DataView.java
+++ b/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/results/DataView.java
@@ -72,7 +72,7 @@ public abstract class DataView extends JPanel {
Collection<? extends PopupCustomizer> customizers = Lookup.getDefault().lookupAll(PopupCustomizer.class);
if (customizers.isEmpty()) return null;
- List<JMenuItem> menuItems = new ArrayList(customizers.size());
+ List<JMenuItem> menuItems = new ArrayList<>(customizers.size());
for (PopupCustomizer customizer : customizers) {
JMenuItem[] items = customizer.getMenuItems(invoker, this, value, userValue);
if (items != null) Collections.addAll(menuItems, items);
diff --git a/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/results/PackageColorer.java b/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/results/PackageColorer.java
index f455a8bbf2..fd2f104665 100644
--- a/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/results/PackageColorer.java
+++ b/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/results/PackageColorer.java
@@ -69,7 +69,7 @@ public final class PackageColorer {
}
public static List<ColoredFilter> getRegisteredColors() {
- List<ColoredFilter> colors = new ArrayList();
+ List<ColoredFilter> colors = new ArrayList<>();
for (ColoredFilter color : COLORS) colors.add(new ColoredFilter(color));
return colors;
}
diff --git a/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/swing/FilteringToolbar.java b/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/swing/FilteringToolbar.java
index 2acd6a980d..10ca6f5583 100644
--- a/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/swing/FilteringToolbar.java
+++ b/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/swing/FilteringToolbar.java
@@ -45,7 +45,7 @@ public abstract class FilteringToolbar extends InvisibleToolbar {
private TextFilter filter;
- private final List<Component> hiddenComponents = new ArrayList();
+ private final List<Component> hiddenComponents = new ArrayList<>();
private final AbstractButton filterButton;
public FilteringToolbar(String name) {
diff --git a/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/swing/MultiButtonGroup.java b/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/swing/MultiButtonGroup.java
index 49f2c2b1a4..c5d9020a68 100644
--- a/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/swing/MultiButtonGroup.java
+++ b/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/swing/MultiButtonGroup.java
@@ -30,7 +30,7 @@ import javax.swing.ButtonModel;
*/
public class MultiButtonGroup extends ButtonGroup {
- private final Set<ButtonModel> selected = new HashSet();
+ private final Set<ButtonModel> selected = new HashSet<>();
public void setSelected(ButtonModel m, boolean b) {
if (b == false) {
diff --git a/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/swing/ProfilerColumnModel.java b/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/swing/ProfilerColumnModel.java
index 9f81f2482f..233039625b 100644
--- a/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/swing/ProfilerColumnModel.java
+++ b/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/swing/ProfilerColumnModel.java
@@ -143,7 +143,7 @@ class ProfilerColumnModel extends DefaultTableColumnModel {
private int minColumnWidth = 20;
private int defaultColumnWidth = 60;
private Map<Integer, Integer> defaultColumnWidths;
- private Map<Integer, Integer> hiddenColumnWidths = new HashMap();
+ private Map<Integer, Integer> hiddenColumnWidths = new HashMap<>();
void setDefaultColumnWidth(int width) {
defaultColumnWidth = width;
diff --git a/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/swing/ProfilerPopup.java b/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/swing/ProfilerPopup.java
index e162ce9ad4..9334079554 100644
--- a/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/swing/ProfilerPopup.java
+++ b/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/swing/ProfilerPopup.java
@@ -625,7 +625,7 @@ public final class ProfilerPopup {
}
private static List<Component> components(Container aContainer) {
- List<Component> l = new ArrayList();
+ List<Component> l = new ArrayList<>();
for (int i = 0; i < aContainer.getComponentCount(); i++) {
Component c = aContainer.getComponent(i);
diff --git a/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/swing/ProfilerTable.java b/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/swing/ProfilerTable.java
index 67ade207ca..40aeed7b7e 100644
--- a/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/swing/ProfilerTable.java
+++ b/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/swing/ProfilerTable.java
@@ -509,8 +509,8 @@ public class ProfilerTable extends JTable {
private Object[] selectValues(Object[] values, int column, boolean scrollToVisible) {
if (values == null || values.length == 0) return null;
- Set<Object> toSelect = new HashSet(Arrays.asList(values));
- List<Object> selected = new ArrayList(toSelect.size());
+ Set<Object> toSelect = new HashSet<>(Arrays.asList(values));
+ List<Object> selected = new ArrayList<>(toSelect.size());
internal = true;
try {
diff --git a/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/swing/ProfilerTreeTable.java b/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/swing/ProfilerTreeTable.java
index cdd4b7a651..b8e1ec6bac 100644
--- a/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/swing/ProfilerTreeTable.java
+++ b/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/swing/ProfilerTreeTable.java
@@ -1491,7 +1491,7 @@ public class ProfilerTreeTable extends ProfilerTable {
public void setSelectionPaths(TreePath[] paths) {
if (changingModel && paths != null) {
- List<TreePath> similarPaths = new ArrayList();
+ List<TreePath> similarPaths = new ArrayList<>();
for (int i = 0; i < paths.length; i++) {
TreePath similarPath = getSimilarPath(paths[i]);
if (similarPath != null) similarPaths.add(similarPath);
diff --git a/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/threads/NameStateRenderer.java b/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/threads/NameStateRenderer.java
index 147a6a6bef..19753ccd79 100644
--- a/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/threads/NameStateRenderer.java
+++ b/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/threads/NameStateRenderer.java
@@ -48,7 +48,7 @@ public class NameStateRenderer extends LabelRenderer {
}
private static final int THREAD_ICON_SIZE = 9;
- private static final Map<Byte, Icon> STATE_ICONS_CACHE = new HashMap();
+ private static final Map<Byte, Icon> STATE_ICONS_CACHE = new HashMap<>();
private static Icon getIcon(byte state) {
Icon icon = STATE_ICONS_CACHE.get(state);
diff --git a/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/threads/ThreadsPanel.java b/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/threads/ThreadsPanel.java
index a375575291..38935fcbb5 100644
--- a/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/threads/ThreadsPanel.java
+++ b/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/threads/ThreadsPanel.java
@@ -85,8 +85,8 @@ public class ThreadsPanel extends DataView {
private Filter filter = Filter.ALL;
- private final Set<Integer> selected = new HashSet();
- private final Set<Integer> selectedApplied = new HashSet();
+ private final Set<Integer> selected = new HashSet<>();
+ private final Set<Integer> selectedApplied = new HashSet<>();
private Component zoomInAction;
private Component zoomOutAction;
diff --git a/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/threads/ViewManager.java b/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/threads/ViewManager.java
index 313d66c7b3..61dcffc598 100644
--- a/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/threads/ViewManager.java
+++ b/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/threads/ViewManager.java
@@ -75,7 +75,7 @@ public class ViewManager extends ProfilerTableContainer.ColumnChangeAdapter {
updateTimeMarks(true);
- rowViews = new HashMap();
+ rowViews = new HashMap<>();
}
diff --git a/profiler/lib.profiler/src/org/netbeans/lib/profiler/classfile/ClassInfo.java b/profiler/lib.profiler/src/org/netbeans/lib/profiler/classfile/ClassInfo.java
index 83336b4804..01010ce2fd 100644
--- a/profiler/lib.profiler/src/org/netbeans/lib/profiler/classfile/ClassInfo.java
+++ b/profiler/lib.profiler/src/org/netbeans/lib/profiler/classfile/ClassInfo.java
@@ -618,7 +618,7 @@ public abstract class ClassInfo extends BaseClassInfo implements JavaClassConsta
byte type = buffer[offset++];
if (type == 8) { // ITEM_Unitialized
if (uninitializedList == null) {
- uninitializedList = new ArrayList();
+ uninitializedList = new ArrayList<>();
}
while (uninitializedList.size() < listIndex+1) {
uninitializedList.add(null);
diff --git a/profiler/lib.profiler/src/org/netbeans/lib/profiler/heap/DominatorTree.java b/profiler/lib.profiler/src/org/netbeans/lib/profiler/heap/DominatorTree.java
index 2c8ca4075b..5f777502d4 100644
--- a/profiler/lib.profiler/src/org/netbeans/lib/profiler/heap/DominatorTree.java
+++ b/profiler/lib.profiler/src/org/netbeans/lib/profiler/heap/DominatorTree.java
@@ -315,7 +315,7 @@ class DominatorTree {
// debugging
private void printObjs(List<Long> changedIds, List<Long> oldDomIds, List<Long> newDomIds, List<Boolean> addedByDirtySet, List<Long> changedIdx) {
if (changedIds.size()>20) return;
- TreeMap<Integer,String> m = new TreeMap();
+ TreeMap<Integer,String> m = new TreeMap<>();
for (int i=0; i<changedIds.size(); i++) {
Long iid = changedIds.get(i);
diff --git a/profiler/lib.profiler/src/org/netbeans/lib/profiler/instrumentation/Instrumentor.java b/profiler/lib.profiler/src/org/netbeans/lib/profiler/instrumentation/Instrumentor.java
index 088f8e1a5e..78db76a5d3 100644
--- a/profiler/lib.profiler/src/org/netbeans/lib/profiler/instrumentation/Instrumentor.java
+++ b/profiler/lib.profiler/src/org/netbeans/lib/profiler/instrumentation/Instrumentor.java
@@ -144,7 +144,7 @@ public class Instrumentor implements CommonConstants {
RuntimeProfilingPoint[] pps = settings.getRuntimeProfilingPoints();
if ((rootClassNames == null) && (pps.length > 0)) {
- rootClassNames = new ArrayList();
+ rootClassNames = new ArrayList<>();
}
for (int i = 0; i < pps.length; i++) {
diff --git a/profiler/lib.profiler/src/org/netbeans/lib/profiler/results/cpu/CPUResultsDiff.java b/profiler/lib.profiler/src/org/netbeans/lib/profiler/results/cpu/CPUResultsDiff.java
index a190c1d35e..7e28679b0f 100644
--- a/profiler/lib.profiler/src/org/netbeans/lib/profiler/results/cpu/CPUResultsDiff.java
+++ b/profiler/lib.profiler/src/org/netbeans/lib/profiler/results/cpu/CPUResultsDiff.java
@@ -93,7 +93,7 @@ public class CPUResultsDiff extends CPUResultsSnapshot {
}
public Map<Integer, ClientUtils.SourceCodeSelection> getMethodIDMap(int view) {
- Map<Integer, ClientUtils.SourceCodeSelection> map = new HashMap();
+ Map<Integer, ClientUtils.SourceCodeSelection> map = new HashMap<>();
for (int i = 0; i < snapshot1.instrMethodClassesViews[view].length; i++)
map.put(i, snapshot1.getSourceCodeSelection(i, view));
for (int i = 0; i < snapshot2.instrMethodClassesViews[view].length; i++)
@@ -139,9 +139,9 @@ public class CPUResultsDiff extends CPUResultsSnapshot {
private Collection<Integer> threads2(Collection<Integer> threads1) {
if (threads1 == null || threads1.isEmpty()) return threads1;
- Set<String> threads1Names = new HashSet();
+ Set<String> threads1Names = new HashSet<>();
for (int thread1Id : threads1) threads1Names.add(getThreadNameForId(thread1Id));
- Set<Integer> threads2 = new HashSet();
+ Set<Integer> threads2 = new HashSet<>();
for (int thread2Id : snapshot2.getThreadIds())
if (threads1Names.contains(snapshot2.getThreadNameForId(thread2Id)))
threads2.add(thread2Id);
diff --git a/profiler/lib.profiler/src/org/netbeans/lib/profiler/results/cpu/CPUResultsSnapshot.java b/profiler/lib.profiler/src/org/netbeans/lib/profiler/results/cpu/CPUResultsSnapshot.java
index 73dd3ea9ab..3c0b0342c4 100644
--- a/profiler/lib.profiler/src/org/netbeans/lib/profiler/results/cpu/CPUResultsSnapshot.java
+++ b/profiler/lib.profiler/src/org/netbeans/lib/profiler/results/cpu/CPUResultsSnapshot.java
@@ -143,7 +143,7 @@ public class CPUResultsSnapshot extends ResultsSnapshot {
// Number of instrumented methods - may be smaller than the size of the above arrays
protected int nInstrMethods;
- private final Map<CCTNode, FilterSortSupport.Configuration> sortInfos = new WeakHashMap();
+ private final Map<CCTNode, FilterSortSupport.Configuration> sortInfos = new WeakHashMap<>();
//~ Constructors -------------------------------------------------------------------------------------------------------------
@@ -249,7 +249,7 @@ public class CPUResultsSnapshot extends ResultsSnapshot {
}
public Map<Integer, ClientUtils.SourceCodeSelection> getMethodIDMap(int view) {
- Map<Integer, ClientUtils.SourceCodeSelection> map = new HashMap();
+ Map<Integer, ClientUtils.SourceCodeSelection> map = new HashMap<>();
for (int i = 0; i < instrMethodClassesViews[view].length; i++)
map.put(i, getSourceCodeSelection(i, view));
return map;
@@ -317,7 +317,7 @@ public class CPUResultsSnapshot extends ResultsSnapshot {
}
private PrestimeCPUCCTNode[] mergedChildren(PrestimeCPUCCTNode[] nodes) {
- List<PrestimeCPUCCTNode> merged = new ArrayList();
+ List<PrestimeCPUCCTNode> merged = new ArrayList<>();
for (PrestimeCPUCCTNode node : nodes) {
CCTNode[] children = node.getChildren();
@@ -333,7 +333,7 @@ public class CPUResultsSnapshot extends ResultsSnapshot {
public PrestimeCPUCCTNode getReverseRootNode(final int view, Collection<Integer> threads, boolean merge) {
int[] threadIds = getThreadIds();
- List<PrestimeCPUCCTNode> nodes = new ArrayList();
+ List<PrestimeCPUCCTNode> nodes = new ArrayList<>();
for (int i = 0; i < threadIds.length; i++) {
final int threadIdF = threadIds[i];
if (threads == null || threads.contains(threadIdF)) {
diff --git a/profiler/lib.profiler/src/org/netbeans/lib/profiler/results/cpu/CPUSamplingDataFrameProcessor.java b/profiler/lib.profiler/src/org/netbeans/lib/profiler/results/cpu/CPUSamplingDataFrameProcessor.java
index bc732c7649..2b5b592a86 100644
--- a/profiler/lib.profiler/src/org/netbeans/lib/profiler/results/cpu/CPUSamplingDataFrameProcessor.java
+++ b/profiler/lib.profiler/src/org/netbeans/lib/profiler/results/cpu/CPUSamplingDataFrameProcessor.java
@@ -51,7 +51,7 @@ public class CPUSamplingDataFrameProcessor extends AbstractLockDataFrameProcesso
private long currentTimestamp;
private Map<Integer,ThreadInfo> currentThreadsDump;
private Map<Integer,ThreadInfo> lastThreadsDump;
- private List<ThreadDump> threadDumps = new ArrayList();
+ private List<ThreadDump> threadDumps = new ArrayList<>();
private MethodNameFormatter formatter = MethodNameFormatterFactory.getDefault(new DefaultMethodNameFormatter(DefaultMethodNameFormatter.VERBOSITY_FULLMETHOD)).getFormatter();
private StackTraceSnapshotBuilder builder;
@@ -60,13 +60,13 @@ public class CPUSamplingDataFrameProcessor extends AbstractLockDataFrameProcesso
public void doProcessDataFrame(ByteBuffer buffer) {
JMethodIdTable methodIdsTable = JMethodIdTable.getDefault();
- threadDumps = new ArrayList();
+ threadDumps = new ArrayList<>();
while (buffer.hasRemaining()) {
byte eventType = buffer.get();
switch (eventType) {
case CommonConstants.THREAD_DUMP_START:
- currentThreadsDump = new HashMap();
+ currentThreadsDump = new HashMap<>();
currentTimestamp = getTimeStamp(buffer);
if (LOGGER.isLoggable(Level.FINEST)) {
LOGGER.finest("Thread dump start: Timestamps:"+currentTimestamp); // NOI18N
@@ -248,7 +248,7 @@ public class CPUSamplingDataFrameProcessor extends AbstractLockDataFrameProcesso
}
private void processCollectedDumps(JMethodIdTable methodIdTable, List<ThreadDump> threadDumps) {
- Map<Integer,StackTraceElement> stackTraceElements = new HashMap();
+ Map<Integer,StackTraceElement> stackTraceElements = new HashMap<>();
InstrumentationFilter filter = builder.getFilter();
for (ThreadDump td : threadDumps) {
diff --git a/profiler/lib.profiler/src/org/netbeans/lib/profiler/results/cpu/DiffCPUCCTNode.java b/profiler/lib.profiler/src/org/netbeans/lib/profiler/results/cpu/DiffCPUCCTNode.java
index 39082ee2ac..1fe93b1321 100644
--- a/profiler/lib.profiler/src/org/netbeans/lib/profiler/results/cpu/DiffCPUCCTNode.java
+++ b/profiler/lib.profiler/src/org/netbeans/lib/profiler/results/cpu/DiffCPUCCTNode.java
@@ -89,7 +89,7 @@ class DiffCPUCCTNode extends PrestimeCPUCCTNodeBacked {
}
private static PrestimeCPUCCTNode[] computeChildren(PrestimeCPUCCTNode[] children1, PrestimeCPUCCTNode[] children2, PrestimeCPUCCTNode parent) {
- Map<String, PrestimeCPUCCTNode> nodes1 = new HashMap();
+ Map<String, PrestimeCPUCCTNode> nodes1 = new HashMap<>();
for (PrestimeCPUCCTNode node : children1) {
String name = node.getNodeName();
PrestimeCPUCCTNode sameNode = nodes1.get(name);
@@ -97,7 +97,7 @@ class DiffCPUCCTNode extends PrestimeCPUCCTNodeBacked {
else sameNode.merge(node); // Merge same-named items
}
- Map<String, PrestimeCPUCCTNode> nodes2 = new HashMap();
+ Map<String, PrestimeCPUCCTNode> nodes2 = new HashMap<>();
for (PrestimeCPUCCTNode node : children2) {
String name = node.getNodeName();
PrestimeCPUCCTNode sameNode = nodes2.get(name);
@@ -105,7 +105,7 @@ class DiffCPUCCTNode extends PrestimeCPUCCTNodeBacked {
else sameNode.merge(node); // Merge same-named items
}
- List<PrestimeCPUCCTNode> children = new ArrayList();
+ List<PrestimeCPUCCTNode> children = new ArrayList<>();
for (PrestimeCPUCCTNode node1 : nodes1.values()) {
PrestimeCPUCCTNode node2 = nodes2.get(node1.getNodeName());
if (node2 != null) children.add(new DiffCPUCCTNode(node1, node2));
diff --git a/profiler/lib.profiler/src/org/netbeans/lib/profiler/results/cpu/DiffFlatProfileContainer.java b/profiler/lib.profiler/src/org/netbeans/lib/profiler/results/cpu/DiffFlatProfileContainer.java
index d4ce8f8c6f..cd078f0d37 100644
--- a/profiler/lib.profiler/src/org/netbeans/lib/profiler/results/cpu/DiffFlatProfileContainer.java
+++ b/profiler/lib.profiler/src/org/netbeans/lib/profiler/results/cpu/DiffFlatProfileContainer.java
@@ -38,11 +38,11 @@ public class DiffFlatProfileContainer extends FlatProfileContainer {
static DiffFlatProfileContainer create(FlatProfileContainer c1, FlatProfileContainer c2) {
boolean collectingTwoTimeStamps = c1.collectingTwoTimeStamps && c2.collectingTwoTimeStamps;
- Set<ClientUtils.SourceCodeSelection> sels1 = new HashSet();
+ Set<ClientUtils.SourceCodeSelection> sels1 = new HashSet<>();
int rows1 = c1.timeInMcs0.length;
for (int i = 0; i < rows1; i++) sels1.add(c1.getSourceCodeSelectionAtRow(i));
- Map<ClientUtils.SourceCodeSelection, Integer> sels2 = new HashMap();
+ Map<ClientUtils.SourceCodeSelection, Integer> sels2 = new HashMap<>();
int rows2 = c2.timeInMcs0.length;
for (int i = 0; i < rows2; i++) sels2.put(c2.getSourceCodeSelectionAtRow(i), i);
diff --git a/profiler/lib.profiler/src/org/netbeans/lib/profiler/results/cpu/PrestimeCPUCCTNode.java b/profiler/lib.profiler/src/org/netbeans/lib/profiler/results/cpu/PrestimeCPUCCTNode.java
index e38017dcaf..ed6885bad3 100644
--- a/profiler/lib.profiler/src/org/netbeans/lib/profiler/results/cpu/PrestimeCPUCCTNode.java
+++ b/profiler/lib.profiler/src/org/netbeans/lib/profiler/results/cpu/PrestimeCPUCCTNode.java
@@ -172,7 +172,7 @@ public abstract class PrestimeCPUCCTNode extends CCTNode implements Cloneable {
addTotalTime1(_node.getTotalTime1());
addWaitTime0(_node.getWaitTime0());
- List<CCTNode> ch = new ArrayList();
+ List<CCTNode> ch = new ArrayList<>();
// Include current children
PrestimeCPUCCTNode[] _children = (PrestimeCPUCCTNode[])getChildren();
@@ -194,7 +194,7 @@ public abstract class PrestimeCPUCCTNode extends CCTNode implements Cloneable {
}
protected static Collection<PrestimeCPUCCTNode> resolveChildren(PrestimeCPUCCTNode node) {
- List<PrestimeCPUCCTNode> chldrn = new ArrayList();
+ List<PrestimeCPUCCTNode> chldrn = new ArrayList<>();
PrestimeCPUCCTNode[] chld = (PrestimeCPUCCTNode[])node.getChildren();
if (chld != null) for (PrestimeCPUCCTNode chl : chld)
if (!chl.isSelfTimeNode()) chldrn.add(chl);
diff --git a/profiler/lib.profiler/src/org/netbeans/lib/profiler/results/cpu/PrestimeCPUCCTNodeBacked.java b/profiler/lib.profiler/src/org/netbeans/lib/profiler/results/cpu/PrestimeCPUCCTNodeBacked.java
index 7e02196861..0475b48498 100644
--- a/profiler/lib.profiler/src/org/netbeans/lib/profiler/results/cpu/PrestimeCPUCCTNodeBacked.java
+++ b/profiler/lib.profiler/src/org/netbeans/lib/profiler/results/cpu/PrestimeCPUCCTNodeBacked.java
@@ -163,7 +163,7 @@ public class PrestimeCPUCCTNodeBacked extends PrestimeCPUCCTNode {
return children;
}
- List<PrestimeCPUCCTNodeBacked> childrenL = new ArrayList();
+ List<PrestimeCPUCCTNodeBacked> childrenL = new ArrayList<>();
// PrestimeCPUCCTNodeBacked filtered = null;
// FilterSortSupport.Configuration config = container.getCPUResSnapshot().getFilterSortInfo(this);
diff --git a/profiler/lib.profiler/src/org/netbeans/lib/profiler/results/cpu/StackTraceSnapshotBuilder.java b/profiler/lib.profiler/src/org/netbeans/lib/profiler/results/cpu/StackTraceSnapshotBuilder.java
index 84409a160d..5c4c95e6ea 100644
--- a/profiler/lib.profiler/src/org/netbeans/lib/profiler/results/cpu/StackTraceSnapshotBuilder.java
+++ b/profiler/lib.profiler/src/org/netbeans/lib/profiler/results/cpu/StackTraceSnapshotBuilder.java
@@ -270,7 +270,7 @@ public class StackTraceSnapshotBuilder {
int stackTraceCount = 0;
// int builderBatchSize;
final Set<String> ignoredThreadNames = new HashSet<String>();
- final Map<Long,Long> threadtimes = new HashMap();
+ final Map<Long,Long> threadtimes = new HashMap<>();
{
registerNewMethodInfo(new MethodInfo("Thread","")); // NOI18N
@@ -308,7 +308,7 @@ public class StackTraceSnapshotBuilder {
if (timediff < 0) return;
synchronized (lock) {
- Map<Long,SampledThreadInfo> tinfoMap = new HashMap();
+ Map<Long,SampledThreadInfo> tinfoMap = new HashMap<>();
for (SampledThreadInfo tinfo : threads) {
tinfoMap.put(tinfo.getThreadId(),tinfo);
@@ -325,7 +325,7 @@ public class StackTraceSnapshotBuilder {
if (timediff < 0) return;
synchronized (lock) {
- Map<Long,SampledThreadInfo> tinfoMap = new HashMap();
+ Map<Long,SampledThreadInfo> tinfoMap = new HashMap<>();
// if (stackTraceCount%builderBatchSize == 0) {
// ccgb.doBatchStart();
diff --git a/profiler/lib.profiler/src/org/netbeans/lib/profiler/results/jdbc/JdbcGraphBuilder.java b/profiler/lib.profiler/src/org/netbeans/lib/profiler/results/jdbc/JdbcGraphBuilder.java
index 0cc6404354..83641ab6fb 100644
--- a/profiler/lib.profiler/src/org/netbeans/lib/profiler/results/jdbc/JdbcGraphBuilder.java
+++ b/profiler/lib.profiler/src/org/netbeans/lib/profiler/results/jdbc/JdbcGraphBuilder.java
@@ -183,10 +183,10 @@ public class JdbcGraphBuilder extends BaseCallGraphBuilder implements CPUProfili
protected void doStartup(ProfilerClient profilerClient) {
statements = new HashMap();
connections = new HashMap();
- selectsToId = new HashMap();
- idsToSelect = new HashMap();
- currentObject = new HashMap();
- currentSqlLevel = new HashMap();
+ selectsToId = new HashMap<>();
+ idsToSelect = new HashMap<>();
+ currentObject = new HashMap<>();
+ currentSqlLevel = new HashMap<>();
threadInfos.reset();
stacksForSelects = null;
lastSelectId = 0;
diff --git a/profiler/lib.profiler/src/org/netbeans/lib/profiler/results/jdbc/JdbcResultsDiff.java b/profiler/lib.profiler/src/org/netbeans/lib/profiler/results/jdbc/JdbcResultsDiff.java
index 7a0139d4ac..afb4e8a3c8 100644
--- a/profiler/lib.profiler/src/org/netbeans/lib/profiler/results/jdbc/JdbcResultsDiff.java
+++ b/profiler/lib.profiler/src/org/netbeans/lib/profiler/results/jdbc/JdbcResultsDiff.java
@@ -129,13 +129,13 @@ public class JdbcResultsDiff extends JdbcResultsSnapshot {
int s2nSelects = snapshot2.getNProfiledSelects();
// temporary cache for creating diff
- HashMap<String, Integer> selectsNamesIdxMap = new HashMap(s1nSelects);
- ArrayList<String> selectsArr = new ArrayList(s1nSelects);
- ArrayList<Long> invocationsArr = new ArrayList(s1nSelects);
- ArrayList<Long> timesArr = new ArrayList(s1nSelects);
- ArrayList<Integer> commandsArr = new ArrayList(s1nSelects);
- ArrayList<String[]> tablesArr = new ArrayList(s1nSelects);
- ArrayList<Integer> typesArr = new ArrayList(s1nSelects);
+ HashMap<String, Integer> selectsNamesIdxMap = new HashMap<>(s1nSelects);
+ ArrayList<String> selectsArr = new ArrayList<>(s1nSelects);
+ ArrayList<Long> invocationsArr = new ArrayList<>(s1nSelects);
+ ArrayList<Long> timesArr = new ArrayList<>(s1nSelects);
+ ArrayList<Integer> commandsArr = new ArrayList<>(s1nSelects);
+ ArrayList<String[]> tablesArr = new ArrayList<>(s1nSelects);
+ ArrayList<Integer> typesArr = new ArrayList<>(s1nSelects);
// fill the cache with negative values from snapshot1
String[] s1SelectNames = snapshot1.getSelectNames();
diff --git a/profiler/lib.profiler/src/org/netbeans/lib/profiler/results/jdbc/JdbcResultsSnapshot.java b/profiler/lib.profiler/src/org/netbeans/lib/profiler/results/jdbc/JdbcResultsSnapshot.java
index ff5fea87bf..f6cf76678d 100644
--- a/profiler/lib.profiler/src/org/netbeans/lib/profiler/results/jdbc/JdbcResultsSnapshot.java
+++ b/profiler/lib.profiler/src/org/netbeans/lib/profiler/results/jdbc/JdbcResultsSnapshot.java
@@ -180,7 +180,7 @@ public class JdbcResultsSnapshot extends ResultsSnapshot {
private void filter(String filter, int filterType, PresoObjAllocCCTNode node) {
if (node.children != null) {
PresoObjAllocCCTNode filtered = null;
- List<PresoObjAllocCCTNode> ch = new ArrayList();
+ List<PresoObjAllocCCTNode> ch = new ArrayList<>();
for (PresoObjAllocCCTNode n : node.children) {
PresoObjAllocCCTNode nn = (PresoObjAllocCCTNode)n;
if (FilterSortSupport.passesFilter(filter, filterType, nn.getNodeName())) {
diff --git a/profiler/lib.profiler/src/org/netbeans/lib/profiler/results/jdbc/SQLParser.java b/profiler/lib.profiler/src/org/netbeans/lib/profiler/results/jdbc/SQLParser.java
index bfc2b40ed7..c747decb6a 100644
--- a/profiler/lib.profiler/src/org/netbeans/lib/profiler/results/jdbc/SQLParser.java
+++ b/profiler/lib.profiler/src/org/netbeans/lib/profiler/results/jdbc/SQLParser.java
@@ -91,7 +91,7 @@ class SQLParser {
if (fromClause != null) {
String[] tablesRefs = fromClause.trim().split(",");
- Set<String> tables = new HashSet(tablesRefs.length);
+ Set<String> tables = new HashSet<>(tablesRefs.length);
for (int i = 0; i < tablesRefs.length; i++) {
Matcher m = wordPattern.matcher(tablesRefs[i]);
diff --git a/profiler/lib.profiler/src/org/netbeans/lib/profiler/results/locks/LockCCTNode.java b/profiler/lib.profiler/src/org/netbeans/lib/profiler/results/locks/LockCCTNode.java
index a4f30f7aa2..7e1006f9a5 100644
--- a/profiler/lib.profiler/src/org/netbeans/lib/profiler/results/locks/LockCCTNode.java
+++ b/profiler/lib.profiler/src/org/netbeans/lib/profiler/results/locks/LockCCTNode.java
@@ -95,13 +95,13 @@ public abstract class LockCCTNode extends CCTNode {
void addChild(LockCCTNode child) {
if (children == null) {
- children = new ArrayList();
+ children = new ArrayList<>();
}
children.add(child);
}
void computeChildren() {
- children = new ArrayList();
+ children = new ArrayList<>();
}
private void computeChildrenImpl() {
diff --git a/profiler/lib.profiler/src/org/netbeans/lib/profiler/results/locks/LockGraphBuilder.java b/profiler/lib.profiler/src/org/netbeans/lib/profiler/results/locks/LockGraphBuilder.java
index 99ceba9d12..5c28d699ca 100644
--- a/profiler/lib.profiler/src/org/netbeans/lib/profiler/results/locks/LockGraphBuilder.java
+++ b/profiler/lib.profiler/src/org/netbeans/lib/profiler/results/locks/LockGraphBuilder.java
@@ -39,17 +39,17 @@ public class LockGraphBuilder extends BaseCallGraphBuilder implements LockProfil
static final Logger LOG = Logger.getLogger(LockGraphBuilder.class.getName());
private final ThreadInfos threadInfos = new ThreadInfos();
- private Map<Integer, MonitorInfo> monitorInfos = new HashMap();
+ private Map<Integer, MonitorInfo> monitorInfos = new HashMap<>();
private final TransactionalSupport transaction = new TransactionalSupport();
@Override
protected RuntimeCCTNode getAppRootNode() {
- Map<ThreadInfo, List<List<ThreadInfo.MonitorDetail>>> threadsCopy = new HashMap(threadInfos.threadInfos.length);
- Map<MonitorInfo, List<List<MonitorInfo.ThreadDetail>>> monitorsCopy = new HashMap(monitorInfos.size());
+ Map<ThreadInfo, List<List<ThreadInfo.MonitorDetail>>> threadsCopy = new HashMap<>(threadInfos.threadInfos.length);
+ Map<MonitorInfo, List<List<MonitorInfo.ThreadDetail>>> monitorsCopy = new HashMap<>(monitorInfos.size());
for (ThreadInfo ti : threadInfos.threadInfos) {
if (ti != null) {
- List<List<ThreadInfo.MonitorDetail>> monitors = new ArrayList(2);
+ List<List<ThreadInfo.MonitorDetail>> monitors = new ArrayList<>(2);
if (!ti.isEmpty()) {
monitors.add(ti.cloneWaitMonitorDetails());
@@ -59,7 +59,7 @@ public class LockGraphBuilder extends BaseCallGraphBuilder implements LockProfil
}
}
for (MonitorInfo mi : monitorInfos.values()) {
- List<List<MonitorInfo.ThreadDetail>> threads = new ArrayList(2);
+ List<List<MonitorInfo.ThreadDetail>> threads = new ArrayList<>(2);
threads.add(mi.cloneWaitThreadDetails());
threads.add(mi.cloneOwnerThreadDetails());
@@ -89,7 +89,7 @@ public class LockGraphBuilder extends BaseCallGraphBuilder implements LockProfil
try {
threadInfos.reset();
- monitorInfos = new HashMap();
+ monitorInfos = new HashMap<>();
} finally {
transaction.endTrans();
}
@@ -99,7 +99,7 @@ public class LockGraphBuilder extends BaseCallGraphBuilder implements LockProfil
@Override
protected void doShutdown() {
threadInfos.reset();
- monitorInfos = new HashMap();
+ monitorInfos = new HashMap<>();
}
@Override
diff --git a/profiler/lib.profiler/src/org/netbeans/lib/profiler/results/locks/MonitorInfo.java b/profiler/lib.profiler/src/org/netbeans/lib/profiler/results/locks/MonitorInfo.java
index ab55f698e5..9b5733cf06 100644
--- a/profiler/lib.profiler/src/org/netbeans/lib/profiler/results/locks/MonitorInfo.java
+++ b/profiler/lib.profiler/src/org/netbeans/lib/profiler/results/locks/MonitorInfo.java
@@ -38,9 +38,9 @@ class MonitorInfo {
MonitorInfo(int id) {
monitorId = id;
- waitThreads = new HashMap();
- ownerThreads = new HashMap();
- openThreads = new HashMap();
+ waitThreads = new HashMap<>();
+ ownerThreads = new HashMap<>();
+ openThreads = new HashMap<>();
className = "*unknown*"; // NOI18N
}
@@ -145,14 +145,14 @@ class MonitorInfo {
ThreadDetail(ThreadInfo ti) {
threadInfo = ti;
- threads = new HashMap();
+ threads = new HashMap<>();
}
ThreadDetail(ThreadDetail d) {
threadInfo = d.threadInfo;
count = d.count;
waitTime = d.waitTime;
- threads = new HashMap();
+ threads = new HashMap<>();
for (ThreadDetail td : d.threads.values()) {
threads.put(td.threadInfo, new ThreadDetail(td));
}
diff --git a/profiler/lib.profiler/src/org/netbeans/lib/profiler/results/locks/ThreadInfo.java b/profiler/lib.profiler/src/org/netbeans/lib/profiler/results/locks/ThreadInfo.java
index acc49d8bea..9dda63e655 100644
--- a/profiler/lib.profiler/src/org/netbeans/lib/profiler/results/locks/ThreadInfo.java
+++ b/profiler/lib.profiler/src/org/netbeans/lib/profiler/results/locks/ThreadInfo.java
@@ -41,8 +41,8 @@ class ThreadInfo {
threadId = id;
threadName = name;
threadClassName = className;
- waitMonitors = new HashMap();
- ownerMonitors = new HashMap();
+ waitMonitors = new HashMap<>();
+ ownerMonitors = new HashMap<>();
}
void openMonitor(ThreadInfo owner, MonitorInfo mi, long timeStamp) {
@@ -147,14 +147,14 @@ class ThreadInfo {
private MonitorDetail(MonitorInfo mi) {
monitor = mi;
- threads = new HashMap();
+ threads = new HashMap<>();
}
MonitorDetail(MonitorDetail m) {
monitor = m.monitor;
count = m.count;
waitTime = m.waitTime;
- threads = new HashMap();
+ threads = new HashMap<>();
for (MonitorInfo.ThreadDetail td : m.threads.values()) {
threads.put(td.threadInfo, td);
}
diff --git a/profiler/lib.profiler/src/org/netbeans/lib/profiler/results/memory/AllocMemoryResultsDiff.java b/profiler/lib.profiler/src/org/netbeans/lib/profiler/results/memory/AllocMemoryResultsDiff.java
index 38c353511e..5a7b23045b 100644
--- a/profiler/lib.profiler/src/org/netbeans/lib/profiler/results/memory/AllocMemoryResultsDiff.java
+++ b/profiler/lib.profiler/src/org/netbeans/lib/profiler/results/memory/AllocMemoryResultsDiff.java
@@ -155,9 +155,9 @@ public class AllocMemoryResultsDiff extends AllocMemoryResultsSnapshot {
s2nClasses = Math.min(s2nClasses, snapshot2.getObjectsSizePerClass().length);
// temporary cache for creating diff
- HashMap<String, Integer> classNamesIdxMap = new HashMap(s1nClasses);
- ArrayList<Integer> objCountsArr = new ArrayList(s1nClasses);
- ArrayList<Long> objSizesArr = new ArrayList(s1nClasses);
+ HashMap<String, Integer> classNamesIdxMap = new HashMap<>(s1nClasses);
+ ArrayList<Integer> objCountsArr = new ArrayList<>(s1nClasses);
+ ArrayList<Long> objSizesArr = new ArrayList<>(s1nClasses);
// fill the cache with negative values from snapshot1
String[] s1ClassNames = snapshot1.getClassNames();
diff --git a/profiler/lib.profiler/src/org/netbeans/lib/profiler/results/memory/DiffObjAllocCCTNode.java b/profiler/lib.profiler/src/org/netbeans/lib/profiler/results/memory/DiffObjAllocCCTNode.java
index 595c8d69d3..13f8b84953 100644
--- a/profiler/lib.profiler/src/org/netbeans/lib/profiler/results/memory/DiffObjAllocCCTNode.java
+++ b/profiler/lib.profiler/src/org/netbeans/lib/profiler/results/memory/DiffObjAllocCCTNode.java
@@ -106,7 +106,7 @@ public class DiffObjAllocCCTNode extends PresoObjAllocCCTNode {
}
private static PresoObjAllocCCTNode[] computeChildren(PresoObjAllocCCTNode[] children1, PresoObjAllocCCTNode[] children2, PresoObjAllocCCTNode parent) {
- Map<Handle, PresoObjAllocCCTNode> nodes1 = new HashMap();
+ Map<Handle, PresoObjAllocCCTNode> nodes1 = new HashMap<>();
for (PresoObjAllocCCTNode node : children1) {
Handle name = new Handle(node);
PresoObjAllocCCTNode sameNode = nodes1.get(name);
@@ -114,7 +114,7 @@ public class DiffObjAllocCCTNode extends PresoObjAllocCCTNode {
else sameNode.merge(node);
}
- Map<Handle, PresoObjAllocCCTNode> nodes2 = new HashMap();
+ Map<Handle, PresoObjAllocCCTNode> nodes2 = new HashMap<>();
for (PresoObjAllocCCTNode node : children2) {
Handle name = new Handle(node);
PresoObjAllocCCTNode sameNode = nodes2.get(name);
@@ -122,7 +122,7 @@ public class DiffObjAllocCCTNode extends PresoObjAllocCCTNode {
else sameNode.merge(node); // Merge same-named items
}
- List<PresoObjAllocCCTNode> children = new ArrayList();
+ List<PresoObjAllocCCTNode> children = new ArrayList<>();
for (PresoObjAllocCCTNode node1 : nodes1.values()) {
PresoObjAllocCCTNode node2 = nodes2.get(new Handle(node1));
if (node2 != null) children.add(new DiffObjAllocCCTNode(node1, node2));
diff --git a/profiler/lib.profiler/src/org/netbeans/lib/profiler/results/memory/DiffObjLivenessCCTNode.java b/profiler/lib.profiler/src/org/netbeans/lib/profiler/results/memory/DiffObjLivenessCCTNode.java
index 6c04df8f7d..fad5c094d3 100644
--- a/profiler/lib.profiler/src/org/netbeans/lib/profiler/results/memory/DiffObjLivenessCCTNode.java
+++ b/profiler/lib.profiler/src/org/netbeans/lib/profiler/results/memory/DiffObjLivenessCCTNode.java
@@ -118,7 +118,7 @@ class DiffObjLivenessCCTNode extends PresoObjLivenessCCTNode {
}
private static PresoObjAllocCCTNode[] computeChildren(PresoObjAllocCCTNode[] children1, PresoObjAllocCCTNode[] children2, PresoObjLivenessCCTNode parent) {
- Map<Handle, PresoObjAllocCCTNode> nodes1 = new HashMap();
+ Map<Handle, PresoObjAllocCCTNode> nodes1 = new HashMap<>();
for (PresoObjAllocCCTNode node : children1) {
Handle name = new Handle(node);
PresoObjAllocCCTNode sameNode = nodes1.get(name);
@@ -126,7 +126,7 @@ class DiffObjLivenessCCTNode extends PresoObjLivenessCCTNode {
else sameNode.merge(node);
}
- Map<Handle, PresoObjAllocCCTNode> nodes2 = new HashMap();
+ Map<Handle, PresoObjAllocCCTNode> nodes2 = new HashMap<>();
for (PresoObjAllocCCTNode node : children2) {
Handle name = new Handle(node);
PresoObjAllocCCTNode sameNode = nodes2.get(name);
@@ -134,7 +134,7 @@ class DiffObjLivenessCCTNode extends PresoObjLivenessCCTNode {
else sameNode.merge(node); // Merge same-named items
}
- List<PresoObjAllocCCTNode> children = new ArrayList();
+ List<PresoObjAllocCCTNode> children = new ArrayList<>();
for (PresoObjAllocCCTNode node1 : nodes1.values()) {
PresoObjAllocCCTNode node2 = nodes2.get(new Handle(node1));
if (node2 != null) children.add(new DiffObjLivenessCCTNode((PresoObjLivenessCCTNode)node1, (PresoObjLivenessCCTNode)node2));
diff --git a/profiler/lib.profiler/src/org/netbeans/lib/profiler/results/memory/HeapHistogramManager.java b/profiler/lib.profiler/src/org/netbeans/lib/profiler/results/memory/HeapHistogramManager.java
index 11803877df..065d338354 100644
--- a/profiler/lib.profiler/src/org/netbeans/lib/profiler/results/memory/HeapHistogramManager.java
+++ b/profiler/lib.profiler/src/org/netbeans/lib/profiler/results/memory/HeapHistogramManager.java
@@ -34,7 +34,7 @@ import org.netbeans.lib.profiler.wireprotocol.HeapHistogramResponse;
*/
public class HeapHistogramManager {
- private Map<Integer, String> classesIdMap = new HashMap(8000);
+ private Map<Integer, String> classesIdMap = new HashMap<>(8000);
private final ProfilerEngineSettings settings;
public HeapHistogramManager(ProfilerEngineSettings settings) {
@@ -76,8 +76,8 @@ public class HeapHistogramManager {
HeapHistogramImpl(Date t) {
time = t;
- heap = new HashSet(4096);
- perm = new HashSet();
+ heap = new HashSet<>(4096);
+ perm = new HashSet<>();
}
void addClassInfo(ClassInfo ci, boolean permInfo) {
diff --git a/profiler/lib.profiler/src/org/netbeans/lib/profiler/results/memory/LivenessMemoryResultsDiff.java b/profiler/lib.profiler/src/org/netbeans/lib/profiler/results/memory/LivenessMemoryResultsDiff.java
index a3fa25e10a..616d8e82d6 100644
--- a/profiler/lib.profiler/src/org/netbeans/lib/profiler/results/memory/LivenessMemoryResultsDiff.java
+++ b/profiler/lib.profiler/src/org/netbeans/lib/profiler/results/memory/LivenessMemoryResultsDiff.java
@@ -205,14 +205,14 @@ public class LivenessMemoryResultsDiff extends LivenessMemoryResultsSnapshot {
int s2nClasses = snapshot2.getNTrackedItems();
// temporary cache for creating diff
- HashMap<String, Integer> classNamesIdxMap = new HashMap(s1nClasses);
- ArrayList<Long> nTrackedAllocObjectsArr = new ArrayList(s1nClasses);
- ArrayList<Long> objectsSizePerClassArr = new ArrayList(s1nClasses);
- ArrayList<Integer> nTrackedLiveObjectsArr = new ArrayList(s1nClasses);
- ArrayList<Integer> maxSurvGenArr = new ArrayList(s1nClasses);
- ArrayList<Float> avgObjectAgeArr = new ArrayList(s1nClasses);
- ArrayList<Long> trackedLiveObjectsSizeArr = new ArrayList(s1nClasses);
- ArrayList<Integer> nTotalAllocObjectsArr = new ArrayList(s1nClasses);
+ HashMap<String, Integer> classNamesIdxMap = new HashMap<>(s1nClasses);
+ ArrayList<Long> nTrackedAllocObjectsArr = new ArrayList<>(s1nClasses);
+ ArrayList<Long> objectsSizePerClassArr = new ArrayList<>(s1nClasses);
+ ArrayList<Integer> nTrackedLiveObjectsArr = new ArrayList<>(s1nClasses);
+ ArrayList<Integer> maxSurvGenArr = new ArrayList<>(s1nClasses);
+ ArrayList<Float> avgObjectAgeArr = new ArrayList<>(s1nClasses);
+ ArrayList<Long> trackedLiveObjectsSizeArr = new ArrayList<>(s1nClasses);
+ ArrayList<Integer> nTotalAllocObjectsArr = new ArrayList<>(s1nClasses);
// fill the cache with negative values from snapshot1
String[] s1ClassNames = snapshot1.getClassNames();
diff --git a/profiler/lib.profiler/src/org/netbeans/lib/profiler/results/memory/MemoryResultsSnapshot.java b/profiler/lib.profiler/src/org/netbeans/lib/profiler/results/memory/MemoryResultsSnapshot.java
index 39b4231489..9cf1b1ebba 100644
--- a/profiler/lib.profiler/src/org/netbeans/lib/profiler/results/memory/MemoryResultsSnapshot.java
+++ b/profiler/lib.profiler/src/org/netbeans/lib/profiler/results/memory/MemoryResultsSnapshot.java
@@ -153,7 +153,7 @@ public abstract class MemoryResultsSnapshot extends ResultsSnapshot {
private void filter(String filter, int filterType, PresoObjAllocCCTNode node) {
if (node.children != null) {
PresoObjAllocCCTNode filtered = null;
- List<PresoObjAllocCCTNode> ch = new ArrayList();
+ List<PresoObjAllocCCTNode> ch = new ArrayList<>();
for (PresoObjAllocCCTNode n : node.children) {
PresoObjAllocCCTNode nn = (PresoObjAllocCCTNode)n;
if (FilterSortSupport.passesFilter(filter, filterType, nn.getNodeName())) {
diff --git a/profiler/lib.profiler/src/org/netbeans/lib/profiler/results/memory/PresoObjAllocCCTNode.java b/profiler/lib.profiler/src/org/netbeans/lib/profiler/results/memory/PresoObjAllocCCTNode.java
index 4f069883a6..ee7de5a865 100644
--- a/profiler/lib.profiler/src/org/netbeans/lib/profiler/results/memory/PresoObjAllocCCTNode.java
+++ b/profiler/lib.profiler/src/org/netbeans/lib/profiler/results/memory/PresoObjAllocCCTNode.java
@@ -137,7 +137,7 @@ public class PresoObjAllocCCTNode extends CCTNode {
nCalls += _node.nCalls;
totalObjSize += _node.totalObjSize;
- List<CCTNode> ch = new ArrayList();
+ List<CCTNode> ch = new ArrayList<>();
// Include current children
if (children != null) ch.addAll(Arrays.asList(children));
diff --git a/profiler/lib.profiler/src/org/netbeans/lib/profiler/results/memory/SampledMemoryResultsDiff.java b/profiler/lib.profiler/src/org/netbeans/lib/profiler/results/memory/SampledMemoryResultsDiff.java
index 5f7e623efd..2c09f7ca81 100644
--- a/profiler/lib.profiler/src/org/netbeans/lib/profiler/results/memory/SampledMemoryResultsDiff.java
+++ b/profiler/lib.profiler/src/org/netbeans/lib/profiler/results/memory/SampledMemoryResultsDiff.java
@@ -119,9 +119,9 @@ public class SampledMemoryResultsDiff extends SampledMemoryResultsSnapshot {
s2nClasses = Math.min(s2nClasses, snapshot2.getObjectsSizePerClass().length);
// temporary cache for creating diff
- HashMap<String, Integer> classNamesIdxMap = new HashMap(s1nClasses);
- ArrayList<Integer> objCountsArr = new ArrayList(s1nClasses);
- ArrayList<Long> objSizesArr = new ArrayList(s1nClasses);
+ HashMap<String, Integer> classNamesIdxMap = new HashMap<>(s1nClasses);
+ ArrayList<Integer> objCountsArr = new ArrayList<>(s1nClasses);
+ ArrayList<Long> objSizesArr = new ArrayList<>(s1nClasses);
// fill the cache with negative values from snapshot1
String[] s1ClassNames = snapshot1.getClassNames();
diff --git a/profiler/lib.profiler/test/functional/src/org/netbeans/lib/profiler/tests/jfluid/perf/InstrumentationTest.java b/profiler/lib.profiler/test/functional/src/org/netbeans/lib/profiler/tests/jfluid/perf/InstrumentationTest.java
index 07dcab77d9..0344843cab 100644
--- a/profiler/lib.profiler/test/functional/src/org/netbeans/lib/profiler/tests/jfluid/perf/InstrumentationTest.java
+++ b/profiler/lib.profiler/test/functional/src/org/netbeans/lib/profiler/tests/jfluid/perf/InstrumentationTest.java
@@ -53,7 +53,7 @@ import java.util.jar.JarFile;
public class InstrumentationTest extends CommonProfilerTestCase implements NbPerformanceTest {
//~ Instance fields ----------------------------------------------------------------------------------------------------------
- ArrayList<NbPerformanceTest.PerformanceData> data = new ArrayList();
+ ArrayList<NbPerformanceTest.PerformanceData> data = new ArrayList<>();
ProfilerEngineSettings settings;
String[] classNames;
byte[][] classesBytes;
@@ -168,8 +168,8 @@ public class InstrumentationTest extends CommonProfilerTestCase implements NbPer
}
protected void setClasses(String jarPath) throws Exception {
- ArrayList<String> names = new ArrayList(16);
- ArrayList<byte[]> bytes = new ArrayList(16);
+ ArrayList<String> names = new ArrayList<>(16);
+ ArrayList<byte[]> bytes = new ArrayList<>(16);
JarFile file = new JarFile(jarPath);
Enumeration<JarEntry> entries = file.entries();
ByteArrayOutputStream bos = new ByteArrayOutputStream(1024);
@@ -202,7 +202,7 @@ public class InstrumentationTest extends CommonProfilerTestCase implements NbPer
protected void setRootMethods(String jarFile) throws Exception {
JarFile file = new JarFile(jarFile);
- HashSet<String> list = new HashSet(8);
+ HashSet<String> list = new HashSet<>(8);
for (Enumeration<JarEntry> entries = file.entries(); entries.hasMoreElements();) {
JarEntry entry = entries.nextElement();
diff --git a/profiler/lib.profiler/test/qa-functional/src/org/netbeans/lib/profiler/tests/jfluid/perf/InstrumentationTest.java b/profiler/lib.profiler/test/qa-functional/src/org/netbeans/lib/profiler/tests/jfluid/perf/InstrumentationTest.java
index 5eeba6ebd9..bf686c6f61 100644
--- a/profiler/lib.profiler/test/qa-functional/src/org/netbeans/lib/profiler/tests/jfluid/perf/InstrumentationTest.java
+++ b/profiler/lib.profiler/test/qa-functional/src/org/netbeans/lib/profiler/tests/jfluid/perf/InstrumentationTest.java
@@ -55,7 +55,7 @@ import org.netbeans.junit.NbModuleSuite;
public class InstrumentationTest extends CommonProfilerTestCase implements NbPerformanceTest {
//~ Instance fields ----------------------------------------------------------------------------------------------------------
- ArrayList<NbPerformanceTest.PerformanceData> data = new ArrayList();
+ ArrayList<NbPerformanceTest.PerformanceData> data = new ArrayList<>();
ProfilerEngineSettings settings;
String[] classNames;
byte[][] classesBytes;
@@ -179,8 +179,8 @@ public class InstrumentationTest extends CommonProfilerTestCase implements NbPer
}
protected void setClasses(String jarPath) throws Exception {
- ArrayList<String> names = new ArrayList(16);
- ArrayList<byte[]> bytes = new ArrayList(16);
+ ArrayList<String> names = new ArrayList<>(16);
+ ArrayList<byte[]> bytes = new ArrayList<>(16);
JarFile file = new JarFile(jarPath);
Enumeration<JarEntry> entries = file.entries();
ByteArrayOutputStream bos = new ByteArrayOutputStream(1024);
@@ -213,7 +213,7 @@ public class InstrumentationTest extends CommonProfilerTestCase implements NbPer
protected void setRootMethods(String jarFile) throws Exception {
JarFile file = new JarFile(jarFile);
- HashSet<String> list = new HashSet(8);
+ HashSet<String> list = new HashSet<>(8);
for (Enumeration<JarEntry> entries = file.entries(); entries.hasMoreElements();) {
JarEntry entry = entries.nextElement();
diff --git a/profiler/profiler.api/src/org/netbeans/modules/profiler/api/JavaPlatform.java b/profiler/profiler.api/src/org/netbeans/modules/profiler/api/JavaPlatform.java
index ebe38f8769..109c08677c 100644
--- a/profiler/profiler.api/src/org/netbeans/modules/profiler/api/JavaPlatform.java
+++ b/profiler/profiler.api/src/org/netbeans/modules/profiler/api/JavaPlatform.java
@@ -66,7 +66,7 @@ public final class JavaPlatform {
*/
public static List<JavaPlatform> getPlatforms() {
List<JavaPlatformProvider> platformProviders = provider().getPlatforms();
- List<JavaPlatform> platforms = new ArrayList(platformProviders.size());
+ List<JavaPlatform> platforms = new ArrayList<>(platformProviders.size());
for (JavaPlatformProvider p : platformProviders) {
if (p.getPlatformJavaFile() != null &&
diff --git a/profiler/profiler.api/src/org/netbeans/modules/profiler/api/ProfilerIDESettings.java b/profiler/profiler.api/src/org/netbeans/modules/profiler/api/ProfilerIDESettings.java
index 4f7d2bb03f..6b4fff05c5 100644
--- a/profiler/profiler.api/src/org/netbeans/modules/profiler/api/ProfilerIDESettings.java
+++ b/profiler/profiler.api/src/org/netbeans/modules/profiler/api/ProfilerIDESettings.java
@@ -573,7 +573,7 @@ public final class ProfilerIDESettings implements GlobalProfilingSettings {
return dnsaMap;
}
- dnsaMap = new HashMap();
+ dnsaMap = new HashMap<>();
String allPairs = getPreferences().get(DNSA_SETTINGS_KEY, null);
diff --git a/profiler/profiler.api/src/org/netbeans/modules/profiler/api/java/ExternalPackages.java b/profiler/profiler.api/src/org/netbeans/modules/profiler/api/java/ExternalPackages.java
index 3af9786d9f..ba9dfc15cd 100644
--- a/profiler/profiler.api/src/org/netbeans/modules/profiler/api/java/ExternalPackages.java
+++ b/profiler/profiler.api/src/org/netbeans/modules/profiler/api/java/ExternalPackages.java
@@ -52,7 +52,7 @@ public final class ExternalPackages {
@Override
public Collection<SourceClassInfo> getClasses() {
- Set<FileObject> clzs = new TreeSet(pathComparator);
+ Set<FileObject> clzs = new TreeSet<>(pathComparator);
Enumeration<? extends FileObject> e = pkg.getData(false);
while (e.hasMoreElements()) {
FileObject clz = e.nextElement();
@@ -93,7 +93,7 @@ public final class ExternalPackages {
@Override
public Collection<SourcePackageInfo> getSubpackages() {
- Set<FileObject> pkgs = new TreeSet(pathComparator);
+ Set<FileObject> pkgs = new TreeSet<>(pathComparator);
Enumeration<? extends FileObject> e = pkg.getFolders(false);
while (e.hasMoreElements()) {
pkgs.add(e.nextElement());
@@ -323,7 +323,7 @@ public final class ExternalPackages {
}
if (rec) {
- Queue<SourcePackageInfo> _packages = new ArrayDeque(pkgis);
+ Queue<SourcePackageInfo> _packages = new ArrayDeque<>(pkgis);
pkgis.clear();
while (!_packages.isEmpty()) {
FilePackageInfo pkg = (FilePackageInfo)_packages.poll();
diff --git a/profiler/profiler.heapwalker/src/org/netbeans/modules/profiler/heapwalk/ClassesListController.java b/profiler/profiler.heapwalker/src/org/netbeans/modules/profiler/heapwalk/ClassesListController.java
index 3ed91b1864..beb2573681 100644
--- a/profiler/profiler.heapwalker/src/org/netbeans/modules/profiler/heapwalk/ClassesListController.java
+++ b/profiler/profiler.heapwalker/src/org/netbeans/modules/profiler/heapwalk/ClassesListController.java
@@ -468,7 +468,7 @@ public class ClassesListController extends AbstractController {
if (compareRetained) classesController.getHeapFragmentWalker().
computeRetainedSizes(false, false);
- Map<String, DiffJavaClass> classes = new HashMap();
+ Map<String, DiffJavaClass> classes = new HashMap<>();
List<JavaClass> classes1 = h1.getAllClasses();
for (JavaClass jc1 : classes1) {
diff --git a/profiler/profiler.heapwalker/src/org/netbeans/modules/profiler/heapwalk/HeapWalkerManager.java b/profiler/profiler.heapwalker/src/org/netbeans/modules/profiler/heapwalk/HeapWalkerManager.java
index 9aa63920c2..654ea82a4c 100644
--- a/profiler/profiler.heapwalker/src/org/netbeans/modules/profiler/heapwalk/HeapWalkerManager.java
+++ b/profiler/profiler.heapwalker/src/org/netbeans/modules/profiler/heapwalk/HeapWalkerManager.java
@@ -53,8 +53,8 @@ import org.openide.filesystems.FileUtil;
public class HeapWalkerManager {
//~ Instance fields ----------------------------------------------------------------------------------------------------------
- private Set dumpsBeingDeleted = new HashSet();
- private List<HeapWalker> heapWalkers = new ArrayList();
+ private Set dumpsBeingDeleted = new HashSet<>();
+ private List<HeapWalker> heapWalkers = new ArrayList<>();
private final RequestProcessor heapwalkerRp = new RequestProcessor(HeapWalkerManager.class);
diff --git a/profiler/profiler.heapwalker/src/org/netbeans/modules/profiler/heapwalk/OverviewController.java b/profiler/profiler.heapwalker/src/org/netbeans/modules/profiler/heapwalk/OverviewController.java
index 9e34bbb885..f0462c852a 100644
--- a/profiler/profiler.heapwalker/src/org/netbeans/modules/profiler/heapwalk/OverviewController.java
+++ b/profiler/profiler.heapwalker/src/org/netbeans/modules/profiler/heapwalk/OverviewController.java
@@ -536,7 +536,7 @@ public class OverviewController extends AbstractController {
private Map<ThreadObjectGCRoot,Map<Integer,List<JavaFrameGCRoot>>> computeJavaFrameMap(Collection<GCRoot> roots) {
- Map<ThreadObjectGCRoot,Map<Integer,List<JavaFrameGCRoot>>> javaFrameMap = new HashMap();
+ Map<ThreadObjectGCRoot,Map<Integer,List<JavaFrameGCRoot>>> javaFrameMap = new HashMap<>();
for (GCRoot root : roots) {
if (GCRoot.JAVA_FRAME.equals(root.getKind())) {
@@ -547,7 +547,7 @@ public class OverviewController extends AbstractController {
List<JavaFrameGCRoot> locals;
if (stackMap == null) {
- stackMap = new HashMap();
+ stackMap = new HashMap<>();
javaFrameMap.put(threadObj,stackMap);
}
locals = stackMap.get(frameNo);
diff --git a/profiler/profiler.heapwalker/src/org/netbeans/modules/profiler/heapwalk/details/api/DetailsSupport.java b/profiler/profiler.heapwalker/src/org/netbeans/modules/profiler/heapwalk/details/api/DetailsSupport.java
index a3d78790c4..b77e5ff9de 100644
--- a/profiler/profiler.heapwalker/src/org/netbeans/modules/profiler/heapwalk/details/api/DetailsSupport.java
+++ b/profiler/profiler.heapwalker/src/org/netbeans/modules/profiler/heapwalk/details/api/DetailsSupport.java
@@ -87,8 +87,8 @@ public final class DetailsSupport {
if (cachedPairs != null) return cachedPairs;
// All registered className|DetailsProvider pairs
- List<ProviderClassPair> allPairs = new ArrayList();
- List<ProviderClassPair> simplePairs = new ArrayList();
+ List<ProviderClassPair> allPairs = new ArrayList<>();
+ List<ProviderClassPair> simplePairs = new ArrayList<>();
Collection<? extends DetailsProvider> providers = getProviders();
for (DetailsProvider provider : providers) {
String[] classes = provider.getSupportedClasses();
@@ -98,7 +98,7 @@ public final class DetailsSupport {
else simplePairs.add(new ProviderClassPair(provider, null));
}
- List<ProviderClassPair> pairs = new ArrayList();
+ List<ProviderClassPair> pairs = new ArrayList<>();
// Only compatible className|DetailsProvider pairs
if (!allPairs.isEmpty()) {
diff --git a/profiler/profiler.heapwalker/src/org/netbeans/modules/profiler/heapwalk/details/jdk/IoDetailsProvider.java b/profiler/profiler.heapwalker/src/org/netbeans/modules/profiler/heapwalk/details/jdk/IoDetailsProvider.java
index 603984a181..d09030b908 100644
--- a/profiler/profiler.heapwalker/src/org/netbeans/modules/profiler/heapwalk/details/jdk/IoDetailsProvider.java
+++ b/profiler/profiler.heapwalker/src/org/netbeans/modules/profiler/heapwalk/details/jdk/IoDetailsProvider.java
@@ -93,7 +93,7 @@ public final class IoDetailsProvider extends DetailsProvider.Basic {
}
private Map<Long, String> computeFDCache(Heap heap, JavaClass fdClass) {
- Map<Long, String> cache = new HashMap();
+ Map<Long, String> cache = new HashMap<>();
computeFDCacheForClass(heap, FD_RAF_CLASS, "fd", cache); // NOI18N
computeFDCacheForClass(heap, FD_FIS_CLASS, "fd", cache); // NOi18N
computeFDCacheForClass(heap, FD_FOS_CLASS, "fd", cache); // NOI18N
diff --git a/profiler/profiler.heapwalker/src/org/netbeans/modules/profiler/heapwalk/details/jdk/ui/ComponentBuilders.java b/profiler/profiler.heapwalker/src/org/netbeans/modules/profiler/heapwalk/details/jdk/ui/ComponentBuilders.java
index 102e33f25f..764ef0f065 100644
--- a/profiler/profiler.heapwalker/src/org/netbeans/modules/profiler/heapwalk/details/jdk/ui/ComponentBuilders.java
+++ b/profiler/profiler.heapwalker/src/org/netbeans/modules/profiler/heapwalk/details/jdk/ui/ComponentBuilders.java
@@ -85,7 +85,7 @@ final class ComponentBuilders {
ChildrenBuilder(Instance instance, Heap heap) {
super(instance, heap);
- component = new ArrayList();
+ component = new ArrayList<>();
if (instance instanceof ObjectArrayInstance) { // Component[] (JDK 5-)
List<Instance> components = ((ObjectArrayInstance)instance).getValues();
diff --git a/profiler/profiler.heapwalker/src/org/netbeans/modules/profiler/heapwalk/details/jdk/ui/DataViewBuilders.java b/profiler/profiler.heapwalker/src/org/netbeans/modules/profiler/heapwalk/details/jdk/ui/DataViewBuilders.java
index 6e8fbae1bb..a1d77511ef 100644
--- a/profiler/profiler.heapwalker/src/org/netbeans/modules/profiler/heapwalk/details/jdk/ui/DataViewBuilders.java
+++ b/profiler/profiler.heapwalker/src/org/netbeans/modules/profiler/heapwalk/details/jdk/ui/DataViewBuilders.java
@@ -113,7 +113,7 @@ final class DataViewBuilders {
DefaultListModelBuilder(Instance instance, Heap heap) {
super(instance, heap);
- model = new ArrayList();
+ model = new ArrayList<>();
Object _delegate = instance.getValueOfField("delegate");
if (_delegate instanceof Instance) {
@@ -236,7 +236,7 @@ final class DataViewBuilders {
TableColumnModelBuilder(Instance instance, Heap heap) {
super(instance, heap);
- tableColumns = new ArrayList();
+ tableColumns = new ArrayList<>();
columnMargin = DetailsUtils.getIntFieldValue(instance, "columnMargin", 1);
Object _columns = instance.getValueOfField("tableColumns");
diff --git a/profiler/profiler.heapwalker/src/org/netbeans/modules/profiler/heapwalk/model/HeapPatterns.java b/profiler/profiler.heapwalker/src/org/netbeans/modules/profiler/heapwalk/model/HeapPatterns.java
index 43e6822e51..22906bae6d 100644
--- a/profiler/profiler.heapwalker/src/org/netbeans/modules/profiler/heapwalk/model/HeapPatterns.java
+++ b/profiler/profiler.heapwalker/src/org/netbeans/modules/profiler/heapwalk/model/HeapPatterns.java
@@ -44,7 +44,7 @@ final class HeapPatterns {
private static final Map<String,String> LINKED_LIST_ENTRY_CLASSNAMES;
static {
- Map<String,String> entryClass = new HashMap();
+ Map<String,String> entryClass = new HashMap<>();
entryClass.put("java.util.LinkedList$Entry","previous, next"); // NOI18N
entryClass.put("java.util.LinkedList$Node","prev, next"); // NOI18N
diff --git a/profiler/profiler.heapwalker/src/org/netbeans/modules/profiler/heapwalk/ui/AnalysisControllerUI.java b/profiler/profiler.heapwalker/src/org/netbeans/modules/profiler/heapwalk/ui/AnalysisControllerUI.java
index 91a92b927c..cdf8a97294 100644
--- a/profiler/profiler.heapwalker/src/org/netbeans/modules/profiler/heapwalk/ui/AnalysisControllerUI.java
+++ b/profiler/profiler.heapwalker/src/org/netbeans/modules/profiler/heapwalk/ui/AnalysisControllerUI.java
@@ -200,7 +200,7 @@ public class AnalysisControllerUI extends JPanel {
}
private boolean[] getRulesSelection() {
- List<JCheckBox> ruleCheckboxes = new ArrayList();
+ List<JCheckBox> ruleCheckboxes = new ArrayList<>();
for (Component component : rulesContainer.getComponents()) {
if (component instanceof JCheckBox && ((JCheckBox) component).getActionCommand().equals("RULE_CHECKBOX")) {
diff --git a/profiler/profiler.nbimpl/src/org/netbeans/modules/profiler/nbimpl/project/ProjectUtilities.java b/profiler/profiler.nbimpl/src/org/netbeans/modules/profiler/nbimpl/project/ProjectUtilities.java
index f91a30ac26..2bb1afbd88 100644
--- a/profiler/profiler.nbimpl/src/org/netbeans/modules/profiler/nbimpl/project/ProjectUtilities.java
+++ b/profiler/profiler.nbimpl/src/org/netbeans/modules/profiler/nbimpl/project/ProjectUtilities.java
@@ -171,7 +171,7 @@ public final class ProjectUtilities {
public static Project[] getOpenedProjectsForAttach() {
Project[] projects = getOpenedProjects();
- ArrayList<Project> projectsArray = new ArrayList(projects.length);
+ ArrayList<Project> projectsArray = new ArrayList<>(projects.length);
for (int i = 0; i < projects.length; i++) {
if (ProjectUtilities.isProjectTypeSupportedForAttach(projects[i])) {
diff --git a/profiler/profiler.ppoints/src/org/netbeans/modules/profiler/ppoints/GlobalProfilingPointsProcessor.java b/profiler/profiler.ppoints/src/org/netbeans/modules/profiler/ppoints/GlobalProfilingPointsProcessor.java
index cac4be4d8e..8557e7bc11 100644
--- a/profiler/profiler.ppoints/src/org/netbeans/modules/profiler/ppoints/GlobalProfilingPointsProcessor.java
+++ b/profiler/profiler.ppoints/src/org/netbeans/modules/profiler/ppoints/GlobalProfilingPointsProcessor.java
@@ -41,8 +41,8 @@ public class GlobalProfilingPointsProcessor implements DataManagerListener {
//~ Instance fields ----------------------------------------------------------------------------------------------------------
- private List<TimedGlobalProfilingPoint> scheduledTimedPPs = new ArrayList();
- private List<TriggeredGlobalProfilingPoint> scheduledTriggeredPPs = new ArrayList();
+ private List<TimedGlobalProfilingPoint> scheduledTimedPPs = new ArrayList<>();
+ private List<TriggeredGlobalProfilingPoint> scheduledTriggeredPPs = new ArrayList<>();
private ProfilingSettings profilingSettings;
private Lookup.Provider profiledProject;
private GlobalProfilingPoint[] gpp;
@@ -171,7 +171,7 @@ public class GlobalProfilingPointsProcessor implements DataManagerListener {
checkForStop();
if (isRunning) {
- List<TimedGlobalProfilingPoint> rescheduledTimedPPs = new ArrayList();
+ List<TimedGlobalProfilingPoint> rescheduledTimedPPs = new ArrayList<>();
for (TimedGlobalProfilingPoint tgpp : scheduledTimedPPs) {
if (timeConditionMet(tgpp.getCondition())) {
@@ -227,7 +227,7 @@ public class GlobalProfilingPointsProcessor implements DataManagerListener {
checkForStop();
if (isRunning) {
- List<TriggeredGlobalProfilingPoint> rescheduledTriggeredPPs = new ArrayList();
+ List<TriggeredGlobalProfilingPoint> rescheduledTriggeredPPs = new ArrayList<>();
for (TriggeredGlobalProfilingPoint tgpp : scheduledTriggeredPPs) {
if (triggerConditionMet(tgpp.getCondition())) {
diff --git a/profiler/profiler.ppoints/src/org/netbeans/modules/profiler/ppoints/ProfilingPointFactory.java b/profiler/profiler.ppoints/src/org/netbeans/modules/profiler/ppoints/ProfilingPointFactory.java
index 49ea32bc16..b29933a641 100644
--- a/profiler/profiler.ppoints/src/org/netbeans/modules/profiler/ppoints/ProfilingPointFactory.java
+++ b/profiler/profiler.ppoints/src/org/netbeans/modules/profiler/ppoints/ProfilingPointFactory.java
@@ -143,7 +143,7 @@ public abstract class ProfilingPointFactory {
ProfilerStorage.loadProjectProperties(properties, project, getProfilingPointsStorage());
int index = 0;
- List<ProfilingPoint> profilingPoints = new ArrayList();
+ List<ProfilingPoint> profilingPoints = new ArrayList<>();
while (properties.getProperty(index + "_" + ProfilingPoint.PROPERTY_NAME) != null) { // NOI18N
ProfilingPoint profilingPoint = loadProfilingPoint(project, properties, index);
diff --git a/profiler/profiler.ppoints/src/org/netbeans/modules/profiler/ppoints/ProfilingPointsManager.java b/profiler/profiler.ppoints/src/org/netbeans/modules/profiler/ppoints/ProfilingPointsManager.java
index 3f6b053d48..8126745bd2 100644
--- a/profiler/profiler.ppoints/src/org/netbeans/modules/profiler/ppoints/ProfilingPointsManager.java
+++ b/profiler/profiler.ppoints/src/org/netbeans/modules/profiler/ppoints/ProfilingPointsManager.java
@@ -292,8 +292,8 @@ public final class ProfilingPointsManager extends ProfilingPointsProcessor
//~ Instance fields ----------------------------------------------------------------------------------------------------------
private CustomizerButton customizerButton;
- private List<GlobalProfilingPoint> activeGlobalProfilingPoints = new ArrayList();
- private Map<Integer, RuntimeProfilingPointMapper> activeCodeProfilingPoints = new HashMap();
+ private List<GlobalProfilingPoint> activeGlobalProfilingPoints = new ArrayList<>();
+ private Map<Integer, RuntimeProfilingPointMapper> activeCodeProfilingPoints = new HashMap<>();
private PropertyChangeListener pcl = new PropertyChangeListener() {
public void propertyChange(PropertyChangeEvent evt) {
if (evt.getPropertyName().equals(ProfilingPointFactory.AVAILABILITY_PROPERTY)) {
@@ -304,10 +304,10 @@ public final class ProfilingPointsManager extends ProfilingPointsProcessor
};
private PropertyChangeSupport propertyChangeSupport = new PropertyChangeSupport(this);
- private Set<ProfilingPoint> dirtyProfilingPoints = Collections.synchronizedSet(new HashSet());
- private List<ValidityAwarePanel> customizers = new ArrayList();
- private final Collection<Lookup.Provider> openedProjects = new ArrayList();
- private List<ProfilingPoint> profilingPoints = new ArrayList();
+ private Set<ProfilingPoint> dirtyProfilingPoints = Collections.synchronizedSet(new HashSet<>());
+ private List<ValidityAwarePanel> customizers = new ArrayList<>();
+ private final Collection<Lookup.Provider> openedProjects = new ArrayList<>();
+ private List<ProfilingPoint> profilingPoints = new ArrayList<>();
private ProfilingPointFactory[] profilingPointFactories = new ProfilingPointFactory[0];
private boolean profilingInProgress = false; // collecting data
private boolean profilingSessionInProgress = false; // session started and not yet finished
@@ -396,7 +396,7 @@ public final class ProfilingPointsManager extends ProfilingPointsProcessor
List<ProfilingPoint> projectProfilingPoints = sorted ? getSortedProfilingPoints(project, 1, false)
: getProfilingPoints(project, ProfilerIDESettings.
getInstance().getIncludeProfilingPointsDependencies(), false); // TODO: define default sorting (current sorting of Profiling Points window?)
- List<ProfilingPoint> compatibleProfilingPoints = new ArrayList();
+ List<ProfilingPoint> compatibleProfilingPoints = new ArrayList<>();
for (ProfilingPoint profilingPoint : projectProfilingPoints) {
if (profilingPoint.supportsProfilingSettings(profilingSettings)) {
@@ -435,7 +435,7 @@ public final class ProfilingPointsManager extends ProfilingPointsProcessor
Lookup.Provider project,
boolean inclSubprojects,
boolean inclUnavailable) {
- Set<Lookup.Provider> projects = new HashSet();
+ Set<Lookup.Provider> projects = new HashSet<>();
if (project == null) {
synchronized (openedProjects) { projects.addAll(openedProjects); }
@@ -444,7 +444,7 @@ public final class ProfilingPointsManager extends ProfilingPointsProcessor
if (inclSubprojects) projects.addAll(getOpenSubprojects(project));
}
- ArrayList<T> filteredProfilingPoints = new ArrayList();
+ ArrayList<T> filteredProfilingPoints = new ArrayList<>();
Iterator<ProfilingPoint> iterator = profilingPoints.iterator();
Set<FileObject> projectsLoc = locations(projects);
@@ -506,7 +506,7 @@ public final class ProfilingPointsManager extends ProfilingPointsProcessor
nextUniqueRPPIdentificator = 0;
- List<RuntimeProfilingPoint> runtimeProfilingPoints = new ArrayList();
+ List<RuntimeProfilingPoint> runtimeProfilingPoints = new ArrayList<>();
List<ProfilingPoint> compatibleProfilingPoints = getCompatibleProfilingPoints(project, profilingSettings, false);
for (ProfilingPoint compatibleProfilingPoint : compatibleProfilingPoints) {
@@ -723,7 +723,7 @@ public final class ProfilingPointsManager extends ProfilingPointsProcessor
public void reset() {
// TODO: currently only last used profiling points are reset, check if all profiling points need to be reset
- List<ProfilingPoint> profilingPointsToReset = new ArrayList();
+ List<ProfilingPoint> profilingPointsToReset = new ArrayList<>();
// reset CodeProfilingPoints
Collection<RuntimeProfilingPointMapper> mappersToReset = activeCodeProfilingPoints.values();
@@ -908,7 +908,7 @@ public final class ProfilingPointsManager extends ProfilingPointsProcessor
private static Set<FileObject> locations(Collection<Lookup.Provider> projects) {
if (projects == null || projects.isEmpty()) return Collections.EMPTY_SET;
- Set<FileObject> locations = new HashSet();
+ Set<FileObject> locations = new HashSet<>();
for (Lookup.Provider project : projects)
locations.add(ProjectUtilities.getProjectDirectory(project));
return locations;
@@ -923,12 +923,12 @@ public final class ProfilingPointsManager extends ProfilingPointsProcessor
}
private Set<Lookup.Provider> getOpenSubprojects(Lookup.Provider project) {
- Set<Lookup.Provider> subprojects = new HashSet();
+ Set<Lookup.Provider> subprojects = new HashSet<>();
ProjectUtilities.fetchSubprojects(project, subprojects);
if (subprojects.isEmpty()) return subprojects;
- Set<Lookup.Provider> openSubprojects = new HashSet();
+ Set<Lookup.Provider> openSubprojects = new HashSet<>();
Set<FileObject> subprojectsLoc = locations(subprojects);
synchronized(openedProjects) {
for (Lookup.Provider openProject : openedProjects)
@@ -1097,8 +1097,8 @@ public final class ProfilingPointsManager extends ProfilingPointsProcessor
}
}
- private final List<ProfilingPointScopeProvider> scopeProviders = new ArrayList();
- private final List<Lookup.Provider> providedScopes = new ArrayList();
+ private final List<ProfilingPointScopeProvider> scopeProviders = new ArrayList<>();
+ private final List<Lookup.Provider> providedScopes = new ArrayList<>();
private void cacheProvidedScopes() {
scopeProviders.clear();
@@ -1132,8 +1132,8 @@ public final class ProfilingPointsManager extends ProfilingPointsProcessor
}
private void processOpenedProjectsChanged() {
- Collection<Lookup.Provider> lastOpenedProjects = new ArrayList();
- List<Lookup.Provider> lastProvidedScopes = new ArrayList();
+ Collection<Lookup.Provider> lastOpenedProjects = new ArrayList<>();
+ List<Lookup.Provider> lastProvidedScopes = new ArrayList<>();
synchronized (openedProjects) {
lastOpenedProjects.addAll(openedProjects);
openedProjects.clear();
@@ -1229,8 +1229,8 @@ public final class ProfilingPointsManager extends ProfilingPointsProcessor
private synchronized void storeProfilingPoints(ProfilingPoint[] profilingPointsArr) {
if (ignoreStoreProfilingPoints) return;
- final Set<Lookup.Provider> projects = new HashSet();
- final Set<ProfilingPointFactory> factories = new HashSet();
+ final Set<Lookup.Provider> projects = new HashSet<>();
+ final Set<ProfilingPointFactory> factories = new HashSet<>();
for (ProfilingPoint profilingPoint : profilingPointsArr) {
projects.add(profilingPoint.getProject());
@@ -1259,7 +1259,7 @@ public final class ProfilingPointsManager extends ProfilingPointsProcessor
private void unloadProfilingPoints(Lookup.Provider project) {
List<ProfilingPoint> closedProfilingPoints = getProfilingPoints(project, false, true);
- List<ProfilingPoint> dirtyClosedProfilingPoints = new ArrayList();
+ List<ProfilingPoint> dirtyClosedProfilingPoints = new ArrayList<>();
for (ProfilingPoint profilingPoint : closedProfilingPoints) {
if (dirtyProfilingPoints.contains(profilingPoint)) {
diff --git a/profiler/profiler.ppoints/src/org/netbeans/modules/profiler/ppoints/ResetResultsProfilingPoint.java b/profiler/profiler.ppoints/src/org/netbeans/modules/profiler/ppoints/ResetResultsProfilingPoint.java
index c824d8f063..d1ed3e2cad 100644
--- a/profiler/profiler.ppoints/src/org/netbeans/modules/profiler/ppoints/ResetResultsProfilingPoint.java
+++ b/profiler/profiler.ppoints/src/org/netbeans/modules/profiler/ppoints/ResetResultsProfilingPoint.java
@@ -269,7 +269,7 @@ public final class ResetResultsProfilingPoint extends CodeProfilingPoint.Single
//~ Instance fields ----------------------------------------------------------------------------------------------------------
private Annotation annotation;
- private List<Result> results = new ArrayList();
+ private List<Result> results = new ArrayList<>();
private final Object resultsSync = new Object();
private WeakReference<Report> reportReference;
diff --git a/profiler/profiler.ppoints/src/org/netbeans/modules/profiler/ppoints/StopwatchProfilingPoint.java b/profiler/profiler.ppoints/src/org/netbeans/modules/profiler/ppoints/StopwatchProfilingPoint.java
index fadd473375..5764b343fb 100644
--- a/profiler/profiler.ppoints/src/org/netbeans/modules/profiler/ppoints/StopwatchProfilingPoint.java
+++ b/profiler/profiler.ppoints/src/org/netbeans/modules/profiler/ppoints/StopwatchProfilingPoint.java
@@ -378,7 +378,7 @@ public final class StopwatchProfilingPoint extends CodeProfilingPoint.Paired imp
private Annotation endAnnotation;
private Annotation startAnnotation;
- private List<Result> results = new ArrayList();
+ private List<Result> results = new ArrayList<>();
private final Object resultsSync = new Object();
private WeakReference<Report> reportReference;
diff --git a/profiler/profiler.ppoints/src/org/netbeans/modules/profiler/ppoints/TakeSnapshotProfilingPoint.java b/profiler/profiler.ppoints/src/org/netbeans/modules/profiler/ppoints/TakeSnapshotProfilingPoint.java
index 31b7b705bb..4359cea0b6 100644
--- a/profiler/profiler.ppoints/src/org/netbeans/modules/profiler/ppoints/TakeSnapshotProfilingPoint.java
+++ b/profiler/profiler.ppoints/src/org/netbeans/modules/profiler/ppoints/TakeSnapshotProfilingPoint.java
@@ -361,7 +361,7 @@ public final class TakeSnapshotProfilingPoint extends CodeProfilingPoint.Single
//~ Instance fields ----------------------------------------------------------------------------------------------------------
private Annotation annotation;
- private List<Result> results = new ArrayList();
+ private List<Result> results = new ArrayList<>();
private final Object resultsSync = new Object();
private String snapshotFile = System.getProperty("java.io.tmpdir"); // NOI18N
private String snapshotTarget = TARGET_PROJECT_KEY;
diff --git a/profiler/profiler.ppoints/src/org/netbeans/modules/profiler/ppoints/TimedTakeSnapshotProfilingPoint.java b/profiler/profiler.ppoints/src/org/netbeans/modules/profiler/ppoints/TimedTakeSnapshotProfilingPoint.java
index b522b46b9f..962f0bc6af 100644
--- a/profiler/profiler.ppoints/src/org/netbeans/modules/profiler/ppoints/TimedTakeSnapshotProfilingPoint.java
+++ b/profiler/profiler.ppoints/src/org/netbeans/modules/profiler/ppoints/TimedTakeSnapshotProfilingPoint.java
@@ -315,7 +315,7 @@ public final class TimedTakeSnapshotProfilingPoint extends TimedGlobalProfilingP
//~ Instance fields ----------------------------------------------------------------------------------------------------------
- private List<Result> results = new ArrayList();
+ private List<Result> results = new ArrayList<>();
private final Object resultsSync = new Object();
private String snapshotFile = System.getProperty("java.io.tmpdir"); // NOI18N
private String snapshotTarget = TARGET_PROJECT_KEY;
diff --git a/profiler/profiler.ppoints/src/org/netbeans/modules/profiler/ppoints/TriggeredTakeSnapshotProfilingPoint.java b/profiler/profiler.ppoints/src/org/netbeans/modules/profiler/ppoints/TriggeredTakeSnapshotProfilingPoint.java
index 6def17071d..2b7dc2e3c6 100644
--- a/profiler/profiler.ppoints/src/org/netbeans/modules/profiler/ppoints/TriggeredTakeSnapshotProfilingPoint.java
+++ b/profiler/profiler.ppoints/src/org/netbeans/modules/profiler/ppoints/TriggeredTakeSnapshotProfilingPoint.java
@@ -345,7 +345,7 @@ public final class TriggeredTakeSnapshotProfilingPoint extends TriggeredGlobalPr
//~ Instance fields ----------------------------------------------------------------------------------------------------------
- private List<Result> results = new ArrayList();
+ private List<Result> results = new ArrayList<>();
private final Object resultsSync = new Object();
private String snapshotFile = System.getProperty("java.io.tmpdir"); // NOI18N
private String snapshotTarget = TARGET_PROJECT_KEY;
diff --git a/profiler/profiler.ppoints/src/org/netbeans/modules/profiler/ppoints/Utils.java b/profiler/profiler.ppoints/src/org/netbeans/modules/profiler/ppoints/Utils.java
index b8a7ce8199..0cbddccc4a 100644
--- a/profiler/profiler.ppoints/src/org/netbeans/modules/profiler/ppoints/Utils.java
+++ b/profiler/profiler.ppoints/src/org/netbeans/modules/profiler/ppoints/Utils.java
@@ -654,7 +654,7 @@ public class Utils {
File file = new File(location.getFile());
int lineNumber = location.getLine();
- List<CodeProfilingPoint> lineProfilingPoints = new ArrayList();
+ List<CodeProfilingPoint> lineProfilingPoints = new ArrayList<>();
List<CodeProfilingPoint> profilingPoints = ProfilingPointsManager.getDefault()
.getProfilingPoints(CodeProfilingPoint.class, null, false);
@@ -725,7 +725,7 @@ public class Utils {
public static String getUniqueName(String name, String nameSuffix, Lookup.Provider project) {
List<ProfilingPoint> projectProfilingPoints = ProfilingPointsManager.getDefault().getProfilingPoints(project, false, true);
- Set<String> projectProfilingPointsNames = new HashSet();
+ Set<String> projectProfilingPointsNames = new HashSet<>();
for (ProfilingPoint projectProfilingPoint : projectProfilingPoints) {
projectProfilingPointsNames.add(projectProfilingPoint.getName());
diff --git a/profiler/profiler.ppoints/src/org/netbeans/modules/profiler/ppoints/ui/ProfilingPointReport.java b/profiler/profiler.ppoints/src/org/netbeans/modules/profiler/ppoints/ui/ProfilingPointReport.java
index df8c5ec08e..d34410fc4c 100644
--- a/profiler/profiler.ppoints/src/org/netbeans/modules/profiler/ppoints/ui/ProfilingPointReport.java
+++ b/profiler/profiler.ppoints/src/org/netbeans/modules/profiler/ppoints/ui/ProfilingPointReport.java
@@ -48,7 +48,7 @@ public abstract class ProfilingPointReport extends ProfilerTopComponent {
private static final ProfilingSettings REF_CPU_INSTR =
ProfilingSettingsPresets.createCPUPreset(ProfilingSettings.PROFILE_CPU_ENTIRE);
- private static final Set<ProfilingPointReport> openReports = new HashSet();
+ private static final Set<ProfilingPointReport> openReports = new HashSet<>();
private static boolean profilingRunning;
private static ProfilingSettings currentSettings;
diff --git a/profiler/profiler.ppoints/src/org/netbeans/modules/profiler/ppoints/ui/ProfilingPointsWindowUI.java b/profiler/profiler.ppoints/src/org/netbeans/modules/profiler/ppoints/ui/ProfilingPointsWindowUI.java
index 1c9aed9d8e..b4b2822e72 100644
--- a/profiler/profiler.ppoints/src/org/netbeans/modules/profiler/ppoints/ui/ProfilingPointsWindowUI.java
+++ b/profiler/profiler.ppoints/src/org/netbeans/modules/profiler/ppoints/ui/ProfilingPointsWindowUI.java
@@ -434,7 +434,7 @@ public class ProfilingPointsWindowUI extends JPanel implements ActionListener, L
return;
}
- List<ProfilingPoint> pointsToRemove = new ArrayList();
+ List<ProfilingPoint> pointsToRemove = new ArrayList<>();
for (int selectedRow : selectedRows) {
ProfilingPoint selectedProfilingPoint = getProfilingPointAt(selectedRow);
diff --git a/profiler/profiler.ppoints/src/org/netbeans/modules/profiler/ppoints/ui/ProjectSelector.java b/profiler/profiler.ppoints/src/org/netbeans/modules/profiler/ppoints/ui/ProjectSelector.java
index 2309c587d8..06b99616da 100644
--- a/profiler/profiler.ppoints/src/org/netbeans/modules/profiler/ppoints/ui/ProjectSelector.java
+++ b/profiler/profiler.ppoints/src/org/netbeans/modules/profiler/ppoints/ui/ProjectSelector.java
@@ -93,7 +93,7 @@ class ProjectSelector extends LazyComboBox<Lookup.Provider> {
}
protected final Lookup.Provider[] populate() {
- Set<Lookup.Provider> s = new HashSet();
+ Set<Lookup.Provider> s = new HashSet<>();
for (Lookup.Provider project : ProjectUtilities.getOpenedProjects())
if (ProjectProfilingSupport.get(project).areProfilingPointsSupported())
@@ -103,7 +103,7 @@ class ProjectSelector extends LazyComboBox<Lookup.Provider> {
if (ProjectProfilingSupport.get(project).areProfilingPointsSupported())
s.add(project);
- List<Lookup.Provider> l = new ArrayList();
+ List<Lookup.Provider> l = new ArrayList<>();
Lookup.Provider[] pa = s.toArray(new Lookup.Provider[0]);
l.add(EXTRA_ITEM);
l.addAll(Arrays.asList(ProjectUtilities.getSortedProjects(pa)));
diff --git a/profiler/profiler.snaptracer/src/org/netbeans/modules/profiler/snaptracer/TracerProgressObject.java b/profiler/profiler.snaptracer/src/org/netbeans/modules/profiler/snaptracer/TracerProgressObject.java
index 5a3931b208..f497246f64 100644
--- a/profiler/profiler.snaptracer/src/org/netbeans/modules/profiler/snaptracer/TracerProgressObject.java
+++ b/profiler/profiler.snaptracer/src/org/netbeans/modules/profiler/snaptracer/TracerProgressObject.java
@@ -64,7 +64,7 @@ public final class TracerProgressObject {
this.text = text;
currentStep = 0;
lastStep = 0;
- listeners = new HashSet();
+ listeners = new HashSet<>();
}
@@ -177,7 +177,7 @@ public final class TracerProgressObject {
final int currentStepF = currentStep;
final int addedStepsF = currentStep - lastStep;
final String textF = text;
- final Set<Listener> toNotify = new HashSet(listeners);
+ final Set<Listener> toNotify = new HashSet<>(listeners);
SwingUtilities.invokeLater(new Runnable() {
public void run() {
for (Listener listener : toNotify)
diff --git a/profiler/profiler.snaptracer/src/org/netbeans/modules/profiler/snaptracer/impl/IdeSnapshot.java b/profiler/profiler.snaptracer/src/org/netbeans/modules/profiler/snaptracer/impl/IdeSnapshot.java
index 715f94942f..2997627a84 100644
--- a/profiler/profiler.snaptracer/src/org/netbeans/modules/profiler/snaptracer/impl/IdeSnapshot.java
+++ b/profiler/profiler.snaptracer/src/org/netbeans/modules/profiler/snaptracer/impl/IdeSnapshot.java
@@ -56,8 +56,8 @@ public final class IdeSnapshot {
if (uigestureFO != null) {
xmlLogs = new LogReader(uigestureFO);
xmlLogs.load();
- recordsMap = new HashMap();
- infosMap = new HashMap();
+ recordsMap = new HashMap<>();
+ infosMap = new HashMap<>();
}
}
diff --git a/profiler/profiler.snaptracer/src/org/netbeans/modules/profiler/snaptracer/impl/TracerController.java b/profiler/profiler.snaptracer/src/org/netbeans/modules/profiler/snaptracer/impl/TracerController.java
index 6dbb784ad9..4e077ffb93 100644
--- a/profiler/profiler.snaptracer/src/org/netbeans/modules/profiler/snaptracer/impl/TracerController.java
+++ b/profiler/profiler.snaptracer/src/org/netbeans/modules/profiler/snaptracer/impl/TracerController.java
@@ -174,7 +174,7 @@ public final class TracerController {
}
private void notifySessionInitializing(Set<Map.Entry<TracerPackage, List<TracerProbe>>> items) {
- List<TracerProgressObject> progresses = new ArrayList();
+ List<TracerProgressObject> progresses = new ArrayList<>();
int steps = 0;
Iterator<Map.Entry<TracerPackage, List<TracerProbe>>> itemsI = items.iterator();
while (itemsI.hasNext()) {
@@ -224,7 +224,7 @@ public final class TracerController {
private boolean notifySessionStarting(Set<Map.Entry<TracerPackage, List<TracerProbe>>> items) {
Iterator<Map.Entry<TracerPackage, List<TracerProbe>>> itemsI = items.iterator();
- Map<TracerPackage, List<TracerProbe>> notifiedItems = new HashMap();
+ Map<TracerPackage, List<TracerProbe>> notifiedItems = new HashMap<>();
String notifiedName = null;
try {
while (itemsI.hasNext()) {
@@ -236,7 +236,7 @@ public final class TracerController {
PackageStateHandler ph = pkg.getStateHandler();
if (ph != null) ph.sessionStarting(probesArr, null);
- List<TracerProbe> notifiedList = new ArrayList();
+ List<TracerProbe> notifiedList = new ArrayList<>();
notifiedItems.put(pkg, notifiedList);
Iterator<TracerProbe> probesI = probes.iterator();
diff --git a/profiler/profiler.snaptracer/src/org/netbeans/modules/profiler/snaptracer/impl/TracerModel.java b/profiler/profiler.snaptracer/src/org/netbeans/modules/profiler/snaptracer/impl/TracerModel.java
index bf967c1616..2e6fa27564 100644
--- a/profiler/profiler.snaptracer/src/org/netbeans/modules/profiler/snaptracer/impl/TracerModel.java
+++ b/profiler/profiler.snaptracer/src/org/netbeans/modules/profiler/snaptracer/impl/TracerModel.java
@@ -53,10 +53,10 @@ public final class TracerModel {
private final IdeSnapshot snapshot;
- private final Map<TracerPackage, List<TracerProbe>> probesCache = new HashMap();
- private final Map<TracerProbe, TracerProbeDescriptor> descriptorsCache = new HashMap();
+ private final Map<TracerPackage, List<TracerProbe>> probesCache = new HashMap<>();
+ private final Map<TracerProbe, TracerProbeDescriptor> descriptorsCache = new HashMap<>();
- private final Set<Listener> listeners = new HashSet();
+ private final Set<Listener> listeners = new HashSet<>();
private final TimelineSupport timelineSupport;
@@ -147,7 +147,7 @@ public final class TracerModel {
// Must be called in EDT
List<TracerProbe> getDefinedProbes() {
- List<TracerProbe> probes = new ArrayList();
+ List<TracerProbe> probes = new ArrayList<>();
probes.addAll(timelineSupport.getProbes());
return probes;
}
@@ -160,7 +160,7 @@ public final class TracerModel {
return Positionable.STRONG_COMPARATOR.compare(o1.getKey(), o2.getKey());
}
};
- Set<Map.Entry<TracerPackage, List<TracerProbe>>> probes = new TreeSet(comp);
+ Set<Map.Entry<TracerPackage, List<TracerProbe>>> probes = new TreeSet<>(comp);
synchronized(probesCache) { probes.addAll(probesCache.entrySet()); }
return probes;
}
@@ -178,7 +178,7 @@ public final class TracerModel {
synchronized(probesCache) {
List<TracerProbe> probes = probesCache.get(p);
if (probes == null) {
- probes = new ArrayList();
+ probes = new ArrayList<>();
probesCache.put(p, probes);
}
probes.add(r);
@@ -265,7 +265,7 @@ public final class TracerModel {
}
private void fireProbeAdded(final TracerProbe probe) {
- final Set<Listener> toNotify = new HashSet();
+ final Set<Listener> toNotify = new HashSet<>();
synchronized(listeners) { toNotify.addAll(listeners); }
SwingUtilities.invokeLater(new Runnable() {
public void run() {
@@ -277,7 +277,7 @@ public final class TracerModel {
}
private void fireProbeRemoved(final TracerProbe probe, final boolean probesDefined) {
- final Set<Listener> toNotify = new HashSet();
+ final Set<Listener> toNotify = new HashSet<>();
synchronized(listeners) { toNotify.addAll(listeners); }
SwingUtilities.invokeLater(new Runnable() {
public void run() {
diff --git a/profiler/profiler.snaptracer/src/org/netbeans/modules/profiler/snaptracer/impl/TracerSupportImpl.java b/profiler/profiler.snaptracer/src/org/netbeans/modules/profiler/snaptracer/impl/TracerSupportImpl.java
index 1cbf541d71..4f5f5e22f6 100644
--- a/profiler/profiler.snaptracer/src/org/netbeans/modules/profiler/snaptracer/impl/TracerSupportImpl.java
+++ b/profiler/profiler.snaptracer/src/org/netbeans/modules/profiler/snaptracer/impl/TracerSupportImpl.java
@@ -69,7 +69,7 @@ public final class TracerSupportImpl {
}
public synchronized List<TracerPackage> getPackages(IdeSnapshot snapshot) {
- List<TracerPackage> packages = new ArrayList();
+ List<TracerPackage> packages = new ArrayList<>();
for (TracerPackageProvider provider : providers)
packages.addAll(Arrays.asList(provider.getPackages(snapshot)));
Collections.sort(packages, Positionable.COMPARATOR);
@@ -83,7 +83,7 @@ public final class TracerSupportImpl {
private TracerSupportImpl() {
- providers = new HashSet();
+ providers = new HashSet<>();
registerPackageProvider(new TestPackageProvider());
}
diff --git a/profiler/profiler.snaptracer/src/org/netbeans/modules/profiler/snaptracer/impl/options/TracerOptionsPanel.java b/profiler/profiler.snaptracer/src/org/netbeans/modules/profiler/snaptracer/impl/options/TracerOptionsPanel.java
index 5c1faa48bb..659b646871 100644
--- a/profiler/profiler.snaptracer/src/org/netbeans/modules/profiler/snaptracer/impl/options/TracerOptionsPanel.java
+++ b/profiler/profiler.snaptracer/src/org/netbeans/modules/profiler/snaptracer/impl/options/TracerOptionsPanel.java
@@ -564,7 +564,7 @@ final class TracerOptionsPanel extends JPanel {
}
private List<AbstractButton> getSelected(JPanel container) {
- List<AbstractButton> selected = new ArrayList();
+ List<AbstractButton> selected = new ArrayList<>();
for (Component c : container.getComponents())
if (c instanceof AbstractButton && ((AbstractButton)c).isSelected())
selected.add((AbstractButton)c);
diff --git a/profiler/profiler.snaptracer/src/org/netbeans/modules/profiler/snaptracer/impl/swing/ColorIcon.java b/profiler/profiler.snaptracer/src/org/netbeans/modules/profiler/snaptracer/impl/swing/ColorIcon.java
index 22c7a26ad7..76973627ee 100644
--- a/profiler/profiler.snaptracer/src/org/netbeans/modules/profiler/snaptracer/impl/swing/ColorIcon.java
+++ b/profiler/profiler.snaptracer/src/org/netbeans/modules/profiler/snaptracer/impl/swing/ColorIcon.java
@@ -39,7 +39,7 @@ public final class ColorIcon implements javax.swing.Icon {
private final boolean shadow;
private final Color color;
- private static final Map<Color, ColorIcon> icons = new HashMap();
+ private static final Map<Color, ColorIcon> icons = new HashMap<>();
private ColorIcon(Color color) {
diff --git a/profiler/profiler.snaptracer/src/org/netbeans/modules/profiler/snaptracer/impl/swing/DropdownButton.java b/profiler/profiler.snaptracer/src/org/netbeans/modules/profiler/snaptracer/impl/swing/DropdownButton.java
index 53cee01b94..6ab486f1f7 100644
--- a/profiler/profiler.snaptracer/src/org/netbeans/modules/profiler/snaptracer/impl/swing/DropdownButton.java
+++ b/profiler/profiler.snaptracer/src/org/netbeans/modules/profiler/snaptracer/impl/swing/DropdownButton.java
@@ -39,7 +39,7 @@ public final class DropdownButton extends JToggleButton {
public static final String KEY_CLASS = "KEY_CLASS"; // NOI18N
public static final String KEY_BOOLVALUE = "KEY_BOOLVALUE"; // NOI18N
- private final List<Action> actions = new ArrayList();
+ private final List<Action> actions = new ArrayList<>();
public DropdownButton(Icon icon) {
diff --git a/profiler/profiler.snaptracer/src/org/netbeans/modules/profiler/snaptracer/impl/timeline/TimelineAxis.java b/profiler/profiler.snaptracer/src/org/netbeans/modules/profiler/snaptracer/impl/timeline/TimelineAxis.java
index be0e0ea0cb..ad7e399070 100644
--- a/profiler/profiler.snaptracer/src/org/netbeans/modules/profiler/snaptracer/impl/timeline/TimelineAxis.java
+++ b/profiler/profiler.snaptracer/src/org/netbeans/modules/profiler/snaptracer/impl/timeline/TimelineAxis.java
@@ -247,8 +247,8 @@ final class TimelineAxis extends JPanel {
private boolean wasSelected;
private long hoverTime;
- private final List<Integer> selections = new ArrayList();
- private final List<Integer> intervals = new ArrayList();
+ private final List<Integer> selections = new ArrayList<>();
+ private final List<Integer> intervals = new ArrayList<>();
private final int markExtent = 2;
diff --git a/profiler/profiler.snaptracer/src/org/netbeans/modules/profiler/snaptracer/impl/timeline/TimelineChart.java b/profiler/profiler.snaptracer/src/org/netbeans/modules/profiler/snaptracer/impl/timeline/TimelineChart.java
index 1801fcedb5..959a17a54c 100644
--- a/profiler/profiler.snaptracer/src/org/netbeans/modules/profiler/snaptracer/impl/timeline/TimelineChart.java
+++ b/profiler/profiler.snaptracer/src/org/netbeans/modules/profiler/snaptracer/impl/timeline/TimelineChart.java
@@ -67,7 +67,7 @@ final class TimelineChart extends SynchronousXYChart {
private int lastHoverMode;
private int lastMoveMode;
- private final Set<RowListener> rowListeners = new HashSet();
+ private final Set<RowListener> rowListeners = new HashSet<>();
// --- Constructors --------------------------------------------------------
@@ -75,8 +75,8 @@ final class TimelineChart extends SynchronousXYChart {
TimelineChart(SynchronousXYItemsModel itemsModel) {
super(itemsModel, new PaintersModel.Default());
- rows = new ArrayList();
- itemsToRows = new HashMap();
+ rows = new ArrayList<>();
+ itemsToRows = new HashMap<>();
setBottomBased(false);
@@ -170,7 +170,7 @@ final class TimelineChart extends SynchronousXYChart {
void increaseRowHeights(boolean step) {
if (rows.isEmpty()) return;
int incr = step ? ROW_RESIZE_STEP : 1;
- List<Row> resized = new ArrayList(rows.size());
+ List<Row> resized = new ArrayList<>(rows.size());
for (Row row : rows)
if (row.setHeight(row.getHeight() + incr, step))
resized.add(row);
@@ -183,7 +183,7 @@ final class TimelineChart extends SynchronousXYChart {
void decreaseRowHeights(boolean step) {
if (rows.isEmpty()) return;
int decr = step ? ROW_RESIZE_STEP : 1;
- List<Row> resized = new ArrayList(rows.size());
+ List<Row> resized = new ArrayList<>(rows.size());
for (Row row : rows)
if (row.setHeight(row.getHeight() - decr, step))
resized.add(row);
@@ -195,7 +195,7 @@ final class TimelineChart extends SynchronousXYChart {
void resetRowHeights() {
if (rows.isEmpty()) return;
- List<Row> resized = new ArrayList(rows.size());
+ List<Row> resized = new ArrayList<>(rows.size());
for (Row row : rows)
if (row.setHeight(DEF_ROW_HEIGHT, true))
resized.add(row);
@@ -491,7 +491,7 @@ final class TimelineChart extends SynchronousXYChart {
// --- Constructors ----------------------------------------------------
Row() {
- items = new ArrayList();
+ items = new ArrayList<>();
context = new RowContext(this);
}
diff --git a/profiler/profiler.snaptracer/src/org/netbeans/modules/profiler/snaptracer/impl/timeline/TimelineModel.java b/profiler/profiler.snaptracer/src/org/netbeans/modules/profiler/snaptracer/impl/timeline/TimelineModel.java
index d919c7cf4f..076d4bdc74 100644
--- a/profiler/profiler.snaptracer/src/org/netbeans/modules/profiler/snaptracer/impl/timeline/TimelineModel.java
+++ b/profiler/profiler.snaptracer/src/org/netbeans/modules/profiler/snaptracer/impl/timeline/TimelineModel.java
@@ -41,7 +41,7 @@ final class TimelineModel implements Timeline {
private long[] timestamps;
private long[][] values;
- private final List<TimelineXYItem> items = new ArrayList();
+ private final List<TimelineXYItem> items = new ArrayList<>();
TimelineModel() {
diff --git a/profiler/profiler.snaptracer/src/org/netbeans/modules/profiler/snaptracer/impl/timeline/TimelineSelectionManager.java b/profiler/profiler.snaptracer/src/org/netbeans/modules/profiler/snaptracer/impl/timeline/TimelineSelectionManager.java
index 2299ad2249..ddf3387421 100644
--- a/profiler/profiler.snaptracer/src/org/netbeans/modules/profiler/snaptracer/impl/timeline/TimelineSelectionManager.java
+++ b/profiler/profiler.snaptracer/src/org/netbeans/modules/profiler/snaptracer/impl/timeline/TimelineSelectionManager.java
@@ -237,8 +237,8 @@ class TimelineSelectionManager implements ChartSelectionModel {
highlightedSelection = new ArrayList(items);
fireHighlightedItemsChanged(items, items, Collections.EMPTY_LIST);
} else {
- List<ItemSelection> addedItems = new ArrayList();
- List<ItemSelection> removedItems = new ArrayList();
+ List<ItemSelection> addedItems = new ArrayList<>();
+ List<ItemSelection> removedItems = new ArrayList<>();
for (ItemSelection item : items)
if (!highlightedSelection.contains(item)) addedItems.add(item);
@@ -267,8 +267,8 @@ class TimelineSelectionManager implements ChartSelectionModel {
selectedSelection = new ArrayList(items);
fireSelectedItemsChanged(items, items, Collections.EMPTY_LIST);
} else {
- List<ItemSelection> addedItems = new ArrayList();
- List<ItemSelection> removedItems = new ArrayList();
+ List<ItemSelection> addedItems = new ArrayList<>();
+ List<ItemSelection> removedItems = new ArrayList<>();
for (ItemSelection item : items)
if (!selectedSelection.contains(item)) addedItems.add(item);
@@ -342,7 +342,7 @@ class TimelineSelectionManager implements ChartSelectionModel {
PaintersModel paintersModel = chart.getPaintersModel();
int itemsCount = itemsModel.getItemsCount();
- List<ItemSelection> closestSelection = new ArrayList(itemsCount);
+ List<ItemSelection> closestSelection = new ArrayList<>(itemsCount);
for (int i = 0; i < itemsCount; i++) {
ChartItem item = itemsModel.getItem(i);
diff --git a/profiler/profiler.snaptracer/src/org/netbeans/modules/profiler/snaptracer/impl/timeline/TimelineSelectionOverlay.java b/profiler/profiler.snaptracer/src/org/netbeans/modules/profiler/snaptracer/impl/timeline/TimelineSelectionOverlay.java
index cdf3f434c5..deed5b17fe 100644
--- a/profiler/profiler.snaptracer/src/org/netbeans/modules/profiler/snaptracer/impl/timeline/TimelineSelectionOverlay.java
+++ b/profiler/profiler.snaptracer/src/org/netbeans/modules/profiler/snaptracer/impl/timeline/TimelineSelectionOverlay.java
@@ -79,8 +79,8 @@ final class TimelineSelectionOverlay extends ChartOverlay {
configurationListener = new ConfigurationListener();
selectionListener = new SelectionListener();
timeSelectionListener = new TimeSelectionListener();
- highlightedValues = new HashSet();
- selectedValues = new HashSet();
+ highlightedValues = new HashSet<>();
+ selectedValues = new HashSet<>();
initDefaultValues();
}
@@ -135,7 +135,7 @@ final class TimelineSelectionOverlay extends ChartOverlay {
selectionExtent = 3;
}
- private final Set<Integer> paintedLines = new HashSet();
+ private final Set<Integer> paintedLines = new HashSet<>();
public void paint(Graphics g) {
if (highlightedValues.isEmpty() && selectedValues.isEmpty()) return;
@@ -206,7 +206,7 @@ final class TimelineSelectionOverlay extends ChartOverlay {
}
private void vLineBoundsChanged(Set<Point> oldSelection, Set<Point> newSelection) {
- SortedSet<Integer> selectionBounds = new TreeSet();
+ SortedSet<Integer> selectionBounds = new TreeSet<>();
for (Point p : oldSelection) selectionBounds.add(p.x);
int selections = selectionBounds.size();
if (selections == 1) {
@@ -228,7 +228,7 @@ final class TimelineSelectionOverlay extends ChartOverlay {
}
private List<ItemSelection> getSelections() {
- List<ItemSelection> items = new ArrayList();
+ List<ItemSelection> items = new ArrayList<>();
Set<Integer> timestamps = support.getSelectedTimestamps();
SynchronousXYItemsModel model = (SynchronousXYItemsModel)chart.getItemsModel();
@@ -263,11 +263,11 @@ final class TimelineSelectionOverlay extends ChartOverlay {
implements TimelineChart.RowListener {
private final Runnable selectionUpdater = new Runnable() {
public void run() {
- Set<Point> oldSelectedValues = new HashSet(selectedValues);
+ Set<Point> oldSelectedValues = new HashSet<>(selectedValues);
updateValues(selectedValues, getSelections(), chart);
vLineBoundsChanged(oldSelectedValues, selectedValues);
- Set<Point> oldValues = new HashSet(highlightedValues);
+ Set<Point> oldValues = new HashSet<>(highlightedValues);
updateValues(highlightedValues, chart.getSelectionModel().
getHighlightedItems(), chart);
vLineBoundsChanged(oldValues, highlightedValues);
@@ -303,7 +303,7 @@ final class TimelineSelectionOverlay extends ChartOverlay {
public void highlightedItemsChanged(List<ItemSelection> currentItems,
List<ItemSelection> addedItems, List<ItemSelection> removedItems) {
- Set<Point> oldHighlightedValues = new HashSet(highlightedValues);
+ Set<Point> oldHighlightedValues = new HashSet<>(highlightedValues);
updateValues(highlightedValues, currentItems, chart);
vLineBoundsChanged(oldHighlightedValues, highlightedValues);
}
@@ -317,7 +317,7 @@ final class TimelineSelectionOverlay extends ChartOverlay {
public void indexSelectionChanged() {}
public void timeSelectionChanged(boolean timestampsSelected, boolean justHovering) {
- Set<Point> oldSelectedValues = new HashSet(selectedValues);
+ Set<Point> oldSelectedValues = new HashSet<>(selectedValues);
updateValues(selectedValues, getSelections(), chart);
vLineBoundsChanged(oldSelectedValues, selectedValues);
}
diff --git a/profiler/profiler.snaptracer/src/org/netbeans/modules/profiler/snaptracer/impl/timeline/TimelineSupport.java b/profiler/profiler.snaptracer/src/org/netbeans/modules/profiler/snaptracer/impl/timeline/TimelineSupport.java
index 4c8679a525..4829809bc3 100644
--- a/profiler/profiler.snaptracer/src/org/netbeans/modules/profiler/snaptracer/impl/timeline/TimelineSupport.java
+++ b/profiler/profiler.snaptracer/src/org/netbeans/modules/profiler/snaptracer/impl/timeline/TimelineSupport.java
@@ -75,15 +75,15 @@ public final class TimelineSupport {
private final TimelineLegendOverlay legend;
private final TimelineUnitsOverlay units;
- private final List<TracerProbe> probes = new ArrayList();
- private final List<TimelineChart.Row> rows = new ArrayList();
+ private final List<TracerProbe> probes = new ArrayList<>();
+ private final List<TimelineChart.Row> rows = new ArrayList<>();
private final DescriptorResolver descriptorResolver;
- private final Set<ValuesListener> valuesListeners = new HashSet();
+ private final Set<ValuesListener> valuesListeners = new HashSet<>();
- private final Set<Integer> selectedTimestamps = new HashSet();
- private final List<Integer> selectedIntervals = new ArrayList();
- private final Set<SelectionListener> selectionListeners = new HashSet();
+ private final Set<Integer> selectedTimestamps = new HashSet<>();
+ private final List<Integer> selectedIntervals = new ArrayList<>();
+ private final Set<SelectionListener> selectionListeners = new HashSet<>();
private final IdeSnapshot snapshot;
@@ -460,7 +460,7 @@ public final class TimelineSupport {
TimeAxisUtils.TIME_DATE_FORMAT, new Object[] {
TimeAxisUtils.TIME_MSEC, TimeAxisUtils.DATE_YEAR}));
- final List<ProbeItemDescriptor> probeDescriptors = new ArrayList(columnsCount);
+ final List<ProbeItemDescriptor> probeDescriptors = new ArrayList<>(columnsCount);
for (TracerProbe probe : probes)
probeDescriptors.addAll(Arrays.asList(probe.getItemDescriptors()));
final ValueItemDescriptor[] descriptors = new ValueItemDescriptor[columnsCount];
@@ -717,7 +717,7 @@ public final class TimelineSupport {
private void updateSelectedItems() {
List<SynchronousXYItem> selectedItems = getSelectedItems();
List<ItemSelection> selections =
- new ArrayList(selectedItems.size() * selectedTimestamps.size());
+ new ArrayList<>(selectedItems.size() * selectedTimestamps.size());
for (int selectedIndex : selectedTimestamps)
for (SynchronousXYItem selectedItem : selectedItems)
@@ -795,7 +795,7 @@ public final class TimelineSupport {
private List<SynchronousXYItem> getSelectedItems() {
List<TimelineChart.Row> selectedRows = chart.getSelectedRows();
- List<SynchronousXYItem> selectedItems = new ArrayList();
+ List<SynchronousXYItem> selectedItems = new ArrayList<>();
for (TimelineChart.Row selectedRow : selectedRows)
selectedItems.addAll(Arrays.asList(selectedRow.getItems()));
return selectedItems;
diff --git a/profiler/profiler.snaptracer/src/org/netbeans/modules/profiler/snaptracer/impl/timeline/TimelineTooltipOverlay.java b/profiler/profiler.snaptracer/src/org/netbeans/modules/profiler/snaptracer/impl/timeline/TimelineTooltipOverlay.java
index 073feb9058..4b2d344c2b 100644
--- a/profiler/profiler.snaptracer/src/org/netbeans/modules/profiler/snaptracer/impl/timeline/TimelineTooltipOverlay.java
+++ b/profiler/profiler.snaptracer/src/org/netbeans/modules/profiler/snaptracer/impl/timeline/TimelineTooltipOverlay.java
@@ -213,7 +213,7 @@ final class TimelineTooltipOverlay extends ChartOverlay implements ActionListene
int itemsCount = row.getItemsCount();
TimelineTooltipPainter.Model model = rowModels[rowIndex];
for (int mark : selectedTimestamps) {
- List<ItemSelection> selections = new ArrayList(itemsCount);
+ List<ItemSelection> selections = new ArrayList<>(itemsCount);
for (int itemIndex = 0; itemIndex < itemsCount; itemIndex++) {
SynchronousXYItem item = (SynchronousXYItem)row.getItem(itemIndex);
selections.add(new XYItemSelection.Default(item, mark,
@@ -245,7 +245,7 @@ final class TimelineTooltipOverlay extends ChartOverlay implements ActionListene
setPosition(null, tooltipPainter, i, false);
} else {
TimelineChart.Row row = chart.getRow(i);
- List<ItemSelection> selections = new ArrayList(highlightedItems.size());
+ List<ItemSelection> selections = new ArrayList<>(highlightedItems.size());
for (ItemSelection sel : highlightedItems)
if (row.containsItem(sel.getItem()))
diff --git a/profiler/profiler/src/org/netbeans/modules/profiler/SampledCPUSnapshot.java b/profiler/profiler/src/org/netbeans/modules/profiler/SampledCPUSnapshot.java
index ce96cefa06..9c102abe8b 100644
--- a/profiler/profiler/src/org/netbeans/modules/profiler/SampledCPUSnapshot.java
+++ b/profiler/profiler/src/org/netbeans/modules/profiler/SampledCPUSnapshot.java
@@ -104,10 +104,10 @@ public final class SampledCPUSnapshot {
}
public List<Integer> getIntervals(int startIndex, int endIndex,PrestimeCPUCCTNode node) throws IOException {
- List<Integer> intervals = new ArrayList();
+ List<Integer> intervals = new ArrayList<>();
SamplesInputStream stream = seek(startIndex);
CCTNode n = node;
- List<String[]> stack = new ArrayList();
+ List<String[]> stack = new ArrayList<>();
final String NATIVE_ID = "[native]"; // NOI18N
boolean match = false;
do {
diff --git a/profiler/profiler/src/org/netbeans/modules/profiler/SnapshotResultsWindow.java b/profiler/profiler/src/org/netbeans/modules/profiler/SnapshotResultsWindow.java
index ac3691544c..9227dda96c 100644
--- a/profiler/profiler/src/org/netbeans/modules/profiler/SnapshotResultsWindow.java
+++ b/profiler/profiler/src/org/netbeans/modules/profiler/SnapshotResultsWindow.java
@@ -104,7 +104,7 @@ public final class SnapshotResultsWindow extends ProfilerTopComponent {
void registerSnapshotResultsWindow(SnapshotResultsWindow w) {
assert SwingUtilities.isEventDispatchThread();
if (registeredWindows == null) {
- registeredWindows = new ArrayList();
+ registeredWindows = new ArrayList<>();
}
registeredWindows.add(w);
}
diff --git a/profiler/profiler/src/org/netbeans/modules/profiler/actions/LoadSnapshotAction.java b/profiler/profiler/src/org/netbeans/modules/profiler/actions/LoadSnapshotAction.java
index 463d3ebe56..75bc07616f 100644
--- a/profiler/profiler/src/org/netbeans/modules/profiler/actions/LoadSnapshotAction.java
+++ b/profiler/profiler/src/org/netbeans/modules/profiler/actions/LoadSnapshotAction.java
@@ -114,8 +114,8 @@ public final class LoadSnapshotAction extends AbstractAction {
if (chooser.showOpenDialog(WindowManager.getDefault().getMainWindow()) == JFileChooser.APPROVE_OPTION) {
final File[] files = chooser.getSelectedFiles();
- final ArrayList<FileObject> snapshotsFOArr = new ArrayList();
- final ArrayList<File> heapdumpsFArr = new ArrayList();
+ final ArrayList<FileObject> snapshotsFOArr = new ArrayList<>();
+ final ArrayList<File> heapdumpsFArr = new ArrayList<>();
for (int i = 0; i < files.length; i++) {
File file = files[i];
diff --git a/profiler/profiler/src/org/netbeans/modules/profiler/v2/ProfilerFeatures.java b/profiler/profiler/src/org/netbeans/modules/profiler/v2/ProfilerFeatures.java
index e62a361415..700b11b7f2 100644
--- a/profiler/profiler/src/org/netbeans/modules/profiler/v2/ProfilerFeatures.java
+++ b/profiler/profiler/src/org/netbeans/modules/profiler/v2/ProfilerFeatures.java
@@ -75,10 +75,10 @@ final class ProfilerFeatures {
singleFeatured = Boolean.parseBoolean(storage.readFlag(FLAG_SINGLE_FEATURE, SINGLE_FEATURE_DEFAULT.toString()));
ppoints = Boolean.parseBoolean(storage.readFlag(FLAG_PROFILING_POINTS, PROFILING_POINTS_DEFAULT.toString()));
- features = new TreeSet(FEATURES_COMPARATOR);
- activated = new TreeSet(FEATURES_COMPARATOR);
+ features = new TreeSet<>(FEATURES_COMPARATOR);
+ activated = new TreeSet<>(FEATURES_COMPARATOR);
- listeners = new HashSet();
+ listeners = new HashSet<>();
// Populates SessionStorage, can be accessed in EDT from now
for (ProfilerFeature.Provider provider : ProfilerFeature.Registry.getProviders()) {
@@ -102,7 +102,7 @@ final class ProfilerFeatures {
}
static Set<ProfilerFeature> getCompatible(Set<ProfilerFeature> f, Lookup c) {
- Set<ProfilerFeature> s = new TreeSet(FEATURES_COMPARATOR);
+ Set<ProfilerFeature> s = new TreeSet<>(FEATURES_COMPARATOR);
for (ProfilerFeature p : f) if (p.supportsConfiguration(c)) s.add(p);
return s;
}
@@ -180,7 +180,7 @@ final class ProfilerFeatures {
private void saveActivatedFeatures() {
if (loading) return;
- final Set<ProfilerFeature> _activated = new HashSet(activated);
+ final Set<ProfilerFeature> _activated = new HashSet<>(activated);
RequestProcessor.getDefault().post(new Runnable() {
public void run() {
SessionStorage storage = session.getStorage();
diff --git a/profiler/profiler/src/org/netbeans/modules/profiler/v2/ProfilerPlugins.java b/profiler/profiler/src/org/netbeans/modules/profiler/v2/ProfilerPlugins.java
index 28b7cc1632..28a012efb2 100644
--- a/profiler/profiler/src/org/netbeans/modules/profiler/v2/ProfilerPlugins.java
+++ b/profiler/profiler/src/org/netbeans/modules/profiler/v2/ProfilerPlugins.java
@@ -51,7 +51,7 @@ final class ProfilerPlugins {
if (providers.isEmpty()) {
plugins = null;
} else {
- List<ProfilerPlugin> _plugins = new ArrayList();
+ List<ProfilerPlugin> _plugins = new ArrayList<>();
Lookup.Provider project = session.getProject();
SessionStorage storage = session.getStorage();
for (ProfilerPlugin.Provider provider : providers) {
@@ -82,7 +82,7 @@ final class ProfilerPlugins {
}
List<JMenuItem> menuItems() {
- List<JMenuItem> menus = new ArrayList();
+ List<JMenuItem> menus = new ArrayList<>();
if (plugins != null) for (ProfilerPlugin plugin : plugins) {
try {
diff --git a/profiler/profiler/src/org/netbeans/modules/profiler/v2/ProfilerSession.java b/profiler/profiler/src/org/netbeans/modules/profiler/v2/ProfilerSession.java
index aba9ccf4fb..f842d5653f 100644
--- a/profiler/profiler/src/org/netbeans/modules/profiler/v2/ProfilerSession.java
+++ b/profiler/profiler/src/org/netbeans/modules/profiler/v2/ProfilerSession.java
@@ -192,7 +192,7 @@ public abstract class ProfilerSession {
// --- Profiler API bridge -------------------------------------------------
- private final Set<ProfilingStateListener> profilingStateListeners = new HashSet();
+ private final Set<ProfilingStateListener> profilingStateListeners = new HashSet<>();
public final int getState() {
diff --git a/profiler/profiler/src/org/netbeans/modules/profiler/v2/ProfilerWindow.java b/profiler/profiler/src/org/netbeans/modules/profiler/v2/ProfilerWindow.java
index be9ae5293f..e6ddc22fd9 100644
--- a/profiler/profiler/src/org/netbeans/modules/profiler/v2/ProfilerWindow.java
+++ b/profiler/profiler/src/org/netbeans/modules/profiler/v2/ProfilerWindow.java
@@ -537,7 +537,7 @@ class ProfilerWindow extends ProfilerTopComponent {
private void displayPopupImpl() {
final Set<ProfilerFeature> _features = features.getAvailable();
final Set<ProfilerFeature> _selected = features.getActivated();
- final List<ToggleButtonMenuItem> _items = new ArrayList();
+ final List<ToggleButtonMenuItem> _items = new ArrayList<>();
// --- Features listener ---
final ProfilerFeatures.Listener listener = new ProfilerFeatures.Listener() {
diff --git a/profiler/profiler/src/org/netbeans/modules/profiler/v2/features/MethodsFeatureModes.java b/profiler/profiler/src/org/netbeans/modules/profiler/v2/features/MethodsFeatureModes.java
index 77b493bf34..29abea15a9 100644
--- a/profiler/profiler/src/org/netbeans/modules/profiler/v2/features/MethodsFeatureModes.java
+++ b/profiler/profiler/src/org/netbeans/modules/profiler/v2/features/MethodsFeatureModes.java
@@ -194,7 +194,7 @@ final class MethodsFeatureModes {
private static final String PROJECTS_FLAG = "PROJECTS_FLAG"; // NOI18N
ProjectClassesMode() {
- selectedProjects = new HashSet();
+ selectedProjects = new HashSet<>();
Collection<File> files = createFilesFromStorage();
if (files.isEmpty()) {
@@ -279,7 +279,7 @@ final class MethodsFeatureModes {
}
private Collection<File> createFilesFromStorage() {
- Set<File> files = new HashSet();
+ Set<File> files = new HashSet<>();
String s = readFlag(PROJECTS_FLAG, null);
if (s != null) {
@@ -291,7 +291,7 @@ final class MethodsFeatureModes {
}
private Collection<File> createFilesFromSelection() {
- Set<File> files = new HashSet();
+ Set<File> files = new HashSet<>();
if (selectedProjects.size() > 1 || !selectedProjects.contains(getProject()))
for (Lookup.Provider project : selectedProjects)
diff --git a/profiler/profiler/src/org/netbeans/modules/profiler/v2/features/ObjectsFeatureModes.java b/profiler/profiler/src/org/netbeans/modules/profiler/v2/features/ObjectsFeatureModes.java
index 3871a4d3d9..352aad43d0 100644
--- a/profiler/profiler/src/org/netbeans/modules/profiler/v2/features/ObjectsFeatureModes.java
+++ b/profiler/profiler/src/org/netbeans/modules/profiler/v2/features/ObjectsFeatureModes.java
@@ -177,7 +177,7 @@ final class ObjectsFeatureModes {
private static final String PROJECTS_FLAG = "PROJECTS_FLAG"; // NOI18N
ProjectClassesMode() {
- selectedProjects = new HashSet();
+ selectedProjects = new HashSet<>();
Collection<File> files = createFilesFromStorage();
if (files.isEmpty()) {
@@ -262,7 +262,7 @@ final class ObjectsFeatureModes {
}
private Collection<File> createFilesFromStorage() {
- Set<File> files = new HashSet();
+ Set<File> files = new HashSet<>();
String s = readFlag(PROJECTS_FLAG, null);
if (s != null) {
@@ -274,7 +274,7 @@ final class ObjectsFeatureModes {
}
private Collection<File> createFilesFromSelection() {
- Set<File> files = new HashSet();
+ Set<File> files = new HashSet<>();
if (selectedProjects.size() > 1 || !selectedProjects.contains(getProject()))
for (Lookup.Provider project : selectedProjects)
diff --git a/profiler/profiler/src/org/netbeans/modules/profiler/v2/impl/ClassMethodList.java b/profiler/profiler/src/org/netbeans/modules/profiler/v2/impl/ClassMethodList.java
index e793144511..66428f7351 100644
--- a/profiler/profiler/src/org/netbeans/modules/profiler/v2/impl/ClassMethodList.java
+++ b/profiler/profiler/src/org/netbeans/modules/profiler/v2/impl/ClassMethodList.java
@@ -164,7 +164,7 @@ public final class ClassMethodList {
if (methods) {
Collection<SourceMethodInfo> mtd = ClassMethodSelector.selectMethods(session);
if (!mtd.isEmpty()) {
- sel = new HashSet();
+ sel = new HashSet<>();
for (SourceMethodInfo smi : mtd) sel.add(
new ClientUtils.SourceCodeSelection(smi.getClassName(),
smi.getName(), smi.getSignature()));
@@ -172,7 +172,7 @@ public final class ClassMethodList {
} else {
Collection<SourceClassInfo> cls = ClassMethodSelector.selectClasses(session);
if (!cls.isEmpty()) {
- sel = new HashSet();
+ sel = new HashSet<>();
for (SourceClassInfo sci : cls) sel.add(new ClientUtils.SourceCodeSelection(
sci.getQualifiedName(), Wildcards.ALLWILDCARD, null));
}
diff --git a/profiler/profiler/src/org/netbeans/modules/profiler/v2/impl/ClassMethodSelector.java b/profiler/profiler/src/org/netbeans/modules/profiler/v2/impl/ClassMethodSelector.java
index 77839a86cc..003089351c 100644
--- a/profiler/profiler/src/org/netbeans/modules/profiler/v2/impl/ClassMethodSelector.java
+++ b/profiler/profiler/src/org/netbeans/modules/profiler/v2/impl/ClassMethodSelector.java
@@ -406,7 +406,7 @@ public final class ClassMethodSelector {
}
private static Collection<FileObject> getFiles(SessionStorage _storage) {
- List<FileObject> files = new ArrayList();
+ List<FileObject> files = new ArrayList<>();
String _files = _storage.readFlag("CMS.files", ""); // NOI18N
if (!_files.isEmpty()) for (String file : _files.split("#")) { // NOI18N
@@ -710,7 +710,7 @@ public final class ClassMethodSelector {
}
private static Collection<SourcePackageInfo> getProjectPackages(Lookup.Provider project, boolean sources, boolean dependencies) {
- Set<SourcePackageInfo> packages = new HashSet();
+ Set<SourcePackageInfo> packages = new HashSet<>();
if (sources) packages.addAll(ProfilerTypeUtils.getPackages(false, SourcePackageInfo.Scope.SOURCE, project));
if (dependencies) packages.addAll(ProfilerTypeUtils.getPackages(false, SourcePackageInfo.Scope.DEPENDENCIES, project));
@@ -726,7 +726,7 @@ public final class ClassMethodSelector {
}
private static Collection<SourcePackageInfo> getFilePackages(FileObject file) {
- Set<SourcePackageInfo> packages = new HashSet(ExternalPackages.forPath(file, true));
+ Set<SourcePackageInfo> packages = new HashSet<>(ExternalPackages.forPath(file, true));
Set<SourcePackageInfo> sortedPackages = new TreeSet<SourcePackageInfo>(
new Comparator<SourcePackageInfo>() {
@@ -883,7 +883,7 @@ public final class ClassMethodSelector {
Collection<SourceClassInfo> classes = pkg.getClasses();
if (inner) {
- Set<SourceClassInfo> _classes = new HashSet();
+ Set<SourceClassInfo> _classes = new HashSet<>();
while (!classes.isEmpty()) {
SourceClassInfo cls = classes.iterator().next();
classes.remove(cls);
@@ -1057,7 +1057,7 @@ public final class ClassMethodSelector {
}
);
- Set<SourceMethodInfo> methods = new HashSet(cls.getConstructors());
+ Set<SourceMethodInfo> methods = new HashSet<>(cls.getConstructors());
methods.addAll(cls.getMethods(inherited));
for (SourceMethodInfo method : methods) {
int modifiers = method.getModifiers();
@@ -1212,9 +1212,9 @@ public final class ClassMethodSelector {
public FilteredListModel(ListModel data) {
this.data = data;
- listeners = new HashSet();
+ listeners = new HashSet<>();
- indices = new ArrayList();
+ indices = new ArrayList<>();
doFilter();
this.data.addListDataListener(new ListDataListener() {
diff --git a/profiler/profiler/src/org/netbeans/modules/profiler/v2/impl/FeaturesView.java b/profiler/profiler/src/org/netbeans/modules/profiler/v2/impl/FeaturesView.java
index 4196b69679..1fdf4be1a1 100644
--- a/profiler/profiler/src/org/netbeans/modules/profiler/v2/impl/FeaturesView.java
+++ b/profiler/profiler/src/org/netbeans/modules/profiler/v2/impl/FeaturesView.java
@@ -62,7 +62,7 @@ public class FeaturesView extends JPanel {
private JLabel hintLabel;
private final Color hintColor;
- private final Set<ChangeListener> listeners = new HashSet();
+ private final Set<ChangeListener> listeners = new HashSet<>();
public FeaturesView(Component defaultView, String buttonString) {
diff --git a/profiler/profiler/src/org/netbeans/modules/profiler/v2/impl/SnapshotsWindowUI.java b/profiler/profiler/src/org/netbeans/modules/profiler/v2/impl/SnapshotsWindowUI.java
index 2bd562816b..1ee973f374 100644
--- a/profiler/profiler/src/org/netbeans/modules/profiler/v2/impl/SnapshotsWindowUI.java
+++ b/profiler/profiler/src/org/netbeans/modules/profiler/v2/impl/SnapshotsWindowUI.java
@@ -172,7 +172,7 @@ public final class SnapshotsWindowUI extends ProfilerTopComponent {
private ChangeListener openProjectsListener;
private FileObject currentFolder;
- private final List<Snapshot> snapshots = new ArrayList();
+ private final List<Snapshot> snapshots = new ArrayList<>();
private Action openA;
private Action exportA;
@@ -228,7 +228,7 @@ public final class SnapshotsWindowUI extends ProfilerTopComponent {
SnapshotsWindowHelper.PROCESSOR.post(new Runnable() {
public void run() {
ResultsManager rm = ResultsManager.getDefault();
- final List<Snapshot> _snapshots = new ArrayList();
+ final List<Snapshot> _snapshots = new ArrayList<>();
for (FileObject fo : rm.listSavedSnapshots(project, null))
_snapshots.add(new Snapshot(fo) {
boolean alternativeSorting() {
diff --git a/profiler/profiler/src/org/netbeans/modules/profiler/v2/ui/ProjectSelector.java b/profiler/profiler/src/org/netbeans/modules/profiler/v2/ui/ProjectSelector.java
index bb90bea798..9f474f4878 100644
--- a/profiler/profiler/src/org/netbeans/modules/profiler/v2/ui/ProjectSelector.java
+++ b/profiler/profiler/src/org/netbeans/modules/profiler/v2/ui/ProjectSelector.java
@@ -90,11 +90,11 @@ public class ProjectSelector extends LazyComboBox<Lookup.Provider> {
}
protected final Lookup.Provider[] populate() {
- Set<Lookup.Provider> s = new HashSet();
+ Set<Lookup.Provider> s = new HashSet<>();
s.addAll(Arrays.asList(ProjectUtilities.getOpenedProjects()));
s.addAll(additionalProjects());
- List<Lookup.Provider> l = new ArrayList();
+ List<Lookup.Provider> l = new ArrayList<>();
Lookup.Provider[] pa = s.toArray(new Lookup.Provider[0]);
l.add(EXTERNAL_PROCESS);
l.addAll(Arrays.asList(ProjectUtilities.getSortedProjects(pa)));
diff --git a/webcommon/javascript2.editor/src/org/netbeans/modules/javascript2/editor/CompletionContextFinder.java b/webcommon/javascript2.editor/src/org/netbeans/modules/javascript2/editor/CompletionContextFinder.java
index d5165c1bfa..7c7bf7bf0e 100644
--- a/webcommon/javascript2.editor/src/org/netbeans/modules/javascript2/editor/CompletionContextFinder.java
+++ b/webcommon/javascript2.editor/src/org/netbeans/modules/javascript2/editor/CompletionContextFinder.java
@@ -255,7 +255,7 @@ public class CompletionContextFinder {
tokenId = token.id();
boolean commaFirst = false;
if (tokenId == JsTokenId.OPERATOR_COMMA && ts.movePrevious()) {
- List<JsTokenId> checkParentList = new ArrayList(listIds);
+ List<JsTokenId> checkParentList = new ArrayList<>(listIds);
List<JsTokenId> parentList = Arrays.asList(JsTokenId.BRACKET_LEFT_PAREN, JsTokenId.BRACKET_RIGHT_PAREN, JsTokenId.BRACKET_RIGHT_CURLY);
checkParentList.addAll(parentList);
token = LexUtilities.findPreviousToken(ts, checkParentList);
diff --git a/webcommon/javascript2.editor/src/org/netbeans/modules/javascript2/editor/FileUtils.java b/webcommon/javascript2.editor/src/org/netbeans/modules/javascript2/editor/FileUtils.java
index 890f148b10..a5f744228a 100644
--- a/webcommon/javascript2.editor/src/org/netbeans/modules/javascript2/editor/FileUtils.java
+++ b/webcommon/javascript2.editor/src/org/netbeans/modules/javascript2/editor/FileUtils.java
@@ -91,7 +91,7 @@ public class FileUtils {
assert relativeTo != null;
- List<CompletionProposal> result = new LinkedList();
+ List<CompletionProposal> result = new LinkedList<>();
int lastSlash = prefix.lastIndexOf('/');
String pathPrefix;
@@ -105,7 +105,7 @@ public class FileUtils {
filePrefix = prefix;
}
- Set<FileObject> directories = new HashSet();
+ Set<FileObject> directories = new HashSet<>();
File prefixFile = null;
if (pathPrefix != null && !pathPrefix.startsWith(".")) { //NOI18N
if (pathPrefix.length() == 0 && prefix.startsWith(SLASH)) {
diff --git a/webcommon/javascript2.editor/src/org/netbeans/modules/javascript2/editor/JsInstantRenamer.java b/webcommon/javascript2.editor/src/org/netbeans/modules/javascript2/editor/JsInstantRenamer.java
index 9fdb512054..3677f4a73a 100644
--- a/webcommon/javascript2.editor/src/org/netbeans/modules/javascript2/editor/JsInstantRenamer.java
+++ b/webcommon/javascript2.editor/src/org/netbeans/modules/javascript2/editor/JsInstantRenamer.java
@@ -50,7 +50,7 @@ public class JsInstantRenamer implements InstantRenamer {
if (info instanceof JsParserResult) {
JsParserResult pResult = (JsParserResult)info;
Set<OffsetRange> findOccurrenceRanges = OccurrencesFinderImpl.findOccurrenceRanges(pResult, info.getSnapshot().getEmbeddedOffset(caretOffset));
- HashSet<OffsetRange> sourceRanges = new HashSet(findOccurrenceRanges.size());
+ HashSet<OffsetRange> sourceRanges = new HashSet<>(findOccurrenceRanges.size());
for (OffsetRange range : findOccurrenceRanges) {
sourceRanges.add(LexUtilities.getLexerOffsets(pResult, range));
}
diff --git a/webcommon/javascript2.editor/src/org/netbeans/modules/javascript2/editor/JsKeyStrokeHandler.java b/webcommon/javascript2.editor/src/org/netbeans/modules/javascript2/editor/JsKeyStrokeHandler.java
index 068e8c80f2..2fae2b9299 100644
--- a/webcommon/javascript2.editor/src/org/netbeans/modules/javascript2/editor/JsKeyStrokeHandler.java
+++ b/webcommon/javascript2.editor/src/org/netbeans/modules/javascript2/editor/JsKeyStrokeHandler.java
@@ -81,7 +81,7 @@ class JsKeyStrokeHandler implements KeystrokeHandler {
@Override
public List<OffsetRange> findLogicalRanges(final ParserResult info, final int caretOffset) {
- final Set<OffsetRange> ranges = new LinkedHashSet();
+ final Set<OffsetRange> ranges = new LinkedHashSet<>();
if (info instanceof JsParserResult) {
final JsParserResult jsParserResult = (JsParserResult) info;
FunctionNode root = jsParserResult.getRoot();
@@ -233,7 +233,7 @@ class JsKeyStrokeHandler implements KeystrokeHandler {
}
}
- final ArrayList<OffsetRange> retval = new ArrayList(ranges);
+ final ArrayList<OffsetRange> retval = new ArrayList<>(ranges);
Collections.reverse(retval);
return retval;
}
diff --git a/webcommon/javascript2.editor/src/org/netbeans/modules/javascript2/editor/JsStructureScanner.java b/webcommon/javascript2.editor/src/org/netbeans/modules/javascript2/editor/JsStructureScanner.java
index 37bc2795d5..d3c04b2d01 100644
--- a/webcommon/javascript2.editor/src/org/netbeans/modules/javascript2/editor/JsStructureScanner.java
+++ b/webcommon/javascript2.editor/src/org/netbeans/modules/javascript2/editor/JsStructureScanner.java
@@ -105,7 +105,7 @@ public class JsStructureScanner implements StructureScanner {
if (cancel.isCancelled()) {
return collectedItems;
}
- Collection<? extends JsObject> properties = new ArrayList(jsObject.getProperties().values());
+ Collection<? extends JsObject> properties = new ArrayList<>(jsObject.getProperties().values());
boolean countFunctionChild = (jsObject.getJSKind().isFunction() && !jsObject.isAnonymous() && jsObject.getJSKind() != JsElement.Kind.CONSTRUCTOR
&& !containsFunction(jsObject))
|| (ModelUtils.PROTOTYPE.equals(jsObject.getName()) && properties.isEmpty());
diff --git a/webcommon/javascript2.editor/src/org/netbeans/modules/javascript2/editor/navigation/DeclarationFinderImpl.java b/webcommon/javascript2.editor/src/org/netbeans/modules/javascript2/editor/navigation/DeclarationFinderImpl.java
index 332e40a61a..c1b2257ed2 100644
--- a/webcommon/javascript2.editor/src/org/netbeans/modules/javascript2/editor/navigation/DeclarationFinderImpl.java
+++ b/webcommon/javascript2.editor/src/org/netbeans/modules/javascript2/editor/navigation/DeclarationFinderImpl.java
@@ -169,14 +169,14 @@ public class DeclarationFinderImpl implements DeclarationFinder {
}
// build the FQN of the last defined property in the file / model
String lastDefinedFQN = parent.getFullyQualifiedName();
- List<IndexResult> rItems = new ArrayList();
+ List<IndexResult> rItems = new ArrayList<>();
if (partIndex < fqnParts.length) {
// find the next property from FQN in the index for the defined property in the file / model
rItems.addAll(findPropertyOfType(jsIndex, lastDefinedFQN.toString(), fqnParts[partIndex]));
parent = findPropertyOrParameterInModel(parent, fqnParts[partIndex]);
partIndex++;
for (int i = partIndex; (!rItems.isEmpty()) && i < fqnParts.length; i++ ) {
- List<IndexResult> copy = new ArrayList(rItems);
+ List<IndexResult> copy = new ArrayList<>(rItems);
rItems.clear();
// and for the found property find next property from the FQN
for (IndexResult indexResult : copy) {
@@ -294,7 +294,7 @@ public class DeclarationFinderImpl implements DeclarationFinder {
}
private Collection<? extends IndexResult> findPropertyOfType(Index jsIndex, String fqn, String propertyName, int count) {
- List<IndexResult> items = new ArrayList();
+ List<IndexResult> items = new ArrayList<>();
if (count > 5) {
return items;
}
diff --git a/webcommon/javascript2.editor/test/unit/src/org/netbeans/modules/javascript2/editor/JsFindLogicalRangesTest.java b/webcommon/javascript2.editor/test/unit/src/org/netbeans/modules/javascript2/editor/JsFindLogicalRangesTest.java
index 6beed81eda..96197dcb3c 100644
--- a/webcommon/javascript2.editor/test/unit/src/org/netbeans/modules/javascript2/editor/JsFindLogicalRangesTest.java
+++ b/webcommon/javascript2.editor/test/unit/src/org/netbeans/modules/javascript2/editor/JsFindLogicalRangesTest.java
@@ -76,14 +76,14 @@ public class JsFindLogicalRangesTest extends JsTestBase {
JsKeyStrokeHandler handler = new JsKeyStrokeHandler();
List<OffsetRange> ranges = handler.findLogicalRanges(info, caretOffset);
- List<OffsetRange> reverse = new ArrayList(ranges);
+ List<OffsetRange> reverse = new ArrayList<>(ranges);
Collections.reverse(reverse);
int offset = 0;
int rangesIndex = 0;
OffsetRange currentRange = ranges.get(ranges.size() - rangesIndex - 1);
StringBuilder annotatedSource = new StringBuilder();
String text = info.getSnapshot().getText().toString();
- HashMap<Integer, String> annotations = new HashMap();
+ HashMap<Integer, String> annotations = new HashMap<>();
for (OffsetRange range : reverse) {
rangesIndex++;
String annotation = annotations.get(range.getStart());
diff --git a/webcommon/javascript2.model/src/org/netbeans/modules/javascript2/model/api/ModelUtils.java b/webcommon/javascript2.model/src/org/netbeans/modules/javascript2/model/api/ModelUtils.java
index 3d99f8a0ab..8f810b6a77 100644
--- a/webcommon/javascript2.model/src/org/netbeans/modules/javascript2/model/api/ModelUtils.java
+++ b/webcommon/javascript2.model/src/org/netbeans/modules/javascript2/model/api/ModelUtils.java
@@ -544,7 +544,7 @@ public class ModelUtils {
} else if(type.getType().startsWith(SemiTypeResolverVisitor.ST_VAR)){
String name = type.getType().substring(5);
DeclarationScope declarationScope = object instanceof DeclarationScope ? (DeclarationScope)object : getDeclarationScope(object);
- List<JsObject> variables = new ArrayList(ModelUtils.getVariables(declarationScope));
+ List<JsObject> variables = new ArrayList<>(ModelUtils.getVariables(declarationScope));
if (!(object instanceof DeclarationScope) && object.getParent() != null && !(object.getParent() instanceof DeclarationScope)) {
variables.addAll(object.getParent().getProperties().values());
}
@@ -1755,7 +1755,7 @@ public class ModelUtils {
int partType = 0;
boolean wasLastDot = lookBefore;
int offsetFirstRightParen = -1;
- List<String> exp = new ArrayList();
+ List<String> exp = new ArrayList<>();
while (token.id() != JsTokenId.OPERATOR_SEMICOLON
&& token.id() != JsTokenId.BRACKET_RIGHT_CURLY && token.id() != JsTokenId.BRACKET_LEFT_CURLY
@@ -1906,7 +1906,7 @@ public class ModelUtils {
for (Occurrence occurrence : property.getOccurrences()) {
newProperty.addOccurrence(occurrence.getOffsetRange());
}
- List<JsObject>propertiesToMove = new ArrayList(property.getProperties().values());
+ List<JsObject>propertiesToMove = new ArrayList<>(property.getProperties().values());
for (JsObject propOfProperty: propertiesToMove) {
moveProperty(newProperty, propOfProperty);
}
diff --git a/webcommon/javascript2.requirejs/test/unit/src/org/netbeans/modules/javascript2/requirejs/editor/RequireFileCodeCompletionTest.java b/webcommon/javascript2.requirejs/test/unit/src/org/netbeans/modules/javascript2/requirejs/editor/RequireFileCodeCompletionTest.java
index c7ecab4398..68122ca2d6 100644
--- a/webcommon/javascript2.requirejs/test/unit/src/org/netbeans/modules/javascript2/requirejs/editor/RequireFileCodeCompletionTest.java
+++ b/webcommon/javascript2.requirejs/test/unit/src/org/netbeans/modules/javascript2/requirejs/editor/RequireFileCodeCompletionTest.java
@@ -76,7 +76,7 @@ public class RequireFileCodeCompletionTest extends JsCodeCompletionBase {
lookupAll.add(new TestProjectSupport.FileOwnerQueryImpl(tp));
MockLookup.setInstances(lookupAll.toArray());
- Map<String, String> mappings = new HashMap();
+ Map<String, String> mappings = new HashMap<>();
mappings.put("utils", "js/folder1/api/utils.js");
mappings.put("api", "js/folder1/api");
mappings.put("lib/api", "js/folder1/api");
diff --git a/webcommon/javascript2.requirejs/test/unit/src/org/netbeans/modules/javascript2/requirejs/editor/RequireJSCodeCompletionTest.java b/webcommon/javascript2.requirejs/test/unit/src/org/netbeans/modules/javascript2/requirejs/editor/RequireJSCodeCompletionTest.java
index 74d19cc4fa..cd1eac2dc9 100644
--- a/webcommon/javascript2.requirejs/test/unit/src/org/netbeans/modules/javascript2/requirejs/editor/RequireJSCodeCompletionTest.java
+++ b/webcommon/javascript2.requirejs/test/unit/src/org/netbeans/modules/javascript2/requirejs/editor/RequireJSCodeCompletionTest.java
@@ -61,7 +61,7 @@ public class RequireJSCodeCompletionTest extends JsCodeCompletionBase {
FileObject folder = getTestFile("TestProject1");
Project tp = new TestProjectSupport.TestProject(folder, null);
- Map<String, String> mappings = new HashMap();
+ Map<String, String> mappings = new HashMap<>();
mappings.put("utils", "js/folder1/api/utils.js");
mappings.put("api", "js/folder1/api");
mappings.put("lib/api", "js/folder1/api");
diff --git a/webcommon/javascript2.requirejs/test/unit/src/org/netbeans/modules/javascript2/requirejs/editor/RequireJsDeclarationFinderTest.java b/webcommon/javascript2.requirejs/test/unit/src/org/netbeans/modules/javascript2/requirejs/editor/RequireJsDeclarationFinderTest.java
index d8b7c15a03..b3878466a9 100644
--- a/webcommon/javascript2.requirejs/test/unit/src/org/netbeans/modules/javascript2/requirejs/editor/RequireJsDeclarationFinderTest.java
+++ b/webcommon/javascript2.requirejs/test/unit/src/org/netbeans/modules/javascript2/requirejs/editor/RequireJsDeclarationFinderTest.java
@@ -50,7 +50,7 @@ public class RequireJsDeclarationFinderTest extends JsTestBase {
lookupAll.add(new TestProjectSupport.FileOwnerQueryImpl(testProject));
MockLookup.setInstances(lookupAll.toArray());
- Map<String, String> mappings = new HashMap();
+ Map<String, String> mappings = new HashMap<>();
mappings.put("utils", "js/folder1/api/utils.js");
mappings.put("api", "js/folder1/api");
mappings.put("lib/api", "js/folder1/api");
diff --git a/webcommon/web.inspect/src/org/netbeans/modules/web/inspect/ui/Utilities.java b/webcommon/web.inspect/src/org/netbeans/modules/web/inspect/ui/Utilities.java
index e7729e386b..4e613c594e 100644
--- a/webcommon/web.inspect/src/org/netbeans/modules/web/inspect/ui/Utilities.java
+++ b/webcommon/web.inspect/src/org/netbeans/modules/web/inspect/ui/Utilities.java
@@ -45,10 +45,10 @@ import org.openide.windows.WindowManager;
*/
public class Utilities {
/** MIME types of files with a content that can be styled. */
- private static final Collection<String> STYLED_MIME_TYPES = new HashSet(
+ private static final Collection<String> STYLED_MIME_TYPES = new HashSet<>(
Arrays.asList(new String[]{"text/html", "text/xhtml", "text/x-jsp", "text/x-php5"})); // NOI18N
/** MIME types of files for which we have a special support in Navigator. */
- private static final Collection<String> NAVIGATOR_MIME_TYPES = new HashSet(
+ private static final Collection<String> NAVIGATOR_MIME_TYPES = new HashSet<>(
Arrays.asList(new String[]{"text/html", "text/xhtml"})); // NOI18N
/** {@code RequestProcessor} for this class. */
private static RequestProcessor RP = new RequestProcessor(Utilities.class);
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@netbeans.apache.org
For additional commands, e-mail: commits-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists