Skip to content

Commit d1820e6

Browse files
committed
Remove try/catch workaround in BreakpointLabelAction
The workaround in computeInlineEditorBounds() caught the ArrayIndexOutOfBoundsException thrown by TreeItem.getBounds() on macOS. That exception is fixed in SWT by eclipse-platform/eclipse.platform.swt#3628 (included in I-builds from I20261007-2300 onwards), so the workaround is no longer needed. Follow-up to eclipse-platform/eclipse.platform.swt#2749
1 parent 71639a4 commit d1820e6

1 file changed

Lines changed: 1 addition & 18 deletions

File tree

‎debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/BreakpointLabelAction.java‎

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -111,28 +111,11 @@ public void keyPressed(KeyEvent e) {
111111
}
112112

113113
private static Rectangle computeInlineEditorBounds(TreeItem treeItem) {
114-
Rectangle bounds;
115-
try {
116-
bounds = treeItem.getBounds();
117-
} catch (ArrayIndexOutOfBoundsException e) {
118-
// TreeItem having FontData [Breakpoints having custom label]
119-
bounds = macBugWorkaround(treeItem);
120-
}
114+
Rectangle bounds = treeItem.getBounds();
121115
int editorWidth = Math.max(computeEditorExtent(treeItem), bounds.width);
122116
return new Rectangle(bounds.x, bounds.y, editorWidth, bounds.height);
123117
}
124118

125-
// Workaround for SWT bug on Mac where TreeItem.getBounds() throws exception
126-
// when custom fonts are used, see
127-
// https://github.com/eclipse-platform/eclipse.platform.swt/issues/2749
128-
private static Rectangle macBugWorkaround(TreeItem treeItem) {
129-
treeItem.setFont(null);
130-
Rectangle bounds = treeItem.getBounds(0);
131-
bounds.x = bounds.x + 10;
132-
bounds.width = computeEditorExtent(treeItem);
133-
return bounds;
134-
}
135-
136119
private static int computeEditorExtent(TreeItem treeItem) {
137120
GC gc = new GC(treeItem.getParent());
138121
try {

0 commit comments

Comments
 (0)