From 4b91adf9a4afb4eaf0e815c48b5d2cfdcb639f66 Mon Sep 17 00:00:00 2001 From: Jonathan Hedley Date: Thu, 23 Nov 2023 17:34:06 +1100 Subject: [PATCH] Simpler empty test --- src/main/java/org/jsoup/nodes/Element.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/jsoup/nodes/Element.java b/src/main/java/org/jsoup/nodes/Element.java index a1b09b3676..cfb19113b1 100644 --- a/src/main/java/org/jsoup/nodes/Element.java +++ b/src/main/java/org/jsoup/nodes/Element.java @@ -1822,7 +1822,7 @@ public Element clone() { public Element shallowClone() { // simpler than implementing a clone version with no child copy String baseUri = baseUri(); - if (baseUri.equals("")) baseUri = null; // saves setting a blank internal attribute + if (baseUri.isEmpty()) baseUri = null; // saves setting a blank internal attribute return new Element(tag, baseUri, attributes == null ? null : attributes.clone()); }