Skip to content

Commit a4c7ea7

Browse files
committed
code cleanup
1 parent 04968d4 commit a4c7ea7

File tree

15 files changed

+33
-39
lines changed

15 files changed

+33
-39
lines changed

src/main/java/org/htmlunit/FormEncodingType.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public final class FormEncodingType implements Serializable {
3030
/** URL-encoded form encoding. */
3131
public static final FormEncodingType URL_ENCODED = new FormEncodingType("application/x-www-form-urlencoded");
3232

33-
/** Multipart form encoding (used to be a constant in HttpClient but it was deprecated with no alternative). */
33+
/** Multipart form encoding (used to be a constant in HttpClient, but it was deprecated with no alternative). */
3434
public static final FormEncodingType MULTIPART = new FormEncodingType("multipart/form-data");
3535

3636
/** text/plain. */

src/main/java/org/htmlunit/attachment/DownloadingAttachmentHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
* <li>download file into a default folder when attachment response is detected</li>
3535
* <li>infer filename from octet stream response and use that when saving file</li>
3636
* <li>if a file already exists, append number to it.
37-
* Keep incrementing numbers until you find a slot that is free (thats how Chrome handles duplicate filenames).</li>
37+
* Keep incrementing numbers until you find a slot that is free (that's how Chrome handles duplicate filenames).</li>
3838
* </ul>
3939
*
4040
* @author Marek Andreansky

src/main/java/org/htmlunit/html/DomText.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ private void initDoTypeProcessor() {
184184
}
185185

186186
/**
187-
* Indicates if the provided character can by "typed" in the element.
187+
* Indicates if the provided character can be "typed" in the element.
188188
* @param c the character
189189
* @return {@code true} if it is accepted
190190
*/

src/main/java/org/htmlunit/html/HtmlDivision.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public class HtmlDivision extends HtmlElement {
3535
/**
3636
* Creates an instance of HtmlDivision.
3737
*
38-
* <p><b>Don't directly construct, it is public as an implementation side-effect.</b>
38+
* <p><b>Don't directly construct, it is public as an implementation side effect.</b>
3939
*
4040
* @param qualifiedName the qualified name of the element type to instantiate
4141
* @param page the HtmlPage that contains this element

src/main/java/org/htmlunit/html/HtmlElement.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ protected void setAttributeNS(final String namespaceURI, final String qualifiedN
209209
final boolean mappedElement = isAttachedToPage()
210210
&& (DomElement.NAME_ATTRIBUTE.equals(qualifiedName) || DomElement.ID_ATTRIBUTE.equals(qualifiedName));
211211
if (mappedElement) {
212-
// cast is save here because isMappedElement checks for HtmlPage
212+
// cast is safe here because isMappedElement checks for HtmlPage
213213
htmlPage.removeMappedElement(this, false, false);
214214
}
215215

@@ -363,7 +363,7 @@ public void removeAttribute(final String attributeName) {
363363

364364
/**
365365
* Support for reporting HTML attribute changes. This method can be called when an attribute
366-
* has been added and it will send the appropriate {@link HtmlAttributeChangeEvent} to any
366+
* has been added, and it will send the appropriate {@link HtmlAttributeChangeEvent} to any
367367
* registered {@link HtmlAttributeChangeListener}s.
368368
* <p>
369369
* Note that this method recursively calls this element's parent's
@@ -381,7 +381,7 @@ protected void fireHtmlAttributeAdded(final HtmlAttributeChangeEvent event) {
381381

382382
/**
383383
* Support for reporting HTML attribute changes. This method can be called when an attribute
384-
* has been replaced and it will send the appropriate {@link HtmlAttributeChangeEvent} to any
384+
* has been replaced, and it will send the appropriate {@link HtmlAttributeChangeEvent} to any
385385
* registered {@link HtmlAttributeChangeListener}s.
386386
* <p>
387387
* Note that this method recursively calls this element's parent's
@@ -399,7 +399,7 @@ protected void fireHtmlAttributeReplaced(final HtmlAttributeChangeEvent event) {
399399

400400
/**
401401
* Support for reporting HTML attribute changes. This method can be called when an attribute
402-
* has been removed and it will send the appropriate {@link HtmlAttributeChangeEvent} to any
402+
* has been removed, and it will send the appropriate {@link HtmlAttributeChangeEvent} to any
403403
* registered {@link HtmlAttributeChangeListener}s.
404404
* <p>
405405
* Note that this method recursively calls this element's parent's
@@ -864,7 +864,7 @@ protected void typeDone(final String newValue, final boolean notifyAttributeChan
864864
}
865865

866866
/**
867-
* Indicates if the provided character can by "typed" in the element.
867+
* Indicates if the provided character can be "typed" in the element.
868868
* @param c the character
869869
* @return {@code true} if it is accepted
870870
*/

src/main/java/org/htmlunit/html/HtmlFileInput.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public class HtmlFileInput extends HtmlInput implements LabelableElement {
6868

6969
/**
7070
* Returns the in-memory data assigned to this file input element, if any.
71-
* @return {@code null} if {@link #setData(byte[])} hasn't be used
71+
* @return {@code null} if {@link #setData(byte[])} hasn't been used
7272
*/
7373
public final byte[] getData() {
7474
return data_;

src/main/java/org/htmlunit/html/HtmlForm.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -417,10 +417,10 @@ public List<NameValuePair> getParameterListForSubmit(final SubmittableElement su
417417
* @return the page contained by this form's window after the reset
418418
*/
419419
public Page reset() {
420-
final SgmlPage htmlPage = getPage();
420+
final SgmlPage sgmlPage = getPage();
421421
final ScriptResult scriptResult = fireEvent(Event.TYPE_RESET);
422422
if (ScriptResult.isFalse(scriptResult)) {
423-
return htmlPage.getWebClient().getCurrentWindow().getEnclosedPage();
423+
return sgmlPage.getWebClient().getCurrentWindow().getEnclosedPage();
424424
}
425425

426426
for (final HtmlElement next : getHtmlElementDescendants()) {
@@ -429,7 +429,7 @@ public Page reset() {
429429
}
430430
}
431431

432-
return htmlPage;
432+
return sgmlPage;
433433
}
434434

435435
/**
@@ -490,7 +490,7 @@ private static boolean isValidForSubmission(final HtmlElement element, final Sub
490490
return ((HtmlInput) element).isChecked();
491491
}
492492
}
493-
if (HtmlSelect.TAG_NAME.equals(tagName)) {
493+
if (element instanceof HtmlSelect) {
494494
return ((HtmlSelect) element).isValidForSubmission();
495495
}
496496
return true;

src/main/java/org/htmlunit/javascript/host/Element.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ public NamedNodeMap getAttributes() {
175175
}
176176

177177
/**
178-
* Creates the JS object for the property attributes. This object will the be cached.
178+
* Creates the JS object for the property attributes. This object will be cached.
179179
* @return the JS object
180180
*/
181181
protected NamedNodeMap createAttributesObject() {
@@ -636,7 +636,7 @@ public HTMLCollection getElementsByClassName(final String className) {
636636
}
637637
String classAttribute = ((HtmlElement) node).getAttributeDirect("class");
638638
if (ATTRIBUTE_NOT_DEFINED == classAttribute) {
639-
return false; // probably better performance as most of elements won't have a class attribute
639+
return false; // probably better performance as most elements won't have a class attribute
640640
}
641641

642642
classAttribute = " " + classAttribute + " ";
@@ -760,7 +760,7 @@ private Object[] getInsertAdjacentLocation(final String where) {
760760
// compute the where and how the new nodes should be added
761761
if (POSITION_AFTER_BEGIN.equalsIgnoreCase(where)) {
762762
if (currentNode.getFirstChild() == null) {
763-
// new nodes should appended to the children of current node
763+
// new nodes should append to the children of current node
764764
node = currentNode;
765765
append = true;
766766
}
@@ -776,13 +776,13 @@ else if (POSITION_BEFORE_BEGIN.equalsIgnoreCase(where)) {
776776
append = false;
777777
}
778778
else if (POSITION_BEFORE_END.equalsIgnoreCase(where)) {
779-
// new nodes should appended to the children of current node
779+
// new nodes should append to the children of current node
780780
node = currentNode;
781781
append = true;
782782
}
783783
else if (POSITION_AFTER_END.equalsIgnoreCase(where)) {
784784
if (currentNode.getNextSibling() == null) {
785-
// new nodes should appended to the children of parent node
785+
// new nodes should append to the children of parent node
786786
node = currentNode.getParentNode();
787787
append = true;
788788
}

src/main/java/org/htmlunit/javascript/host/event/Event.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -933,7 +933,7 @@ public String getPropertyName() {
933933
* Initializes this event.
934934
* @param type the event type
935935
* @param bubbles whether or not the event should bubble
936-
* @param cancelable whether or not the event the event should be cancelable
936+
* @param cancelable whether or not the event should be cancelable
937937
*/
938938
@JsxFunction
939939
public void initEvent(final String type, final boolean bubbles, final boolean cancelable) {

src/main/java/org/htmlunit/javascript/host/event/EventHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public Object call(final Context cx, final Scriptable scope,
5858
// final HtmlUnitScriptable jsObj = node_.getScriptableObject();
5959
// have changed this - the scope is now thisObj to fix
6060
// https://github.com/HtmlUnit/htmlunit/issues/347
61-
// but i still have not found any description about the right scope
61+
// but still have not found any description about the right scope
6262

6363
// compile "just in time"
6464
if (realFunction_ == null) {

0 commit comments

Comments
 (0)