diff options
author | Jonah Graham | 2018-11-20 16:20:42 +0000 |
---|---|---|
committer | Jonah Graham | 2018-11-22 21:55:36 +0000 |
commit | caf2292768deccd885b5b6989b731742e2e5edf4 (patch) | |
tree | 711a6088f2e17c7e31ebb51af1eadc1af00768e5 /dsf/org.eclipse.cdt.dsf | |
parent | 8844a8f9f22802fedffa3cb2a8a21b041aa64b74 (diff) | |
download | org.eclipse.cdt-caf2292768deccd885b5b6989b731742e2e5edf4.tar.gz org.eclipse.cdt-caf2292768deccd885b5b6989b731742e2e5edf4.tar.xz org.eclipse.cdt-caf2292768deccd885b5b6989b731742e2e5edf4.zip |
Bug 540373: Cleanup: Remove redundant type arguments
This was done by selecting all projects in Eclipse then
Source -> Clean Up... -> choosing:
- Remove redundant type arguments
and completing the wizard
Change-Id: Iaecc7010f097b4b1fabd29ccaa34ccb23a716fbf
Diffstat (limited to 'dsf/org.eclipse.cdt.dsf')
18 files changed, 87 insertions, 87 deletions
diff --git a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/AbstractCache.java b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/AbstractCache.java index 615bc312c9c..a8cc47eddaa 100644 --- a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/AbstractCache.java +++ b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/AbstractCache.java @@ -246,7 +246,7 @@ public abstract class AbstractCache<V> implements ICache<V> { synchronized (this) { if (fWaitingList instanceof RequestMonitor) { if (((RequestMonitor) fWaitingList).isCanceled()) { - canceledRms = new ArrayList<RequestMonitor>(1); + canceledRms = new ArrayList<>(1); canceledRms.add((RequestMonitor) fWaitingList); canceled = true; } else { @@ -259,7 +259,7 @@ public abstract class AbstractCache<V> implements ICache<V> { if (waitingList[i] != null) { if (waitingList[i].isCanceled()) { if (canceledRms == null) { - canceledRms = new ArrayList<RequestMonitor>(1); + canceledRms = new ArrayList<>(1); } canceledRms.add(waitingList[i]); } else { diff --git a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/DefaultDsfExecutor.java b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/DefaultDsfExecutor.java index 389b67fd4a2..74782ff5822 100644 --- a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/DefaultDsfExecutor.java +++ b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/DefaultDsfExecutor.java @@ -147,7 +147,7 @@ public class DefaultDsfExecutor extends ScheduledThreadPoolExecutor implements D * an executable object was created. * <br>Note: Only used when tracing. */ - static Map<Thread, DefaultDsfExecutor> fThreadToExecutorMap = new HashMap<Thread, DefaultDsfExecutor>(); + static Map<Thread, DefaultDsfExecutor> fThreadToExecutorMap = new HashMap<>(); /** * Currently executing runnable/callable. @@ -434,7 +434,7 @@ public class DefaultDsfExecutor extends ScheduledThreadPoolExecutor implements D public <V> ScheduledFuture<V> schedule(Callable<V> callable, long delay, TimeUnit unit) { if (DEBUG_EXECUTOR || ASSERTIONS_ENABLED) { if (!(callable instanceof TracingWrapper)) { - callable = new TracingWrapperCallable<V>(callable); + callable = new TracingWrapperCallable<>(callable); } } return super.schedule(callable, delay, unit); @@ -485,7 +485,7 @@ public class DefaultDsfExecutor extends ScheduledThreadPoolExecutor implements D @Override public <T> Future<T> submit(Callable<T> callable) { if (DEBUG_EXECUTOR || ASSERTIONS_ENABLED) { - callable = new TracingWrapperCallable<T>(callable); + callable = new TracingWrapperCallable<>(callable); } return super.submit(callable); } diff --git a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/DsfExecutable.java b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/DsfExecutable.java index e2c6510d122..59fa2a736b1 100644 --- a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/DsfExecutable.java +++ b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/DsfExecutable.java @@ -127,7 +127,7 @@ public class DsfExecutable { // constructor of this object. StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace(); Class<?> thisClass = getClass(); - Set<String> classNamesSet = new HashSet<String>(); + Set<String> classNamesSet = new HashSet<>(); while (thisClass != null) { classNamesSet.add(thisClass.getName()); thisClass = thisClass.getSuperclass(); diff --git a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/MultiRequestMonitor.java b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/MultiRequestMonitor.java index 4c88031e73f..541ee217d85 100644 --- a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/MultiRequestMonitor.java +++ b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/MultiRequestMonitor.java @@ -129,7 +129,7 @@ public class MultiRequestMonitor<V extends RequestMonitor> extends RequestMonito */ public List<V> getRequestMonitors() { synchronized (fRequestMonitorList) { // needed while copying, even when list is a synchronized collection - return new LinkedList<V>(fRequestMonitorList); + return new LinkedList<>(fRequestMonitorList); } } diff --git a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/RangeCache.java b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/RangeCache.java index 298b4bc86dc..13bb598ff50 100644 --- a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/RangeCache.java +++ b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/RangeCache.java @@ -135,7 +135,7 @@ abstract public class RangeCache<V> { * non-overlapping ranges of elements. */ - private SortedSet<Request> fRequests = new TreeSet<Request>(); + private SortedSet<Request> fRequests = new TreeSet<>(); public RangeCache(ImmediateInDsfExecutor executor) { fExecutor = executor; @@ -237,7 +237,7 @@ abstract public class RangeCache<V> { } private List<Request> getRequests(long fOffset, int fCount) { - List<Request> requests = new ArrayList<Request>(1); + List<Request> requests = new ArrayList<>(1); // Create a new request for the data to retrieve. Request current = new Request(fOffset, fCount); @@ -282,7 +282,7 @@ abstract public class RangeCache<V> { */ private Request adjustRequestTail(Request current, List<Request> transactionRequests, long offset, int count) { // Create a duplicate of the tailSet, in order to avoid a concurrent modification exception. - List<Request> tailSet = new ArrayList<Request>(fRequests.tailSet(current)); + List<Request> tailSet = new ArrayList<>(fRequests.tailSet(current)); // Iterate through the matching requests and add them to the requests list. for (Request tailRequest : tailSet) { @@ -318,7 +318,7 @@ abstract public class RangeCache<V> { } private List<V> makeElementsListFromRequests(List<Request> requests, long offset, int count) { - List<V> retVal = new ArrayList<V>(count); + List<V> retVal = new ArrayList<>(count); long index = offset; long end = offset + count; int requestIdx = 0; diff --git a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/ReflectionSequence.java b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/ReflectionSequence.java index ace6092de20..a1a8321fbcf 100644 --- a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/ReflectionSequence.java +++ b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/ReflectionSequence.java @@ -224,7 +224,7 @@ abstract public class ReflectionSequence extends Sequence { private List<Step> getGroupSteps(String groupId, Map<String, Method> executeMethods, Map<String, Method> rollBackMethods) { - List<Step> steps = new ArrayList<Step>(executeMethods.size()); + List<Step> steps = new ArrayList<>(executeMethods.size()); String[] order = getExecutionOrder(groupId); if (order == null) { @@ -244,7 +244,7 @@ abstract public class ReflectionSequence extends Sequence { } private Map<String, Method> getAnnotatedMethods(Class<? extends Annotation> annotationType) { - Map<String, Method> retVal = new HashMap<String, Method>(); + Map<String, Method> retVal = new HashMap<>(); try { Method[] methods = getClass().getMethods(); for (Method method : methods) { diff --git a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/RequestMonitor.java b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/RequestMonitor.java index 16bc0c31854..7721adc7d75 100644 --- a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/RequestMonitor.java +++ b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/RequestMonitor.java @@ -257,7 +257,7 @@ public class RequestMonitor extends DsfExecutable { */ public synchronized void addCancelListener(ICanceledListener listener) { if (fCancelListeners == null) { - fCancelListeners = new ArrayList<ICanceledListener>(1); + fCancelListeners = new ArrayList<>(1); } fCancelListeners.add(listener); } diff --git a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/datamodel/DMContexts.java b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/datamodel/DMContexts.java index b5dc17f266f..6701903e0e2 100644 --- a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/datamodel/DMContexts.java +++ b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/datamodel/DMContexts.java @@ -59,11 +59,11 @@ public class DMContexts { } // Use a LinkedHashSet to avoid duplicates and preserver insertion-order - Set<IDMContext> nodes = new LinkedHashSet<IDMContext>(); + Set<IDMContext> nodes = new LinkedHashSet<>(); nodes.addAll(Arrays.asList(ctx.getParents())); while (nodes.isEmpty() == false) { Set<IDMContext> parents = nodes; - nodes = new LinkedHashSet<IDMContext>(); + nodes = new LinkedHashSet<>(); for (IDMContext parent : parents) { if (ancestorType.isAssignableFrom(parent.getClass())) { return (V) parent; @@ -149,12 +149,12 @@ public class DMContexts { return null; // Use a LinkedHashSet to avoid duplicates and preserver insertion-order - Set<V> requestedAncestors = new LinkedHashSet<V>(); - Set<IDMContext> nodes = new LinkedHashSet<IDMContext>(); + Set<V> requestedAncestors = new LinkedHashSet<>(); + Set<IDMContext> nodes = new LinkedHashSet<>(); nodes.add(ctx); while (nodes.isEmpty() == false) { Set<IDMContext> parents = nodes; - nodes = new LinkedHashSet<IDMContext>(); + nodes = new LinkedHashSet<>(); for (IDMContext parent : parents) { if (ancestorType.isAssignableFrom(parent.getClass())) { requestedAncestors.add((V) parent); @@ -209,7 +209,7 @@ public class DMContexts { * This method is implemented recursively, which is not necessarily * the most efficient way to do this. */ - List<IDMContext> list = new ArrayList<IDMContext>(); + List<IDMContext> list = new ArrayList<>(); list.add(dmc); for (IDMContext parentDmc : dmc.getParents()) { diff --git a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/internal/provisional/model/MemoryBlockRetrievalManager.java b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/internal/provisional/model/MemoryBlockRetrievalManager.java index 4d547c4b9f7..84775b9c9d5 100644 --- a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/internal/provisional/model/MemoryBlockRetrievalManager.java +++ b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/internal/provisional/model/MemoryBlockRetrievalManager.java @@ -45,7 +45,7 @@ public class MemoryBlockRetrievalManager implements IMemoryBlockRetrievalManager private final String fModelId; private final DsfSession fSession; private final ILaunchConfiguration fLaunchConfig; - private final Map<IMemoryDMContext, IMemoryBlockRetrieval> fMapMemDMCToBlockRetrieval = new HashMap<IMemoryDMContext, IMemoryBlockRetrieval>(); + private final Map<IMemoryDMContext, IMemoryBlockRetrieval> fMapMemDMCToBlockRetrieval = new HashMap<>(); /** * Constructor diff --git a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/model/DsfMemoryBlock.java b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/model/DsfMemoryBlock.java index 50969a54027..527fe198a90 100644 --- a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/model/DsfMemoryBlock.java +++ b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/model/DsfMemoryBlock.java @@ -76,7 +76,7 @@ public class DsfMemoryBlock extends PlatformObject implements IMemoryBlockExtens private String fUpdatePolicy = UPDATE_POLICY_AUTOMATIC; - private ArrayList<Object> fConnections = new ArrayList<Object>(); + private ArrayList<Object> fConnections = new ArrayList<>(); @SuppressWarnings("unused") private boolean isEnabled; diff --git a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/model/DsfMemoryBlockRetrieval.java b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/model/DsfMemoryBlockRetrieval.java index 410facbad34..2e8b9489b03 100644 --- a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/model/DsfMemoryBlockRetrieval.java +++ b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/model/DsfMemoryBlockRetrieval.java @@ -253,7 +253,7 @@ public class DsfMemoryBlockRetrieval extends PlatformObject implements IMemoryBl // Process the block list specific to this memory context // FIXME: (Bug228573) We only process the first entry... if (root.getAttribute(ATTR_EXPRESSION_LIST_CONTEXT).equals(fContextString)) { - List<IMemoryBlock> blocks = new ArrayList<IMemoryBlock>(); + List<IMemoryBlock> blocks = new ArrayList<>(); NodeList expressionList = root.getChildNodes(); int length = expressionList.getLength(); for (int i = 0; i < length; ++i) { diff --git a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/BreakpointsMediator.java b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/BreakpointsMediator.java index b687727e93b..380e167384d 100644 --- a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/BreakpointsMediator.java +++ b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/BreakpointsMediator.java @@ -99,7 +99,7 @@ public class BreakpointsMediator extends AbstractDsfService implements IBreakpoi * - Modified on breakpointChanged() * - Diminished on breakpointRemoved() */ - private Map<IBreakpointsTargetDMContext, Map<IBreakpoint, List<Map<String, Object>>>> fPlatformBPs = new HashMap<IBreakpointsTargetDMContext, Map<IBreakpoint, List<Map<String, Object>>>>(); + private Map<IBreakpointsTargetDMContext, Map<IBreakpoint, List<Map<String, Object>>>> fPlatformBPs = new HashMap<>(); /** * Holds the mapping from platform breakpoint to the corresponding target @@ -111,19 +111,19 @@ public class BreakpointsMediator extends AbstractDsfService implements IBreakpoi * - A platform breakpoint is added/removed * - A thread filter is applied/removed */ - private Map<IBreakpointsTargetDMContext, Map<IBreakpoint, List<IBreakpointDMContext>>> fBreakpointDMContexts = new HashMap<IBreakpointsTargetDMContext, Map<IBreakpoint, List<IBreakpointDMContext>>>(); + private Map<IBreakpointsTargetDMContext, Map<IBreakpoint, List<IBreakpointDMContext>>> fBreakpointDMContexts = new HashMap<>(); /** * Due to the very asynchronous nature of DSF, a new breakpoint request can * pop up at any time before an ongoing one is completed. The following set * is used to store requests until the ongoing operation completes. */ - private Set<IBreakpoint> fPendingRequests = new HashSet<IBreakpoint>(); + private Set<IBreakpoint> fPendingRequests = new HashSet<>(); /** * @see fPendingRequests */ - private Set<IBreakpoint> fPendingBreakpoints = new HashSet<IBreakpoint>(); + private Set<IBreakpoint> fPendingBreakpoints = new HashSet<>(); /////////////////////////////////////////////////////////////////////////// // AbstractDsfService @@ -203,7 +203,7 @@ public class BreakpointsMediator extends AbstractDsfService implements IBreakpoi // We have to make a copy of the fPlatformBPs keys because uninstallBreakpoints() // modifies the map as it walks through it. - List<IBreakpointsTargetDMContext> platformBPKeysCopy = new ArrayList<IBreakpointsTargetDMContext>( + List<IBreakpointsTargetDMContext> platformBPKeysCopy = new ArrayList<>( fPlatformBPs.size()); platformBPKeysCopy.addAll(0, fPlatformBPs.keySet()); for (IBreakpointsTargetDMContext dmc : platformBPKeysCopy) { @@ -274,7 +274,7 @@ public class BreakpointsMediator extends AbstractDsfService implements IBreakpoi // Read initial breakpoints from platform. Copy the breakpoint attributes into a local map. // Note that we cannot write data into fPlatformBPs table here directly because we are not // executing on the dispatch thread. - final Map<IBreakpoint, List<Map<String, Object>>> initialPlatformBPs = new HashMap<IBreakpoint, List<Map<String, Object>>>(); + final Map<IBreakpoint, List<Map<String, Object>>> initialPlatformBPs = new HashMap<>(); try { // Get the stored breakpoint list from the platform BreakpointManager IBreakpoint[] bps = DebugPlugin.getDefault().getBreakpointManager().getBreakpoints(); @@ -441,7 +441,7 @@ public class BreakpointsMediator extends AbstractDsfService implements IBreakpoi protected void handleCompleted() { List<IBreakpointDMContext> list = breakpointIDs.get(breakpoint); if (list == null) { - list = new LinkedList<IBreakpointDMContext>(); + list = new LinkedList<>(); breakpointIDs.put(breakpoint, list); } @@ -567,19 +567,19 @@ public class BreakpointsMediator extends AbstractDsfService implements IBreakpoi } // Get the list of corresponding back-end breakpoints - final List<IBreakpointDMContext> oldBpContexts = new ArrayList<IBreakpointDMContext>( + final List<IBreakpointDMContext> oldBpContexts = new ArrayList<>( breakpointIDs.get(breakpoint)); // Calculate the list of attributes maps that have not changed. // Immediately add these to the list of new breakpoint contexts, // and remove them from further breakpoint attribute comparisons. final List<Map<String, Object>> commonAttrsList = getCommonAttributeMaps(newAttrsList0, oldAttrsList0); - final List<IBreakpointDMContext> newBpContexts = new ArrayList<IBreakpointDMContext>(commonAttrsList.size()); + final List<IBreakpointDMContext> newBpContexts = new ArrayList<>(commonAttrsList.size()); - final List<Map<String, Object>> newAttrsList = new ArrayList<Map<String, Object>>(newAttrsList0); + final List<Map<String, Object>> newAttrsList = new ArrayList<>(newAttrsList0); newAttrsList.removeAll(commonAttrsList); - List<Map<String, Object>> oldAttrsList = new ArrayList<Map<String, Object>>(oldAttrsList0); + List<Map<String, Object>> oldAttrsList = new ArrayList<>(oldAttrsList0); for (int i = 0; i < oldAttrsList.size(); i++) { if (commonAttrsList.contains(oldAttrsList.get(i))) { if (oldBpContexts.size() > i) { @@ -685,8 +685,8 @@ public class BreakpointsMediator extends AbstractDsfService implements IBreakpoi private List<Map<String, Object>> getCommonAttributeMaps(List<Map<String, Object>> array1, List<Map<String, Object>> array2) { - List<Map<String, Object>> intersection = new LinkedList<Map<String, Object>>(); - List<Map<String, Object>> list2 = new ArrayList<Map<String, Object>>(array2); + List<Map<String, Object>> intersection = new LinkedList<>(); + List<Map<String, Object>> list2 = new ArrayList<>(array2); for (Map<String, Object> array1Map : array1) { if (list2.remove(array1Map)) { intersection.add(array1Map); @@ -704,7 +704,7 @@ public class BreakpointsMediator extends AbstractDsfService implements IBreakpoi */ private List<Map<String, Object>> getAttributesDeltas(List<Map<String, Object>> oldAttributesList, List<Map<String, Object>> newAttributesList) { - List<Map<String, Object>> deltas = new ArrayList<Map<String, Object>>(oldAttributesList.size()); + List<Map<String, Object>> deltas = new ArrayList<>(oldAttributesList.size()); // Go through the bp attributes common to the old and the new lists and calculate // their deltas. @@ -712,16 +712,16 @@ public class BreakpointsMediator extends AbstractDsfService implements IBreakpoi Map<String, Object> oldAttributes = oldAttributesList.get(i); Map<String, Object> newAttributes = newAttributesList.get(i); - Map<String, Object> delta = new HashMap<String, Object>(); + Map<String, Object> delta = new HashMap<>(); Set<String> oldKeySet = oldAttributes.keySet(); Set<String> newKeySet = newAttributes.keySet(); - Set<String> commonKeys = new HashSet<String>(newKeySet); + Set<String> commonKeys = new HashSet<>(newKeySet); commonKeys.retainAll(oldKeySet); - Set<String> addedKeys = new HashSet<String>(newKeySet); + Set<String> addedKeys = new HashSet<>(newKeySet); addedKeys.removeAll(oldKeySet); - Set<String> removedKeys = new HashSet<String>(oldKeySet); + Set<String> removedKeys = new HashSet<>(oldKeySet); removedKeys.removeAll(newKeySet); // Add the modified attributes diff --git a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/BreakpointsMediator2.java b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/BreakpointsMediator2.java index 3cc49fe4c85..dac53b96c55 100644 --- a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/BreakpointsMediator2.java +++ b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/BreakpointsMediator2.java @@ -186,13 +186,13 @@ public class BreakpointsMediator2 extends AbstractDsfService implements IBreakpo * - Modified on breakpointChanged() * - Diminished on breakpointRemoved() */ - private Map<IBreakpointsTargetDMContext, Map<IBreakpoint, List<ITargetBreakpointInfo>>> fPlatformBPs = new HashMap<IBreakpointsTargetDMContext, Map<IBreakpoint, List<ITargetBreakpointInfo>>>(); + private Map<IBreakpointsTargetDMContext, Map<IBreakpoint, List<ITargetBreakpointInfo>>> fPlatformBPs = new HashMap<>(); /** * BreakpointsTargetDMContext's that are being removed from {@link #fPlatformBPs}. * See where this is used for more. */ - private List<IBreakpointsTargetDMContext> fBPTargetDMCsBeingRemoved = new ArrayList<IBreakpoints.IBreakpointsTargetDMContext>(); + private List<IBreakpointsTargetDMContext> fBPTargetDMCsBeingRemoved = new ArrayList<>(); /** * Mapping of platform breakpoints to all their attributes (standard ones and @@ -202,7 +202,7 @@ public class BreakpointsMediator2 extends AbstractDsfService implements IBreakpo * 2. updated in breakpointsChanged(); <br> * 3. diminished in breakpointsRemoved(); */ - private Map<IBreakpoint, Map<String, Object>> fBreakpointAttributes = new HashMap<IBreakpoint, Map<String, Object>>(); + private Map<IBreakpoint, Map<String, Object>> fBreakpointAttributes = new HashMap<>(); /** * Hold info about a breakpoint events (added, removed, changed) for later @@ -239,9 +239,9 @@ public class BreakpointsMediator2 extends AbstractDsfService implements IBreakpo * pop up at any time before an ongoing one is completed. The following set * is used to store requests until the ongoing operation completes. */ - private Set<IBreakpoint> fRunningEvents = new HashSet<IBreakpoint>(); + private Set<IBreakpoint> fRunningEvents = new HashSet<>(); - private Map<IBreakpoint, LinkedList<PendingEventInfo>> fPendingEvents = new HashMap<IBreakpoint, LinkedList<PendingEventInfo>>(); + private Map<IBreakpoint, LinkedList<PendingEventInfo>> fPendingEvents = new HashMap<>(); /////////////////////////////////////////////////////////////////////////// // AbstractDsfService @@ -319,7 +319,7 @@ public class BreakpointsMediator2 extends AbstractDsfService implements IBreakpo // We have to make a copy of the fPlatformBPs keys because uninstallBreakpoints() // modifies the map as it walks through it. - List<IBreakpointsTargetDMContext> platformBPKeysCopy = new ArrayList<IBreakpointsTargetDMContext>( + List<IBreakpointsTargetDMContext> platformBPKeysCopy = new ArrayList<>( fPlatformBPs.size()); platformBPKeysCopy.addAll(0, fPlatformBPs.keySet()); for (IBreakpointsTargetDMContext dmc : platformBPKeysCopy) { @@ -522,12 +522,12 @@ public class BreakpointsMediator2 extends AbstractDsfService implements IBreakpo // Ensure the breakpoint is not already installed assert !platformBPs.containsKey(breakpoint); - final ArrayList<TargetBP> targetBPsAttempted = new ArrayList<TargetBP>(attrsList.size()); + final ArrayList<TargetBP> targetBPsAttempted = new ArrayList<>(attrsList.size()); for (int i = 0; i < attrsList.size(); i++) { targetBPsAttempted.add(new TargetBP(attrsList.get(i))); } - final ArrayList<ITargetBreakpointInfo> targetBPsInstalled = new ArrayList<ITargetBreakpointInfo>( + final ArrayList<ITargetBreakpointInfo> targetBPsInstalled = new ArrayList<>( attrsList.size()); // Update the breakpoint status when all back-end breakpoints have been installed @@ -663,7 +663,7 @@ public class BreakpointsMediator2 extends AbstractDsfService implements IBreakpo getExecutor().execute(new DsfRunnable() { @Override public void run() { - Collection<IBreakpointsTargetDMContext> dmcs = new ArrayList<IBreakpointsTargetDMContext>(); + Collection<IBreakpointsTargetDMContext> dmcs = new ArrayList<>(); if (bpsTargetDmc == null) dmcs.addAll(fPlatformBPs.keySet()); else @@ -690,7 +690,7 @@ public class BreakpointsMediator2 extends AbstractDsfService implements IBreakpo * @return */ private PlatformBreakpointInfo[] collectBreakpointsInfo(IBreakpoint[] bps) { - List<PlatformBreakpointInfo> bpsInfo = new ArrayList<PlatformBreakpointInfo>(bps.length); + List<PlatformBreakpointInfo> bpsInfo = new ArrayList<>(bps.length); for (IBreakpoint bp : bps) { if (bp.getMarker() == null) @@ -713,7 +713,7 @@ public class BreakpointsMediator2 extends AbstractDsfService implements IBreakpo private void doBreakpointsAddedInExecutor(PlatformBreakpointInfo[] bpsInfo, Collection<IBreakpointsTargetDMContext> bpTargetDMCs, final RequestMonitor rm) { - final Map<IBreakpoint, Map<IBreakpointsTargetDMContext, ITargetBreakpointInfo[]>> eventBPs = new HashMap<IBreakpoint, Map<IBreakpointsTargetDMContext, ITargetBreakpointInfo[]>>( + final Map<IBreakpoint, Map<IBreakpointsTargetDMContext, ITargetBreakpointInfo[]>> eventBPs = new HashMap<>( bpsInfo.length, 1); CountingRequestMonitor processPendingCountingRm = new CountingRequestMonitor(getExecutor(), rm) { @@ -738,7 +738,7 @@ public class BreakpointsMediator2 extends AbstractDsfService implements IBreakpo int processPendingCountingRmCount = 0; for (final PlatformBreakpointInfo bpinfo : bpsInfo) { - final Map<IBreakpointsTargetDMContext, ITargetBreakpointInfo[]> targetBPs = new HashMap<IBreakpointsTargetDMContext, ITargetBreakpointInfo[]>( + final Map<IBreakpointsTargetDMContext, ITargetBreakpointInfo[]> targetBPs = new HashMap<>( fPlatformBPs.size(), 1); eventBPs.put(bpinfo.breakpoint, targetBPs); @@ -780,7 +780,7 @@ public class BreakpointsMediator2 extends AbstractDsfService implements IBreakpo // disabled breakpoint. If not, just bail out. // if (!bpinfo.enabled) { - Map<String, Object> attr = new HashMap<String, Object>(1); + Map<String, Object> attr = new HashMap<>(1); attr.put(IBreakpoint.ENABLED, Boolean.FALSE); Map<String, Object> targetEnablementAttr = fAttributeTranslator2.convertAttributes(attr); if (!fAttributeTranslator2.canUpdateAttributes(bpinfo.breakpoint, dmc, targetEnablementAttr)) { @@ -834,7 +834,7 @@ public class BreakpointsMediator2 extends AbstractDsfService implements IBreakpo getExecutor().execute(new DsfRunnable() { @Override public void run() { - Map<String, Object> tmp = new HashMap<String, Object>(1); + Map<String, Object> tmp = new HashMap<>(1); tmp.put(IBreakpoint.ENABLED, true); final String targetEnablementKey = fAttributeTranslator2.convertAttributes(tmp).keySet().iterator() .next(); @@ -859,9 +859,9 @@ public class BreakpointsMediator2 extends AbstractDsfService implements IBreakpo if (attrDelta.size() == 0) continue; - final List<IBreakpointsTargetDMContext> reinstallContexts = new ArrayList<IBreakpointsTargetDMContext>(); + final List<IBreakpointsTargetDMContext> reinstallContexts = new ArrayList<>(); - List<IBreakpointsTargetDMContext> updateContexts = new ArrayList<IBreakpointsTargetDMContext>(); + List<IBreakpointsTargetDMContext> updateContexts = new ArrayList<>(); // Now change the breakpoint for each known context. // @@ -987,7 +987,7 @@ public class BreakpointsMediator2 extends AbstractDsfService implements IBreakpo private void doBreakpointsRemoved(final IBreakpoint[] bps, final IBreakpointsTargetDMContext bpsTargetDmc, final RequestMonitor rm) { - final List<IBreakpoint> bpCandidates = new ArrayList<IBreakpoint>(); + final List<IBreakpoint> bpCandidates = new ArrayList<>(); for (int i = 0; i < bps.length; i++) { IBreakpoint bp = bps[i]; @@ -1007,7 +1007,7 @@ public class BreakpointsMediator2 extends AbstractDsfService implements IBreakpo getExecutor().execute(new DsfRunnable() { @Override public void run() { - Collection<IBreakpointsTargetDMContext> contexts = new ArrayList<IBreakpointsTargetDMContext>(); + Collection<IBreakpointsTargetDMContext> contexts = new ArrayList<>(); if (bpsTargetDmc == null) contexts.addAll(fPlatformBPs.keySet()); else @@ -1032,7 +1032,7 @@ public class BreakpointsMediator2 extends AbstractDsfService implements IBreakpo private void doBreakpointsRemovedInExecutor(IBreakpoint[] bpCandidates, Collection<IBreakpointsTargetDMContext> targetContexts, final RequestMonitor rm) { - final Map<IBreakpoint, Map<IBreakpointsTargetDMContext, ITargetBreakpointInfo[]>> eventBPs = new HashMap<IBreakpoint, Map<IBreakpointsTargetDMContext, ITargetBreakpointInfo[]>>( + final Map<IBreakpoint, Map<IBreakpointsTargetDMContext, ITargetBreakpointInfo[]>> eventBPs = new HashMap<>( bpCandidates.length, 1); CountingRequestMonitor processPendingCountingRm = new CountingRequestMonitor(getExecutor(), rm) { @@ -1068,7 +1068,7 @@ public class BreakpointsMediator2 extends AbstractDsfService implements IBreakpo processPendingCountingRmCount++; - final Map<IBreakpointsTargetDMContext, ITargetBreakpointInfo[]> targetBPs = new HashMap<IBreakpointsTargetDMContext, ITargetBreakpointInfo[]>( + final Map<IBreakpointsTargetDMContext, ITargetBreakpointInfo[]> targetBPs = new HashMap<>( fPlatformBPs.size(), 1); eventBPs.put(breakpoint, targetBPs); @@ -1116,7 +1116,7 @@ public class BreakpointsMediator2 extends AbstractDsfService implements IBreakpo private void updatePendingRequest(IBreakpoint breakpoint, PendingEventInfo pendingEvent) { LinkedList<PendingEventInfo> pendingEventsList = fPendingEvents.get(breakpoint); if (pendingEventsList == null) { - pendingEventsList = new LinkedList<PendingEventInfo>(); + pendingEventsList = new LinkedList<>(); fPendingEvents.put(breakpoint, pendingEventsList); } if (!pendingEventsList.isEmpty() && pendingEventsList.getLast().fEventType == BreakpointEventType.MODIFIED) { @@ -1136,7 +1136,7 @@ public class BreakpointsMediator2 extends AbstractDsfService implements IBreakpo // Make a copy to avoid ConcurrentModificationException // as we are deleting element in the loop. - Set<IBreakpoint> bpsInPendingEvents = new HashSet<IBreakpoint>(fPendingEvents.keySet()); + Set<IBreakpoint> bpsInPendingEvents = new HashSet<>(fPendingEvents.keySet()); for (IBreakpoint bp : bpsInPendingEvents) { if (!fRunningEvents.contains(bp)) { LinkedList<PendingEventInfo> eventInfoList = fPendingEvents.get(bp); @@ -1192,16 +1192,16 @@ public class BreakpointsMediator2 extends AbstractDsfService implements IBreakpo private Map<String, Object> getAttributesDelta(Map<String, Object> oldAttributes, Map<String, Object> newAttributes) { - Map<String, Object> delta = new HashMap<String, Object>(); + Map<String, Object> delta = new HashMap<>(); Set<String> oldKeySet = oldAttributes.keySet(); Set<String> newKeySet = newAttributes.keySet(); - Set<String> commonKeys = new HashSet<String>(newKeySet); + Set<String> commonKeys = new HashSet<>(newKeySet); commonKeys.retainAll(oldKeySet); - Set<String> addedKeys = new HashSet<String>(newKeySet); + Set<String> addedKeys = new HashSet<>(newKeySet); addedKeys.removeAll(oldKeySet); - Set<String> removedKeys = new HashSet<String>(oldKeySet); + Set<String> removedKeys = new HashSet<>(oldKeySet); removedKeys.removeAll(newKeySet); // Add the modified attributes diff --git a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/command/BufferedCommandControl.java b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/command/BufferedCommandControl.java index b270e02c6ca..c4c34521cd7 100644 --- a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/command/BufferedCommandControl.java +++ b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/command/BufferedCommandControl.java @@ -84,8 +84,8 @@ public class BufferedCommandControl implements ICommandControl { } }; - private final List<ICommandListener> fCommandProcessors = new ArrayList<ICommandListener>(); - private final List<IEventListener> fEventProcessors = new ArrayList<IEventListener>(); + private final List<ICommandListener> fCommandProcessors = new ArrayList<>(); + private final List<IEventListener> fEventProcessors = new ArrayList<>(); public BufferedCommandControl(ICommandControl controlDelegate, DsfExecutor executor, int depth) { fControlDelegate = controlDelegate; diff --git a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/command/CommandCache.java b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/command/CommandCache.java index 024006f48c6..b400275a6a8 100644 --- a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/command/CommandCache.java +++ b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/command/CommandCache.java @@ -84,7 +84,7 @@ public class CommandCache implements ICommandListener { public CommandInfo(CommandStyle cmdstyle, ICommand<ICommandResult> cmd, DataRequestMonitor<ICommandResult> rm) { fCmdStyle = cmdstyle; fCommand = cmd; - fCurrentRequestMonitors = new LinkedList<DataRequestMonitor<ICommandResult>>(); + fCurrentRequestMonitors = new LinkedList<>(); fCurrentRequestMonitors.add(rm); fCoalescedCmd = null; } @@ -186,15 +186,15 @@ public class CommandCache implements ICommandListener { * created. When the coalesced commands completes the results will be decomposed * when back into individual results from this command. */ - private Set<IDMContext> fAvailableContexts = new HashSet<IDMContext>(); + private Set<IDMContext> fAvailableContexts = new HashSet<>(); - private Map<IDMContext, HashMap<CommandInfo, CommandResultInfo>> fCachedContexts = new HashMap<IDMContext, HashMap<CommandInfo, CommandResultInfo>>(); + private Map<IDMContext, HashMap<CommandInfo, CommandResultInfo>> fCachedContexts = new HashMap<>(); - private ArrayList<CommandInfo> fPendingQCommandsSent = new ArrayList<CommandInfo>(); + private ArrayList<CommandInfo> fPendingQCommandsSent = new ArrayList<>(); - private ArrayList<CommandInfo> fPendingQCommandsNotYetSent = new ArrayList<CommandInfo>(); + private ArrayList<CommandInfo> fPendingQCommandsNotYetSent = new ArrayList<>(); - private ArrayList<CommandInfo> fPendingQWaitingForCoalescedCompletion = new ArrayList<CommandInfo>(); + private ArrayList<CommandInfo> fPendingQWaitingForCoalescedCompletion = new ArrayList<>(); private static boolean DEBUG = false; private static final String CACHE_TRACE_IDENTIFIER = " [CHE]"; //$NON-NLS-1$ @@ -261,7 +261,7 @@ public class CommandCache implements ICommandListener { */ private CommandInfo getCoalescedCommand(CommandInfo cmd) { - for (CommandInfo currentUnsentEntry : new ArrayList<CommandInfo>(fPendingQCommandsNotYetSent)) { + for (CommandInfo currentUnsentEntry : new ArrayList<>(fPendingQCommandsNotYetSent)) { /* * Get the current unsent entry to determine if we can coalesced with it. */ @@ -287,7 +287,7 @@ public class CommandCache implements ICommandListener { * them to point to the new super command. */ - for (CommandInfo waitingEntry : new ArrayList<CommandInfo>( + for (CommandInfo waitingEntry : new ArrayList<>( fPendingQWaitingForCoalescedCompletion)) { if (waitingEntry.getCoalescedCmd() == currentUnsentEntry) { @@ -469,7 +469,7 @@ public class CommandCache implements ICommandListener { * we create a new result from the coalesced command for it. */ - for (CommandInfo waitingEntry : new ArrayList<CommandInfo>( + for (CommandInfo waitingEntry : new ArrayList<>( fPendingQWaitingForCoalescedCompletion)) { if (waitingEntry.getCoalescedCmd() == finalCachedCmd) { @@ -487,7 +487,7 @@ public class CommandCache implements ICommandListener { if (fCachedContexts.get(context) != null) { fCachedContexts.get(context).put(waitingEntry, subResultInfo); } else { - HashMap<CommandInfo, CommandResultInfo> map = new HashMap<CommandInfo, CommandResultInfo>(); + HashMap<CommandInfo, CommandResultInfo> map = new HashMap<>(); map.put(waitingEntry, subResultInfo); fCachedContexts.put(context, map); } @@ -529,7 +529,7 @@ public class CommandCache implements ICommandListener { if (fCachedContexts.get(context) != null) { fCachedContexts.get(context).put(finalCachedCmd, resultInfo); } else { - HashMap<CommandInfo, CommandResultInfo> map = new HashMap<CommandInfo, CommandResultInfo>(); + HashMap<CommandInfo, CommandResultInfo> map = new HashMap<>(); map.put(finalCachedCmd, resultInfo); fCachedContexts.put(context, map); } @@ -649,7 +649,7 @@ public class CommandCache implements ICommandListener { // instead of only using 'cachedCmd'. This is because although cachedCmd can be considered // equal to unqueuedCommand, it is not identical and we need the full content of unqueuedCommand. // For instance, cachedCmd does not have the list of requestMonitors that unqueuedCommand has. - for (CommandInfo unqueuedCommand : new ArrayList<CommandInfo>(fPendingQCommandsNotYetSent)) { + for (CommandInfo unqueuedCommand : new ArrayList<>(fPendingQCommandsNotYetSent)) { if (unqueuedCommand.equals(cachedCmd)) { fPendingQCommandsNotYetSent.remove(unqueuedCommand); fPendingQCommandsSent.add(unqueuedCommand); diff --git a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/sourcelookup/DsfSourceLookupParticipant.java b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/sourcelookup/DsfSourceLookupParticipant.java index 79494a842dd..e078b8d3bdd 100644 --- a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/sourcelookup/DsfSourceLookupParticipant.java +++ b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/sourcelookup/DsfSourceLookupParticipant.java @@ -86,7 +86,7 @@ public class DsfSourceLookupParticipant extends AbstractSourceLookupParticipant if (results != null) { return results.toArray(); } else { - results = new ArrayList<Object>(); + results = new ArrayList<>(); } ISourceContainer[] containers = getSourceContainers(); // if there is no containers, we can default to absolute path, since we should be able resolve file by absolute path diff --git a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/service/AbstractDsfService.java b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/service/AbstractDsfService.java index 01bcd626a56..c31f32014e6 100644 --- a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/service/AbstractDsfService.java +++ b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/service/AbstractDsfService.java @@ -169,7 +169,7 @@ abstract public class AbstractDsfService implements IDsfService, IDsfStatusConst String[] previousClasses = (String[]) fRegistration.getReference().getProperty(Constants.OBJECTCLASS); // Use a HashSet to avoid duplicates - Set<String> newClasses = new HashSet<String>(); + Set<String> newClasses = new HashSet<>(); newClasses.addAll(Arrays.asList(previousClasses)); newClasses.addAll(Arrays.asList(classes)); classes = newClasses.toArray(new String[0]); diff --git a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/service/DsfSession.java b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/service/DsfSession.java index 3e4624a6e63..13d3c831bfc 100644 --- a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/service/DsfSession.java +++ b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/service/DsfSession.java @@ -287,7 +287,7 @@ public class DsfSession { private int fServiceInstanceCounter; /** Map of registered event listeners. */ - private Map<ListenerEntry, Method[]> fListeners = new HashMap<ListenerEntry, Method[]>(); + private Map<ListenerEntry, Method[]> fListeners = new HashMap<>(); /** * Map of registered adapters, for implementing the <code>IDMContext.getAdapter()</code> @@ -485,7 +485,7 @@ public class DsfSession { Dictionary<String, ?> serviceProperties = (Dictionary<String, ?>) _serviceProperties; // Build a list of listeners; - SortedMap<ListenerEntry, List<Method>> listeners = new TreeMap<ListenerEntry, List<Method>>( + SortedMap<ListenerEntry, List<Method>> listeners = new TreeMap<>( new Comparator<ListenerEntry>() { @Override public int compare(ListenerEntry o1, ListenerEntry o2) { @@ -517,7 +517,7 @@ public class DsfSession { continue; } Method[] allMethods = entry.getValue(); - List<Method> matchingMethods = new ArrayList<Method>(); + List<Method> matchingMethods = new ArrayList<>(); for (Method method : allMethods) { assert method.getParameterTypes().length > 0 : eventClass.getName() + "." + method.getName() //$NON-NLS-1$ + " signature contains zero parameters"; //$NON-NLS-1$ @@ -570,7 +570,7 @@ public class DsfSession { * @return the collection of handler methods */ private Method[] getEventHandlerMethods(Object listener) { - List<Method> retVal = new ArrayList<Method>(); + List<Method> retVal = new ArrayList<>(); try { Method[] methods = listener.getClass().getMethods(); for (Method method : methods) { |