Skip to content

Commit 3770686

Browse files
authored
Merge branch 'eclipse-platform:master' into master
2 parents beb6759 + 08a9488 commit 3770686

File tree

210 files changed

+4166
-2855
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

210 files changed

+4166
-2855
lines changed

ant/org.eclipse.ant.launching/build.properties

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,7 @@ extra.lib/loggers.jar = lib/antdebug.jar
3434
#output.lib/antdebug.jar = common_bin/
3535
#source.lib/remote.jar = remote/
3636
#output.lib/remote.jar = remote_bin/
37-
src.includes = about.html,\
38-
remote/,\
39-
common/
37+
src.includes = about.html
4038
javacWarnings..=-unavoidableGenericProblems
4139

4240
# Maven properties, see https://github.com/eclipse/tycho/wiki/Tycho-Pomless

ant/org.eclipse.ant.ui/build.properties

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@ output.lib/antrunner.jar = ant_runner_support_bin/
2121
#source.lib/remoteAnt.jar = Remote Ant Support/
2222
#output.lib/remoteAnt.jar = remote_support_bin/
2323
src.includes = about.html,\
24-
about_files/,\
25-
Remote Ant Support/
26-
24+
about_files/
2725
bin.includes = icons/,\
2826
plugin.properties,\
2927
plugin.xml,\

debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointEnablement.java

Lines changed: 40 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,15 @@
1313
*******************************************************************************/
1414
package org.eclipse.debug.internal.ui.views.breakpoints;
1515

