From 6285062176ee27299c4f86895b5d977e54f5ede7 Mon Sep 17 00:00:00 2001 From: Jonathan Hedley Date: Sat, 18 Feb 2023 11:24:42 +1100 Subject: [PATCH] Clarified Parser instances are not threadsafe #1892 --- src/main/java/org/jsoup/parser/Parser.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/jsoup/parser/Parser.java b/src/main/java/org/jsoup/parser/Parser.java index 93bb1c031e..83789460af 100644 --- a/src/main/java/org/jsoup/parser/Parser.java +++ b/src/main/java/org/jsoup/parser/Parser.java @@ -9,9 +9,10 @@ import java.util.List; /** - * Parses HTML into a {@link org.jsoup.nodes.Document}. Generally best to use one of the more convenient parse methods - * in {@link org.jsoup.Jsoup}. - */ + Parses HTML or XML into a {@link org.jsoup.nodes.Document}. Generally, it is simpler to use one of the parse methods in + {@link org.jsoup.Jsoup}. +

Note that a Parser instance object is not threadsafe. To reuse a Parser configuration in a multi-threaded + environment, use {@link #newInstance()} to make copies. */ public class Parser { private TreeBuilder treeBuilder; private ParseErrorList errors;