Skip to content

Commit 8770f35

Browse files
ptzieglerazoitl
authored andcommitted
Mark deprecated fields in Edge as "forRemoval"
Those field has been marked as deprecated since forever and is only referenced within the same package and can therefore be made package-private (or private) in a future release. The "removal" warning needs to be suppressed, wherever this field is referenced. Contributes to #778
1 parent 58ce626 commit 8770f35

File tree

6 files changed

+35
-21
lines changed

6 files changed

+35
-21
lines changed

org.eclipse.draw2d/src/org/eclipse/draw2d/graph/BreakCycles.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2003, 2023 IBM Corporation and others.
2+
* Copyright (c) 2003, 2025 IBM Corporation and others.
33
*
44
* This program and the accompanying materials are made available under the
55
* terms of the Eclipse Public License 2.0 which is available at
@@ -176,6 +176,7 @@ private void initializeDegrees(DirectedGraph g) {
176176
}
177177
}
178178

179+
@SuppressWarnings("removal")
179180
private static void invertEdges(DirectedGraph g) {
180181
for (Edge e : g.edges) {
181182
if (getOrderIndex(e.source) > getOrderIndex(e.target)) {

org.eclipse.draw2d/src/org/eclipse/draw2d/graph/CompoundBreakCycles.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2003, 2023 IBM Corporation and others.
2+
* Copyright (c) 2003, 2025 IBM Corporation and others.
33
*
44
* This program and the accompanying materials are made available under the
55
* terms of the Eclipse Public License 2.0 which is available at
@@ -238,6 +238,7 @@ private static void initializeDegrees(DirectedGraph g) {
238238
}
239239
}
240240

241+
@SuppressWarnings("removal")
241242
private void invertEdges(DirectedGraph g) {
242243
// Assign order indices
243244
int orderIndex = 0;

org.eclipse.draw2d/src/org/eclipse/draw2d/graph/Edge.java

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2003, 2023 IBM Corporation and others.
2+
* Copyright (c) 2003, 2025 IBM Corporation and others.
33
*
44
* This program and the accompanying materials are made available under the
55
* terms of the Eclipse Public License 2.0 which is available at
@@ -56,55 +56,61 @@ public class Edge {
5656
* The minimum rank separation between the source and target nodes. The default
5757
* value is 1.
5858
*
59-
* @deprecated use accessors instead
59+
* @deprecated use accessors instead. This field will be made private after the
60+
* 2027-12 release.
6061
*/
61-
@Deprecated
62+
@Deprecated(forRemoval = true, since = "2025-12")
6263
public int delta = 1;
6364

6465
/**
6566
* The ending point.
6667
*
67-
* @deprecated use {@link #getPoints()}
68+
* @deprecated use {@link #getPoints()}. This field will be made package-private
69+
* after the 2027-12 release.
6870
*/
69-
@Deprecated
71+
@Deprecated(forRemoval = true, since = "2025-12")
7072
public Point end;
7173

7274
boolean flag;
7375

7476
/**
7577
* @deprecated INTERNAL field, use accessor method Indicates an edge was
76-
* inverted during the layout
78+
* inverted during the layout. This field will be made
79+
* package-private after the 2027-12 release.
7780
*/
78-
@Deprecated
81+
@Deprecated(forRemoval = true, since = "2025-12")
7982
public boolean isFeedback = false;
8083

8184
/**
8285
* The edge's attachment point at the <em>source</em> node. The default value is
8386
* -1, which indicates that the edge should use the node's default
8487
* {@link Node#getOffsetOutgoing() outgoing} attachment point.
8588
*
86-
* @deprecated use accessors instead
89+
* @deprecated use accessors instead. This field will be made package-private
90+
* after the 2027-12 release.
8791
*/
88-
@Deprecated
92+
@Deprecated(forRemoval = true, since = "2025-12")
8993
public int offsetSource = -1;
9094

9195
/**
9296
* The edge's attachment point at the <em>target</em> node. The default value is
9397
* -1, which indicates that the edge should use the node's default
9498
* {@link Node#getOffsetIncoming() incoming} attachment point.
9599
*
96-
* @deprecated use accessors instead
100+
* @deprecated use accessors instead. This field will be made package-private
101+
* after the 2027-12 release.
97102
*/
98-
@Deprecated
103+
@Deprecated(forRemoval = true, since = "2025-12")
99104
public int offsetTarget = -1;
100105

101106
/**
102107
* The minimum amount of space to leave on both the left and right sides of the
103108
* edge.
104109
*
105-
* @deprecated use accessors instead
110+
* @deprecated use accessors instead. This field will be made private after the
111+
* 2027-12 release.
106112
*/
107-
@Deprecated
113+
@Deprecated(forRemoval = true, since = "2025-12")
108114
public int padding = 10;
109115

110116
private PointList points;
@@ -116,9 +122,10 @@ public class Edge {
116122
/**
117123
* The starting point.
118124
*
119-
* @deprecated use {@link #getPoints()}
125+
* @deprecated use {@link #getPoints()}. This field will be made package-private
126+
* after the 2027-12 release.
120127
*/
121-
@Deprecated
128+
@Deprecated(forRemoval = true, since = "2025-12")
122129
public Point start;
123130

124131
/**
@@ -143,9 +150,10 @@ public class Edge {
143150
public int weight = 1;
144151

145152
/**
146-
* @deprecated use accessors instead
153+
* @deprecated use accessors instead. This field will be made private after the
154+
* 2027-12 release.
147155
*/
148-
@Deprecated
156+
@Deprecated(forRemoval = true, since = "2025-12")
149157
public int width = 1;
150158

151159
/**

org.eclipse.draw2d/src/org/eclipse/draw2d/graph/RouteEdges.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2003, 2023 IBM Corporation and others.
2+
* Copyright (c) 2003, 2025 IBM Corporation and others.
33
*
44
* This program and the accompanying materials are made available under the
55
* terms of the Eclipse Public License 2.0 which is available at
@@ -26,6 +26,7 @@ class RouteEdges extends GraphVisitor {
2626
* @see GraphVisitor#visit(DirectedGraph)
2727
*/
2828
@Override
29+
@SuppressWarnings("removal")
2930
public void revisit(DirectedGraph g) {
3031
for (Edge edge : g.edges) {
3132
edge.start = new Point(edge.getSourceOffset() + edge.source.x, edge.source.y + edge.source.height);
@@ -47,6 +48,7 @@ public void revisit(DirectedGraph g) {
4748
}
4849
}
4950

51+
@SuppressWarnings("removal")
5052
static void routeLongEdge(Edge edge, DirectedGraph g) {
5153
ShortestPathRouter router = new ShortestPathRouter();
5254
Path path = new Path(edge.start, edge.end);

org.eclipse.draw2d/src/org/eclipse/draw2d/graph/TransposeMetrics.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2005, 2023 IBM Corporation and others.
2+
* Copyright (c) 2005, 2025 IBM Corporation and others.
33
*
44
* This program and the accompanying materials are made available under the
55
* terms of the Eclipse Public License 2.0 which is available at
@@ -41,6 +41,7 @@ public void visit(DirectedGraph g) {
4141
}
4242

4343
@Override
44+
@SuppressWarnings("removal")
4445
public void revisit(DirectedGraph g) {
4546
if (g.getDirection() == PositionConstants.SOUTH) {
4647
return;

org.eclipse.draw2d/src/org/eclipse/draw2d/graph/VirtualNodeCreation.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ public VirtualNodeCreation(Edge edge, DirectedGraph graph) {
8585
}
8686

8787
@Override
88+
@SuppressWarnings("removal")
8889
void revert() {
8990
edge.start = edges[0].start;
9091
edge.end = edges[edges.length - 1].end;

0 commit comments

Comments
 (0)