Skip to content

Commit d1468e7

Browse files
ptzieglerazoitl
authored andcommitted
Mark Node.sortValue as "for removal"
The field has been marked as deprecated since forever and should only be used internally, hence be package-private instead of public. Because this field is only accessed within the same package, the removal warning can be safely suppressed. Contributes to #778
1 parent 119ad6b commit d1468e7

File tree

7 files changed

+18
-6
lines changed

7 files changed

+18
-6
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ private static void setOrderIndex(Node n, int index) {
206206
n.workingInts[0] = index;
207207
}
208208

209+
@SuppressWarnings("removal")
209210
private static void sortedInsert(List<Node> list, Node node) {
210211
int insert = 0;
211212
while (insert < list.size() && (list.get(insert)).sortValue > node.sortValue) {

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ RowEntry getRowEntry(Subgraph s, int row) {
102102
return map.get(new RowKey(row, s));
103103
}
104104

105+
@SuppressWarnings("removal")
105106
void copyConstraints(NestingTree tree) {
106107
if (tree.subgraph != null) {
107108
tree.sortValue = tree.subgraph.getRowConstraint();

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

Lines changed: 4 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
@@ -64,6 +64,7 @@ static NestingTree buildNestingTreeForRank(Rank rank) {
6464
return nestingMap.get(null);
6565
}
6666

67+
@SuppressWarnings("removal")
6768
void calculateSortValues() {
6869
int total = 0;
6970
for (Object o : contents) {
@@ -82,6 +83,7 @@ void calculateSortValues() {
8283
sortValue = (double) total / size;
8384
}
8485

86+
@SuppressWarnings("removal")
8587
void getSortValueFromSubgraph() {
8688
if (subgraph != null) {
8789
sortValue = subgraph.sortValue;
@@ -129,6 +131,7 @@ void repopulateRank(Rank r) {
129131
}
130132
}
131133

134+
@SuppressWarnings("removal")
132135
boolean swap(int index) {
133136
Object left = contents.get(index);
134137
Object right = contents.get(index + 1);

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

Lines changed: 4 additions & 3 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
@@ -108,9 +108,10 @@ public class Node {
108108
int rank;
109109

110110
/**
111-
* @deprecated for internal use only
111+
* @deprecated for internal use only. This field will be made package-private
112+
* after the 2028-03 release.
112113
*/
113-
@Deprecated
114+
@Deprecated(forRemoval = true, since = "2026-03")
114115
public double sortValue;
115116

116117
/**

org.eclipse.draw2d/src/org/eclipse/draw2d/graph/NodeList.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
@@ -46,6 +46,7 @@ void adjustRank(int delta) {
4646
}
4747
}
4848

49+
@SuppressWarnings("removal")
4950
void resetSortValues() {
5051
for (int i = 0; i < size(); i++) {
5152
get(i).sortValue = 0.0;

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ void sort() {
191191
} while (change);
192192
}
193193

194+
@SuppressWarnings("removal")
194195
boolean swap(int i) {
195196
Node left = rank.get(i);
196197
Node right = rank.get(i + 1);
@@ -214,6 +215,7 @@ public void sortRankOutgoing(DirectedGraph g, Rank rank, int row, double progres
214215
postSort();
215216
}
216217

218+
@SuppressWarnings("removal")
217219
void sortValueIncoming() {
218220
node.sortValue = evaluateNodeIncoming();
219221
// $TODO restore this optimization
@@ -228,6 +230,7 @@ void sortValueIncoming() {
228230
// node.sortValue += Math.random() * rankSize / (5 + 8 * progress);
229231
}
230232

233+
@SuppressWarnings("removal")
231234
void sortValueOutgoing() {
232235
node.sortValue = evaluateNodeOutgoing();
233236
// $TODO restore this optimization

org.eclipse.draw2d/src/org/eclipse/draw2d/graph/SortSubgraphs.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
@@ -34,6 +34,7 @@ class SortSubgraphs extends GraphVisitor {
3434
Set<Node> orderingGraphNodes = new HashSet<>();
3535
NodePair pair = new NodePair();
3636

37+
@SuppressWarnings("removal")
3738
private void breakSubgraphCycles() {
3839
// The stack of nodes which have no unmarked incoming edges
3940
List<Node> noLefts = new ArrayList<>();
@@ -183,6 +184,7 @@ private static void leftToRight(Node left, Node right) {
183184
rightOf(left).add(right);
184185
}
185186

187+
@SuppressWarnings("removal")
186188
static void sortedInsert(List<Node> list, Node node) {
187189
int insert = 0;
188190
while (insert < list.size() && list.get(insert).sortValue > node.sortValue) {

0 commit comments

Comments
 (0)