diff options
Diffstat (limited to 'org.eclipse.debug.tests/src/org/eclipse/debug/tests/launching')
5 files changed, 22 insertions, 82 deletions
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); |