Skip to content

Commit abd9676

Browse files
committed
Mark deprecated methods as slated for removal in 1.24.1
1 parent bbb56af commit abd9676

File tree

10 files changed

+21
-16
lines changed

10 files changed

+21
-16
lines changed

CHANGES.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
* Build: added CI coverage for JDK 25 [#2403](https://github.com/jhy/jsoup/pull/2403)
1919
* Build: added a CI fuzzer for contextual fragment parsing (in addition to existing full body HTML and XML fuzzers). [oss-fuzz #14041](https://github.com/google/oss-fuzz/pull/14041)
2020

21+
### Changes
22+
* Set a removal schedule of jsoup 1.24.1 for previously deprecated APIs.
23+
2124
### Bug Fixes
2225
* Previously cached child Elements of an Element were not correctly invalidated in `Node#replaceWith(Node)`, which could lead to incorrect results when subsequently calling `Element#children()`. [#2391](https://github.com/jhy/jsoup/issues/2391)
2326
* Attribute selector values are now compared literally without trimming. Previously, jsoup trimmed whitespace from selector values and from element attribute values, which could cause mismatches with browser behavior (e.g. `[attr=" foo "]`). Now matches align with the CSS specification and browser engines. [#2380](https://github.com/jhy/jsoup/issues/2380)

src/main/java/org/jsoup/Connection.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ default Connection newRequest(URL url) {
218218
@param sslSocketFactory SSL socket factory
219219
@return this Connection, for chaining
220220
@see #sslContext(SSLContext)
221-
@deprecated use {@link #sslContext(SSLContext)} instead.
221+
@deprecated use {@link #sslContext(SSLContext)} instead; will be removed in jsoup 1.24.1.
222222
*/
223223
@Deprecated
224224
Connection sslSocketFactory(SSLSocketFactory sslSocketFactory);
@@ -795,7 +795,7 @@ interface Request extends Base<Request> {
795795
796796
@param sslSocketFactory SSL socket factory
797797
@see #sslContext(SSLContext)
798-
@deprecated use {@link #sslContext(SSLContext)} instead.
798+
@deprecated use {@link #sslContext(SSLContext)} instead; will be removed in jsoup 1.24.1.
799799
*/
800800
@Deprecated
801801
void sslSocketFactory(SSLSocketFactory sslSocketFactory);
@@ -1033,7 +1033,7 @@ default Response readFully() throws IOException {
10331033
* <p>Calling {@link #body() } or {@link #bodyAsBytes()} has the same effect.</p>
10341034
* @return this response, for chaining
10351035
* @throws UncheckedIOException if an IO exception occurs during buffering.
1036-
* @deprecated use {@link #readFully()} instead (for the checked exception). Will be removed in a future version.
1036+
* @deprecated use {@link #readFully()} instead (for the checked exception). Will be removed in jsoup 1.24.1.
10371037
*/
10381038
@Deprecated
10391039
Response bufferUp();

src/main/java/org/jsoup/helper/Validate.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public static void notNull(@Nullable Object obj, String msg) {
4848
* @param obj nullable object to cast to not-null
4949
* @return the object, or throws an exception if it is null
5050
* @throws ValidationException if the object is null
51-
* @deprecated prefer to use {@link #expectNotNull(Object, String, Object...)} instead
51+
* @deprecated prefer to use {@link #expectNotNull(Object, String, Object...)} instead; will be removed in jsoup 1.24.1
5252
*/
5353
@Deprecated
5454
public static Object ensureNotNull(@Nullable Object obj) {
@@ -65,7 +65,7 @@ public static Object ensureNotNull(@Nullable Object obj) {
6565
* @param args the arguments to the msg
6666
* @return the object, or throws an exception if it is null
6767
* @throws ValidationException if the object is null
68-
* @deprecated prefer to use {@link #expectNotNull(Object, String, Object...)} instead
68+
* @deprecated prefer to use {@link #expectNotNull(Object, String, Object...)} instead; will be removed in jsoup 1.24.1
6969
*/
7070
@Deprecated
7171
public static Object ensureNotNull(@Nullable Object obj, String msg, Object... args) {

src/main/java/org/jsoup/internal/Normalizer.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ public static String normalize(final String input) {
2323

2424
/**
2525
If a string literal, just lower case the string; otherwise lower-case and trim.
26-
@deprecated internal function; will be removed in a future version.
26+
@deprecated internal helper; replace with {@link #lowerCase(String)} for no-trim, or {@link #normalize(String)} for trim + lowercase.
27+
Will be removed in jsoup 1.24.1.
2728
*/
2829
@Deprecated
2930
public static String normalize(final String input, boolean isStringLiteral) {

src/main/java/org/jsoup/nodes/Attribute.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -202,13 +202,13 @@ static void html(String key, @Nullable String val, QuietAppendable accum, Docume
202202
htmlNoValidate(key, val, accum, out);
203203
}
204204

205-
/** @deprecated internal method and will be removed in a future version */
205+
/** @deprecated internal method; use {@link #html(String, String, QuietAppendable, Document.OutputSettings)} with {@link org.jsoup.internal.QuietAppendable#wrap(Appendable)} instead. Will be removed in jsoup 1.24.1. */
206206
@Deprecated
207207
protected void html(Appendable accum, Document.OutputSettings out) throws IOException {
208208
html(key, val, accum, out);
209209
}
210210

211-
/** @deprecated internal method and will be removed in a future version */
211+
/** @deprecated internal method; use {@link #html(String, String, QuietAppendable, Document.OutputSettings)} with {@link org.jsoup.internal.QuietAppendable#wrap(Appendable)} instead. Will be removed in jsoup 1.24.1. */
212212
@Deprecated
213213
protected static void html(String key, @Nullable String val, Appendable accum, Document.OutputSettings out) throws IOException {
214214
html(key, val, QuietAppendable.wrap(accum), out);
@@ -306,7 +306,7 @@ protected static boolean isDataAttribute(String key) {
306306
*
307307
* @param out output settings
308308
* @return Returns whether collapsible or not
309-
* @deprecated internal method and will be removed in a future version
309+
* @deprecated internal method; use {@link #shouldCollapseAttribute(String, String, Document.OutputSettings)} instead. Will be removed in jsoup 1.24.1.
310310
*/
311311
@Deprecated
312312
protected final boolean shouldCollapseAttribute(Document.OutputSettings out) {

src/main/java/org/jsoup/nodes/Node.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -902,7 +902,7 @@ public String toString() {
902902
return outerHtml();
903903
}
904904

905-
/** @deprecated internal method moved into Printer; will be removed in a future version */
905+
/** @deprecated internal method moved into Printer; will be removed in jsoup 1.24.1. */
906906
@Deprecated
907907
protected void indent(Appendable accum, int depth, Document.OutputSettings out) throws IOException {
908908
accum.append('\n').append(StringUtil.padding(depth * out.indentAmount(), out.maxPaddingWidth()));

src/main/java/org/jsoup/nodes/PseudoTextElement.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
/**
77
* Represents a {@link TextNode} as an {@link Element}, to enable text nodes to be selected with
88
* the {@link org.jsoup.select.Selector} {@code :matchText} syntax.
9-
* @deprecated use {@link Element#selectNodes(String, Class)} instead, with selector of <code>::textnode</code> and class <code>TextNode</code>.
9+
* @deprecated use {@link Element#selectNodes(String, Class)} instead, with selector of <code>::textnode</code> and class <code>TextNode</code>;
10+
* will be removed in jsoup 1.24.1.
1011
*/
1112
@Deprecated
1213
public class PseudoTextElement extends Element {

src/main/java/org/jsoup/parser/HtmlTreeBuilder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public class HtmlTreeBuilder extends TreeBuilder {
6060
"button", "fieldset", "input", "keygen", "object", "output", "select", "textarea"
6161
};
6262

63-
/** @deprecated This is not used anymore. Will be removed in a future release. */
63+
/** @deprecated Not used anymore; configure parser depth via {@link Parser#setMaxDepth(int)}. Will be removed in jsoup 1.24.1. */
6464
@Deprecated
6565
public static final int MaxScopeSearchDepth = 100;
6666

src/main/java/org/jsoup/parser/Tag.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ public boolean isBlock() {
245245
Get if this is an InlineContainer tag.
246246
247247
@return true if an InlineContainer (which formats children as inline).
248-
@deprecated setting is only used within the Printer. Will be removed in a future release.
248+
@deprecated internal pretty-printing flag; use {@link #isInline()} or {@link #isBlock()} to check layout intent. Will be removed in jsoup 1.24.1.
249249
*/
250250
@Deprecated public boolean formatAsBlock() {
251251
return (options & InlineContainer) != 0;

src/main/java/org/jsoup/select/Evaluator.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ public AttributeKeyPair(String key, String value) {
436436

437437
/**
438438
@deprecated since 1.22.1, use {@link #AttributeKeyPair(String, String)}; the previous trimQuoted parameter is no longer used.
439-
This constructor will be removed in a future release.
439+
This constructor will be removed in jsoup 1.24.1.
440440
*/
441441
@Deprecated
442442
public AttributeKeyPair(String key, String value, boolean ignored) {
@@ -1046,7 +1046,7 @@ public String toString() {
10461046
}
10471047

10481048
/**
1049-
@deprecated This selector is deprecated and will be removed in a future version. Migrate to <code>::textnode</code> using the <code>Element#selectNodes()</code> method instead.
1049+
@deprecated This selector is deprecated and will be removed in jsoup 1.24.1. Migrate to <code>::textnode</code> using the <code>Element#selectNodes()</code> method instead.
10501050
*/
10511051
@Deprecated
10521052
public static final class MatchText extends Evaluator {
@@ -1056,7 +1056,7 @@ public MatchText() {
10561056
// log a deprecated error on first use; users typically won't directly construct this Evaluator and so won't otherwise get deprecation warnings
10571057
if (!loggedError) {
10581058
loggedError = true;
1059-
System.err.println("WARNING: :matchText selector is deprecated and will be removed in a future version. Use Element#selectNodes(String, Class) with selector ::textnode and class TextNode instead.");
1059+
System.err.println("WARNING: :matchText selector is deprecated and will be removed in jsoup 1.24.1. Use Element#selectNodes(String, Class) with selector ::textnode and class TextNode instead.");
10601060
}
10611061
}
10621062

0 commit comments

Comments
 (0)