Skip to content

Commit bfc599f

Browse files
committed
Rollback sealed graph fix, will use another patch
1 parent 50c4ec4 commit bfc599f

1 file changed

Lines changed: 4 additions & 9 deletions

File tree

make/jdk/src/classes/build/tools/taglet/SealedGraph.java

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2022, 2026, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2022, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -138,25 +138,20 @@ private final class Renderer {
138138

139139
// Generates a graph in DOT format
140140
String graph(TypeElement rootClass, Set<String> exports) {
141-
if (!isInPublicApi(rootClass, exports)) {
142-
// Alternatively we can return "" for the graph since there is no single root to render
143-
throw new IllegalArgumentException("Root not in public API: " + rootClass.getQualifiedName());
144-
}
145141
final State state = new State(rootClass);
146142
traverse(state, rootClass, exports);
147143
return state.render();
148144
}
149145

150146
static void traverse(State state, TypeElement node, Set<String> exports) {
151-
if (!isInPublicApi(node, exports)) {
152-
throw new IllegalArgumentException("Bad request, not in public API: " + node.getQualifiedName());
153-
}
154147
state.addNode(node);
155148
if (!(node.getModifiers().contains(Modifier.SEALED) || node.getModifiers().contains(Modifier.FINAL))) {
156149
state.addNonSealedEdge(node);
157150
} else {
158151
for (TypeElement subNode : permittedSubclasses(node, exports)) {
159-
state.addEdge(node, subNode);
152+
if (isInPublicApi(node, exports) && isInPublicApi(subNode, exports)) {
153+
state.addEdge(node, subNode);
154+
}
160155
traverse(state, subNode, exports);
161156
}
162157
}

0 commit comments

Comments
 (0)