16+
import java.util.Collections;
17+
import java.util.Map;
18+
import java.util.WeakHashMap;
19+
1620
import org.eclipse.core.resources.IMarkerDelta;
1721
import org.eclipse.core.runtime.CoreException;
1822
import org.eclipse.core.runtime.IAdaptable;
1923
import org.eclipse.debug.core.DebugPlugin;
20-
import org.eclipse.debug.core.IBreakpointListener;
24+
import org.eclipse.debug.core.IBreakpointsListener;
2125
import org.eclipse.debug.core.model.IBreakpoint;
2226
import org.eclipse.debug.ui.AbstractBreakpointOrganizerDelegate;
2327
import org.eclipse.debug.ui.BreakpointTypeCategory;
@@ -26,18 +30,22 @@
2630
* Breakpoint organizers for breakpoint types based on breakpoint enablement
2731
* state.
2832
*/
29-
public class BreakpointEnablement extends AbstractBreakpointOrganizerDelegate implements IBreakpointListener {
33+
public class BreakpointEnablement extends AbstractBreakpointOrganizerDelegate implements IBreakpointsListener {
3034

3135
private final BreakpointTypeCategory ENABLED = new BreakpointTypeCategory("Enabled", 0); //$NON-NLS-1$
3236
private final BreakpointTypeCategory DISABLED = new BreakpointTypeCategory("Disabled", 1); //$NON-NLS-1$
3337

38+
private final Map<IBreakpoint, Boolean> breakpointCache;
39+
3440
public BreakpointEnablement() {
3541
DebugPlugin.getDefault().getBreakpointManager().addBreakpointListener(this);
42+
breakpointCache = Collections.synchronizedMap(new WeakHashMap<>());
3643
}
3744

3845
@Override
3946
public void dispose() {
4047
DebugPlugin.getDefault().getBreakpointManager().removeBreakpointListener(this);
48+
breakpointCache.clear();
4149
}
4250

4351
@Override
@@ -49,6 +57,7 @@ public IAdaptable[] getCategories(IBreakpoint breakpoint) {
4957
} else {
5058
categories = new IAdaptable[] { DISABLED };
5159
}
60+
breakpointCache.put(breakpoint, breakpoint.isEnabled());
5261
return categories;
5362
} catch (CoreException e) {
5463
DebugPlugin.log(e);
@@ -57,15 +66,40 @@ public IAdaptable[] getCategories(IBreakpoint breakpoint) {
5766
}
5867

5968
@Override
60-
public void breakpointAdded(IBreakpoint breakpoint) {
69+
public void breakpointsAdded(IBreakpoint[] breakpoints) {
70+
for (IBreakpoint breakpoint : breakpoints) {
71+
try {
72+
breakpointCache.put(breakpoint, breakpoint.isEnabled());
73+
} catch (CoreException e) {
74+
DebugPlugin.log(e);
75+
}
76+
}
6177
}
6278

6379
@Override
64-
public void breakpointRemoved(IBreakpoint breakpoint, IMarkerDelta delta) {
80+
public void breakpointsRemoved(IBreakpoint[] breakpoints, IMarkerDelta[] deltas) {
81+
for (IBreakpoint breakpoint : breakpoints) {
82+
breakpointCache.remove(breakpoint);
83+
}
6584
}
6685

6786
@Override
68-
public void breakpointChanged(IBreakpoint breakpoint, IMarkerDelta delta) {
69-
fireCategoryChanged(ENABLED);
87+
public void breakpointsChanged(IBreakpoint[] breakpoints, IMarkerDelta[] deltas) {
88+
boolean updateCategories = false;
89+
for (IBreakpoint breakpoint : breakpoints) {
90+
try {
91+
boolean isEnabled = breakpoint.isEnabled();
92+
Boolean wasEnabled = breakpointCache.get(breakpoint);
93+
if (wasEnabled == null || wasEnabled != isEnabled) {
94+
breakpointCache.put(breakpoint, isEnabled);
95+
updateCategories = true;
96+
}
97+
} catch (CoreException e) {
98+
DebugPlugin.log(e);
99+
}
100+
}
101+
if (updateCategories) {
102+
fireCategoryChanged(ENABLED);
103+
}
70104
}
71105
}

debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/DebugElementHelper.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
*******************************************************************************/
1414
package org.eclipse.debug.internal.ui.views.launch;
1515

16-
import java.util.HashMap;
1716
import java.util.Map;
17+
import java.util.concurrent.ConcurrentHashMap;
1818

1919
import org.eclipse.debug.core.model.Breakpoint;
2020
import org.eclipse.debug.internal.ui.DelegatingModelPresentation;
@@ -44,7 +44,7 @@ public class DebugElementHelper {
4444
private static DelegatingModelPresentation fgPresenetation;
4545

4646
// map of images to image descriptors
47-
private static Map<Image, ImageDescriptor> fgImages = new HashMap<>();
47+
private static Map<Image, ImageDescriptor> fgImages = new ConcurrentHashMap<>();
4848

4949
/**
5050
* Disposes this adapter

resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/dtree/AbstractDataTreeNode.java

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,11 @@ public abstract class AbstractDataTreeNode {
5050
*/
5151
AbstractDataTreeNode(String name, AbstractDataTreeNode[] children) {
5252
this.name = name;
53-
if (children == null || children.length == 0)
53+
if (children == null || children.length == 0) {
5454
this.children = AbstractDataTreeNode.NO_CHILDREN;
55-
else
55+
} else {
5656
this.children = children;
57+
}
5758
}
5859

5960
/**
@@ -84,8 +85,9 @@ AbstractDataTreeNode asReverseComparisonNode(IComparator comparator) {
8485
static AbstractDataTreeNode[] assembleWith(AbstractDataTreeNode[] oldNodes, AbstractDataTreeNode[] newNodes, boolean keepDeleted) {
8586

8687
// Optimize the common case where the new list is empty.
87-
if (newNodes.length == 0)
88+
if (newNodes.length == 0) {
8889
return oldNodes;
90+
}
8991

9092
// Can't just return newNodes if oldNodes has length 0
9193
// because newNodes may contain deleted nodes.
@@ -198,8 +200,9 @@ AbstractDataTreeNode assembleWith(AbstractDataTreeNode node) {
198200
}
199201
if (this.isDelta()) {
200202
AbstractDataTreeNode[] assembledChildren = assembleWith(children, node.children, true);
201-
if (this.hasData())
203+
if (this.hasData()) {
202204
return new DataDeltaNode(name, this.getData(), assembledChildren);
205+
}
203206
return new NoDataDeltaNode(name, assembledChildren);
204207
}
205208
AbstractDataTreeNode[] assembledChildren = assembleWith(children, node.children, false);
@@ -271,10 +274,11 @@ AbstractDataTreeNode childAtIgnoreCase(String localName) {
271274
for (AbstractDataTreeNode element : children) {
272275
if (element.getName().equalsIgnoreCase(localName)) {
273276
//if we find a deleted child, keep looking for a real child
274-
if (element.isDeleted())
277+
if (element.isDeleted()) {
275278
result = element;
276-
else
279+
} else {
277280
return element;
281+
}
278282
}
279283
}
280284
return result;
@@ -502,8 +506,9 @@ boolean isEmptyDelta() {
502506
String[] namesOfChildren() {
503507
String names[] = new String[children.length];
504508
/* copy child names (Reverse loop optimized) */
505-
for (int i = children.length; --i >= 0;)
509+
for (int i = children.length; --i >= 0;) {
506510
names[i] = children[i].getName();
511+
}
507512
return names;
508513
}
509514

@@ -538,8 +543,9 @@ void setName(String s) {
538543
*/
539544
protected static AbstractDataTreeNode[] simplifyWithParent(AbstractDataTreeNode[] nodes, IPath key, DeltaDataTree parent, IComparator comparer) {
540545
int nodeCount = nodes.length;
541-
if (nodeCount == 0)
546+
if (nodeCount == 0) {
542547
return NO_CHILDREN;
548+
}
543549
AbstractDataTreeNode[] simplifiedNodes = new AbstractDataTreeNode[nodeCount];
544550
int simplifiedCount = 0;
545551
for (int i = 0; i < nodeCount; ++i) {
@@ -577,9 +583,11 @@ public void storeStrings(StringPool set) {
577583
name = set.add(name);
578584
//copy children pointer in case of concurrent modification
579585
AbstractDataTreeNode[] nodes = children;
580-
if (nodes != null)
581-
for (int i = nodes.length; --i >= 0;)
586+
if (nodes != null) {
587+
for (int i = nodes.length; --i >= 0;) {
582588
nodes[i].storeStrings(set);
589+
}
590+
}
583591
}
584592

585593
/**

resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/dtree/DataDeltaNode.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,9 @@ boolean isDelta() {
100100
AbstractDataTreeNode simplifyWithParent(IPath key, DeltaDataTree parent, IComparator comparer) {
101101
AbstractDataTreeNode[] simplifiedChildren = simplifyWithParent(children, key, parent, comparer);
102102
/* don't compare root nodes */
103-
if (!key.isRoot() && comparer.compare(parent.getData(key), data) == 0)
103+
if (!key.isRoot() && comparer.compare(parent.getData(key), data) == 0) {
104104
return new NoDataDeltaNode(name, simplifiedChildren);
105+
}
105106
return new DataDeltaNode(name, data, simplifiedChildren);
106107
}
107108

resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/dtree/DataTreeNode.java

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,9 @@ public DataTreeNode(String name, Object data, AbstractDataTreeNode[] children) {
5555
*/
5656
@Override
5757
AbstractDataTreeNode asBackwardDelta(DeltaDataTree myTree, DeltaDataTree parentTree, IPath key) {
58-
if (parentTree.includes(key))
58+
if (parentTree.includes(key)) {
5959
return parentTree.copyCompleteSubtree(key);
60+
}
6061
return new DeletedNode(name);
6162
}
6263

@@ -116,8 +117,9 @@ AbstractDataTreeNode compareWith(DataTreeNode other, IComparator comparator) {
116117

117118
@Override
118119
AbstractDataTreeNode compareWithParent(IPath key, DeltaDataTree parent, IComparator comparator) {
119-
if (!parent.includes(key))
120+
if (!parent.includes(key)) {
120121
return convertToAddedComparisonNode(this, NodeComparison.K_ADDED);
122+
}
121123
DataTreeNode inParent = (DataTreeNode) parent.copyCompleteSubtree(key);
122124
return inParent.compareWith(this, comparator);
123125
}
@@ -218,47 +220,52 @@ protected static AbstractDataTreeNode[] forwardDeltaWith(AbstractDataTreeNode[]
218220
AbstractDataTreeNode deltaNode = forwardDeltaWithOrNullIfEqual(oldNodes[oldIndex++], newNodes[newIndex++], comparer);
219221
if (deltaNode != null) {
220222
if (numChildDeltas >= childDeltaMax) {
221-
if (childDeltas == null)
223+
if (childDeltas == null) {
222224
childDeltas = new AbstractDataTreeNode[childDeltaMax = 5];
223-
else
225+
} else {
224226
System.arraycopy(childDeltas, 0, childDeltas = new AbstractDataTreeNode[childDeltaMax = childDeltaMax * 2 + 1], 0, numChildDeltas);
227+
}
225228
}
226229
childDeltas[numChildDeltas++] = deltaNode;
227230
}
228231
} else if (compare < 0) {
229232
if (numChildDeltas >= childDeltaMax) {
230-
if (childDeltas == null)
233+
if (childDeltas == null) {
231234
childDeltas = new AbstractDataTreeNode[childDeltaMax = 5];
232-
else
235+
} else {
233236
System.arraycopy(childDeltas, 0, childDeltas = new AbstractDataTreeNode[childDeltaMax = childDeltaMax * 2 + 1], 0, numChildDeltas);
237+
}
234238
}
235239
childDeltas[numChildDeltas++] = new DeletedNode(oldName);
236240
oldIndex++;
237241
} else {
238242
if (numChildDeltas >= childDeltaMax) {
239-
if (childDeltas == null)
243+
if (childDeltas == null) {
240244
childDeltas = new AbstractDataTreeNode[childDeltaMax = 5];
241-
else
245+
} else {
242246
System.arraycopy(childDeltas, 0, childDeltas = new AbstractDataTreeNode[childDeltaMax = childDeltaMax * 2 + 1], 0, numChildDeltas);
247+
}
243248
}
244249
childDeltas[numChildDeltas++] = newNodes[newIndex++];
245250
}
246251
}
247252
while (oldIndex < oldNodes.length) {
248253
if (numChildDeltas >= childDeltaMax) {
249-
if (childDeltas == null)
254+
if (childDeltas == null) {
250255
childDeltas = new AbstractDataTreeNode[childDeltaMax = 5];
251-
else
256+
} else {
252257
System.arraycopy(childDeltas, 0, childDeltas = new AbstractDataTreeNode[childDeltaMax = childDeltaMax * 2 + 1], 0, numChildDeltas);
258+
}
253259
}
254260
childDeltas[numChildDeltas++] = new DeletedNode(oldNodes[oldIndex++].name);
255261
}
256262
while (newIndex < newNodes.length) {
257263
if (numChildDeltas >= childDeltaMax) {
258-
if (childDeltas == null)
264+
if (childDeltas == null) {
259265
childDeltas = new AbstractDataTreeNode[childDeltaMax = 5];
260-
else
266+
} else {
261267
System.arraycopy(childDeltas, 0, childDeltas = new AbstractDataTreeNode[childDeltaMax = childDeltaMax * 2 + 1], 0, numChildDeltas);
268+
}
262269
}
263270
childDeltas[numChildDeltas++] = newNodes[newIndex++];
264271
}
@@ -346,8 +353,9 @@ public void storeStrings(StringPool set) {
346353
super.storeStrings(set);
347354
//copy data for thread safety
348355
Object o = data;
349-
if (o instanceof IStringPoolParticipant)
356+
if (o instanceof IStringPoolParticipant) {
350357
((IStringPoolParticipant) o).shareStrings(set);
358+
}
351359
}
352360

353361
@Override

resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/dtree/DeletedNode.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,9 @@ public class DeletedNode extends AbstractDataTreeNode {
3636
*/
3737
@Override
3838
AbstractDataTreeNode asBackwardDelta(DeltaDataTree myTree, DeltaDataTree parentTree, IPath key) {
39-
if (parentTree.includes(key))
39+
if (parentTree.includes(key)) {
4040
return parentTree.copyCompleteSubtree(key);
41+
}
4142
return this;
4243
}
4344

@@ -66,8 +67,9 @@ AbstractDataTreeNode compareWithParent(IPath key, DeltaDataTree parent, ICompara
6667
* be a corresponding node in the parent. Deleted nodes can live
6768
* in isolation.
6869
*/
69-
if (parent.includes(key))
70+
if (parent.includes(key)) {
7071
return convertToRemovedComparisonNode(parent.copyCompleteSubtree(key), NodeComparison.K_REMOVED);
72+
}
7173
// Node doesn't exist in either tree. Return an empty comparison.
7274
// Empty comparisons are omitted from the delta.
7375
return new DataTreeNode(key.lastSegment(), new NodeComparison(null, null, 0, 0));
@@ -95,8 +97,9 @@ boolean isDeleted() {
9597
*/
9698
@Override
9799
AbstractDataTreeNode simplifyWithParent(IPath key, DeltaDataTree parent, IComparator comparer) {
98-
if (parent.includes(key))
100+
if (parent.includes(key)) {
99101
return this;
102+
}
100103
return new NoDataDeltaNode(name);
101104
}
102105

0 commit comments

Comments
 (0)