diff options
29 files changed, 199 insertions, 875 deletions
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/DebugPlugin.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/DebugPlugin.java index fd39a0972..6b119b816 100644 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/DebugPlugin.java +++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/DebugPlugin.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2016 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 @@ -397,7 +397,7 @@ public class DebugPlugin extends Plugin { * * @since 3.1 */ - private List<Object> fEventQueue = new ArrayList<Object>(); + private List<Object> fEventQueue = new ArrayList<>(); /** * Job to fire events to listeners. @@ -423,9 +423,7 @@ public class DebugPlugin extends Plugin { setPriority(Job.INTERACTIVE); setSystem(true); } - /* (non-Javadoc) - * @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor) - */ + @Override protected IStatus run(IProgressMonitor monitor) { @@ -445,16 +443,11 @@ public class DebugPlugin extends Plugin { return Status.OK_STATUS; } - /* (non-Javadoc) - * @see org.eclipse.core.runtime.jobs.Job#shouldRun() - */ @Override public boolean shouldRun() { return shouldSchedule(); } - /* (non-Javadoc) - * @see org.eclipse.core.internal.jobs.InternalJob#shouldSchedule() - */ + @Override public boolean shouldSchedule() { return !(isShuttingDown() || fEventListeners.isEmpty()); @@ -679,9 +672,6 @@ public class DebugPlugin extends Plugin { } } - /* (non-Javadoc) - * @see org.eclipse.core.runtime.Plugin#start(org.osgi.framework.BundleContext) - */ @Override public void start(BundleContext context) throws Exception { super.start(context); @@ -1001,7 +991,7 @@ public class DebugPlugin extends Plugin { private void initializeStatusHandlers() { IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(DebugPlugin.PI_DEBUG_CORE, EXTENSION_POINT_STATUS_HANDLERS); IConfigurationElement[] infos= extensionPoint.getConfigurationElements(); - fStatusHandlers = new HashMap<StatusHandlerKey, IConfigurationElement>(infos.length); + fStatusHandlers = new HashMap<>(infos.length); for (int i= 0; i < infos.length; i++) { IConfigurationElement configurationElement = infos[i]; String id = configurationElement.getAttribute("plugin"); //$NON-NLS-1$ @@ -1029,7 +1019,7 @@ public class DebugPlugin extends Plugin { private void initializeProcessFactories() { IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(DebugPlugin.PI_DEBUG_CORE, EXTENSION_POINT_PROCESS_FACTORIES); IConfigurationElement[] infos= extensionPoint.getConfigurationElements(); - fProcessFactories = new HashMap<String, IConfigurationElement>(infos.length); + fProcessFactories = new HashMap<>(infos.length); for (int i= 0; i < infos.length; i++) { IConfigurationElement configurationElement = infos[i]; String id = configurationElement.getAttribute("id"); //$NON-NLS-1$ @@ -1093,18 +1083,12 @@ public class DebugPlugin extends Plugin { } - /* (non-Javadoc) - * @see org.eclipse.core.runtime.ISafeRunnable#handleException(java.lang.Throwable) - */ @Override public void handleException(Throwable exception) { IStatus status = new Status(IStatus.ERROR, getUniqueIdentifier(), ERROR, DebugCoreMessages.DebugPlugin_6, exception); log(status); } - /* (non-Javadoc) - * @see org.eclipse.core.runtime.ISafeRunnable#run() - */ @Override public void run() throws Exception { fRunnable.run(); @@ -1123,9 +1107,6 @@ public class DebugPlugin extends Plugin { private IDebugEventFilter fFilter; private int fMode; - /** - * @see org.eclipse.core.runtime.ISafeRunnable#handleException(java.lang.Throwable) - */ @Override public void handleException(Throwable exception) { switch (fMode) { @@ -1142,9 +1123,6 @@ public class DebugPlugin extends Plugin { } } - /** - * @see org.eclipse.core.runtime.ISafeRunnable#run() - */ @Override public void run() throws Exception { switch (fMode) { @@ -1281,7 +1259,7 @@ public class DebugPlugin extends Plugin { private static String[] parseArgumentsWindows(String args, boolean split) { // see http://msdn.microsoft.com/en-us/library/a1y7w461.aspx - List<String> result = new ArrayList<String>(); + List<String> result = new ArrayList<>(); final int DEFAULT= 0; final int ARG= 1; @@ -1391,7 +1369,7 @@ public class DebugPlugin extends Plugin { private static String[] parseArgumentsImpl(String args, boolean split) { // man sh, see topic QUOTING - List<String> result = new ArrayList<String>(); + List<String> result = new ArrayList<>(); final int DEFAULT= 0; final int ARG= 1; diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/Launch.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/Launch.java index 3fe0b3ade..084042384 100644 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/Launch.java +++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/Launch.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2016 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 @@ -58,7 +58,7 @@ public class Launch extends PlatformObject implements ILaunch, IDisconnect, ILau * in this collection), or empty if * there are no debug targets. */ - private List<IDebugTarget> fTargets = new ArrayList<IDebugTarget>(); + private List<IDebugTarget> fTargets = new ArrayList<>(); /** * The configuration that was launched, or null. @@ -69,7 +69,7 @@ public class Launch extends PlatformObject implements ILaunch, IDisconnect, ILau * The system processes associated with * this launch, or empty if none. */ - private List<IProcess> fProcesses = new ArrayList<IProcess>(); + private List<IProcess> fProcesses = new ArrayList<>(); /** * The source locator to use in the debug session @@ -157,7 +157,7 @@ public class Launch extends PlatformObject implements ILaunch, IDisconnect, ILau readLock.lock(); ArrayList<Object> children; try { - children = new ArrayList<Object>(getDebugTargets0()); + children = new ArrayList<>(getDebugTargets0()); children.addAll(getProcesses0()); } finally { readLock.unlock(); @@ -321,7 +321,7 @@ public class Launch extends PlatformObject implements ILaunch, IDisconnect, ILau @Override public void setAttribute(String key, String value) { if (fAttributes == null) { - fAttributes = new HashMap<String, String>(5); + fAttributes = new HashMap<>(5); } fAttributes.put(key, value); } diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/RefreshUtil.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/RefreshUtil.java index 06913be28..880bf3a4e 100644 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/RefreshUtil.java +++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/RefreshUtil.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2013 IBM Corporation and others. + * Copyright (c) 2009, 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 @@ -135,8 +135,7 @@ public class RefreshUtil { } lmonitor.worked(1); } - } - finally { + } finally { lmonitor.done(); } if (!status.isOK()) { @@ -161,9 +160,7 @@ public class RefreshUtil { Path path = new Path(pathString); IResource resource = ResourcesPlugin.getWorkspace().getRoot().findMember(path); if (resource == null) { - throw new CoreException(new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), - IStatus.ERROR, MessageFormat.format(DebugCoreMessages.RefreshUtil_1, - new Object[] { pathString }), null)); + throw new CoreException(new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), IStatus.ERROR, MessageFormat.format(DebugCoreMessages.RefreshUtil_1, pathString), null)); } return new IResource[] { resource }; } else if (memento.startsWith("${working_set:")) { //$NON-NLS-1$ @@ -194,7 +191,7 @@ public class RefreshUtil { } } } - throw new CoreException(new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), MessageFormat.format(DebugCoreMessages.RefreshUtil_0, new Object[] { memento }))); + throw new CoreException(new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), MessageFormat.format(DebugCoreMessages.RefreshUtil_0, memento))); } /** @@ -236,7 +233,7 @@ public class RefreshUtil { return null; } - List<IAdaptable> resourcesList = new ArrayList<IAdaptable>(); + List<IAdaptable> resourcesList = new ArrayList<>(); StringReader reader = new StringReader(wsMemento); XMLMemento memento = null; diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/commands/AbstractDebugCommand.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/commands/AbstractDebugCommand.java index 4674482f5..cf4ebdda7 100644 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/commands/AbstractDebugCommand.java +++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/commands/AbstractDebugCommand.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2013 IBM Corporation and others. + * Copyright (c) 2006, 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 @@ -62,9 +62,6 @@ public abstract class AbstractDebugCommand implements IDebugCommandHandler { getJobManager().addJobChangeListener(this); } - /* (non-Javadoc) - * @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor) - */ @Override protected IStatus run(IProgressMonitor monitor) { run = true; @@ -118,9 +115,6 @@ public abstract class AbstractDebugCommand implements IDebugCommandHandler { return Status.OK_STATUS; } - /* (non-Javadoc) - * @see org.eclipse.core.runtime.jobs.Job#belongsTo(java.lang.Object) - */ @Override public boolean belongsTo(Object family) { Object myFamily = getEnabledStateJobFamily(request); @@ -177,21 +171,11 @@ public abstract class AbstractDebugCommand implements IDebugCommandHandler { fObject = lock; } - /* - * (non-Javadoc) - * - * @see org.eclipse.core.runtime.jobs.ISchedulingRule#contains(org.eclipse.core.runtime.jobs.ISchedulingRule) - */ @Override public boolean contains(ISchedulingRule rule) { return rule == this; } - /* - * (non-Javadoc) - * - * @see org.eclipse.core.runtime.jobs.ISchedulingRule#isConflicting(org.eclipse.core.runtime.jobs.ISchedulingRule) - */ @Override public boolean isConflicting(ISchedulingRule rule) { if (rule instanceof SerialPerObjectRule) { @@ -203,9 +187,6 @@ public abstract class AbstractDebugCommand implements IDebugCommandHandler { } - /* (non-Javadoc) - * @see org.eclipse.debug.core.commands.IDebugCommandHandler#execute(org.eclipse.debug.core.commands.IDebugCommandRequest) - */ @Override public boolean execute(final IDebugCommandRequest request) { Job job = new Job(getExecuteTaskName()) { @@ -259,9 +240,6 @@ public abstract class AbstractDebugCommand implements IDebugCommandHandler { return false; } - /* (non-Javadoc) - * @see org.eclipse.debug.core.commands.IDebugCommandHandler#canExecute(org.eclipse.debug.core.commands.IEnabledStateRequest) - */ @Override public void canExecute(final IEnabledStateRequest request) { Job job = new UpdateJob(request); @@ -411,7 +389,7 @@ public abstract class AbstractDebugCommand implements IDebugCommandHandler { if (objects.length == 1) { return objects; } else { - LinkedHashSet<Object> set = new LinkedHashSet<Object>(objects.length); + LinkedHashSet<Object> set = new LinkedHashSet<>(objects.length); for (int i = 0; i < objects.length; i++) { set.add(objects[i]); } diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/LaunchConfigurationDelegate.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/LaunchConfigurationDelegate.java index d44785dd7..90620b33b 100644 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/LaunchConfigurationDelegate.java +++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/LaunchConfigurationDelegate.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2013 IBM Corporation and others. + * Copyright (c) 2004, 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 @@ -106,17 +106,11 @@ public abstract class LaunchConfigurationDelegate implements ILaunchConfiguratio */ protected static final IStatus complileErrorProjectPromptStatus = new Status(IStatus.INFO, DEBUG_CORE, 203, IInternalDebugCoreConstants.EMPTY_STRING, null); - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.ILaunchConfigurationDelegate2#getLaunch(org.eclipse.debug.core.ILaunchConfiguration, java.lang.String) - */ @Override public ILaunch getLaunch(ILaunchConfiguration configuration, String mode) throws CoreException { return null; } - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.ILaunchConfigurationDelegate2#buildForLaunch(org.eclipse.debug.core.ILaunchConfiguration, java.lang.String, org.eclipse.core.runtime.IProgressMonitor) - */ @Override public boolean buildForLaunch(ILaunchConfiguration configuration, String mode, IProgressMonitor monitor) throws CoreException { if (monitor != null) { @@ -163,9 +157,6 @@ public abstract class LaunchConfigurationDelegate implements ILaunchConfiguratio return null; } - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.ILaunchConfigurationDelegate2#finalLaunchCheck(org.eclipse.debug.core.ILaunchConfiguration, java.lang.String, org.eclipse.core.runtime.IProgressMonitor) - */ @Override public boolean finalLaunchCheck(ILaunchConfiguration configuration, String mode, IProgressMonitor monitor) throws CoreException { monitor.beginTask("", 1); //$NON-NLS-1$ @@ -177,7 +168,7 @@ public abstract class LaunchConfigurationDelegate implements ILaunchConfiguratio boolean continueLaunch = true; monitor.subTask(DebugCoreMessages.LaunchConfigurationDelegate_6); - List<IAdaptable> errors = new ArrayList<IAdaptable>(); + List<IAdaptable> errors = new ArrayList<>(); for (int i = 0; i < projects.length; i++) { monitor.subTask(MessageFormat.format(DebugCoreMessages.LaunchConfigurationDelegate_7, new Object[] { projects[i].getName() })); if (existsProblems(projects[i])) { @@ -298,7 +289,7 @@ public abstract class LaunchConfigurationDelegate implements ILaunchConfiguratio * projects */ protected IProject[] computeReferencedBuildOrder(IProject[] baseProjects) throws CoreException { - HashSet<IProject> unorderedProjects = new HashSet<IProject>(); + HashSet<IProject> unorderedProjects = new HashSet<>(); for(int i = 0; i< baseProjects.length; i++) { unorderedProjects.add(baseProjects[i]); addReferencedProjects(baseProjects[i], unorderedProjects); @@ -341,9 +332,9 @@ public abstract class LaunchConfigurationDelegate implements ILaunchConfiguratio protected IProject[] computeBuildOrder(IProject[] projects) { String[] orderedNames = ResourcesPlugin.getWorkspace().getDescription().getBuildOrder(); if (orderedNames != null) { - List<IProject> orderedProjects = new ArrayList<IProject>(projects.length); + List<IProject> orderedProjects = new ArrayList<>(projects.length); //Projects may not be in the build order but should be built if selected - List<IProject> unorderedProjects = new ArrayList<IProject>(projects.length); + List<IProject> unorderedProjects = new ArrayList<>(projects.length); for(int i = 0; i < projects.length; ++i) { unorderedProjects.add(projects[i]); } diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/RuntimeProcess.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/RuntimeProcess.java index df1929382..7ca2420fc 100644 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/RuntimeProcess.java +++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/RuntimeProcess.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2015 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 @@ -18,7 +18,6 @@ import java.util.Map.Entry; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.PlatformObject; import org.eclipse.core.runtime.Status; - import org.eclipse.debug.core.DebugEvent; import org.eclipse.debug.core.DebugException; import org.eclipse.debug.core.DebugPlugin; @@ -321,7 +320,7 @@ public class RuntimeProcess extends PlatformObject implements IProcess { @Override public void setAttribute(String key, String value) { if (fAttributes == null) { - fAttributes = new HashMap<String, String>(5); + fAttributes = new HashMap<>(5); } Object origVal = fAttributes.get(key); if (origVal != null && origVal.equals(value)) { @@ -343,9 +342,6 @@ public class RuntimeProcess extends PlatformObject implements IProcess { return fAttributes.get(key); } - /* (non-Javadoc) - * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class) - */ @SuppressWarnings("unchecked") @Override public <T> T getAdapter(Class<T> adapter) { diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/AbstractSourceLookupDirector.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/AbstractSourceLookupDirector.java index f87794c33..b9571a99f 100644 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/AbstractSourceLookupDirector.java +++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/AbstractSourceLookupDirector.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2013 IBM Corporation and others. + * Copyright (c) 2004, 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 @@ -71,7 +71,7 @@ public abstract class AbstractSourceLookupDirector implements ISourceLookupDirec // source locator type identifier protected String fId; //ISourceLocatorParticipants that are listening for container changes - protected ArrayList<ISourceLookupParticipant> fParticipants = new ArrayList<ISourceLookupParticipant>(); + protected ArrayList<ISourceLookupParticipant> fParticipants = new ArrayList<>(); //list of current source containers protected ISourceContainer[] fSourceContainers = null; //the launch config associated with this director @@ -101,7 +101,7 @@ public abstract class AbstractSourceLookupDirector implements ISourceLookupDirec class SourceLookupQuery implements ISafeRunnable { - private List<Object> fSourceElements = new ArrayList<Object>(); + private List<Object> fSourceElements = new ArrayList<>(); private Object fElement = null; private Throwable fException = null; @@ -109,9 +109,6 @@ public abstract class AbstractSourceLookupDirector implements ISourceLookupDirec fElement = element; } - /* (non-Javadoc) - * @see org.eclipse.core.runtime.ISafeRunnable#handleException(java.lang.Throwable) - */ @Override public void handleException(Throwable exception) { fException = exception; @@ -126,9 +123,6 @@ public abstract class AbstractSourceLookupDirector implements ISourceLookupDirec return fException; } - /* (non-Javadoc) - * @see org.eclipse.core.runtime.ISafeRunnable#run() - */ @Override public void run() throws Exception { MultiStatus multiStatus = null; @@ -204,9 +198,6 @@ public abstract class AbstractSourceLookupDirector implements ISourceLookupDirec fId = id; } - /* (non-Javadoc) - * @see org.eclipse.debug.core.sourcelookup.IPersistableSourceLocator2#dispose() - */ @Override public synchronized void dispose() { ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager(); @@ -248,7 +239,7 @@ public abstract class AbstractSourceLookupDirector implements ISourceLookupDirec * @return a list of source containers */ private List<ISourceContainer> parseSourceContainers(NodeList list) throws CoreException { - List<ISourceContainer> containers = new ArrayList<ISourceContainer>(); + List<ISourceContainer> containers = new ArrayList<>(); for (int i=0; i < list.getLength(); i++) { if(!(list.item(i).getNodeType() == Node.ELEMENT_NODE)) { continue; @@ -288,9 +279,6 @@ public abstract class AbstractSourceLookupDirector implements ISourceLookupDirec } } - /* (non-Javadoc) - * @see org.eclipse.debug.core.sourcelookup.ISourceLookupDirector#getSourceContainers() - */ @Override public synchronized ISourceContainer[] getSourceContainers() { if (fSourceContainers == null) { @@ -301,17 +289,11 @@ public abstract class AbstractSourceLookupDirector implements ISourceLookupDirec return copy; } - /* (non-Javadoc) - * @see org.eclipse.debug.core.sourcelookup.ISourceLookupDirector#isFindDuplicates() - */ @Override public boolean isFindDuplicates() { return fDuplicates; } - /* (non-Javadoc) - * @see org.eclipse.debug.core.sourcelookup.ISourceLookupDirector#setFindDuplicates(boolean) - */ @Override public void setFindDuplicates(boolean duplicates) { fDuplicates = duplicates; @@ -329,9 +311,6 @@ public abstract class AbstractSourceLookupDirector implements ISourceLookupDirec } } - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfigurationListener#launchConfigurationAdded(org.eclipse.debug.core.ILaunchConfiguration) - */ @Override public void launchConfigurationAdded(ILaunchConfiguration configuration) { ILaunchConfiguration from = DebugPlugin.getDefault().getLaunchManager().getMovedFrom(configuration); @@ -366,9 +345,6 @@ public abstract class AbstractSourceLookupDirector implements ISourceLookupDirec } - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfigurationListener#launchConfigurationRemoved(org.eclipse.debug.core.ILaunchConfiguration) - */ @Override public void launchConfigurationRemoved(ILaunchConfiguration configuration) { if (configuration.equals(getLaunchConfiguration())) { @@ -378,9 +354,6 @@ public abstract class AbstractSourceLookupDirector implements ISourceLookupDirec } } - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IPersistableSourceLocator#getMemento() - */ @Override public synchronized String getMemento() throws CoreException { Document doc = DebugPlugin.newDocument(); @@ -407,9 +380,6 @@ public abstract class AbstractSourceLookupDirector implements ISourceLookupDirec return DebugPlugin.serializeDocument(doc); } - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IPersistableSourceLocator#initializeFromMemento(java.lang.String) - */ @Override public void initializeFromMemento(String memento) throws CoreException { doInitializeFromMemento(memento, true); @@ -573,9 +543,6 @@ public abstract class AbstractSourceLookupDirector implements ISourceLookupDirec return false; } - /* (non-Javadoc) - * @see org.eclipse.debug.core.sourcelookup.IPersistableSourceLocator2#initializeFromMemento(java.lang.String, org.eclipse.debug.core.ILaunchConfiguration) - */ @Override public void initializeFromMemento(String memento, ILaunchConfiguration configuration) throws CoreException { dispose(); @@ -583,9 +550,6 @@ public abstract class AbstractSourceLookupDirector implements ISourceLookupDirec doInitializeFromMemento(memento, false); } - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IPersistableSourceLocator#initializeDefaults(org.eclipse.debug.core.ILaunchConfiguration) - */ @Override public void initializeDefaults(ILaunchConfiguration configuration) throws CoreException { dispose(); @@ -594,9 +558,6 @@ public abstract class AbstractSourceLookupDirector implements ISourceLookupDirec initializeParticipants(); } - /* (non-Javadoc) - * @see org.eclipse.debug.core.sourcelookup.ISourceLookupDirector#getLaunchConfiguration() - */ @Override public ILaunchConfiguration getLaunchConfiguration() { return fConfig; @@ -619,37 +580,26 @@ public abstract class AbstractSourceLookupDirector implements ISourceLookupDirec launchManager.addLaunchListener(this); } - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchListener#launchAdded(org.eclipse.debug.core.ILaunch) - */ @Override public void launchAdded(ILaunch launch) { } - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchListener#launchChanged(org.eclipse.debug.core.ILaunch) - */ + @Override public void launchChanged(ILaunch launch) { } - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchListener#launchRemoved(org.eclipse.debug.core.ILaunch) - */ + @Override public void launchRemoved(ILaunch launch) { if (this.equals(launch.getSourceLocator())) { dispose(); } } - /* (non-Javadoc) - * @see org.eclipse.debug.core.sourcelookup.ISourceLookupDirector#getParticipants() - */ + @Override public synchronized ISourceLookupParticipant[] getParticipants() { return fParticipants.toArray(new ISourceLookupParticipant[fParticipants.size()]); } - /* (non-Javadoc) - * @see org.eclipse.debug.core.sourcelookup.ISourceLookupDirector#supportsSourceContainerType(org.eclipse.debug.core.sourcelookup.ISourceContainerType) - */ + @Override public boolean supportsSourceContainerType(ISourceContainerType type) { return true; @@ -665,7 +615,7 @@ public abstract class AbstractSourceLookupDirector implements ISourceLookupDirec */ protected void cacheResolvedElement(List<Object> duplicates, Object sourceElement) { if (fResolvedElements == null) { - fResolvedElements = new HashMap<Object, Object>(10); + fResolvedElements = new HashMap<>(10); } for (Object dup : duplicates) { fResolvedElements.put(dup, sourceElement); @@ -699,9 +649,6 @@ public abstract class AbstractSourceLookupDirector implements ISourceLookupDirec } } - /* (non-Javadoc) - * @see org.eclipse.debug.core.sourcelookup.ISourceLookupDirector#clearSourceElements(java.lang.Object) - */ @Override public void clearSourceElements(Object element) { List<Object> list = doSourceLookup(element); @@ -711,9 +658,7 @@ public abstract class AbstractSourceLookupDirector implements ISourceLookupDirec } } } - /* (non-Javadoc) - * @see org.eclipse.debug.core.sourcelookup.ISourceLookupDirector#addParticipants(org.eclipse.debug.core.sourcelookup.ISourceLookupParticipant[]) - */ + @Override public void addParticipants(ISourceLookupParticipant[] participants) { for (int i = 0; i < participants.length; i++) { @@ -722,9 +667,7 @@ public abstract class AbstractSourceLookupDirector implements ISourceLookupDirec participant.sourceContainersChanged(this); } } - /* (non-Javadoc) - * @see org.eclipse.debug.core.sourcelookup.ISourceLookupDirector#removeParticipants(org.eclipse.debug.core.sourcelookup.ISourceLookupParticipant[]) - */ + @Override public void removeParticipants(ISourceLookupParticipant[] participants) { for (int i = 0; i < participants.length; i++) { @@ -732,16 +675,11 @@ public abstract class AbstractSourceLookupDirector implements ISourceLookupDirec } } - /* (non-Javadoc) - * @see org.eclipse.debug.core.sourcelookup.ISourceLookupDirector#getId() - */ @Override public String getId() { return fId; } - /* (non-Javadoc) - * @see org.eclipse.debug.core.sourcelookup.ISourceLookupDirector#getSourcePathComputer() - */ + @Override public ISourcePathComputer getSourcePathComputer() { if (fComputer == null && getLaunchConfiguration() != null) { @@ -752,16 +690,12 @@ public abstract class AbstractSourceLookupDirector implements ISourceLookupDirec } return fComputer; } - /* (non-Javadoc) - * @see org.eclipse.debug.core.sourcelookup.ISourceLookupDirector#setSourcePathComputer(org.eclipse.debug.core.sourcelookup.ISourcePathComputer) - */ + @Override public void setSourcePathComputer(ISourcePathComputer computer) { fComputer = computer; } - /* (non-Javadoc) - * @see org.eclipse.debug.core.sourcelookup.ISourceLookupDirector#findSourceElements(java.lang.Object) - */ + @Override public Object[] findSourceElements(Object object) throws CoreException { SourceLookupQuery query = new SourceLookupQuery(object); @@ -777,9 +711,7 @@ public abstract class AbstractSourceLookupDirector implements ISourceLookupDirec } return sources.toArray(); } - /* (non-Javadoc) - * @see org.eclipse.debug.core.sourcelookup.ISourceLookupDirector#getSourceElement(java.lang.Object) - */ + @Override public Object getSourceElement(Object element) { List<Object> sources = doSourceLookup(element); diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/AbstractSourceLookupParticipant.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/AbstractSourceLookupParticipant.java index be9876582..6a3e56358 100644 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/AbstractSourceLookupParticipant.java +++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/AbstractSourceLookupParticipant.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2013 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 @@ -33,32 +33,23 @@ public abstract class AbstractSourceLookupParticipant implements ISourceLookupPa protected static final Object[] EMPTY = new Object[0]; - /* (non-Javadoc) - * @see org.eclipse.debug.core.sourcelookup.ISourceLookupParticipant#init(org.eclipse.debug.core.sourcelookup.ISourceLookupDirector) - */ @Override public void init(ISourceLookupDirector director) { fDirector = director; } - /* (non-Javadoc) - * @see org.eclipse.debug.core.sourcelookup.ISourceLookupParticipant#dispose() - */ @Override public void dispose() { fDirector = null; } - /* (non-Javadoc) - * @see org.eclipse.debug.core.sourcelookup.ISourceLookupParticipant#findSourceElements(java.lang.Object) - */ @Override public Object[] findSourceElements(Object object) throws CoreException { List<Object> results = null; CoreException single = null; MultiStatus multiStatus = null; if (isFindDuplicates()) { - results = new ArrayList<Object>(); + results = new ArrayList<>(); } String name = getSourceName(object); if (name != null) { @@ -162,9 +153,6 @@ public abstract class AbstractSourceLookupParticipant implements ISourceLookupPa return new ISourceContainer[0]; } - /* (non-Javadoc) - * @see org.eclipse.debug.core.sourcelookup.ISourceLookupParticipant#sourceContainersChanged(org.eclipse.debug.core.sourcelookup.ISourceLookupDirector) - */ @Override public void sourceContainersChanged(ISourceLookupDirector director) { } diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/CompositeSourceContainer.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/CompositeSourceContainer.java index 4b79ce6bc..3ad6d707e 100644 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/CompositeSourceContainer.java +++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/CompositeSourceContainer.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2013 IBM Corporation and others. + * Copyright (c) 2003, 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 @@ -32,17 +32,11 @@ public abstract class CompositeSourceContainer extends AbstractSourceContainer { private ISourceContainer[] fContainers; - /* (non-Javadoc) - * @see org.eclipse.debug.core.sourcelookup.ISourceContainer#isComposite() - */ @Override public boolean isComposite() { return true; } - /* (non-Javadoc) - * @see org.eclipse.debug.core.sourcelookup.ISourceContainer#findSourceElements(java.lang.String) - */ @Override public Object[] findSourceElements(String name) throws CoreException { return findSourceElements(name, getSourceContainers()); @@ -73,7 +67,7 @@ public abstract class CompositeSourceContainer extends AbstractSourceContainer { CoreException single = null; MultiStatus multiStatus = null; if (isFindDuplicates()) { - results = new ArrayList<Object>(); + results = new ArrayList<>(); } for (int i = 0; i < containers.length; i++) { ISourceContainer container = containers[i]; @@ -124,9 +118,6 @@ public abstract class CompositeSourceContainer extends AbstractSourceContainer { */ protected abstract ISourceContainer[] createSourceContainers() throws CoreException; - /* (non-Javadoc) - * @see org.eclipse.debug.core.sourcelookup.ISourceContainer#getSourceContainers() - */ @Override public synchronized ISourceContainer[] getSourceContainers() throws CoreException { if (fContainers == null) { @@ -139,9 +130,6 @@ public abstract class CompositeSourceContainer extends AbstractSourceContainer { return fContainers; } - /* (non-Javadoc) - * @see org.eclipse.debug.core.sourcelookup.ISourceContainer#dispose() - */ @Override public void dispose() { super.dispose(); diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/ContainerSourceContainer.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/ContainerSourceContainer.java index 97a073951..098dea05a 100644 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/ContainerSourceContainer.java +++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/ContainerSourceContainer.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2013 IBM Corporation and others. + * Copyright (c) 2003, 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 @@ -80,12 +80,9 @@ public abstract class ContainerSourceContainer extends CompositeSourceContainer return fContainer; } - /* (non-Javadoc) - * @see org.eclipse.debug.internal.core.sourcelookup.ISourceContainer#findSourceElements(java.lang.String) - */ @Override public Object[] findSourceElements(String name) throws CoreException { - ArrayList<Object> sources = new ArrayList<Object>(); + ArrayList<Object> sources = new ArrayList<>(); // An IllegalArgumentException is thrown from the "getFile" method // if the path created by appending the file name to the container @@ -146,17 +143,11 @@ public abstract class ContainerSourceContainer extends CompositeSourceContainer return sources.toArray(); } - /* (non-Javadoc) - * @see org.eclipse.debug.internal.core.sourcelookup.ISourceContainer#getName() - */ @Override public String getName() { return getContainer().getName(); } - /* (non-Javadoc) - * @see java.lang.Object#equals(java.lang.Object) - */ @Override public boolean equals(Object obj) { if (obj != null && obj instanceof ContainerSourceContainer) { @@ -166,30 +157,21 @@ public abstract class ContainerSourceContainer extends CompositeSourceContainer return false; } - /* (non-Javadoc) - * @see java.lang.Object#hashCode() - */ @Override public int hashCode() { return getContainer().hashCode(); } - /* (non-Javadoc) - * @see org.eclipse.debug.internal.core.sourcelookup.ISourceContainer#isComposite() - */ @Override public boolean isComposite() { return fSubfolders; } - /* (non-Javadoc) - * @see org.eclipse.debug.internal.core.sourcelookup.containers.CompositeSourceContainer#createSourceContainers() - */ @Override protected ISourceContainer[] createSourceContainers() throws CoreException { if(fSubfolders) { IResource[] resources = getContainer().members(); - List<ISourceContainer> list = new ArrayList<ISourceContainer>(resources.length); + List<ISourceContainer> list = new ArrayList<>(resources.length); for (int i = 0; i < resources.length; i++) { IResource resource = resources[i]; if (resource.getType() == IResource.FOLDER) { diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/DirectorySourceContainer.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/DirectorySourceContainer.java index 3a7689df2..480ccaad7 100644 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/DirectorySourceContainer.java +++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/DirectorySourceContainer.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2013 IBM Corporation and others. + * Copyright (c) 2003, 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 @@ -68,9 +68,6 @@ public class DirectorySourceContainer extends CompositeSourceContainer { fSubfolders = subfolders; } - /* (non-Javadoc) - * @see org.eclipse.debug.core.sourcelookup.ISourceContainer#getName() - */ @Override public String getName() { return fDirectory.getName(); @@ -87,20 +84,14 @@ public class DirectorySourceContainer extends CompositeSourceContainer { return fDirectory; } - /* (non-Javadoc) - * @see org.eclipse.debug.core.sourcelookup.ISourceContainer#getType() - */ @Override public ISourceContainerType getType() { return getSourceContainerType(TYPE_ID); } - /* (non-Javadoc) - * @see org.eclipse.debug.core.sourcelookup.ISourceContainer#findSourceElements(java.lang.String) - */ @Override public Object[] findSourceElements(String name) throws CoreException { - ArrayList<Object> sources = new ArrayList<Object>(); + ArrayList<Object> sources = new ArrayList<>(); File directory = getDirectory(); File file = new File(directory, name); if (file.exists() && file.isFile()) { @@ -132,17 +123,11 @@ public class DirectorySourceContainer extends CompositeSourceContainer { return sources.toArray(); } - /* (non-Javadoc) - * @see org.eclipse.debug.core.sourcelookup.ISourceContainer#isComposite() - */ @Override public boolean isComposite() { return fSubfolders; } - /* (non-Javadoc) - * @see java.lang.Object#equals(java.lang.Object) - */ @Override public boolean equals(Object obj) { if (obj instanceof DirectorySourceContainer) { @@ -151,23 +136,18 @@ public class DirectorySourceContainer extends CompositeSourceContainer { } return false; } - /* (non-Javadoc) - * @see java.lang.Object#hashCode() - */ + @Override public int hashCode() { return getDirectory().hashCode(); } - /* (non-Javadoc) - * @see org.eclipse.debug.core.sourcelookup.containers.CompositeSourceContainer#createSourceContainers() - */ @Override protected ISourceContainer[] createSourceContainers() throws CoreException { if (isComposite()) { String[] files = fDirectory.list(); if (files != null) { - List<ISourceContainer> dirs = new ArrayList<ISourceContainer>(); + List<ISourceContainer> dirs = new ArrayList<>(); for (int i = 0; i < files.length; i++) { String name = files[i]; File file = new File(getDirectory(), name); diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/ExternalArchiveSourceContainer.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/ExternalArchiveSourceContainer.java index de702e7c5..ff2a56333 100644 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/ExternalArchiveSourceContainer.java +++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/ExternalArchiveSourceContainer.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2013 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 @@ -45,7 +45,7 @@ public class ExternalArchiveSourceContainer extends AbstractSourceContainer { private boolean fDisposed; private boolean fDetectRoots; private Set<String> fPotentialRoots; - private List<String> fRoots = new ArrayList<String>(); + private List<String> fRoots = new ArrayList<>(); private String fArchivePath; /** * Unique identifier for the external archive source container type @@ -115,7 +115,7 @@ public class ExternalArchiveSourceContainer extends AbstractSourceContainer { if (isQualfied || entryName.length() == newname.length() || entryName.charAt(entryName.length() - newname.length() - 1) == '/') { if (isFindDuplicates()) { if (matches == null) { - matches = new ArrayList<ZipEntryStorage>(); + matches = new ArrayList<>(); } matches.add(new ZipEntryStorage(file, entry)); } else { @@ -147,7 +147,7 @@ public class ExternalArchiveSourceContainer extends AbstractSourceContainer { return null; } if (fPotentialRoots == null) { - fPotentialRoots = new HashSet<String>(); + fPotentialRoots = new HashSet<>(); fPotentialRoots.add(""); //$NON-NLS-1$ // all potential roots are the directories try { diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/ProjectSourceContainer.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/ProjectSourceContainer.java index 5682d216c..dd66e5c69 100644 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/ProjectSourceContainer.java +++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/ProjectSourceContainer.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2013 IBM Corporation and others. + * Copyright (c) 2004, 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 @@ -70,25 +70,16 @@ public class ProjectSourceContainer extends ContainerSourceContainer { return (IProject) getContainer(); } - /* (non-Javadoc) - * @see org.eclipse.debug.core.sourcelookup.ISourceContainer#getType() - */ @Override public ISourceContainerType getType() { return getSourceContainerType(TYPE_ID); } - /* (non-Javadoc) - * @see org.eclipse.debug.core.sourcelookup.ISourceContainer#isComposite() - */ @Override public boolean isComposite() { return true; } - /* (non-Javadoc) - * @see org.eclipse.debug.core.sourcelookup.containers.CompositeSourceContainer#createSourceContainers() - */ @Override protected ISourceContainer[] createSourceContainers() throws CoreException { if (getProject().isOpen()) { @@ -96,7 +87,7 @@ public class ProjectSourceContainer extends ContainerSourceContainer { IProject project = getProject(); IProject[] projects = getAllReferencedProjects(project); ISourceContainer[] folders = super.createSourceContainers(); - List<ISourceContainer> all = new ArrayList<ISourceContainer>(folders.length + projects.length); + List<ISourceContainer> all = new ArrayList<>(folders.length + projects.length); for (int i = 0; i < folders.length; i++) { all.add(folders[i]); } @@ -115,7 +106,7 @@ public class ProjectSourceContainer extends ContainerSourceContainer { } private IProject[] getAllReferencedProjects(IProject project) throws CoreException { - Set<IProject> all = new HashSet<IProject>(); + Set<IProject> all = new HashSet<>(); getAllReferencedProjects(all, project); return all.toArray(new IProject[all.size()]); } diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/BreakpointManager.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/BreakpointManager.java index 991dc1166..d8be9d4f8 100644 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/BreakpointManager.java +++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/BreakpointManager.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2016 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 @@ -100,20 +100,20 @@ public class BreakpointManager implements IBreakpointManager, IResourceChangeLis * to tell if a marker has been created & changed since the breakpoint has been * registered (see bug 138473). */ - private Set<IMarker> fPostChangMarkersChanged = new HashSet<IMarker>(); + private Set<IMarker> fPostChangMarkersChanged = new HashSet<>(); /** * A collection of breakpoint markers that have received a POST_BUILD notification * of being added. */ - private Set<IMarker> fPostBuildMarkersAdded = new HashSet<IMarker>(); + private Set<IMarker> fPostBuildMarkersAdded = new HashSet<>(); /** * Collection of breakpoints being added currently. Used to * suppress change notification of "REGISTERED" attribute when * being added. */ - private List<IBreakpoint> fSuppressChange = new ArrayList<IBreakpoint>(); + private List<IBreakpoint> fSuppressChange = new ArrayList<>(); /** * A table of breakpoint extension points, keyed by @@ -259,8 +259,8 @@ public class BreakpointManager implements IBreakpointManager, IResourceChangeLis * Constructs a new breakpoint manager. */ public BreakpointManager() { - fMarkersToBreakpoints = new HashMap<IMarker, IBreakpoint>(10); - fBreakpointExtensions = new HashMap<String, IConfigurationElement>(15); + fMarkersToBreakpoints = new HashMap<>(10); + fBreakpointExtensions = new HashMap<>(15); } /** @@ -273,7 +273,7 @@ public class BreakpointManager implements IBreakpointManager, IResourceChangeLis private void loadBreakpoints(IResource resource, boolean notify) throws CoreException { initBreakpointExtensions(); IMarker[] markers= getPersistedMarkers(resource); - List<IBreakpoint> added = new ArrayList<IBreakpoint>(); + List<IBreakpoint> added = new ArrayList<>(); for (int i = 0; i < markers.length; i++) { IMarker marker= markers[i]; try { @@ -313,8 +313,8 @@ public class BreakpointManager implements IBreakpointManager, IResourceChangeLis */ protected IMarker[] getPersistedMarkers(IResource resource) throws CoreException { IMarker[] markers= resource.findMarkers(IBreakpoint.BREAKPOINT_MARKER, true, IResource.DEPTH_INFINITE); - final List<IMarker> delete = new ArrayList<IMarker>(); - List<IMarker> persisted = new ArrayList<IMarker>(); + final List<IMarker> delete = new ArrayList<>(); + List<IMarker> persisted = new ArrayList<>(); for (int i = 0; i < markers.length; i++) { IMarker marker= markers[i]; // ensure the marker has a valid model identifier attribute @@ -458,7 +458,7 @@ public class BreakpointManager implements IBreakpointManager, IResourceChangeLis public IBreakpoint[] getBreakpoints(String modelIdentifier) { Vector<IBreakpoint> allBreakpoints = getBreakpoints0(); synchronized (allBreakpoints) { - ArrayList<IBreakpoint> temp = new ArrayList<IBreakpoint>(allBreakpoints.size()); + ArrayList<IBreakpoint> temp = new ArrayList<>(allBreakpoints.size()); for (IBreakpoint breakpoint : allBreakpoints) { String id= breakpoint.getModelIdentifier(); if (id != null && id.equals(modelIdentifier)) { @@ -507,7 +507,7 @@ public class BreakpointManager implements IBreakpointManager, IResourceChangeLis */ @Override public void removeBreakpoints(IBreakpoint[] breakpoints, final boolean delete) throws CoreException { - final List<IBreakpoint> remove = new ArrayList<IBreakpoint>(breakpoints.length); + final List<IBreakpoint> remove = new ArrayList<>(breakpoints.length); List<IBreakpoint> bps = getBreakpoints0(); for (int i = 0; i < breakpoints.length; i++) { IBreakpoint breakpoint = breakpoints[i]; @@ -611,8 +611,8 @@ public class BreakpointManager implements IBreakpointManager, IResourceChangeLis * @throws CoreException if a problem is encountered */ private void addBreakpoints(IBreakpoint[] breakpoints, boolean notify) throws CoreException { - List<IBreakpoint> added = new ArrayList<IBreakpoint>(breakpoints.length); - final List<IBreakpoint> update = new ArrayList<IBreakpoint>(); + List<IBreakpoint> added = new ArrayList<>(breakpoints.length); + final List<IBreakpoint> update = new ArrayList<>(); for (int i = 0; i < breakpoints.length; i++) { IBreakpoint breakpoint = breakpoints[i]; if (!getBreakpoints0().contains(breakpoint)) { @@ -671,7 +671,7 @@ public class BreakpointManager implements IBreakpointManager, IResourceChangeLis @Override public void fireBreakpointChanged(IBreakpoint breakpoint) { if (getBreakpoints0().contains(breakpoint)) { - List<IBreakpoint> changed = new ArrayList<IBreakpoint>(); + List<IBreakpoint> changed = new ArrayList<>(); changed.add(breakpoint); fireUpdate(changed, null, CHANGED); } @@ -723,23 +723,23 @@ public class BreakpointManager implements IBreakpointManager, IResourceChangeLis /** * Moved markers */ - private List<IMarker> fMoved = new ArrayList<IMarker>(); + private List<IMarker> fMoved = new ArrayList<>(); /** * Removed breakpoints */ - private List<IBreakpoint> fRemoved = new ArrayList<IBreakpoint>(); + private List<IBreakpoint> fRemoved = new ArrayList<>(); /** * Added breakpoints. * @since 3.7 */ - private List<IBreakpoint> fAdded = new ArrayList<IBreakpoint>(); + private List<IBreakpoint> fAdded = new ArrayList<>(); /** * Changed breakpoints and associated marker deltas */ - private List<IBreakpoint> fChanged = new ArrayList<IBreakpoint>(); - private List<IMarkerDelta> fChangedDeltas = new ArrayList<IMarkerDelta>(); + private List<IBreakpoint> fChanged = new ArrayList<>(); + private List<IMarkerDelta> fChangedDeltas = new ArrayList<>(); /** * Resets the visitor for a delta traversal - empties @@ -1342,7 +1342,7 @@ public class BreakpointManager implements IBreakpointManager, IResourceChangeLis */ private synchronized void initializeImportParticipants() { if(fImportParticipants == null) { - fImportParticipants = new HashMap<String, ArrayList<BreakpointImportParticipantDelegate>>(); + fImportParticipants = new HashMap<>(); fDefaultParticipant = new DefaultImportParticipant(); IExtensionPoint ep = Platform.getExtensionRegistry().getExtensionPoint(DebugPlugin.getUniqueIdentifier(), DebugPlugin.EXTENSION_POINT_BREAKPOINT_IMPORT_PARTICIPANTS); IConfigurationElement[] elements = ep.getConfigurationElements(); @@ -1353,7 +1353,7 @@ public class BreakpointManager implements IBreakpointManager, IResourceChangeLis if(type != null) { list = fImportParticipants.get(type); if(list == null) { - list = new ArrayList<BreakpointImportParticipantDelegate>(); + list = new ArrayList<>(); fImportParticipants.put(type, list); } list.add(new BreakpointImportParticipantDelegate(elements[i])); diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/DebugOptions.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/DebugOptions.java index e02b4099c..bd51b90c8 100644 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/DebugOptions.java +++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/DebugOptions.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2013 IBM Corporation and others. + * Copyright (c) 2006, 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 @@ -44,14 +44,11 @@ public class DebugOptions implements DebugOptionsListener { * @param context the bundle context */ public DebugOptions(BundleContext context) { - Hashtable<String, String> props = new Hashtable<String, String>(2); + Hashtable<String, String> props = new Hashtable<>(2); props.put(org.eclipse.osgi.service.debug.DebugOptions.LISTENER_SYMBOLICNAME, DebugPlugin.getUniqueIdentifier()); context.registerService(DebugOptionsListener.class.getName(), this, props); } - /* (non-Javadoc) - * @see org.eclipse.osgi.service.debug.DebugOptionsListener#optionsChanged(org.eclipse.osgi.service.debug.DebugOptions) - */ @Override public void optionsChanged(org.eclipse.osgi.service.debug.DebugOptions options) { fgDebugTrace = options.newDebugTrace(DebugPlugin.getUniqueIdentifier()); diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/ExpressionManager.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/ExpressionManager.java index 927499070..12a9d6035 100644 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/ExpressionManager.java +++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/ExpressionManager.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2016 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 @@ -72,7 +72,7 @@ public class ExpressionManager extends PlatformObject implements IExpressionMana * Mapping of debug model identifiers (String) to * expression delegate extensions (IConfigurationElement) */ - private Map<String, IConfigurationElement> fWatchExpressionDelegates = new HashMap<String, IConfigurationElement>(); + private Map<String, IConfigurationElement> fWatchExpressionDelegates = new HashMap<>(); // Constants for add/remove/change/insert/move notification private static final int ADDED = 1; @@ -117,9 +117,6 @@ public class ExpressionManager extends PlatformObject implements IExpressionMana } } - /* (non-Javadoc) - * @see org.eclipse.debug.core.IExpressionManager#newWatchExpressionDelegate(java.lang.String) - */ @Override public IWatchExpressionDelegate newWatchExpressionDelegate(String debugModel) { try { @@ -134,9 +131,6 @@ public class ExpressionManager extends PlatformObject implements IExpressionMana } } - /* (non-Javadoc) - * @see org.eclipse.debug.core.IExpressionManager#hasWatchExpressionDelegate(java.lang.String) - */ @Override public boolean hasWatchExpressionDelegate(String id) { IConfigurationElement element= fWatchExpressionDelegates.get(id); @@ -179,7 +173,7 @@ public class ExpressionManager extends PlatformObject implements IExpressionMana boolean enabled= TRUE_VALUE.equals(element.getAttribute(ENABLED_TAG)); IWatchExpression expression= newWatchExpression(expressionText, enabled); if (fExpressions == null) { - fExpressions = new Vector<IExpression>(list.getLength()); + fExpressions = new Vector<>(list.getLength()); } fExpressions.add(expression); } else { @@ -201,9 +195,6 @@ public class ExpressionManager extends PlatformObject implements IExpressionMana return new WatchExpression(expressionText, enabled); } - /* (non-Javadoc) - * @see org.eclipse.debug.core.IExpressionManager#newWatchExpression(java.lang.String) - */ @Override public IWatchExpression newWatchExpression(String expressionText) { return new WatchExpression(expressionText); @@ -254,17 +245,11 @@ public class ExpressionManager extends PlatformObject implements IExpressionMana return LaunchManager.serializeDocument(document); } - /* (non-Javadoc) - * @see org.eclipse.debug.core.IExpressionManager#addExpression(org.eclipse.debug.core.model.IExpression) - */ @Override public void addExpression(IExpression expression) { addExpressions(new IExpression[]{expression}); } - /* (non-Javadoc) - * @see org.eclipse.debug.core.IExpressionManager#addExpressions(org.eclipse.debug.core.model.IExpression[]) - */ @Override public void addExpressions(IExpression[] expressions) { List<IExpression> added = doAdd(expressions); @@ -282,10 +267,10 @@ public class ExpressionManager extends PlatformObject implements IExpressionMana * @return list of expressions that were actually added. */ private List<IExpression> doAdd(IExpression[] expressions) { - List<IExpression> added = new ArrayList<IExpression>(expressions.length); + List<IExpression> added = new ArrayList<>(expressions.length); synchronized (this) { if (fExpressions == null) { - fExpressions = new Vector<IExpression>(expressions.length); + fExpressions = new Vector<>(expressions.length); } for (int i = 0; i < expressions.length; i++) { IExpression expression = expressions[i]; @@ -298,9 +283,6 @@ public class ExpressionManager extends PlatformObject implements IExpressionMana return added; } - /* (non-Javadoc) - * @see org.eclipse.debug.core.IExpressionManager#getExpressions() - */ @Override public synchronized IExpression[] getExpressions() { if (fExpressions == null) { @@ -311,15 +293,12 @@ public class ExpressionManager extends PlatformObject implements IExpressionMana return temp; } - /* (non-Javadoc) - * @see org.eclipse.debug.core.IExpressionManager#getExpressions(java.lang.String) - */ @Override public synchronized IExpression[] getExpressions(String modelIdentifier) { if (fExpressions == null) { return new IExpression[0]; } - ArrayList<IExpression> temp = new ArrayList<IExpression>(fExpressions.size()); + ArrayList<IExpression> temp = new ArrayList<>(fExpressions.size()); for (IExpression expression : fExpressions) { String id = expression.getModelIdentifier(); if (id != null && id.equals(modelIdentifier)) { @@ -353,7 +332,7 @@ public class ExpressionManager extends PlatformObject implements IExpressionMana if (!insertBefore){ insertionIndex++; } - inserted = new ArrayList<IExpression>(expressions.length); + inserted = new ArrayList<>(expressions.length); for (int i = 0; i < expressions.length; i++) { IExpression expression = expressions[i]; if (fExpressions.indexOf(expression) == -1) { @@ -390,7 +369,7 @@ public class ExpressionManager extends PlatformObject implements IExpressionMana * @since 3.4 */ public void moveExpressions(IExpression[] expressions, IExpression insertionLocation, boolean insertBefore){ - List<IExpression> movedExpressions = new ArrayList<IExpression>(expressions.length); + List<IExpression> movedExpressions = new ArrayList<>(expressions.length); int insertionIndex = -1; IExpression[] movedExpressionsArray = null; synchronized (this) { @@ -427,20 +406,14 @@ public class ExpressionManager extends PlatformObject implements IExpressionMana } } - /* (non-Javadoc) - * @see org.eclipse.debug.core.IExpressionManager#removeExpression(org.eclipse.debug.core.model.IExpression) - */ @Override public void removeExpression(IExpression expression) { removeExpressions(new IExpression[] {expression}); } - /* (non-Javadoc) - * @see org.eclipse.debug.core.IExpressionManager#removeExpressions(org.eclipse.debug.core.model.IExpression[]) - */ @Override public void removeExpressions(IExpression[] expressions) { - List<IExpression> removed = new ArrayList<IExpression>(expressions.length); + List<IExpression> removed = new ArrayList<>(expressions.length); synchronized (this) { if (fExpressions == null) { return; @@ -461,9 +434,6 @@ public class ExpressionManager extends PlatformObject implements IExpressionMana } } - /* (non-Javadoc) - * @see org.eclipse.debug.core.IExpressionManager#addExpressionListener(org.eclipse.debug.core.IExpressionListener) - */ @Override public void addExpressionListener(IExpressionListener listener) { if (fListeners == null) { @@ -472,9 +442,6 @@ public class ExpressionManager extends PlatformObject implements IExpressionMana fListeners.add(listener); } - /* (non-Javadoc) - * @see org.eclipse.debug.core.IExpressionManager#removeExpressionListener(org.eclipse.debug.core.IExpressionListener) - */ @Override public void removeExpressionListener(IExpressionListener listener) { if (fListeners == null) { @@ -526,17 +493,11 @@ public class ExpressionManager extends PlatformObject implements IExpressionMana getExpressionsNotifier().notify(expressions, update, index); } - /* (non-Javadoc) - * @see org.eclipse.debug.core.IExpressionManager#hasExpressions() - */ @Override public synchronized boolean hasExpressions() { return fExpressions != null && !fExpressions.isEmpty(); } - /* (non-Javadoc) - * @see org.eclipse.debug.core.IExpressionManager#addExpressionListener(org.eclipse.debug.core.IExpressionsListener) - */ @Override public void addExpressionListener(IExpressionsListener listener) { if (fExpressionsListeners == null) { @@ -545,9 +506,6 @@ public class ExpressionManager extends PlatformObject implements IExpressionMana fExpressionsListeners.add(listener); } - /* (non-Javadoc) - * @see org.eclipse.debug.core.IExpressionManager#removeExpressionListener(org.eclipse.debug.core.IExpressionsListener) - */ @Override public void removeExpressionListener(IExpressionsListener listener) { if (fExpressionsListeners == null) { @@ -570,18 +528,12 @@ public class ExpressionManager extends PlatformObject implements IExpressionMana private int fType; private IExpression fExpression; - /* (non-Javadoc) - * @see org.eclipse.core.runtime.ISafeRunnable#handleException(java.lang.Throwable) - */ @Override public void handleException(Throwable exception) { IStatus status = new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), DebugPlugin.INTERNAL_ERROR, "An exception occurred during expression change notification.", exception); //$NON-NLS-1$ DebugPlugin.log(status); } - /* (non-Javadoc) - * @see org.eclipse.core.runtime.ISafeRunnable#run() - */ @Override public void run() throws Exception { switch (fType) { @@ -641,18 +593,12 @@ public class ExpressionManager extends PlatformObject implements IExpressionMana private int fIndex; private IExpression[] fNotifierExpressions; - /* (non-Javadoc) - * @see org.eclipse.core.runtime.ISafeRunnable#handleException(java.lang.Throwable) - */ @Override public void handleException(Throwable exception) { IStatus status = new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), DebugPlugin.INTERNAL_ERROR, "An exception occurred during expression change notification.", exception); //$NON-NLS-1$ DebugPlugin.log(status); } - /* (non-Javadoc) - * @see org.eclipse.core.runtime.ISafeRunnable#run() - */ @Override public void run() throws Exception { switch (fType) { diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/InputStreamMonitor.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/InputStreamMonitor.java index 3196df3ea..65c9d61dc 100644 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/InputStreamMonitor.java +++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/InputStreamMonitor.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2013 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 @@ -70,7 +70,7 @@ public class InputStreamMonitor { */ public InputStreamMonitor(OutputStream stream, String encoding) { fStream= stream; - fQueue = new Vector<String>(); + fQueue = new Vector<>(); fLock= new Object(); fEncoding= encoding; } diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfiguration.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfiguration.java index df33c3472..075d2e24b 100644 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfiguration.java +++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfiguration.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 @@ -282,9 +282,6 @@ public class LaunchConfiguration extends PlatformObject implements ILaunchConfig throw new CoreException(s); } - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfiguration#contentsEqual(org.eclipse.debug.core.ILaunchConfiguration) - */ @Override public boolean contentsEqual(ILaunchConfiguration object) { try { @@ -301,18 +298,12 @@ public class LaunchConfiguration extends PlatformObject implements ILaunchConfig } } - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfiguration#copy(java.lang.String) - */ @Override public ILaunchConfigurationWorkingCopy copy(String name) throws CoreException { ILaunchConfigurationWorkingCopy copy = new LaunchConfigurationWorkingCopy(this, name); return copy; } - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfiguration#delete() - */ @Override public void delete() throws CoreException { if (exists()) { @@ -345,9 +336,6 @@ public class LaunchConfiguration extends PlatformObject implements ILaunchConfig } } - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfiguration#delete(int) - */ @Override public void delete(int flag) throws CoreException { if (flag == UPDATE_PROTOTYPE_CHILDREN && isPrototype()) { @@ -404,9 +392,6 @@ public class LaunchConfiguration extends PlatformObject implements ILaunchConfig return false; } - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfiguration#exists() - */ @Override public boolean exists() { IFile file = getFile(); @@ -423,77 +408,47 @@ public class LaunchConfiguration extends PlatformObject implements ILaunchConfig return false; } - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfiguration#getAttribute(java.lang.String, boolean) - */ @Override public boolean getAttribute(String attributeName, boolean defaultValue) throws CoreException { return getInfo().getBooleanAttribute(attributeName, defaultValue); } - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfiguration#getAttribute(java.lang.String, int) - */ @Override public int getAttribute(String attributeName, int defaultValue) throws CoreException { return getInfo().getIntAttribute(attributeName, defaultValue); } - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfiguration#getAttribute(java.lang.String, java.util.List) - */ @Override public List<String> getAttribute(String attributeName, List<String> defaultValue) throws CoreException { return getInfo().getListAttribute(attributeName, defaultValue); } - /* - * (non-Javadoc) - * @see - * org.eclipse.debug.core.ILaunchConfiguration#getAttribute(java.lang.String - * , java.util.Set) - */ @Override public Set<String> getAttribute(String attributeName, Set<String> defaultValue) throws CoreException { return getInfo().getSetAttribute(attributeName, defaultValue); } - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfiguration#getAttribute(java.lang.String, java.util.Map) - */ @Override public Map<String, String> getAttribute(String attributeName, Map<String, String> defaultValue) throws CoreException { return getInfo().getMapAttribute(attributeName, defaultValue); } - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfiguration#getAttribute(java.lang.String, java.lang.String) - */ @Override public String getAttribute(String attributeName, String defaultValue) throws CoreException { return getInfo().getStringAttribute(attributeName, defaultValue); } - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfiguration#getAttributes() - */ @Override public Map<String, Object> getAttributes() throws CoreException { LaunchConfigurationInfo info = getInfo(); return info.getAttributes(); } - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfiguration#getCategory() - */ @Override public String getCategory() throws CoreException { return getType().getCategory(); } - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfiguration#getFile() - */ @Override public IFile getFile() { IContainer container = getContainer(); @@ -541,9 +496,6 @@ public class LaunchConfiguration extends PlatformObject implements ILaunchConfig return (LaunchManager)DebugPlugin.getDefault().getLaunchManager(); } - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfiguration#getLocation() - */ @Override public IPath getLocation() { try { @@ -580,9 +532,6 @@ public class LaunchConfiguration extends PlatformObject implements ILaunchConfig return null; } - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfiguration#getResource() - */ @Override public IResource[] getMappedResources() throws CoreException { List<String> paths = getAttribute(ATTR_MAPPED_RESOURCE_PATHS, (List<String>) null); @@ -593,7 +542,7 @@ public class LaunchConfiguration extends PlatformObject implements ILaunchConfig if (types == null || types.size() != paths.size()) { throw new CoreException(newStatus(DebugCoreMessages.LaunchConfiguration_0, DebugPlugin.ERROR, null)); } - ArrayList<IResource> list = new ArrayList<IResource>(); + ArrayList<IResource> list = new ArrayList<>(); IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); for(int i = 0; i < paths.size(); i++) { String pathStr = paths.get(i); @@ -635,9 +584,6 @@ public class LaunchConfiguration extends PlatformObject implements ILaunchConfig return list.toArray(new IResource[list.size()]); } - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfiguration#getMemento() - */ @Override public String getMemento() throws CoreException { IPath relativePath = null; @@ -668,9 +614,6 @@ public class LaunchConfiguration extends PlatformObject implements ILaunchConfig throw new CoreException(status); } - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfiguration#getName() - */ @Override public String getName() { return fName; @@ -691,28 +634,19 @@ public class LaunchConfiguration extends PlatformObject implements ILaunchConfig @Override public Set<String> getModes() throws CoreException { Set<String> options = getAttribute(ATTR_LAUNCH_MODES, (Set<String>) null); - return (options != null ? new HashSet<String>(options) : new HashSet<String>(0)); + return (options != null ? new HashSet<>(options) : new HashSet<>(0)); } - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfiguration#getType() - */ @Override public ILaunchConfigurationType getType() throws CoreException { return getInfo().getType(); } - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfiguration#getWorkingCopy() - */ @Override public ILaunchConfigurationWorkingCopy getWorkingCopy() throws CoreException { return new LaunchConfigurationWorkingCopy(this); } - /* (non-Javadoc) - * @see java.lang.Object#hashCode() - */ @Override public int hashCode() { IContainer container = getContainer(); @@ -723,9 +657,6 @@ public class LaunchConfiguration extends PlatformObject implements ILaunchConfig } } - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfiguration#hasAttribute(java.lang.String) - */ @Override public boolean hasAttribute(String attributeName) throws CoreException { return getInfo().hasAttribute(attributeName); @@ -761,49 +692,31 @@ public class LaunchConfiguration extends PlatformObject implements ILaunchConfig } } - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfiguration#isLocal() - */ @Override public boolean isLocal() { return getContainer() == null; } - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfiguration#isMigrationCandidate() - */ @Override public boolean isMigrationCandidate() throws CoreException { return ((LaunchConfigurationType)getType()).isMigrationCandidate(this); } - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfiguration#isWorkingCopy() - */ @Override public boolean isWorkingCopy() { return false; } - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfiguration#launch(java.lang.String, org.eclipse.core.runtime.IProgressMonitor) - */ @Override public ILaunch launch(String mode, IProgressMonitor monitor) throws CoreException { return launch(mode, monitor, false); } - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfiguration#launch(java.lang.String, org.eclipse.core.runtime.IProgressMonitor, boolean) - */ @Override public ILaunch launch(String mode, IProgressMonitor monitor, boolean build) throws CoreException { return launch(mode, monitor, build, true); } - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfiguration#launch(java.lang.String, org.eclipse.core.runtime.IProgressMonitor, boolean, boolean) - */ @Override public ILaunch launch(String mode, IProgressMonitor monitor, boolean build, boolean register) throws CoreException { /* Setup progress monitor @@ -879,8 +792,7 @@ public class LaunchConfiguration extends PlatformObject implements ILaunchConfig // ensure the launch mode is valid if (!mode.equals(launch.getLaunchMode())) { IStatus status = new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), DebugPlugin.ERROR, - MessageFormat.format(DebugCoreMessages.LaunchConfiguration_14, new Object[] { - mode, launch.getLaunchMode() }), null); + MessageFormat.format(DebugCoreMessages.LaunchConfiguration_14, mode, launch.getLaunchMode()), null); throw new CoreException(status); } } @@ -968,9 +880,6 @@ public class LaunchConfiguration extends PlatformObject implements ILaunchConfig } } - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfiguration#migrate() - */ @Override public void migrate() throws CoreException { ((LaunchConfigurationType)getType()).migrate(this); @@ -1010,17 +919,11 @@ public class LaunchConfiguration extends PlatformObject implements ILaunchConfig fContainer = container; } - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfiguration#supportsMode(java.lang.String) - */ @Override public boolean supportsMode(String mode) throws CoreException { return getType().supportsMode(mode); } - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfiguration#isReadOnly() - */ @Override public boolean isReadOnly() { try { @@ -1033,9 +936,6 @@ public class LaunchConfiguration extends PlatformObject implements ILaunchConfig return true; } - /** - * @see org.eclipse.debug.core.ILaunchConfiguration#getPreferredDelegate(java.util.Set) - */ @Override public ILaunchDelegate getPreferredDelegate(Set<String> modes) throws CoreException { Map<String, String> delegates = getAttribute(LaunchConfiguration.ATTR_PREFERRED_LAUNCHERS, (Map<String, String>) null); @@ -1048,17 +948,11 @@ public class LaunchConfiguration extends PlatformObject implements ILaunchConfig return null; } - /** - * @see java.lang.Object#toString() - */ @Override public String toString() { return getName(); } - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfiguration#getPrototype() - */ @Override public ILaunchConfiguration getPrototype() throws CoreException { String memento = getAttribute(ATTR_PROTOTYPE, (String)null); @@ -1070,13 +964,10 @@ public class LaunchConfiguration extends PlatformObject implements ILaunchConfig return null; } - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfiguration#getPrototypeChildren() - */ @Override public Collection<ILaunchConfiguration> getPrototypeChildren() throws CoreException { ILaunchConfiguration[] configurations = getLaunchManager().getLaunchConfigurations(getType()); - List<ILaunchConfiguration> proteges = new ArrayList<ILaunchConfiguration>(); + List<ILaunchConfiguration> proteges = new ArrayList<>(); for (int i = 0; i < configurations.length; i++) { ILaunchConfiguration config = configurations[i]; if (this.equals(config.getPrototype())) { @@ -1086,9 +977,6 @@ public class LaunchConfiguration extends PlatformObject implements ILaunchConfig return proteges; } - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfiguration#isPrototype() - */ @Override public boolean isPrototype() { return fIsPrototype; @@ -1121,9 +1009,6 @@ public class LaunchConfiguration extends PlatformObject implements ILaunchConfig return false; } - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfiguration#getKind() - */ @Override public int getKind() throws CoreException { if (fIsPrototype) { @@ -1132,10 +1017,6 @@ public class LaunchConfiguration extends PlatformObject implements ILaunchConfig return CONFIGURATION; } - /* - * (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfiguration#isAttributeModified(java.lang.String) - */ @Override public boolean isAttributeModified(String attribute) throws CoreException { ILaunchConfiguration prototype = getPrototype(); @@ -1147,25 +1028,13 @@ public class LaunchConfiguration extends PlatformObject implements ILaunchConfig return false; } - /* - * (non-Javadoc) - * @see - * org.eclipse.debug.core.ILaunchConfiguration#getPrototypeVisibleAttributes - * () - */ @Override public Set<String> getPrototypeVisibleAttributes() throws CoreException { return getInfo().getVisibleAttributes(); } - /* - * (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfiguration# - * setPrototypeAttributeVisibility(java.lang.String, boolean) - */ @Override public void setPrototypeAttributeVisibility(String attribute, boolean visible) throws CoreException { getInfo().setAttributeVisibility(attribute, visible); } } - diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfigurationInfo.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfigurationInfo.java index 72aa2114d..5c27bb9d1 100644 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfigurationInfo.java +++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfigurationInfo.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 @@ -175,7 +175,7 @@ public class LaunchConfigurationInfo { throw new DebugException( new Status( IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), - DebugException.REQUEST_FAILED, MessageFormat.format(DebugCoreMessages.LaunchConfigurationInfo_Attribute__0__is_not_of_type_java_lang_String__1, new Object[] { key }), null + DebugException.REQUEST_FAILED, MessageFormat.format(DebugCoreMessages.LaunchConfigurationInfo_Attribute__0__is_not_of_type_java_lang_String__1, key), null ) ); } @@ -202,7 +202,7 @@ public class LaunchConfigurationInfo { throw new DebugException( new Status( IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), - DebugException.REQUEST_FAILED, MessageFormat.format(DebugCoreMessages.LaunchConfigurationInfo_Attribute__0__is_not_of_type_int__2, new Object[] { key }), null + DebugException.REQUEST_FAILED, MessageFormat.format(DebugCoreMessages.LaunchConfigurationInfo_Attribute__0__is_not_of_type_int__2, key), null ) ); } @@ -229,7 +229,7 @@ public class LaunchConfigurationInfo { throw new DebugException( new Status( IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), - DebugException.REQUEST_FAILED, MessageFormat.format(DebugCoreMessages.LaunchConfigurationInfo_Attribute__0__is_not_of_type_boolean__3, new Object[] { key }), null + DebugException.REQUEST_FAILED, MessageFormat.format(DebugCoreMessages.LaunchConfigurationInfo_Attribute__0__is_not_of_type_boolean__3, key), null ) ); } @@ -257,7 +257,7 @@ public class LaunchConfigurationInfo { throw new DebugException( new Status( IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), - DebugException.REQUEST_FAILED, MessageFormat.format(DebugCoreMessages.LaunchConfigurationInfo_Attribute__0__is_not_of_type_java_util_List__1, new Object[] { key }), null + DebugException.REQUEST_FAILED, MessageFormat.format(DebugCoreMessages.LaunchConfigurationInfo_Attribute__0__is_not_of_type_java_util_List__1, key), null ) ); } @@ -288,7 +288,7 @@ public class LaunchConfigurationInfo { throw new DebugException( new Status( IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), - DebugException.REQUEST_FAILED, MessageFormat.format(DebugCoreMessages.LaunchConfigurationInfo_35, new Object[] { key }), null + DebugException.REQUEST_FAILED, MessageFormat.format(DebugCoreMessages.LaunchConfigurationInfo_35, key), null ) ); } @@ -328,7 +328,7 @@ public class LaunchConfigurationInfo { throw new DebugException( new Status( IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), - DebugException.REQUEST_FAILED, MessageFormat.format(DebugCoreMessages.LaunchConfigurationInfo_Attribute__0__is_not_of_type_java_util_Map__1, new Object[] { key }), null + DebugException.REQUEST_FAILED, MessageFormat.format(DebugCoreMessages.LaunchConfigurationInfo_Attribute__0__is_not_of_type_java_util_Map__1, key), null ) ); } @@ -398,7 +398,7 @@ public class LaunchConfigurationInfo { * @return a copy of this info's attribute map */ protected TreeMap<String, Object> getAttributes() { - return new TreeMap<String, Object>(getAttributeTable()); + return new TreeMap<>(getAttributeTable()); } /** @@ -541,7 +541,7 @@ public class LaunchConfigurationInfo { Element setElement = doc.createElement(elementType); setElement.setAttribute(KEY, setKey); // persist in sorted order - List<String> list = new ArrayList<String>(set); + List<String> list = new ArrayList<>(set); Collections.sort(list); Element element = null; for (String str : list) { @@ -567,7 +567,7 @@ public class LaunchConfigurationInfo { Element mapElement = doc.createElement(elementType); mapElement.setAttribute(KEY, mapKey); // persist in sorted order based on keys - List<String> keys = new ArrayList<String>(map.keySet()); + List<String> keys = new ArrayList<>(map.keySet()); Collections.sort(keys); for (String key : keys) { String value = map.get(key); @@ -610,7 +610,7 @@ public class LaunchConfigurationInfo { ILaunchConfigurationType type = DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurationType(id); if (type == null) { - String message= MessageFormat.format(DebugCoreMessages.LaunchConfigurationInfo_missing_type, new Object[]{id}); + String message = MessageFormat.format(DebugCoreMessages.LaunchConfigurationInfo_missing_type, id); throw new DebugException( new Status( IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), @@ -705,7 +705,7 @@ public class LaunchConfigurationInfo { String listKey = element.getAttribute(KEY); NodeList nodeList = element.getChildNodes(); int entryCount = nodeList.getLength(); - List<String> list = new ArrayList<String>(entryCount); + List<String> list = new ArrayList<>(entryCount); Node node = null; Element selement = null; for (int i = 0; i < entryCount; i++) { @@ -734,7 +734,7 @@ public class LaunchConfigurationInfo { String setKey = element.getAttribute(KEY); NodeList nodeList = element.getChildNodes(); int entryCount = nodeList.getLength(); - Set<String> set = new HashSet<String>(entryCount); + Set<String> set = new HashSet<>(entryCount); Node node = null; Element selement = null; for(int i = 0; i < entryCount; i++) { @@ -761,7 +761,7 @@ public class LaunchConfigurationInfo { String mapKey = element.getAttribute(KEY); NodeList nodeList = element.getChildNodes(); int entryCount = nodeList.getLength(); - Map<String, String> map = new HashMap<String, String>(entryCount); + Map<String, String> map = new HashMap<>(entryCount); Node node = null; Element selement = null; for (int i = 0; i < entryCount; i++) { diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfigurationType.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfigurationType.java index cd7595266..df188153e 100644 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfigurationType.java +++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfigurationType.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 @@ -117,36 +117,24 @@ public class LaunchConfigurationType extends PlatformObject implements ILaunchCo initializePreferredDelegates(); } - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfigurationType#getAttribute(java.lang.String) - */ @Override public String getAttribute(String attributeName) { return fElement.getAttribute(attributeName); } - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfigurationType#getCategory() - */ @Override public String getCategory() { return fElement.getAttribute(IConfigurationElementConstants.CATEGORY); } - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfigurationType#getDelegate() - */ @Override public ILaunchConfigurationDelegate getDelegate() throws CoreException { return getDelegate(ILaunchManager.RUN_MODE); } - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfigurationType#getDelegate(java.lang.String) - */ @Override public ILaunchConfigurationDelegate getDelegate(String mode) throws CoreException { - Set<String> modes = new HashSet<String>(); + Set<String> modes = new HashSet<>(); modes.add(mode); ILaunchDelegate[] delegates = getDelegates(modes); if (delegates.length > 0) { @@ -155,20 +143,13 @@ public class LaunchConfigurationType extends PlatformObject implements ILaunchCo IStatus status = null; ILaunchMode launchMode = DebugPlugin.getDefault().getLaunchManager().getLaunchMode(mode); if (launchMode == null) { - status = new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), - MessageFormat.format(DebugCoreMessages.LaunchConfigurationType_7, - new Object[] { mode })); + status = new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), MessageFormat.format(DebugCoreMessages.LaunchConfigurationType_7, mode)); } else { - status = new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), - MessageFormat.format(DebugCoreMessages.LaunchConfigurationType_7, - new Object[] { ((LaunchManager) DebugPlugin.getDefault().getLaunchManager()).getLaunchModeName(mode) })); + status = new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), MessageFormat.format(DebugCoreMessages.LaunchConfigurationType_7, ((LaunchManager) DebugPlugin.getDefault().getLaunchManager()).getLaunchModeName(mode))); } throw new CoreException(status); } - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfigurationType#getDelegates(java.util.Set) - */ @Override public ILaunchDelegate[] getDelegates(Set<String> modes) throws CoreException { initializeDelegates(); @@ -179,13 +160,10 @@ public class LaunchConfigurationType extends PlatformObject implements ILaunchCo return delegates.toArray(new ILaunchDelegate[delegates.size()]); } - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfigurationType#setPreferredDelegate(java.util.Set, org.eclipse.debug.core.ILaunchDelegate) - */ @Override public void setPreferredDelegate(Set<String> modes, ILaunchDelegate delegate) { if(fPreferredDelegates == null) { - fPreferredDelegates = new HashMap<Set<String>, ILaunchDelegate>(); + fPreferredDelegates = new HashMap<>(); } if (delegate == null) { fPreferredDelegates.remove(modes); @@ -195,9 +173,6 @@ public class LaunchConfigurationType extends PlatformObject implements ILaunchCo ((LaunchManager)DebugPlugin.getDefault().getLaunchManager()).persistPreferredLaunchDelegate(this); } - /** - * @see org.eclipse.debug.core.ILaunchConfigurationType#getPreferredDelegate(java.util.Set) - */ @Override public ILaunchDelegate getPreferredDelegate(Set<String> modes) { initializePreferredDelegates(); @@ -233,7 +208,7 @@ public class LaunchConfigurationType extends PlatformObject implements ILaunchCo */ private synchronized void initializePreferredDelegates() { if(fPreferredDelegates == null) { - fPreferredDelegates = new HashMap<Set<String>, ILaunchDelegate>(); + fPreferredDelegates = new HashMap<>(); initializeDelegates(); LaunchManager lm = (LaunchManager) DebugPlugin.getDefault().getLaunchManager(); ILaunchDelegate delegate = null; @@ -252,7 +227,7 @@ public class LaunchConfigurationType extends PlatformObject implements ILaunchCo private synchronized void initializeDelegates() { if (fDelegates == null) { // initialize delegate - fDelegates = new Hashtable<Set<String>, Set<ILaunchDelegate>>(); + fDelegates = new Hashtable<>(); LaunchDelegate[] launchDelegates = getLaunchDelegateExtensions(); LaunchDelegate delegate = null; List<Set<String>> modelist = null; @@ -263,7 +238,7 @@ public class LaunchConfigurationType extends PlatformObject implements ILaunchCo for (Set<String> modes : modelist) { tmp = fDelegates.get(modes); if (tmp == null) { - tmp = new HashSet<ILaunchDelegate>(); + tmp = new HashSet<>(); fDelegates.put(modes, tmp); } tmp.add(delegate); @@ -281,33 +256,21 @@ public class LaunchConfigurationType extends PlatformObject implements ILaunchCo return ((LaunchManager) DebugPlugin.getDefault().getLaunchManager()).getLaunchDelegates(getIdentifier()); } - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfigurationType#getIdentifier() - */ @Override public String getIdentifier() { return fElement.getAttribute(IConfigurationElementConstants.ID); } - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfigurationType#getName() - */ @Override public String getName() { return fElement.getAttribute(IConfigurationElementConstants.NAME); } - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfigurationType#getPluginId() - */ @Override public String getPluginIdentifier() { return fElement.getContributor().getName(); } - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfigurationType#getSourceLocatorId() - */ @Override public String getSourceLocatorId() { if(fSourceLocator == null) { @@ -333,9 +296,6 @@ public class LaunchConfigurationType extends PlatformObject implements ILaunchCo return fSourceLocator; } - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfigurationType#getSourcePathComputer() - */ @Override public ISourcePathComputer getSourcePathComputer() { if(fSourcePathComputer == null) { @@ -369,13 +329,10 @@ public class LaunchConfigurationType extends PlatformObject implements ILaunchCo return fSourcePathComputer; } - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfigurationType#getSupportedModes() - */ @Override public Set<String> getSupportedModes() { if(fModes == null) { - fModes = new HashSet<String>(); + fModes = new HashSet<>(); LaunchDelegate[] delegates = getLaunchDelegateExtensions(); List<Set<String>> modesets = null; for(int i= 0; i < delegates.length; i++) { @@ -388,9 +345,6 @@ public class LaunchConfigurationType extends PlatformObject implements ILaunchCo return fModes; } - /** - * @see org.eclipse.debug.core.ILaunchConfigurationType#getSupportedModeCombinations() - */ @Override public Set<Set<String>> getSupportedModeCombinations() { if(fModeCombinations == null) { @@ -427,9 +381,6 @@ public class LaunchConfigurationType extends PlatformObject implements ILaunchCo } } - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfigurationType#isPublic() - */ @Override public boolean isPublic() { String publicString = fElement.getAttribute(IConfigurationElementConstants.PUBLIC); @@ -456,9 +407,6 @@ public class LaunchConfigurationType extends PlatformObject implements ILaunchCo } } - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfigurationType#newInstance(org.eclipse.core.resources.IContainer, java.lang.String) - */ @Override public ILaunchConfigurationWorkingCopy newInstance(IContainer container, String name) throws CoreException { // validate the configuration name - see bug 275741 @@ -478,9 +426,6 @@ public class LaunchConfigurationType extends PlatformObject implements ILaunchCo return new LaunchConfigurationWorkingCopy(container, name, this); } - /** - * @see org.eclipse.debug.core.ILaunchConfigurationType#supportsMode(java.lang.String) - */ @Override public boolean supportsMode(String mode) { if(fModeCombinations == null) { @@ -494,17 +439,11 @@ public class LaunchConfigurationType extends PlatformObject implements ILaunchCo return false; } - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfigurationType#getContributorName() - */ @Override public String getContributorName() { return fElement.getContributor().getName(); } - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfigurationType#supportsModeCombination(java.util.Set) - */ @Override public boolean supportsModeCombination(Set<String> modes) { if(fModeCombinations == null) { @@ -520,27 +459,17 @@ public class LaunchConfigurationType extends PlatformObject implements ILaunchCo fPreferredDelegates = null; } - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfigurationType#getPrototypes() - */ @Override public ILaunchConfiguration[] getPrototypes() throws CoreException { return DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurations(this, ILaunchConfiguration.PROTOTYPE); } - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfigurationType#newPrototypeInstance(org.eclipse.core.resources.IContainer, java.lang.String) - */ @Override public ILaunchConfigurationWorkingCopy newPrototypeInstance(IContainer container, String name) throws CoreException { LaunchConfigurationWorkingCopy wc = new LaunchConfigurationWorkingCopy(container, name, this, true); return wc; } - /* - * (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfigurationType#supportsPrototypes() - */ @Override public boolean supportsPrototypes() { String allowPrototypesString = fElement.getAttribute(IConfigurationElementConstants.ALLOW_PROTOTYPES); diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchDelegate.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchDelegate.java index e6dddf937..640685fc1 100644 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchDelegate.java +++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchDelegate.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2013 IBM Corporation and others. + * Copyright (c) 2006, 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 @@ -77,9 +77,6 @@ public final class LaunchDelegate implements ILaunchDelegate { fElement = element; } - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchDelegateProxy#getDelegate() - */ @Override public ILaunchConfigurationDelegate getDelegate() throws CoreException { if(fDelegate == null) { @@ -93,9 +90,6 @@ public final class LaunchDelegate implements ILaunchDelegate { return fDelegate; } - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchDelegateProxy#getId() - */ @Override public String getId() { return fElement.getAttribute(IConfigurationElementConstants.ID); @@ -124,7 +118,7 @@ public final class LaunchDelegate implements ILaunchDelegate { * @since 3.3 */ private Set<String> parseModes(IConfigurationElement element) { - HashSet<String> set = new HashSet<String>(); + HashSet<String> set = new HashSet<>(); String modes = element.getAttribute(IConfigurationElementConstants.MODES); if (modes != null) { String[] strings = modes.split(","); //$NON-NLS-1$ @@ -135,14 +129,11 @@ public final class LaunchDelegate implements ILaunchDelegate { return set; } - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchDelegateProxy#getModes() - */ @Override public List<Set<String>> getModes() { if(fLaunchModes == null) { - fLaunchModes = new ArrayList<Set<String>>(); - fPerspectiveIds = new HashMap<Set<String>, String>(); + fLaunchModes = new ArrayList<>(); + fPerspectiveIds = new HashMap<>(); IConfigurationElement[] children = fElement.getChildren(IConfigurationElementConstants.MODE_COMBINATION); Set<String> modeset = null; for (int i = 0; i < children.length; i++) { @@ -157,7 +148,7 @@ public final class LaunchDelegate implements ILaunchDelegate { if (modes != null) { String[] strings = modes.split(","); //$NON-NLS-1$ for (int i = 0; i < strings.length; i++) { - modeset = new HashSet<String>(); + modeset = new HashSet<>(); modeset.add(strings[i].trim()); fLaunchModes.add(modeset); } @@ -215,9 +206,6 @@ public final class LaunchDelegate implements ILaunchDelegate { return fElement.getAttribute(IConfigurationElementConstants.SOURCE_PATH_COMPUTER); } - /** - * @see org.eclipse.debug.core.ILaunchDelegate#getDescription() - */ @Override public String getDescription() { String desc = fElement.getAttribute(IConfigurationElementConstants.DELEGATE_DESCRIPTION); @@ -227,17 +215,11 @@ public final class LaunchDelegate implements ILaunchDelegate { return desc; } - /** - * @see org.eclipse.debug.core.ILaunchDelegate#getPluginIdentifier() - */ @Override public String getPluginIdentifier() { return fElement.getContributor().getName(); } - /** - * @see java.lang.Object#equals(java.lang.Object) - */ @Override public boolean equals(Object obj) { if(obj == null) { @@ -252,9 +234,6 @@ public final class LaunchDelegate implements ILaunchDelegate { return id == null ? 0 : id.hashCode(); } - /** - * @see org.eclipse.debug.core.ILaunchDelegate#getPerspectiveId(java.util.Set) - */ @Override public String getPerspectiveId(Set<String> modes) { if(fPerspectiveIds == null) { diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchManager.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchManager.java index 1d66666bc..f0800df0e 100644 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchManager.java +++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchManager.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 @@ -186,9 +186,6 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe private int fType; private ILaunchConfiguration fConfiguration; - /** - * @see org.eclipse.core.runtime.ISafeRunnable#handleException(java.lang.Throwable) - */ @Override public void handleException(Throwable exception) { IStatus status = new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), DebugPlugin.INTERNAL_ERROR, "An exception occurred during launch configuration change notification.", exception); //$NON-NLS-1$ @@ -212,9 +209,6 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe fListener = null; } - /** - * @see org.eclipse.core.runtime.ISafeRunnable#run() - */ @Override public void run() throws Exception { switch (fType) { @@ -244,9 +238,6 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe private ILaunch[] fNotifierLaunches; private ILaunch[] fRegistered; - /** - * @see org.eclipse.core.runtime.ISafeRunnable#handleException(java.lang.Throwable) - */ @Override public void handleException(Throwable exception) { IStatus status = new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), DebugPlugin.INTERNAL_ERROR, "An exception occurred during launch change notification.", exception); //$NON-NLS-1$ @@ -272,9 +263,6 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe fListener = null; } - /** - * @see org.eclipse.core.runtime.ISafeRunnable#run() - */ @Override public void run() throws Exception { switch (fType) { @@ -295,7 +283,7 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe } } else { if (registered == null) { - registered = new ArrayList<ILaunch>(fNotifierLaunches.length); + registered = new ArrayList<>(fNotifierLaunches.length); for (int k = 0; k < j; k++) { registered.add(fNotifierLaunches[k]); } @@ -330,9 +318,6 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe */ class MappedResourceVisitor implements IResourceDeltaVisitor { - /* (non-Javadoc) - * @see org.eclipse.core.resources.IResourceDeltaVisitor#visit(org.eclipse.core.resources.IResourceDelta) - */ @Override public boolean visit(IResourceDelta delta) throws CoreException { if (0 != (delta.getFlags() & IResourceDelta.OPEN)) { @@ -358,9 +343,6 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe */ class LaunchManagerVisitor implements IResourceDeltaVisitor { - /** - * @see IResourceDeltaVisitor#visit(IResourceDelta) - */ @Override public boolean visit(IResourceDelta delta) { if (delta == null) { @@ -412,9 +394,6 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe private int fType; private ILaunch fLaunch; - /** - * @see org.eclipse.core.runtime.ISafeRunnable#handleException(java.lang.Throwable) - */ @Override public void handleException(Throwable exception) { IStatus status = new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), DebugPlugin.INTERNAL_ERROR, "An exception occurred during launch change notification.", exception); //$NON-NLS-1$ @@ -438,9 +417,6 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe fListener = null; } - /** - * @see org.eclipse.core.runtime.ISafeRunnable#run() - */ @Override public void run() throws Exception { switch (fType) { @@ -472,9 +448,7 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe protected ResourceProxyVisitor(List<IResource> list) { fList= list; } - /** - * @see org.eclipse.core.resources.IResourceProxyVisitor#visit(org.eclipse.core.resources.IResourceProxy) - */ + @Override public boolean visit(IResourceProxy proxy) { if (proxy.getType() == IResource.FILE) { @@ -581,7 +555,7 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe * Launch configuration cache. Keys are <code>LaunchConfiguration</code>, * values are <code>LaunchConfigurationInfo</code>. */ - private Map<ILaunchConfiguration, LaunchConfigurationInfo> fLaunchConfigurations = new HashMap<ILaunchConfiguration, LaunchConfigurationInfo>(10); + private Map<ILaunchConfiguration, LaunchConfigurationInfo> fLaunchConfigurations = new HashMap<>(10); /** * A cache of launch configuration names currently in the workspace. @@ -621,13 +595,13 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe /** * Collection of launches */ - private List<ILaunch> fLaunches = new ArrayList<ILaunch>(10); + private List<ILaunch> fLaunches = new ArrayList<>(10); /** * Set of launches for efficient 'isRegistered()' check TODO remove this - * Launches don't implement hashCode() or equals() - so its no more * efficient than walking the other collection */ - private Set<ILaunch> fLaunchSet = new HashSet<ILaunch>(10); + private Set<ILaunch> fLaunchSet = new HashSet<>(10); /** * Collection of listeners @@ -696,9 +670,6 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe */ private Set<String> fActiveModes; - /** - * @see ILaunchManager#addLaunch(ILaunch) - */ @Override public void addLaunch(ILaunch launch) { if (internalAddLaunch(launch)) { @@ -707,20 +678,14 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe } } - /** - * @see ILaunchManager#addLaunchConfigurationListener(ILaunchConfigurationListener) - */ @Override public void addLaunchConfigurationListener(ILaunchConfigurationListener listener) { fLaunchConfigurationListeners.add(listener); } - /** - * @see org.eclipse.debug.core.ILaunchManager#addLaunches(org.eclipse.debug.core.ILaunch[]) - */ @Override public void addLaunches(ILaunch[] launches) { - List<ILaunch> added = new ArrayList<ILaunch>(launches.length); + List<ILaunch> added = new ArrayList<>(launches.length); for (int i = 0; i < launches.length; i++) { if (internalAddLaunch(launches[i])) { added.add(launches[i]); @@ -735,17 +700,11 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe } } - /** - * @see org.eclipse.debug.core.ILaunchManager#addLaunchListener(org.eclipse.debug.core.ILaunchesListener) - */ @Override public void addLaunchListener(ILaunchesListener listener) { fLaunchesListeners.add(listener); } - /** - * @see ILaunchManager#addLaunchListener(ILaunchListener) - */ @Override public void addLaunchListener(ILaunchListener listener) { fListeners.add(listener); @@ -886,9 +845,6 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe } } - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchManager#getEncoding(org.eclipse.debug.core.ILaunchConfiguration) - */ @Override public String getEncoding(ILaunchConfiguration configuration) throws CoreException { String encoding = configuration.getAttribute(DebugPlugin.ATTR_CONSOLE_ENCODING, (String)null); @@ -990,14 +946,14 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe if (container instanceof IProject && !((IProject)container).isOpen()) { return Collections.EMPTY_LIST; } - List<IResource> list = new ArrayList<IResource>(10); + List<IResource> list = new ArrayList<>(10); ResourceProxyVisitor visitor= new ResourceProxyVisitor(list); try { container.accept(visitor, IResource.NONE); } catch (CoreException ce) { //Closed project...should not be possible with previous check } - List<ILaunchConfiguration> configs = new ArrayList<ILaunchConfiguration>(list.size()); + List<ILaunchConfiguration> configs = new ArrayList<>(list.size()); for (IResource resource : list) { ILaunchConfiguration config = getLaunchConfiguration((IFile) resource); if(config != null && config.exists()) { @@ -1034,7 +990,7 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe IPath containerPath = LOCAL_LAUNCH_CONFIGURATION_CONTAINER_PATH; final File directory = containerPath.toFile(); if (directory.isDirectory()) { - List<ILaunchConfiguration> configs = new ArrayList<ILaunchConfiguration>(); + List<ILaunchConfiguration> configs = new ArrayList<>(); FilenameFilter configFilter = new FilenameFilter() { @Override public boolean accept(File dir, String name) { @@ -1091,9 +1047,6 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe new LaunchesNotifier().notify(launches, update); } - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchManager#generateUniqueLaunchConfigurationNameFrom(java.lang.String) - */ @Override public String generateUniqueLaunchConfigurationNameFrom(String baseName) { int index = 1; @@ -1177,7 +1130,7 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe private synchronized List<ILaunchConfiguration> getAllLaunchConfigurations() { if (fLaunchConfigurationIndex == null) { try { - fLaunchConfigurationIndex = new ArrayList<ILaunchConfiguration>(20); + fLaunchConfigurationIndex = new ArrayList<>(20); List<ILaunchConfiguration> configs = findLocalLaunchConfigurations(); verifyConfigurations(configs, fLaunchConfigurationIndex); configs = findLaunchConfigurations(ResourcesPlugin.getWorkspace().getRoot()); @@ -1251,7 +1204,7 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe } // read each launch configuration - List<ILaunchConfiguration> configs = new ArrayList<ILaunchConfiguration>(4); + List<ILaunchConfiguration> configs = new ArrayList<>(4); NodeList list = root.getChildNodes(); int length = list.getLength(); Node node = null; @@ -1279,13 +1232,10 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe return new ConfigurationNotifier(); } - /** - * @see ILaunchManager#getDebugTargets() - */ @Override public IDebugTarget[] getDebugTargets() { synchronized (fLaunches) { - List<IDebugTarget> allTargets = new ArrayList<IDebugTarget>(fLaunches.size()); + List<IDebugTarget> allTargets = new ArrayList<>(fLaunches.size()); IDebugTarget[] targets = null; for (ILaunch launch : fLaunches) { targets = launch.getDebugTargets(); @@ -1322,16 +1272,13 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe return fgMRVisitor; } - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchManager#getEnvironment(org.eclipse.debug.core.ILaunchConfiguration) - */ @Override public String[] getEnvironment(ILaunchConfiguration configuration) throws CoreException { Map<String, String> configEnv = configuration.getAttribute(ATTR_ENVIRONMENT_VARIABLES, (Map<String, String>) null); if (configEnv == null) { return null; } - Map<String, String> env = new HashMap<String, String>(); + Map<String, String> env = new HashMap<>(); // build base environment boolean append = configuration.getAttribute(ATTR_APPEND_ENVIRONMENT_VARIABLES, true); if (append) { @@ -1376,7 +1323,7 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe env.put(key, value); } } - List<String> strings = new ArrayList<String>(env.size()); + List<String> strings = new ArrayList<>(env.size()); StringBuffer buffer = null; for (Entry<String, String> entry : env.entrySet()) { buffer = new StringBuffer(entry.getKey()); @@ -1472,35 +1419,23 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe return false; } - /** - * @see ILaunchManager#getLaunchConfiguration(IFile) - */ @Override public ILaunchConfiguration getLaunchConfiguration(IFile file) { hookResourceChangeListener(); return new LaunchConfiguration(file); } - /** - * @see ILaunchManager#getLaunchConfiguration(String) - */ @Override public ILaunchConfiguration getLaunchConfiguration(String memento) throws CoreException { hookResourceChangeListener(); return new LaunchConfiguration(memento); } - /** - * @see ILaunchManager#getLaunchConfigurations() - */ @Override public synchronized ILaunchConfiguration[] getLaunchConfigurations() { return getLaunchConfigurations(ILaunchConfiguration.CONFIGURATION); } - /** - * @see org.eclipse.debug.core.ILaunchManager#getLaunchConfigurations(int) - */ @Override public ILaunchConfiguration[] getLaunchConfigurations(int kinds) { List<ILaunchConfiguration> allConfigs = getAllLaunchConfigurations(); @@ -1508,7 +1443,7 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe // all kinds return allConfigs.toArray(new ILaunchConfiguration[allConfigs.size()]); } else { - List<ILaunchConfiguration> select = new ArrayList<ILaunchConfiguration>(allConfigs.size()); + List<ILaunchConfiguration> select = new ArrayList<>(allConfigs.size()); Iterator<ILaunchConfiguration> iterator = allConfigs.iterator(); while (iterator.hasNext()) { ILaunchConfiguration config = iterator.next(); @@ -1524,20 +1459,14 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe } } - /** - * @see ILaunchManager#getLaunchConfigurations(ILaunchConfigurationType) - */ @Override public synchronized ILaunchConfiguration[] getLaunchConfigurations(ILaunchConfigurationType type) throws CoreException { return getLaunchConfigurations(type, ILaunchConfiguration.CONFIGURATION); } - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchManager#getLaunchConfigurations(org.eclipse.debug.core.ILaunchConfigurationType, int) - */ @Override public synchronized ILaunchConfiguration[] getLaunchConfigurations(ILaunchConfigurationType type, int kinds) throws CoreException { - List<ILaunchConfiguration> configs = new ArrayList<ILaunchConfiguration>(); + List<ILaunchConfiguration> configs = new ArrayList<>(); for (ILaunchConfiguration config : getAllLaunchConfigurations()) { if (config.getType().equals(type) && ((config.getKind() & kinds) > 0)) { configs.add(config); @@ -1555,7 +1484,7 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe * in the given project */ protected synchronized List<ILaunchConfiguration> getLaunchConfigurations(IProject project) { - List<ILaunchConfiguration> configs = new ArrayList<ILaunchConfiguration>(); + List<ILaunchConfiguration> configs = new ArrayList<>(); for (ILaunchConfiguration config : getAllLaunchConfigurations()) { IFile file = config.getFile(); if (file != null && file.getProject().equals(project)) { @@ -1565,9 +1494,6 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe return configs; } - /** - * @see ILaunchManager#getLaunchConfigurationType(String) - */ @Override public ILaunchConfigurationType getLaunchConfigurationType(String id) { ILaunchConfigurationType[] types = getLaunchConfigurationTypes(); @@ -1579,18 +1505,12 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe return null; } - /** - * @see ILaunchManager#getLaunchConfigurationTypes() - */ @Override public ILaunchConfigurationType[] getLaunchConfigurationTypes() { initializeLaunchConfigurationTypes(); return fLaunchConfigurationTypes.toArray(new ILaunchConfigurationType[fLaunchConfigurationTypes.size()]); } - /** - * @see ILaunchManager#getLaunches() - */ @Override public ILaunch[] getLaunches() { synchronized (fLaunches) { @@ -1598,18 +1518,12 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe } } - /**) - * @see org.eclipse.debug.core.ILaunchManager#getLaunchMode(java.lang.String) - */ @Override public ILaunchMode getLaunchMode(String mode) { initializeLaunchModes(); return fLaunchModes.get(mode); } - /** - * @see org.eclipse.debug.core.ILaunchManager#getLaunchModes() - */ @Override public ILaunchMode[] getLaunchModes() { initializeLaunchModes(); @@ -1642,7 +1556,7 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe */ public LaunchDelegate[] getLaunchDelegates(String typeid) { initializeLaunchDelegates(); - ArrayList<LaunchDelegate> list = new ArrayList<LaunchDelegate>(); + ArrayList<LaunchDelegate> list = new ArrayList<>(); for (Entry<String, LaunchDelegate> entry : fLaunchDelegates.entrySet()) { LaunchDelegate ld = entry.getValue(); if (ld.getLaunchConfigurationTypeId().equals(typeid)) { @@ -1679,7 +1593,7 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe */ private synchronized void initializeLaunchDelegates() { if(fLaunchDelegates == null) { - fLaunchDelegates = new HashMap<String, LaunchDelegate>(); + fLaunchDelegates = new HashMap<>(); //get all launch delegate contributions IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(DebugPlugin.getUniqueIdentifier(), DebugPlugin.EXTENSION_POINT_LAUNCH_DELEGATES); IConfigurationElement[] infos = extensionPoint.getConfigurationElements(); @@ -1713,7 +1627,7 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe */ private synchronized void initializePreferredDelegates() { if(fPreferredDelegates == null) { - fPreferredDelegates = new HashSet<PreferredDelegate>(); + fPreferredDelegates = new HashSet<>(); String preferred = Platform.getPreferencesService().getString(DebugPlugin.getUniqueIdentifier(), LaunchManager.PREF_PREFERRED_DELEGATES, IInternalDebugCoreConstants.EMPTY_STRING, null); if(!IInternalDebugCoreConstants.EMPTY_STRING.equals(preferred)) { try { @@ -1727,7 +1641,7 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe String delegateid = element.getAttribute(IConfigurationElementConstants.ID); typeid = element.getAttribute(IConfigurationElementConstants.TYPE_ID); String[] modes = element.getAttribute(IConfigurationElementConstants.MODES).split(","); //$NON-NLS-1$ - modeset = new HashSet<String>(Arrays.asList(modes)); + modeset = new HashSet<>(Arrays.asList(modes)); LaunchDelegate delegate = getLaunchDelegateExtension(typeid, delegateid, modeset); if (delegate != null) { //take type id, modeset, delegate and create entry @@ -1779,7 +1693,7 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe while(tokenizer.hasMoreTokens()) { StringTokenizer tokenizer2 = new StringTokenizer(tokenizer.nextToken(), ","); //$NON-NLS-1$ String delegateId = tokenizer2.nextToken(); - HashSet<String> modeset = new HashSet<String>(); + HashSet<String> modeset = new HashSet<>(); while(tokenizer2.hasMoreTokens()) { modeset.add(tokenizer2.nextToken()); } @@ -1824,7 +1738,7 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe * @return collection of launch configurations stored locally */ protected synchronized List<ILaunchConfiguration> getLocalLaunchConfigurations() { - List<ILaunchConfiguration> configs = new ArrayList<ILaunchConfiguration>(); + List<ILaunchConfiguration> configs = new ArrayList<>(); for (ILaunchConfiguration config : getAllLaunchConfigurations()) { if (config.isLocal()) { configs.add(config); @@ -1840,7 +1754,7 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe * @since 3.2 */ public ILaunchConfiguration[] getMappedConfigurations(IResource resource) { - List<ILaunchConfiguration> configurations = new ArrayList<ILaunchConfiguration>(); + List<ILaunchConfiguration> configurations = new ArrayList<>(); for (ILaunchConfiguration config : getAllLaunchConfigurations()) { try { IResource[] resources = config.getMappedResources(); @@ -1864,12 +1778,9 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe return configurations.toArray(new ILaunchConfiguration[configurations.size()]); } - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchManager#getMigrationCandidates() - */ @Override public ILaunchConfiguration[] getMigrationCandidates() throws CoreException { - List<ILaunchConfiguration> configs = new ArrayList<ILaunchConfiguration>(); + List<ILaunchConfiguration> configs = new ArrayList<>(); for (ILaunchConfiguration config : getAllLaunchConfigurations()) { if (!config.isReadOnly() && config.isMigrationCandidate()) { configs.add(config); @@ -1878,9 +1789,6 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe return configs.toArray(new ILaunchConfiguration[configs.size()]); } - /** - * @see org.eclipse.debug.core.ILaunchManager#getMovedFrom(org.eclipse.debug.core.ILaunchConfiguration) - */ @Override public ILaunchConfiguration getMovedFrom(ILaunchConfiguration addedConfiguration) { if (addedConfiguration.equals(fTo)) { @@ -1889,9 +1797,6 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe return null; } - /** - * @see org.eclipse.debug.core.ILaunchManager#getMovedTo(org.eclipse.debug.core.ILaunchConfiguration) - */ @Override public ILaunchConfiguration getMovedTo(ILaunchConfiguration removedConfiguration) { if (removedConfiguration.equals(fFrom)) { @@ -1900,44 +1805,35 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe return null; } - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchManager#getNativeEnvironment() - */ @Override public synchronized Map<String, String> getNativeEnvironment() { if (fgNativeEnv == null) { Map<String, String> casePreserved = getNativeEnvironmentCasePreserved(); if (Platform.getOS().equals(Constants.OS_WIN32)) { - fgNativeEnv = new HashMap<String, String>(); + fgNativeEnv = new HashMap<>(); for (Entry<String, String> entry : casePreserved.entrySet()) { fgNativeEnv.put(entry.getKey().toUpperCase(), entry.getValue()); } } else { - fgNativeEnv = new HashMap<String, String>(casePreserved); + fgNativeEnv = new HashMap<>(casePreserved); } } - return new HashMap<String, String>(fgNativeEnv); + return new HashMap<>(fgNativeEnv); } - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchManager#getNativeEnvironmentCasePreserved() - */ @Override public synchronized Map<String, String> getNativeEnvironmentCasePreserved() { if (fgNativeEnvCasePreserved == null) { - fgNativeEnvCasePreserved = new HashMap<String, String>(); + fgNativeEnvCasePreserved = new HashMap<>(); cacheNativeEnvironment(fgNativeEnvCasePreserved); } - return new HashMap<String, String>(fgNativeEnvCasePreserved); + return new HashMap<>(fgNativeEnvCasePreserved); } - /** - * @see ILaunchManager#getProcesses() - */ @Override public IProcess[] getProcesses() { synchronized (fLaunches) { - List<IProcess> allProcesses = new ArrayList<IProcess>(fLaunches.size()); + List<IProcess> allProcesses = new ArrayList<>(fLaunches.size()); IProcess[] processes = null; for (ILaunch launch : fLaunches) { processes = launch.getProcesses(); @@ -1949,18 +1845,12 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe } } - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchManager#getSourceContainerType(java.lang.String) - */ @Override public ISourceContainerType getSourceContainerType(String id) { initializeSourceContainerTypes(); return sourceContainerTypes.get(id); } - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchManager#getSourceContainerTypes() - */ @Override public ISourceContainerType[] getSourceContainerTypes() { initializeSourceContainerTypes(); @@ -1968,9 +1858,6 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe return containers.toArray(new ISourceContainerType[containers.size()]); } - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchManager#newSourcePathComputer(org.eclipse.debug.core.ILaunchConfiguration) - */ @Override public ISourcePathComputer getSourcePathComputer(ILaunchConfiguration configuration) throws CoreException { String id = null; @@ -1983,9 +1870,6 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe return getSourcePathComputer(id); } - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchManager#getSourcePathComputer(java.lang.String) - */ @Override public ISourcePathComputer getSourcePathComputer(String id) { initializeSourceContainerTypes(); @@ -2009,7 +1893,7 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe if (fComparators == null) { IExtensionPoint extensionPoint= Platform.getExtensionRegistry().getExtensionPoint(DebugPlugin.getUniqueIdentifier(), DebugPlugin.EXTENSION_POINT_LAUNCH_CONFIGURATION_COMPARATORS); IConfigurationElement[] infos= extensionPoint.getConfigurationElements(); - fComparators = new HashMap<String, LaunchConfigurationComparator>(infos.length); + fComparators = new HashMap<>(infos.length); IConfigurationElement configurationElement = null; String attr = null; for (int i= 0; i < infos.length; i++) { @@ -2020,7 +1904,7 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe } else { // invalid status handler IStatus s = new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), DebugException.INTERNAL_ERROR, - MessageFormat.format("Invalid launch configuration comparator extension defined by plug-in {0} - attribute not specified.", new Object[] { configurationElement.getContributor().getName() }), null); //$NON-NLS-1$ + MessageFormat.format("Invalid launch configuration comparator extension defined by plug-in {0} - attribute not specified.", configurationElement.getContributor().getName()), null); //$NON-NLS-1$ DebugPlugin.log(s); } } @@ -2035,7 +1919,7 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe hookResourceChangeListener(); IExtensionPoint extensionPoint= Platform.getExtensionRegistry().getExtensionPoint(DebugPlugin.getUniqueIdentifier(), DebugPlugin.EXTENSION_POINT_LAUNCH_CONFIGURATION_TYPES); IConfigurationElement[] infos = extensionPoint.getConfigurationElements(); - fLaunchConfigurationTypes = new ArrayList<ILaunchConfigurationType>(infos.length); + fLaunchConfigurationTypes = new ArrayList<>(infos.length); for (int i= 0; i < infos.length; i++) { fLaunchConfigurationTypes.add(new LaunchConfigurationType(infos[i])); } @@ -2050,7 +1934,7 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe try { IExtensionPoint extensionPoint= Platform.getExtensionRegistry().getExtensionPoint(DebugPlugin.getUniqueIdentifier(), DebugPlugin.EXTENSION_POINT_LAUNCH_MODES); IConfigurationElement[] infos= extensionPoint.getConfigurationElements(); - fLaunchModes = new HashMap<String, ILaunchMode>(); + fLaunchModes = new HashMap<>(); ILaunchMode mode = null; for (int i= 0; i < infos.length; i++) { mode = new LaunchMode(infos[i]); @@ -2068,7 +1952,7 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe if (sourceContainerTypes == null) { IExtensionPoint extensionPoint= Platform.getExtensionRegistry().getExtensionPoint(DebugPlugin.getUniqueIdentifier(), DebugPlugin.EXTENSION_POINT_SOURCE_CONTAINER_TYPES); IConfigurationElement[] extensions = extensionPoint.getConfigurationElements(); - sourceContainerTypes = new HashMap<String, ISourceContainerType>(); + sourceContainerTypes = new HashMap<>(); for (int i = 0; i < extensions.length; i++) { sourceContainerTypes.put( extensions[i].getAttribute(IConfigurationElementConstants.ID), @@ -2076,7 +1960,7 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe } extensionPoint= Platform.getExtensionRegistry().getExtensionPoint(DebugPlugin.getUniqueIdentifier(), DebugPlugin.EXTENSION_POINT_SOURCE_PATH_COMPUTERS); extensions = extensionPoint.getConfigurationElements(); - sourcePathComputers = new HashMap<String, ISourcePathComputer>(); + sourcePathComputers = new HashMap<>(); for (int i = 0; i < extensions.length; i++) { sourcePathComputers.put( extensions[i].getAttribute(IConfigurationElementConstants.ID), @@ -2092,7 +1976,7 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe if (fSourceLocators == null) { IExtensionPoint extensionPoint= Platform.getExtensionRegistry().getExtensionPoint(DebugPlugin.getUniqueIdentifier(), DebugPlugin.EXTENSION_POINT_SOURCE_LOCATORS); IConfigurationElement[] infos= extensionPoint.getConfigurationElements(); - fSourceLocators = new HashMap<String, IConfigurationElement>(infos.length); + fSourceLocators = new HashMap<>(infos.length); IConfigurationElement configurationElement = null; String id = null; for (int i= 0; i < infos.length; i++) { @@ -2103,7 +1987,7 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe } else { // invalid status handler IStatus s = new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), DebugException.INTERNAL_ERROR, - MessageFormat.format("Invalid source locator extension defined by plug-in \"{0}\": \"id\" not specified.", new Object[] { configurationElement.getContributor().getName() }), null); //$NON-NLS-1$ + MessageFormat.format("Invalid source locator extension defined by plug-in \"{0}\": \"id\" not specified.", configurationElement.getContributor().getName()), null); //$NON-NLS-1$ DebugPlugin.log(s); } } @@ -2146,9 +2030,7 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe return fLaunches.remove(launch); } } - /** - * @see ILaunchManager#isExistingLaunchConfigurationName(String) - */ + @Override public boolean isExistingLaunchConfigurationName(String name) { String[] sortedConfigNames = getAllSortedConfigNames(); @@ -2187,9 +2069,6 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe return Platform.getPreferencesService().getBoolean(DebugPlugin.getUniqueIdentifier(), DebugPlugin.PREF_DELETE_CONFIGS_ON_PROJECT_DELETE, true, null); } - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchManager#isRegistered(org.eclipse.debug.core.ILaunch) - */ @Override public boolean isRegistered(ILaunch launch) { synchronized (fLaunches) { @@ -2293,9 +2172,6 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe } } - /** - * @see ILaunchManager#newSourceLocator(String) - */ @Override public IPersistableSourceLocator newSourceLocator(String identifier) throws CoreException { initializeSourceLocators(); @@ -2338,9 +2214,6 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe } } - /** - * @see ILaunchManager#removeLaunch(ILaunch) - */ @Override public void removeLaunch(final ILaunch launch) { if (internalRemoveLaunch(launch)) { @@ -2349,20 +2222,14 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe } } - /** - * @see ILaunchManager#removeLaunchConfigurationListener(ILaunchConfigurationListener) - */ @Override public void removeLaunchConfigurationListener(ILaunchConfigurationListener listener) { fLaunchConfigurationListeners.remove(listener); } - /** - * @see org.eclipse.debug.core.ILaunchManager#removeLaunches(org.eclipse.debug.core.ILaunch[]) - */ @Override public void removeLaunches(ILaunch[] launches) { - List<ILaunch> removed = new ArrayList<ILaunch>(launches.length); + List<ILaunch> removed = new ArrayList<>(launches.length); for (int i = 0; i < launches.length; i++) { if (internalRemoveLaunch(launches[i])) { removed.add(launches[i]); @@ -2376,17 +2243,12 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe } } } - /** - * @see org.eclipse.debug.core.ILaunchManager#removeLaunchListener(org.eclipse.debug.core.ILaunchesListener) - */ + @Override public void removeLaunchListener(ILaunchesListener listener) { fLaunchesListeners.remove(listener); } - /** - * @see ILaunchManager#removeLaunchListener(ILaunchListener) - */ @Override public void removeLaunchListener(ILaunchListener listener) { fListeners.remove(listener); @@ -2427,7 +2289,7 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe * @return the list of associated launch configurations */ private ArrayList<ILaunchConfiguration> collectAssociatedLaunches(IResource resource) { - ArrayList<ILaunchConfiguration> list = new ArrayList<ILaunchConfiguration>(); + ArrayList<ILaunchConfiguration> list = new ArrayList<>(); try { ILaunchConfiguration[] configs = DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurations(); IResource[] resources = null; @@ -2669,7 +2531,7 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe * @since 3.4.0 */ public void importConfigurations(File[] files, IProgressMonitor monitor) throws CoreException { - Map<String, ILaunchConfiguration> sharedConfigs = new HashMap<String, ILaunchConfiguration>(); + Map<String, ILaunchConfiguration> sharedConfigs = new HashMap<>(); for (ILaunchConfiguration config : getAllLaunchConfigurations()) { if (!config.isLocal()) { StringBuffer buf = new StringBuffer(config.getName()); @@ -2712,10 +2574,10 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe } } catch (IOException e) { if (stati == null) { - stati = new ArrayList<Status>(); + stati = new ArrayList<>(); } stati.add(new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), DebugPlugin.ERROR, - MessageFormat.format(DebugCoreMessages.LaunchManager_27, new Object[] { source.getPath() }), e)); + MessageFormat.format(DebugCoreMessages.LaunchManager_27, source.getPath()), e)); } lmonitor.worked(1); } @@ -2763,7 +2625,7 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe if (fActiveModes == null) { ILaunchConfigurationType[] types = getLaunchConfigurationTypes(); ILaunchMode[] modes = getLaunchModes(); - fActiveModes = new HashSet<String>(3); + fActiveModes = new HashSet<>(3); for (int i = 0; i < types.length; i++) { for (int j = 0; j < modes.length; j++) { if (types[i].supportsMode(modes[j].getIdentifier())) { @@ -2775,9 +2637,6 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe return fActiveModes.contains(mode); } - /** - * @see org.eclipse.debug.core.ILaunchManager#generateLaunchConfigurationName(java.lang.String) - */ @Override public String generateLaunchConfigurationName(String namePrefix) { String name = generateUniqueLaunchConfigurationNameFrom(namePrefix); @@ -2803,9 +2662,6 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe return generateUniqueLaunchConfigurationNameFrom(name); } - /** - * @see org.eclipse.debug.core.ILaunchManager#isValidLaunchConfigurationName(java.lang.String) - */ @Override public boolean isValidLaunchConfigurationName(String configname) throws IllegalArgumentException { if(Platform.OS_WIN32.equals(Platform.getOS())) { diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LogicalStructureManager.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LogicalStructureManager.java index f0af97e5c..ca9ab0817 100644 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LogicalStructureManager.java +++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LogicalStructureManager.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2015 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 @@ -83,7 +83,7 @@ public class LogicalStructureManager { public ILogicalStructureType[] getLogicalStructureTypes(IValue value) { initialize(); // looks in the logical structure types - List<ILogicalStructureType> select = new ArrayList<ILogicalStructureType>(); + List<ILogicalStructureType> select = new ArrayList<>(); for (ILogicalStructureType type : fTypes) { if (type.providesLogicalStructure(value)) { select.add(type); @@ -103,7 +103,7 @@ public class LogicalStructureManager { * Loads the map of structure selections from the preference store. */ private void loadStructureTypeSelections() { - fStructureTypeSelections = new HashMap<String, Integer>(); + fStructureTypeSelections = new HashMap<>(); String selections= Platform.getPreferencesService().getString(DebugPlugin.getUniqueIdentifier(), PREF_STRUCTURE_SELECTIONS, IInternalDebugCoreConstants.EMPTY_STRING, null); // selections are stored in the form: // selection|selection|...selection| @@ -138,7 +138,7 @@ public class LogicalStructureManager { * Loads the collection of known structures identifiers from the preference store */ private void loadStructureTypeIds() { - fStructureTypeIds = new ArrayList<String>(); + fStructureTypeIds = new ArrayList<>(); // Types are stored as a comma-separated, ordered list. String types= Platform.getPreferencesService().getString(DebugPlugin.getUniqueIdentifier(), PREF_STRUCTURE_IDS, IInternalDebugCoreConstants.EMPTY_STRING, null); StringTokenizer tokenizer= new StringTokenizer(types, ","); //$NON-NLS-1$ @@ -243,7 +243,7 @@ public class LogicalStructureManager { //get the logical structure types from the extension points IExtensionPoint point = Platform.getExtensionRegistry().getExtensionPoint(DebugPlugin.getUniqueIdentifier(), DebugPlugin.EXTENSION_POINT_LOGICAL_STRUCTURE_TYPES); IConfigurationElement[] extensions = point.getConfigurationElements(); - fTypes = new ArrayList<LogicalStructureType>(extensions.length); + fTypes = new ArrayList<>(extensions.length); for (int i = 0; i < extensions.length; i++) { IConfigurationElement extension = extensions[i]; LogicalStructureType type; @@ -257,7 +257,7 @@ public class LogicalStructureManager { // get the logical structure providers from the extension point point= Platform.getExtensionRegistry().getExtensionPoint(DebugPlugin.getUniqueIdentifier(), DebugPlugin.EXTENSION_POINT_LOGICAL_STRUCTURE_PROVIDERS); extensions= point.getConfigurationElements(); - fTypeProviders = new ArrayList<LogicalStructureProvider>(extensions.length); + fTypeProviders = new ArrayList<>(extensions.length); for (int i= 0; i < extensions.length; i++) { try { fTypeProviders.add(new LogicalStructureProvider(extensions[i])); diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/MemoryBlockManager.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/MemoryBlockManager.java index 1b28178e3..8a1a96723 100644 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/MemoryBlockManager.java +++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/MemoryBlockManager.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2015 IBM Corporation and others. + * Copyright (c) 2004, 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 @@ -37,8 +37,8 @@ import org.eclipse.debug.core.model.IMemoryBlockRetrieval; */ public class MemoryBlockManager implements IMemoryBlockManager, IDebugEventSetListener { - private ArrayList<IMemoryBlockListener> listeners = new ArrayList<IMemoryBlockListener>(); - private ArrayList<IMemoryBlock> memoryBlocks = new ArrayList<IMemoryBlock>(); + private ArrayList<IMemoryBlockListener> listeners = new ArrayList<>(); + private ArrayList<IMemoryBlock> memoryBlocks = new ArrayList<>(); private static final int ADDED = 0; private static final int REMOVED = 1; @@ -52,17 +52,11 @@ public class MemoryBlockManager implements IMemoryBlockManager, IDebugEventSetLi private int fType; private IMemoryBlock[] fMemoryBlocks; - /** - * @see org.eclipse.core.runtime.ISafeRunnable#handleException(java.lang.Throwable) - */ @Override public void handleException(Throwable exception) { DebugPlugin.log(exception); } - /** - * @see org.eclipse.core.runtime.ISafeRunnable#run() - */ @Override public void run() throws Exception { switch (fType) { @@ -109,9 +103,6 @@ public class MemoryBlockManager implements IMemoryBlockManager, IDebugEventSetLi return new MemoryBlockNotifier(); } - /* (non-Javadoc) - * @see org.eclipse.debug.ui.IMemoryBlockManager#addMemoryBlock(org.eclipse.debug.core.model.IMemoryBlock) - */ @Override public void addMemoryBlocks(IMemoryBlock[] mem) { if (memoryBlocks == null) { @@ -123,7 +114,7 @@ public class MemoryBlockManager implements IMemoryBlockManager, IDebugEventSetLi } if(mem.length > 0) { - ArrayList<IMemoryBlock> newMemoryBlocks = new ArrayList<IMemoryBlock>(); + ArrayList<IMemoryBlock> newMemoryBlocks = new ArrayList<>(); for (int i=0; i<mem.length; i++) { // do not allow duplicates if (!memoryBlocks.contains(mem[i])) { @@ -139,9 +130,6 @@ public class MemoryBlockManager implements IMemoryBlockManager, IDebugEventSetLi } } - /* (non-Javadoc) - * @see org.eclipse.debug.ui.IMemoryBlockManager#removeMemoryBlock(org.eclipse.debug.core.model.IMemoryBlock) - */ @Override public void removeMemoryBlocks(IMemoryBlock[] memBlocks) { if (memoryBlocks == null) { @@ -171,9 +159,6 @@ public class MemoryBlockManager implements IMemoryBlockManager, IDebugEventSetLi } } - /* (non-Javadoc) - * @see org.eclipse.debug.ui.IMemoryBlockManager#addListener(org.eclipse.debug.ui.IMemoryBlockListener) - */ @Override public void addListener(IMemoryBlockListener listener) { @@ -189,9 +174,6 @@ public class MemoryBlockManager implements IMemoryBlockManager, IDebugEventSetLi } } - /* (non-Javadoc) - * @see org.eclipse.debug.ui.IMemoryBlockManager#removeListener(org.eclipse.debug.ui.IMemoryBlockListener) - */ @Override public void removeListener(IMemoryBlockListener listener) { @@ -207,20 +189,14 @@ public class MemoryBlockManager implements IMemoryBlockManager, IDebugEventSetLi } } - /* (non-Javadoc) - * @see org.eclipse.debug.core.IMemoryBlockManager#getMemoryBlocks() - */ @Override public IMemoryBlock[] getMemoryBlocks() { return memoryBlocks.toArray(new IMemoryBlock[memoryBlocks.size()]); } - /* (non-Javadoc) - * @see org.eclipse.debug.ui.IMemoryBlockManager#getMemoryBlocks(org.eclipse.debug.core.model.IDebugTarget) - */ @Override public IMemoryBlock[] getMemoryBlocks(IDebugTarget debugTarget) { - ArrayList<IMemoryBlock> memoryBlocksList = new ArrayList<IMemoryBlock>(); + ArrayList<IMemoryBlock> memoryBlocksList = new ArrayList<>(); for (IMemoryBlock block : memoryBlocks) { if (block.getDebugTarget() == debugTarget) { memoryBlocksList.add(block); @@ -229,12 +205,9 @@ public class MemoryBlockManager implements IMemoryBlockManager, IDebugEventSetLi return memoryBlocksList.toArray(new IMemoryBlock[memoryBlocksList.size()]); } - /* (non-Javadoc) - * @see org.eclipse.debug.ui.IMemoryBlockManager#getMemoryBlocks(org.eclipse.debug.core.model.IMemoryBlockRetrieval) - */ @Override public IMemoryBlock[] getMemoryBlocks(IMemoryBlockRetrieval retrieve) { - ArrayList<IMemoryBlock> memoryBlocksList = new ArrayList<IMemoryBlock>(); + ArrayList<IMemoryBlock> memoryBlocksList = new ArrayList<>(); for (IMemoryBlock block : memoryBlocks) { if (block instanceof IMemoryBlockExtension) { if (((IMemoryBlockExtension) block).getMemoryBlockRetrieval() == retrieve) { @@ -264,9 +237,6 @@ public class MemoryBlockManager implements IMemoryBlockManager, IDebugEventSetLi getMemoryBlockNotifier().notify(memBlocks, event); } - /* (non-Javadoc) - * @see org.eclipse.debug.core.IDebugEventSetListener#handleDebugEvents(org.eclipse.debug.core.DebugEvent[]) - */ @Override public void handleDebugEvents(DebugEvent[] events) { for (int i=0; i < events.length; i++) { diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/StepFilterManager.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/StepFilterManager.java index 443e98f10..cce63f5e6 100644 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/StepFilterManager.java +++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/StepFilterManager.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2015 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 @@ -50,16 +50,11 @@ public class StepFilterManager implements ILaunchListener { DebugPlugin.getDefault().getLaunchManager().removeLaunchListener(this); } - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchListener#launchAdded(org.eclipse.debug.core.ILaunch) - */ @Override public void launchAdded(ILaunch launch) { launchChanged(launch); } - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchListener#launchChanged(org.eclipse.debug.core.ILaunch) - */ + @Override public void launchChanged(ILaunch launch) { IStepFiltersHandler command = launch.getAdapter(IStepFiltersHandler.class); @@ -91,9 +86,6 @@ public class StepFilterManager implements ILaunchListener { } } - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchListener#launchRemoved(org.eclipse.debug.core.ILaunch) - */ @Override public void launchRemoved(ILaunch launch) {} @@ -109,7 +101,7 @@ public class StepFilterManager implements ILaunchListener { */ public IStepFilter[] getStepFilters(String modelIdentifier) { initialize(); - List<IStepFilter> select = new ArrayList<IStepFilter>(); + List<IStepFilter> select = new ArrayList<>(); for (StepFilter extension : stepFilters) { for (IStepFilter stepFilter : extension.getStepFilters(modelIdentifier)) { select.add(stepFilter); @@ -124,7 +116,7 @@ public class StepFilterManager implements ILaunchListener { if (stepFilters == null) { IExtensionPoint point = Platform.getExtensionRegistry().getExtensionPoint(DebugPlugin.getUniqueIdentifier(), DebugPlugin.EXTENSION_POINT_STEP_FILTERS); IConfigurationElement[] extensions = point.getConfigurationElements(); - stepFilters = new ArrayList<StepFilter>(); + stepFilters = new ArrayList<>(); for (IConfigurationElement extension : extensions) { try { stepFilters.add(new StepFilter(extension)); diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/XMLMemento.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/XMLMemento.java index a3a21e2eb..31854b812 100644 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/XMLMemento.java +++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/XMLMemento.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2015 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 @@ -220,7 +220,7 @@ public final class XMLMemento { } // Extract each node with given type. - ArrayList<Element> list = new ArrayList<Element>(size); + ArrayList<Element> list = new ArrayList<>(size); for (int nX = 0; nX < size; nX++) { Node node = nodes.item(nX); if (node instanceof Element) { diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/StepCommand.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/StepCommand.java index 0cf2c6a58..e5df6da7e 100644 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/StepCommand.java +++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/StepCommand.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2015 IBM Corporation and others. + * Copyright (c) 2006, 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 @@ -60,7 +60,7 @@ public abstract class StepCommand extends AbstractDebugCommand { return true; } // check if frames from same thread - Set<IThread> threads = new HashSet<IThread>(targets.length); + Set<IThread> threads = new HashSet<>(targets.length); for (int i = 0; i < targets.length; i++) { Object object = targets[i]; IStackFrame frame = null; diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/groups/GroupLaunch.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/groups/GroupLaunch.java index d46953cf4..bdb2e28cf 100644 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/groups/GroupLaunch.java +++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/groups/GroupLaunch.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2016 QNX Software Systems and others. + * Copyright (c) 2009, 2018 QNX Software 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 @@ -49,7 +49,7 @@ public class GroupLaunch extends Launch implements ILaunchesListener2 { * A map of all our sub-launches and the current processes that belong to * each one. */ - private Map<ILaunch, IProcess[]> subLaunches = new HashMap<ILaunch, IProcess[]>(); + private Map<ILaunch, IProcess[]> subLaunches = new HashMap<>(); public GroupLaunch(ILaunchConfiguration launchConfiguration, String mode) { super(launchConfiguration, mode, null); diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/sourcelookup/SourceLookupUtils.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/sourcelookup/SourceLookupUtils.java index 1bc135f12..ff6dcc03c 100644 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/sourcelookup/SourceLookupUtils.java +++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/sourcelookup/SourceLookupUtils.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2013 IBM Corporation and others. + * Copyright (c) 2003, 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 @@ -37,7 +37,7 @@ public class SourceLookupUtils { * is about to be closed or deleted, when a launch is * removed, and when a debug target or process terminates. */ - private static HashMap<String, ZipFile> fgZipFileCache = new HashMap<String, ZipFile>(5); + private static HashMap<String, ZipFile> fgZipFileCache = new HashMap<>(5); private static ArchiveCleaner fgCleaner = null; /** @@ -102,9 +102,6 @@ public class SourceLookupUtils { */ static class ArchiveCleaner implements IResourceChangeListener, ILaunchesListener2 { - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchesListener#launchesRemoved(org.eclipse.debug.core.ILaunch[]) - */ @Override public void launchesRemoved(ILaunch[] launches) { for (int i = 0; i < launches.length; i++) { @@ -116,31 +113,19 @@ public class SourceLookupUtils { } } - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchesListener#launchesAdded(org.eclipse.debug.core.ILaunch[]) - */ @Override public void launchesAdded(ILaunch[] launches) { } - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchesListener#launchesChanged(org.eclipse.debug.core.ILaunch[]) - */ @Override public void launchesChanged(ILaunch[] launches) { } - /* (non-Javadoc) - * @see org.eclipse.core.resources.IResourceChangeListener#resourceChanged(org.eclipse.core.resources.IResourceChangeEvent) - */ @Override public void resourceChanged(IResourceChangeEvent event) { SourceLookupUtils.closeArchives(); } - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchesListener2#launchesTerminated(org.eclipse.debug.core.ILaunch[]) - */ @Override public void launchesTerminated(ILaunch[] launches) { SourceLookupUtils.closeArchives(); |