Skip to content

Commit 05b8ff1

Browse files
committed
fix some pmd warnings
1 parent 5affbaa commit 05b8ff1

20 files changed

Lines changed: 26 additions & 24 deletions

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ public NodeFilter getFilter() {
9595
* @see org.w3c.dom.traversal.TreeWalker#getExpandEntityReferences()
9696
* @return the ExpandEntityReferences setting
9797
*/
98+
@SuppressWarnings("PMD.BooleanGetMethodName")
9899
public boolean getExpandEntityReferences() {
99100
return expandEntityReferences_;
100101
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ public Geolocation getGeolocation() {
302302
* of PDF files when navigating to them
303303
*/
304304
@JsxGetter
305-
public boolean getPdfViewerEnabled() {
305+
public boolean isPdfViewerEnabled() {
306306
return true;
307307
}
308308

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ public String getMozOrientation() {
187187
* @return the {@code orientation} property
188188
*/
189189
@JsxGetter({CHROME, EDGE})
190-
public boolean getIsExtended() {
190+
public boolean isIsExtended() {
191191
return false;
192192
}
193193

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2166,7 +2166,7 @@ public SpeechSynthesis getSpeechSynthesis() {
21662166
* @return the {@code offscreenBuffering} property
21672167
*/
21682168
@JsxGetter({CHROME, EDGE})
2169-
public boolean getOffscreenBuffering() {
2169+
public boolean isOffscreenBuffering() {
21702170
return true;
21712171
}
21722172

@@ -3827,7 +3827,7 @@ public void put(final String name, final Scriptable start, final Object value) {
38273827
* @return a boolean indicating whether the current context is secure (true) or not (false).
38283828
*/
38293829
@JsxGetter
3830-
public boolean getIsSecureContext() {
3830+
public boolean isIsSecureContext() {
38313831
final Page page = getWebWindow().getEnclosedPage();
38323832
if (page != null) {
38333833
final String protocol = page.getUrl().getProtocol();

src/main/java/org/htmlunit/javascript/host/dom/DOMMatrix.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ public void setF(final double f) {
448448
*/
449449
@JsxFunction
450450
public DOMMatrix invertSelf() {
451-
if (getIs2D()) {
451+
if (isIs2D()) {
452452
final double det = getM11() * getM22() - getM12() * getM21();
453453
if (det == 0) {
454454
// Not invertible: set all to NaN, is2D_ = false

src/main/java/org/htmlunit/javascript/host/dom/DOMMatrixReadOnly.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ public void setM44(final double m44) {
457457
* @return is2d
458458
*/
459459
@JsxGetter
460-
public boolean getIs2D() {
460+
public boolean isIs2D() {
461461
return is2D_;
462462
}
463463

@@ -615,7 +615,7 @@ public DOMMatrix multiply(final Object other) {
615615
+ m22_ * otherMatrix.m12_
616616
+ m32_ * otherMatrix.m13_
617617
+ m42_ * otherMatrix.m14_);
618-
if (!result.getIs2D()) {
618+
if (!result.isIs2D()) {
619619
result.setM13(m13_ * otherMatrix.m11_
620620
+ m23_ * otherMatrix.m12_
621621
+ m33_ * otherMatrix.m13_
@@ -634,7 +634,7 @@ public DOMMatrix multiply(final Object other) {
634634
+ m22_ * otherMatrix.m22_
635635
+ m32_ * otherMatrix.m23_
636636
+ m42_ * otherMatrix.m24_);
637-
if (!result.getIs2D()) {
637+
if (!result.isIs2D()) {
638638
result.setM23(m13_ * otherMatrix.m21_
639639
+ m23_ * otherMatrix.m22_
640640
+ m33_ * otherMatrix.m23_
@@ -645,7 +645,7 @@ public DOMMatrix multiply(final Object other) {
645645
+ m44_ * otherMatrix.m24_);
646646
}
647647

648-
if (!result.getIs2D()) {
648+
if (!result.isIs2D()) {
649649
result.setM31(m11_ * otherMatrix.m31_
650650
+ m21_ * otherMatrix.m32_
651651
+ m31_ * otherMatrix.m33_
@@ -672,7 +672,7 @@ public DOMMatrix multiply(final Object other) {
672672
+ m22_ * otherMatrix.m42_
673673
+ m32_ * otherMatrix.m43_
674674
+ m42_ * otherMatrix.m44_);
675-
if (!result.getIs2D()) {
675+
if (!result.isIs2D()) {
676676
result.setM43(m13_ * otherMatrix.m41_
677677
+ m23_ * otherMatrix.m42_
678678
+ m33_ * otherMatrix.m43_

src/main/java/org/htmlunit/javascript/host/dom/Document.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1670,7 +1670,7 @@ public void setOninput(final Object oninput) {
16701670
* @return the {@code hidden} property
16711671
*/
16721672
@JsxGetter
1673-
public boolean getHidden() {
1673+
public boolean isHidden() {
16741674
return false;
16751675
}
16761676

src/main/java/org/htmlunit/javascript/host/dom/XPathResult.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ public Node getSingleNodeValue() {
191191
* ORDERED_NODE_ITERATOR_TYPE and the document has been modified since this result was returned.
192192
*/
193193
@JsxGetter
194-
public boolean getInvalidIteratorState() {
194+
public boolean isInvalidIteratorState() {
195195
return false;
196196
}
197197

@@ -263,6 +263,7 @@ public double getNumberValue() {
263263
* @return the value of this boolean result
264264
*/
265265
@JsxGetter
266+
@SuppressWarnings("PMD.BooleanGetMethodName")
266267
public boolean getBooleanValue() {
267268
if (resultType_ != BOOLEAN_TYPE) {
268269
throw JavaScriptEngine.reportRuntimeError("Cannot get booleanValue for type: " + resultType_);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -997,7 +997,7 @@ public void setReturnValue(final Object newValue) {
997997
* @return the return composed property
998998
*/
999999
@JsxGetter
1000-
public boolean getComposed() {
1000+
public boolean isComposed() {
10011001
return false;
10021002
}
10031003

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public void jsConstructor(final String type, final ScriptableObject details) {
8080
* @return whether or not the event is fired while composing
8181
*/
8282
@JsxGetter
83-
public boolean getIsComposing() {
83+
public boolean isIsComposing() {
8484
return isComposing_;
8585
}
8686

0 commit comments

Comments
 (0)