Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kurtakov2018-03-29 10:26:48 +0000
committerAlexander Kurtakov2018-03-29 10:26:48 +0000
commit5251d1be37d5970412dcbe291f47948ada582556 (patch)
treeb5ff3a44bb0f342b6b78aa5276aad09dbecb0463 /org.eclipse.debug.tests
parent6ac5654db62a138703356d3d9f6074228ac01ae6 (diff)
downloadeclipse.platform.debug-5251d1be37d5970412dcbe291f47948ada582556.tar.gz
eclipse.platform.debug-5251d1be37d5970412dcbe291f47948ada582556.tar.xz
eclipse.platform.debug-5251d1be37d5970412dcbe291f47948ada582556.zip
Change-Id: I6f62094af1b4ad2c679e78cc635641918f958fb4 Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
Diffstat (limited to 'org.eclipse.debug.tests')
-rw-r--r--org.eclipse.debug.tests/.settings/org.eclipse.jdt.core.prefs4
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/expressions/ExpressionManagerTests.java42
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/launching/ArgumentParsingTests.java4
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/launching/DebugFileStore.java40
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/launching/DebugFileSystem.java13
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/launching/LaunchConfigurationTests.java37
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/launching/LaunchFavoriteTests.java10
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/ContentTests.java4
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/PopupTests.java6
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/SelectionTests.java4
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/StateTests.java4
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/TestModel.java6
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/TestModelUpdatesListener.java48
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/TreeModelViewerAutopopulateAgent.java7
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/UpdateTests.java8
15 files changed, 76 insertions, 161 deletions
diff --git a/org.eclipse.debug.tests/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.debug.tests/.settings/org.eclipse.jdt.core.prefs
index 89f76dbc2..4cdc29f3e 100644
--- a/org.eclipse.debug.tests/.settings/org.eclipse.jdt.core.prefs
+++ b/org.eclipse.debug.tests/.settings/org.eclipse.jdt.core.prefs
@@ -27,6 +27,7 @@ org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.doc.comment.support=enabled
org.eclipse.jdt.core.compiler.maxProblemPerUnit=100
+org.eclipse.jdt.core.compiler.problem.APILeak=warning
org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
@@ -91,7 +92,7 @@ org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=warning
org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
-org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=warning
org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
@@ -101,6 +102,7 @@ org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=enabled
org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled
org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
+org.eclipse.jdt.core.compiler.problem.terminalDeprecation=warning
org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=disabled
org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/expressions/ExpressionManagerTests.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/expressions/ExpressionManagerTests.java
index 626466eb6..049055549 100644
--- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/expressions/ExpressionManagerTests.java
+++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/expressions/ExpressionManagerTests.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2013 IBM Corporation and others.
+ * Copyright (c) 2010, 2018 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -30,34 +30,25 @@ public class ExpressionManagerTests extends AbstractDebugTest {
class SinlgeListener implements IExpressionListener {
- List<IExpression> added = new ArrayList<IExpression>();
- List<IExpression> removed = new ArrayList<IExpression>();
- List<IExpression> changed = new ArrayList<IExpression>();
+ List<IExpression> added = new ArrayList<>();
+ List<IExpression> removed = new ArrayList<>();
+ List<IExpression> changed = new ArrayList<>();
int addedCallbacks = 0;
int removedCallbacks = 0;
int changedCallbacks = 0;
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.IExpressionListener#expressionAdded(org.eclipse.debug.core.model.IExpression)
- */
@Override
public void expressionAdded(IExpression expression) {
added.add(expression);
addedCallbacks++;
}
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.IExpressionListener#expressionRemoved(org.eclipse.debug.core.model.IExpression)
- */
@Override
public void expressionRemoved(IExpression expression) {
removed.add(expression);
removedCallbacks++;
}
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.IExpressionListener#expressionChanged(org.eclipse.debug.core.model.IExpression)
- */
@Override
public void expressionChanged(IExpression expression) {
changed.add(expression);
@@ -68,16 +59,13 @@ public class ExpressionManagerTests extends AbstractDebugTest {
class MultiListener implements IExpressionsListener {
- List<IExpression> added = new ArrayList<IExpression>();
- List<IExpression> removed = new ArrayList<IExpression>();
- List<IExpression> changed = new ArrayList<IExpression>();
+ List<IExpression> added = new ArrayList<>();
+ List<IExpression> removed = new ArrayList<>();
+ List<IExpression> changed = new ArrayList<>();
int addedCallbacks = 0;
int removedCallbacks = 0;
int changedCallbacks = 0;
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.IExpressionsListener#expressionsAdded(org.eclipse.debug.core.model.IExpression[])
- */
@Override
public void expressionsAdded(IExpression[] expressions) {
for (int i = 0; i < expressions.length; i++) {
@@ -86,9 +74,6 @@ public class ExpressionManagerTests extends AbstractDebugTest {
addedCallbacks++;
}
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.IExpressionsListener#expressionsRemoved(org.eclipse.debug.core.model.IExpression[])
- */
@Override
public void expressionsRemoved(IExpression[] expressions) {
for (int i = 0; i < expressions.length; i++) {
@@ -97,9 +82,6 @@ public class ExpressionManagerTests extends AbstractDebugTest {
removedCallbacks++;
}
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.IExpressionsListener#expressionsChanged(org.eclipse.debug.core.model.IExpression[])
- */
@Override
public void expressionsChanged(IExpression[] expressions) {
for (int i = 0; i < expressions.length; i++) {
@@ -112,15 +94,12 @@ public class ExpressionManagerTests extends AbstractDebugTest {
class InsertMoveListener extends MultiListener implements IExpressionsListener2 {
- List<IExpression> moved = new ArrayList<IExpression>();
- List<IExpression> inserted = new ArrayList<IExpression>();
+ List<IExpression> moved = new ArrayList<>();
+ List<IExpression> inserted = new ArrayList<>();
int insertIndex = -1;
int movedCallbacks = 0;
int insertedCallbacks = 0;
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.core.IExpressionsListener2#expressionsMoved(org.eclipse.debug.core.model.IExpression[], int)
- */
@Override
public void expressionsMoved(IExpression[] expressions, int index) {
for (int i = 0; i < expressions.length; i++) {
@@ -130,9 +109,6 @@ public class ExpressionManagerTests extends AbstractDebugTest {
insertIndex = index;
}
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.core.IExpressionsListener2#expressionsInserted(org.eclipse.debug.core.model.IExpression[], int)
- */
@Override
public void expressionsInserted(IExpression[] expressions, int index) {
for (int i = 0; i < expressions.length; i++) {
diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/launching/ArgumentParsingTests.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/launching/ArgumentParsingTests.java
index a662ef3a7..a0230f8a6 100644
--- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/launching/ArgumentParsingTests.java
+++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/launching/ArgumentParsingTests.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012, 2013 IBM Corporation and others.
+ * Copyright (c) 2012, 2018 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -114,7 +114,7 @@ public class ArgumentParsingTests extends AbstractDebugTest {
Process process = DebugPlugin.exec(execArgs, null);
BufferedReader procOut = new BufferedReader(new InputStreamReader(process.getInputStream()));
- ArrayList<String> procArgs = new ArrayList<String>();
+ ArrayList<String> procArgs = new ArrayList<>();
String procArg;
while ((procArg = procOut.readLine()) != null) {
procArgs.add(procArg);
diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/launching/DebugFileStore.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/launching/DebugFileStore.java
index 9936e8231..a14b759e6 100644
--- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/launching/DebugFileStore.java
+++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/launching/DebugFileStore.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2013 IBM Corporation and others.
+ * Copyright (c) 2008, 2018 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -42,9 +42,6 @@ public class DebugFileStore extends FileStore {
*/
class DebugOutputStream extends ByteArrayOutputStream {
- /* (non-Javadoc)
- * @see java.io.ByteArrayOutputStream#close()
- */
@Override
public void close() throws IOException {
super.close();
@@ -59,13 +56,10 @@ public class DebugFileStore extends FileStore {
uri = id;
}
- /* (non-Javadoc)
- * @see org.eclipse.core.filesystem.provider.FileStore#childNames(int, org.eclipse.core.runtime.IProgressMonitor)
- */
@Override
public String[] childNames(int options, IProgressMonitor monitor) throws CoreException {
URI[] uris = DebugFileSystem.getDefault().getFileURIs();
- List<String> children = new ArrayList<String>();
+ List<String> children = new ArrayList<>();
IPath me = getPath();
for (int i = 0; i < uris.length; i++) {
URI id = uris[i];
@@ -79,9 +73,6 @@ public class DebugFileStore extends FileStore {
return children.toArray(new String[children.size()]);
}
- /* (non-Javadoc)
- * @see org.eclipse.core.filesystem.provider.FileStore#fetchInfo(int, org.eclipse.core.runtime.IProgressMonitor)
- */
@Override
public IFileInfo fetchInfo(int options, IProgressMonitor monitor) throws CoreException {
byte[] contents = DebugFileSystem.getDefault().getContents(toURI());
@@ -102,9 +93,6 @@ public class DebugFileStore extends FileStore {
return info;
}
- /* (non-Javadoc)
- * @see org.eclipse.core.filesystem.provider.FileStore#getChild(java.lang.String)
- */
@Override
public IFileStore getChild(String name) {
try {
@@ -114,9 +102,6 @@ public class DebugFileStore extends FileStore {
return null;
}
- /* (non-Javadoc)
- * @see org.eclipse.core.filesystem.provider.FileStore#getName()
- */
@Override
public String getName() {
IPath path = getPath();
@@ -126,18 +111,12 @@ public class DebugFileStore extends FileStore {
return ""; //$NON-NLS-1$
}
- /**
- * @return
- */
private IPath getPath() {
URI me = toURI();
IPath path = new Path(me.getPath());
return path;
}
- /* (non-Javadoc)
- * @see org.eclipse.core.filesystem.provider.FileStore#getParent()
- */
@Override
public IFileStore getParent() {
IPath path = getPath();
@@ -150,9 +129,6 @@ public class DebugFileStore extends FileStore {
return null;
}
- /* (non-Javadoc)
- * @see org.eclipse.core.filesystem.provider.FileStore#openInputStream(int, org.eclipse.core.runtime.IProgressMonitor)
- */
@Override
public InputStream openInputStream(int options, IProgressMonitor monitor) throws CoreException {
byte[] contents = DebugFileSystem.getDefault().getContents(toURI());
@@ -163,17 +139,11 @@ public class DebugFileStore extends FileStore {
"File does not exist: " + toURI())); //$NON-NLS-1$
}
- /* (non-Javadoc)
- * @see org.eclipse.core.filesystem.provider.FileStore#openOutputStream(int, org.eclipse.core.runtime.IProgressMonitor)
- */
@Override
public OutputStream openOutputStream(int options, IProgressMonitor monitor) throws CoreException {
return new DebugOutputStream();
}
- /* (non-Javadoc)
- * @see org.eclipse.core.filesystem.provider.FileStore#mkdir(int, org.eclipse.core.runtime.IProgressMonitor)
- */
@Override
public IFileStore mkdir(int options, IProgressMonitor monitor) throws CoreException {
IFileInfo info = fetchInfo();
@@ -198,17 +168,11 @@ public class DebugFileStore extends FileStore {
return this;
}
- /* (non-Javadoc)
- * @see org.eclipse.core.filesystem.provider.FileStore#toURI()
- */
@Override
public URI toURI() {
return uri;
}
- /* (non-Javadoc)
- * @see org.eclipse.core.filesystem.provider.FileStore#delete(int, org.eclipse.core.runtime.IProgressMonitor)
- */
@Override
public void delete(int options, IProgressMonitor monitor) throws CoreException {
DebugFileSystem.getDefault().delete(toURI());
diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/launching/DebugFileSystem.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/launching/DebugFileSystem.java
index fbe579814..b0ad81daa 100644
--- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/launching/DebugFileSystem.java
+++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/launching/DebugFileSystem.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2013 IBM Corporation and others.
+ * Copyright (c) 2008, 2018 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -34,7 +34,7 @@ public class DebugFileSystem extends FileSystem {
/**
* Keys URIs to file stores for existing files
*/
- private final Map<URI, byte[]> files = new HashMap<URI, byte[]>();
+ private final Map<URI, byte[]> files = new HashMap<>();
/**
* Constructs the singleton
@@ -56,25 +56,16 @@ public class DebugFileSystem extends FileSystem {
return system;
}
- /* (non-Javadoc)
- * @see org.eclipse.core.filesystem.provider.FileSystem#getStore(java.net.URI)
- */
@Override
public IFileStore getStore(URI uri) {
return new DebugFileStore(uri);
}
- /* (non-Javadoc)
- * @see org.eclipse.core.filesystem.provider.FileSystem#canDelete()
- */
@Override
public boolean canDelete() {
return true;
}
- /* (non-Javadoc)
- * @see org.eclipse.core.filesystem.provider.FileSystem#canWrite()
- */
@Override
public boolean canWrite() {
return true;
diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/launching/LaunchConfigurationTests.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/launching/LaunchConfigurationTests.java
index df3819c7d..3e0490a77 100644
--- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/launching/LaunchConfigurationTests.java
+++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/launching/LaunchConfigurationTests.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2017 IBM Corporation and others.
+ * Copyright (c) 2000, 2018 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -97,29 +97,20 @@ public class LaunchConfigurationTests extends AbstractLaunchTest implements ILau
class Listener implements ILaunchConfigurationListener {
- private final List<ILaunchConfiguration> addedList = new ArrayList<ILaunchConfiguration>();
- private final List<ILaunchConfiguration> removedList = new ArrayList<ILaunchConfiguration>();
- private final List<ILaunchConfiguration> changedList = new ArrayList<ILaunchConfiguration>();
+ private final List<ILaunchConfiguration> addedList = new ArrayList<>();
+ private final List<ILaunchConfiguration> removedList = new ArrayList<>();
+ private final List<ILaunchConfiguration> changedList = new ArrayList<>();
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.ILaunchConfigurationListener#launchConfigurationAdded(org.eclipse.debug.core.ILaunchConfiguration)
- */
@Override
public void launchConfigurationAdded(ILaunchConfiguration configuration) {
addedList.add(configuration);
}
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.ILaunchConfigurationListener#launchConfigurationChanged(org.eclipse.debug.core.ILaunchConfiguration)
- */
@Override
public void launchConfigurationChanged(ILaunchConfiguration configuration) {
changedList.add(configuration);
}
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.ILaunchConfigurationListener#launchConfigurationRemoved(org.eclipse.debug.core.ILaunchConfiguration)
- */
@Override
public void launchConfigurationRemoved(ILaunchConfiguration configuration) {
removedList.add(configuration);
@@ -402,7 +393,7 @@ public class LaunchConfigurationTests extends AbstractLaunchTest implements ILau
*/
public void testSetAttributes() throws CoreException {
ILaunchConfigurationWorkingCopy wc = newConfiguration(null, "config1"); //$NON-NLS-1$
- Map<String, Object> map = new HashMap<String, Object>();
+ Map<String, Object> map = new HashMap<>();
map.put("ATTR1", "ONE"); //$NON-NLS-1$ //$NON-NLS-2$
map.put("ATTR2", "TWO"); //$NON-NLS-1$ //$NON-NLS-2$
wc.setAttributes(map);
@@ -1163,7 +1154,7 @@ public class LaunchConfigurationTests extends AbstractLaunchTest implements ILau
// should be 5 added
List<?> added = listener.getAdded();
assertEquals("Should be 5 added configs", 5, added.size()); //$NON-NLS-1$
- Set<String> names = new HashSet<String>();
+ Set<String> names = new HashSet<>();
Iterator<?> iterator = added.iterator();
while (iterator.hasNext()) {
ILaunchConfiguration lc = (ILaunchConfiguration) iterator.next();
@@ -1220,7 +1211,7 @@ public class LaunchConfigurationTests extends AbstractLaunchTest implements ILau
*/
public void testMapAttributePersistence() throws CoreException, IOException {
ILaunchConfigurationWorkingCopy c1 = newEmptyConfiguration(getProject(), "testMapAttributes1"); //$NON-NLS-1$
- HashMap<String, String> map = new HashMap<String, String>();
+ HashMap<String, String> map = new HashMap<>();
map.put("Z", "z-value"); //$NON-NLS-1$ //$NON-NLS-2$
map.put("Y", "y-value"); //$NON-NLS-1$ //$NON-NLS-2$
map.put("X", "x-value"); //$NON-NLS-1$ //$NON-NLS-2$
@@ -1251,7 +1242,7 @@ public class LaunchConfigurationTests extends AbstractLaunchTest implements ILau
c1.doSave();
ILaunchConfigurationWorkingCopy c2 = newEmptyConfiguration(getProject(), "testMapAttributes2"); //$NON-NLS-1$
- map = new HashMap<String, String>();
+ map = new HashMap<>();
map.put("A", "a-value"); //$NON-NLS-1$ //$NON-NLS-2$
map.put("Z", "z-value"); //$NON-NLS-1$ //$NON-NLS-2$
map.put("B", "b-value"); //$NON-NLS-1$ //$NON-NLS-2$
@@ -1298,7 +1289,7 @@ public class LaunchConfigurationTests extends AbstractLaunchTest implements ILau
*/
public void testSetAttributePersistence() throws CoreException, IOException {
ILaunchConfigurationWorkingCopy c1 = newEmptyConfiguration(getProject(), "testSetAttributes1"); //$NON-NLS-1$
- Set<String> set = new HashSet<String>();
+ Set<String> set = new HashSet<>();
set.add("z-value"); //$NON-NLS-1$
set.add("y-value"); //$NON-NLS-1$
set.add("x-value"); //$NON-NLS-1$
@@ -1329,7 +1320,7 @@ public class LaunchConfigurationTests extends AbstractLaunchTest implements ILau
c1.doSave();
ILaunchConfigurationWorkingCopy c2 = newEmptyConfiguration(getProject(), "testSetAttributes2"); //$NON-NLS-1$
- set = new HashSet<String>();
+ set = new HashSet<>();
set.add("a-value"); //$NON-NLS-1$
set.add("z-value"); //$NON-NLS-1$
set.add("b-value"); //$NON-NLS-1$
@@ -1583,8 +1574,8 @@ public class LaunchConfigurationTests extends AbstractLaunchTest implements ILau
List/* <String> */<String> types = null;
int size = resources.length;
if(resources != null && size > 0) {
- paths = new ArrayList<String>(size);
- types = new ArrayList<String>(size);
+ paths = new ArrayList<>(size);
+ types = new ArrayList<>(size);
for(int i = 0; i < size; i++) {
paths.add(resources[i].path);
types.add(resources[i].type.toString());
@@ -1636,7 +1627,7 @@ public class LaunchConfigurationTests extends AbstractLaunchTest implements ILau
ILaunchConfiguration prototype = wc.doSave();
assertTrue("Should be a prototype", prototype.isPrototype()); //$NON-NLS-1$
ILaunchConfiguration[] prototypes = wc.getType().getPrototypes();
- List<ILaunchConfiguration> list = new ArrayList<ILaunchConfiguration>();
+ List<ILaunchConfiguration> list = new ArrayList<>();
for (int i = 0; i < prototypes.length; i++) {
list.add(prototypes[i]);
}
@@ -1663,7 +1654,7 @@ public class LaunchConfigurationTests extends AbstractLaunchTest implements ILau
ILaunchConfiguration s2 = r2.doSave();
Iterable<ILaunchConfiguration> children = prototype.getPrototypeChildren();
- List<ILaunchConfiguration> list = new ArrayList<ILaunchConfiguration>();
+ List<ILaunchConfiguration> list = new ArrayList<>();
for (ILaunchConfiguration child : children) {
list.add(child);
}
diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/launching/LaunchFavoriteTests.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/launching/LaunchFavoriteTests.java
index 6ddbf214e..e9886ccbb 100644
--- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/launching/LaunchFavoriteTests.java
+++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/launching/LaunchFavoriteTests.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2013 IBM Corporation and others.
+ * Copyright (c) 2010, 2018 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -57,9 +57,6 @@ public class LaunchFavoriteTests extends AbstractLaunchTest {
return getLaunchConfigurationManager().getLaunchHistory(IDebugUIConstants.ID_DEBUG_LAUNCH_GROUP);
}
- /* (non-Javadoc)
- * @see junit.framework.TestCase#setUp()
- */
@Override
protected void setUp() throws Exception {
super.setUp();
@@ -69,9 +66,6 @@ public class LaunchFavoriteTests extends AbstractLaunchTest {
fConfig = getLaunchConfiguration(getName());
}
- /* (non-Javadoc)
- * @see junit.framework.TestCase#tearDown()
- */
@Override
protected void tearDown() throws Exception {
// delete the configuration used during this test
@@ -104,7 +98,7 @@ public class LaunchFavoriteTests extends AbstractLaunchTest {
ILaunchConfigurationWorkingCopy wc = getWorkingCopy(config);
List<String> list = config.getAttribute(IDebugUIConstants.ATTR_FAVORITE_GROUPS, (List<String>) null);
if (list == null) {
- list = new ArrayList<String>();
+ list = new ArrayList<>();
}
list.add(groupId);
wc.setAttribute(IDebugUIConstants.ATTR_FAVORITE_GROUPS, list);
diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/ContentTests.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/ContentTests.java
index aef5d9fc8..8a85dd6c4 100644
--- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/ContentTests.java
+++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/ContentTests.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2015 Wind River Systems and others.
+ * Copyright (c) 2009, 2018 Wind River Systems and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -290,7 +290,7 @@ abstract public class ContentTests extends AbstractViewerModelTest implements IT
}
private boolean areCapturedChildrenUpdatesComplete(List<IViewerUpdate> capturedUpdates, int childCount) {
- List<Integer> expectedChildren = new ArrayList<Integer>();
+ List<Integer> expectedChildren = new ArrayList<>();
for (int i = 0; i < childCount; i++) {
expectedChildren.add(Integer.valueOf(i));
}
diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/PopupTests.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/PopupTests.java
index 4ad73eba1..f1c0a97ae 100644
--- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/PopupTests.java
+++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/PopupTests.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2013 Wind River Systems and others.
+ * Copyright (c) 2009, 2018 Wind River Systems and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -195,10 +195,10 @@ abstract public class PopupTests extends AbstractViewerModelTest implements ITes
}
private boolean areTreeSelectionsEqual(ITreeSelection sel1, ITreeSelection sel2) {
- Set<TreePath> sel1Set = new HashSet<TreePath>();
+ Set<TreePath> sel1Set = new HashSet<>();
sel1Set.addAll( Arrays.asList(sel1.getPaths()) );
- Set<TreePath> sel2Set = new HashSet<TreePath>();
+ Set<TreePath> sel2Set = new HashSet<>();
sel2Set.addAll( Arrays.asList(sel2.getPaths()) );
return sel1Set.equals(sel2Set);
diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/SelectionTests.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/SelectionTests.java
index 9d0488400..56d35dd48 100644
--- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/SelectionTests.java
+++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/SelectionTests.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2013 Wind River Systems and others.
+ * Copyright (c) 2009, 2018 Wind River Systems and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -40,7 +40,7 @@ abstract public class SelectionTests extends AbstractViewerModelTest implements
}
private static class SelectionListener implements ISelectionChangedListener {
- private final List<SelectionChangedEvent> fEvents = new ArrayList<SelectionChangedEvent>(1);
+ private final List<SelectionChangedEvent> fEvents = new ArrayList<>(1);
@Override
public void selectionChanged(SelectionChangedEvent event) {
diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/StateTests.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/StateTests.java
index 9e5437ee4..8583605a5 100644
--- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/StateTests.java
+++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/StateTests.java
@@ -162,10 +162,10 @@ abstract public class StateTests extends AbstractViewerModelTest implements ITes
}
static boolean areTreeSelectionsEqual(ITreeSelection sel1, ITreeSelection sel2) {
- Set<TreePath> sel1Set = new HashSet<TreePath>();
+ Set<TreePath> sel1Set = new HashSet<>();
sel1Set.addAll( Arrays.asList(sel1.getPaths()) );
- Set<TreePath> sel2Set = new HashSet<TreePath>();
+ Set<TreePath> sel2Set = new HashSet<>();
sel2Set.addAll( Arrays.asList(sel2.getPaths()) );
return sel1Set.equals(sel2Set);
diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/TestModel.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/TestModel.java
index 7ec70948f..fedfbc9fe 100644
--- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/TestModel.java
+++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/TestModel.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2015 Wind River Systems and others.
+ * Copyright (c) 2009, 2018 Wind River Systems and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -175,7 +175,7 @@ public class TestModel implements IElementContentProvider, IElementLabelProvider
private IModelSelectionPolicy fModelSelectionPolicy;
private boolean fQueueingUpdates = false;
private boolean fDelayUpdates = false;
- private List<IViewerUpdate> fQueuedUpdates = new LinkedList<IViewerUpdate>();
+ private List<IViewerUpdate> fQueuedUpdates = new LinkedList<>();
/**
* Constructor private. Use static factory methods instead.
@@ -241,7 +241,7 @@ public class TestModel implements IElementContentProvider, IElementLabelProvider
}
public void processQueuedUpdates() {
- List<IViewerUpdate> updates = new ArrayList<IViewerUpdate>(fQueuedUpdates);
+ List<IViewerUpdate> updates = new ArrayList<>(fQueuedUpdates);
fQueuedUpdates.clear();
for (int i = 0; i < updates.size(); i++) {
processUpdate(updates.get(i));
diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/TestModelUpdatesListener.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/TestModelUpdatesListener.java
index 4c570ad22..913929067 100644
--- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/TestModelUpdatesListener.java
+++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/TestModelUpdatesListener.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2016 Wind River Systems and others.
+ * Copyright (c) 2009, 2018 Wind River Systems and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -54,30 +54,30 @@ public class TestModelUpdatesListener implements IViewerUpdateListener, ILabelUp
private boolean fFailOnRedundantUpdates;
private boolean fFailOnRedundantLabelUpdates;
- private Set<IViewerUpdate> fRedundantUpdates = new HashSet<IViewerUpdate>();
- private Set<ILabelUpdate> fRedundantLabelUpdates = new HashSet<ILabelUpdate>();
- private Set<TreePath> fRedundantHasChildrenUpdateExceptions = new HashSet<TreePath>();
- private Set<TreePath> fRedundantChildCountUpdateExceptions = new HashSet<TreePath>();
- private Set<TreePath> fRedundantChildrenUpdateExceptions = new HashSet<TreePath>();
- private Set<TreePath> fRedundantLabelUpdateExceptions = new HashSet<TreePath>();
+ private Set<IViewerUpdate> fRedundantUpdates = new HashSet<>();
+ private Set<ILabelUpdate> fRedundantLabelUpdates = new HashSet<>();
+ private Set<TreePath> fRedundantHasChildrenUpdateExceptions = new HashSet<>();
+ private Set<TreePath> fRedundantChildCountUpdateExceptions = new HashSet<>();
+ private Set<TreePath> fRedundantChildrenUpdateExceptions = new HashSet<>();
+ private Set<TreePath> fRedundantLabelUpdateExceptions = new HashSet<>();
private boolean fFailOnMultipleModelUpdateSequences;
private boolean fFailOnMultipleLabelUpdateSequences;
- private Set<TreePath> fHasChildrenUpdatesScheduled = new HashSet<TreePath>();
- private Set<IViewerUpdate> fHasChildrenUpdatesRunning = new HashSet<IViewerUpdate>();
- private Set<IViewerUpdate> fHasChildrenUpdatesCompleted = new HashSet<IViewerUpdate>();
- private Map<TreePath, Set<Integer>> fChildrenUpdatesScheduled = new HashMap<TreePath, Set<Integer>>();
- private Set<IViewerUpdate> fChildrenUpdatesRunning = new HashSet<IViewerUpdate>();
- private Set<IViewerUpdate> fChildrenUpdatesCompleted = new HashSet<IViewerUpdate>();
- private Set<TreePath> fChildCountUpdatesScheduled = new HashSet<TreePath>();
- private Set<IViewerUpdate> fChildCountUpdatesRunning = new HashSet<IViewerUpdate>();
- private Set<IViewerUpdate> fChildCountUpdatesCompleted = new HashSet<IViewerUpdate>();
- private Set<TreePath> fLabelUpdates = new HashSet<TreePath>();
- private Set<ILabelUpdate> fLabelUpdatesRunning = new HashSet<ILabelUpdate>();
- private Set<ILabelUpdate> fLabelUpdatesCompleted = new HashSet<ILabelUpdate>();
- private Set<TestModel> fProxyModels = new HashSet<TestModel>();
- private Set<TreePath> fStateUpdates = new HashSet<TreePath>();
+ private Set<TreePath> fHasChildrenUpdatesScheduled = new HashSet<>();
+ private Set<IViewerUpdate> fHasChildrenUpdatesRunning = new HashSet<>();
+ private Set<IViewerUpdate> fHasChildrenUpdatesCompleted = new HashSet<>();
+ private Map<TreePath, Set<Integer>> fChildrenUpdatesScheduled = new HashMap<>();
+ private Set<IViewerUpdate> fChildrenUpdatesRunning = new HashSet<>();
+ private Set<IViewerUpdate> fChildrenUpdatesCompleted = new HashSet<>();
+ private Set<TreePath> fChildCountUpdatesScheduled = new HashSet<>();
+ private Set<IViewerUpdate> fChildCountUpdatesRunning = new HashSet<>();
+ private Set<IViewerUpdate> fChildCountUpdatesCompleted = new HashSet<>();
+ private Set<TreePath> fLabelUpdates = new HashSet<>();
+ private Set<ILabelUpdate> fLabelUpdatesRunning = new HashSet<>();
+ private Set<ILabelUpdate> fLabelUpdatesCompleted = new HashSet<>();
+ private Set<TestModel> fProxyModels = new HashSet<>();
+ private Set<TreePath> fStateUpdates = new HashSet<>();
private int fViewerUpdatesStarted = 0;
private int fViewerUpdatesComplete = 0;
private int fViewerUpdatesStartedAtReset;
@@ -260,7 +260,7 @@ public class TestModelUpdatesListener implements IViewerUpdateListener, ILabelUp
public void addChildreUpdate(TreePath path, int index) {
Set<Integer> childrenIndexes = fChildrenUpdatesScheduled.get(path);
if (childrenIndexes == null) {
- childrenIndexes = new TreeSet<Integer>();
+ childrenIndexes = new TreeSet<>();
fChildrenUpdatesScheduled.put(path, childrenIndexes);
}
childrenIndexes.add(Integer.valueOf(index));
@@ -352,7 +352,7 @@ public class TestModelUpdatesListener implements IViewerUpdateListener, ILabelUp
* @return corresponding tree path
*/
private TreePath getViewerTreePath(IModelDelta node) {
- ArrayList<Object> list = new ArrayList<Object>();
+ ArrayList<Object> list = new ArrayList<>();
IModelDelta parentDelta = node.getParentDelta();
while (parentDelta != null) {
list.add(0, node.getElement());
@@ -404,7 +404,7 @@ public class TestModelUpdatesListener implements IViewerUpdateListener, ILabelUp
fChildCountUpdatesScheduled.add(path);
}
if ((flags & CHILDREN_UPDATES) != 0) {
- Set<Integer> childrenIndexes = new HashSet<Integer>();
+ Set<Integer> childrenIndexes = new HashSet<>();
for (int i = 0; i < children.length; i++) {
if (!isFiltered(children[i], filters)) {
childrenIndexes.add(Integer.valueOf(i));
diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/TreeModelViewerAutopopulateAgent.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/TreeModelViewerAutopopulateAgent.java
index 198ea9bc4..11e17d16b 100644
--- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/TreeModelViewerAutopopulateAgent.java
+++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/TreeModelViewerAutopopulateAgent.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2013 Wind River Systems and others.
+ * Copyright (c) 2009, 2018 Wind River Systems and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -24,9 +24,6 @@ import org.eclipse.swt.widgets.Tree;
import org.eclipse.swt.widgets.TreeItem;
import org.eclipse.swt.widgets.Widget;
-/**
- *
- */
public class TreeModelViewerAutopopulateAgent implements IViewerUpdateListener {
private TreeModelViewer fViewer;
@@ -81,7 +78,7 @@ public class TreeModelViewerAutopopulateAgent implements IViewerUpdateListener {
private TreePath getTreePath(Widget w) {
if (w instanceof TreeItem) {
TreeItem item = (TreeItem)w;
- LinkedList<Object> segments = new LinkedList<Object>();
+ LinkedList<Object> segments = new LinkedList<>();
while (item != null) {
Object segment = item.getData();
Assert.isNotNull(segment);
diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/UpdateTests.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/UpdateTests.java
index b66521595..098927317 100644
--- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/UpdateTests.java
+++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/UpdateTests.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2013 Wind River Systems and others.
+ * Copyright (c) 2009, 2018 Wind River Systems and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -428,7 +428,7 @@ abstract public class UpdateTests extends AbstractViewerModelTest implements ITe
}
- ArrayList<IViewerUpdate> updates = new ArrayList<IViewerUpdate>(model.getQueuedUpdates());
+ ArrayList<IViewerUpdate> updates = new ArrayList<>(model.getQueuedUpdates());
model.getQueuedUpdates().clear();
for (int i = updates.size() - 1; i >= 0; i--) {
model.processUpdate(updates.get(i));
@@ -518,7 +518,7 @@ abstract public class UpdateTests extends AbstractViewerModelTest implements ITe
}
- ArrayList<IViewerUpdate> updates = new ArrayList<IViewerUpdate>(model.getQueuedUpdates());
+ ArrayList<IViewerUpdate> updates = new ArrayList<>(model.getQueuedUpdates());
model.getQueuedUpdates().clear();
for (int i = updates.size() - 1; i >= 0; i--) {
model.processUpdate(updates.get(i));
@@ -638,7 +638,7 @@ abstract public class UpdateTests extends AbstractViewerModelTest implements ITe
}
private void completeQueuedUpdatesOfType(TestModel model, Class<?> updateClass) {
- List<IViewerUpdate> updatesToComplete = new LinkedList<IViewerUpdate>();
+ List<IViewerUpdate> updatesToComplete = new LinkedList<>();
for (Iterator<IViewerUpdate> itr = model.getQueuedUpdates().iterator(); itr.hasNext();) {
IViewerUpdate update = itr.next();

Back to the top