Skip to content

Commit 2ef21e5

Browse files
committed
Removed redundant token argument
1 parent 9db2b14 commit 2ef21e5

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

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

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ Element createElementFor(Token.StartTag startTag, String namespace, boolean forc
326326
/** Inserts an HTML element for the given tag) */
327327
Element insertElementFor(final Token.StartTag startTag) {
328328
Element el = createElementFor(startTag, NamespaceHtml, false);
329-
doInsertElement(el, startTag);
329+
doInsertElement(el);
330330

331331
// handle self-closing tags. when the spec expects an empty tag, will directly hit insertEmpty, so won't generate this fake end tag.
332332
if (startTag.isSelfClosing()) {
@@ -353,7 +353,7 @@ Element insertElementFor(final Token.StartTag startTag) {
353353
*/
354354
Element insertForeignElementFor(final Token.StartTag startTag, String namespace) {
355355
Element el = createElementFor(startTag, namespace, true);
356-
doInsertElement(el, startTag);
356+
doInsertElement(el);
357357

358358
if (startTag.isSelfClosing()) {
359359
el.tag().setSelfClosing(); // remember this is self-closing for output
@@ -365,7 +365,7 @@ Element insertForeignElementFor(final Token.StartTag startTag, String namespace)
365365

366366
Element insertEmptyElementFor(Token.StartTag startTag) {
367367
Element el = createElementFor(startTag, NamespaceHtml, false);
368-
doInsertElement(el, startTag);
368+
doInsertElement(el);
369369
pop();
370370
return el;
371371
}
@@ -379,17 +379,16 @@ FormElement insertFormElement(Token.StartTag startTag, boolean onStack, boolean
379379
} else
380380
setFormElement(el);
381381

382-
doInsertElement(el, startTag);
382+
doInsertElement(el);
383383
if (!onStack) pop();
384384
return el;
385385
}
386386

387387
/** Inserts the Element onto the stack. All element inserts must run through this method. Performs any general
388388
tests on the Element before insertion.
389389
* @param el the Element to insert and make the current element
390-
* @param token the token this element was parsed from. If null, uses a zero-width current token as intrinsic insert
391390
*/
392-
private void doInsertElement(Element el, @Nullable Token token) {
391+
private void doInsertElement(Element el) {
393392
if (formElement != null && el.tag().namespace.equals(NamespaceHtml) && StringUtil.inSorted(el.normalName(), TagFormListed))
394393
formElement.addElement(el); // connect form controls to their form element
395394

@@ -945,7 +944,7 @@ void reconstructFormattingElements() {
945944
// 8. create new element from element, 9 insert into current node, onto stack
946945
skip = false; // can only skip increment from 4.
947946
Element newEl = new Element(tagFor(entry.nodeName(), entry.normalName(), defaultNamespace(), settings), null, entry.attributes().clone());
948-
doInsertElement(newEl, null);
947+
doInsertElement(newEl);
949948

950949
// 10. replace entry with new entry
951950
formattingElements.set(pos, newEl);

0 commit comments

Comments
 (0)