Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions flow-server/src/main/java/com/vaadin/flow/dom/Element.java
Original file line number Diff line number Diff line change
Expand Up @@ -1634,11 +1634,11 @@ public PendingJavaScriptResult callJsFunction(String functionName,
String paramPlaceholderString = IntStream.range(1, arguments.length + 1)
.mapToObj(i -> "$" + i).collect(Collectors.joining(","));
// Inject the element as $0
Serializable[] jsParameters;
Object[] jsParameters;
if (arguments.length == 0) {
jsParameters = new Serializable[] { this };
jsParameters = new Object[] { this };
} else {
jsParameters = new Serializable[arguments.length + 1];
jsParameters = new Object[arguments.length + 1];
jsParameters[0] = this;
System.arraycopy(arguments, 0, jsParameters, 1, arguments.length);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -658,11 +658,11 @@
list.add(bean1);
list.add(bean2);

// TODO: Use setPropertyList when updated to jackson

Check warning on line 661 in flow-server/src/test/java/com/vaadin/flow/dom/ElementJacksonTest.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Complete the task associated to this TODO comment.

See more on https://sonarcloud.io/project/issues?id=vaadin_flow&issues=AZrvlhKZkge5YqNjIbg9&open=AZrvlhKZkge5YqNjIbg9&pullRequest=22904
element.setPropertyJson("p", JacksonUtils.listToJson(list));
ArrayNode jsonArray = (ArrayNode) element.getPropertyRaw("p");
Assert.assertEquals("bean1",
jsonArray.get(0).get("string").textValue());

Check warning on line 665 in flow-server/src/test/java/com/vaadin/flow/dom/ElementJacksonTest.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove this use of "textValue"; it is deprecated.

See more on https://sonarcloud.io/project/issues?id=vaadin_flow&issues=AZrvlhKZkge5YqNjIbg-&open=AZrvlhKZkge5YqNjIbg-&pullRequest=22904
Assert.assertEquals("bean2",
jsonArray.get(1).get("string").textValue());

Expand All @@ -673,9 +673,9 @@
element.setPropertyJson("p", JacksonUtils.mapToJson(map));
JsonNode jsonObject = (JsonNode) element.getPropertyRaw("p");
Assert.assertEquals("bean1",
jsonObject.get("one").get("string").textValue());

Check warning on line 676 in flow-server/src/test/java/com/vaadin/flow/dom/ElementJacksonTest.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove this use of "textValue"; it is deprecated.

See more on https://sonarcloud.io/project/issues?id=vaadin_flow&issues=AZrvlhKZkge5YqNjIbhB&open=AZrvlhKZkge5YqNjIbhB&pullRequest=22904
Assert.assertEquals("bean2",
jsonObject.get("two").get("string").textValue());

Check warning on line 678 in flow-server/src/test/java/com/vaadin/flow/dom/ElementJacksonTest.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove this use of "textValue"; it is deprecated.

See more on https://sonarcloud.io/project/issues?id=vaadin_flow&issues=AZrvlhKZkge5YqNjIbhC&open=AZrvlhKZkge5YqNjIbhC&pullRequest=22904
}

@Test
Expand Down Expand Up @@ -714,7 +714,7 @@
BeanWithTemporalFields bean = new BeanWithTemporalFields();
Element element = ElementFactory.createDiv();

// TODO: Use setPropertyBean when updated to jackson

Check warning on line 717 in flow-server/src/test/java/com/vaadin/flow/dom/ElementJacksonTest.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Complete the task associated to this TODO comment.

See more on https://sonarcloud.io/project/issues?id=vaadin_flow&issues=AZrvlhKZkge5YqNjIbhD&open=AZrvlhKZkge5YqNjIbhD&pullRequest=22904
element.setPropertyBean("bean", bean);
ObjectNode json = (ObjectNode) element.getPropertyRaw("bean");

Expand Down Expand Up @@ -1339,7 +1339,7 @@
style.set("borderColor", "blue");
style.set("border-foo", "bar");

List<String> styles = style.getNames().collect(Collectors.toList());

Check warning on line 1342 in flow-server/src/test/java/com/vaadin/flow/dom/ElementJacksonTest.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Replace this usage of 'Stream.collect(Collectors.toList())' with 'Stream.toList()' and ensure that the list is unmodified.

See more on https://sonarcloud.io/project/issues?id=vaadin_flow&issues=AZrvlhKZkge5YqNjIbhE&open=AZrvlhKZkge5YqNjIbhE&pullRequest=22904
Assert.assertEquals(2, styles.size());
Assert.assertTrue(styles.contains("border-color"));
Assert.assertTrue(styles.contains("border-foo"));
Expand All @@ -1352,7 +1352,7 @@
Style style = element.getStyle();
style.set("borderColor", "blue");
style.set("borderColor", null);
List<String> styles = style.getNames().collect(Collectors.toList());

Check warning on line 1355 in flow-server/src/test/java/com/vaadin/flow/dom/ElementJacksonTest.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Replace this usage of 'Stream.collect(Collectors.toList())' with 'Stream.toList()' and ensure that the list is unmodified.

See more on https://sonarcloud.io/project/issues?id=vaadin_flow&issues=AZrvlhKZkge5YqNjIbhF&open=AZrvlhKZkge5YqNjIbhF&pullRequest=22904
Assert.assertFalse(styles.contains("borderColor"));
}

Expand Down Expand Up @@ -1479,7 +1479,7 @@
UI.setCurrent(createUI());
Element element = ElementFactory.createDiv();
String resName = "resource";
StreamResource resource = createEmptyResource(resName);

Check warning on line 1482 in flow-server/src/test/java/com/vaadin/flow/dom/ElementJacksonTest.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove this call to a deprecated class, it has been marked for removal.

See more on https://sonarcloud.io/project/issues?id=vaadin_flow&issues=AZrvlhKZkge5YqNjIbhI&open=AZrvlhKZkge5YqNjIbhI&pullRequest=22904
element.setAttribute("foo", resource);

Assert.assertTrue(element.hasAttribute("foo"));
Expand Down Expand Up @@ -1507,7 +1507,7 @@
UI.setCurrent(createUI());
Element element = ElementFactory.createDiv();
String resName = "resource";
StreamResource resource = createEmptyResource(resName);

Check warning on line 1510 in flow-server/src/test/java/com/vaadin/flow/dom/ElementJacksonTest.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove this call to a deprecated class, it has been marked for removal.

See more on https://sonarcloud.io/project/issues?id=vaadin_flow&issues=AZrvlhKZkge5YqNjIbhK&open=AZrvlhKZkge5YqNjIbhK&pullRequest=22904
element.setAttribute("foo", resource);

Assert.assertTrue(element.hasAttribute("foo"));
Expand Down Expand Up @@ -1557,7 +1557,7 @@
throws URISyntaxException {
UI ui = createUI();
UI.setCurrent(ui);
StreamResource resource = createEmptyResource("resource1");

Check warning on line 1560 in flow-server/src/test/java/com/vaadin/flow/dom/ElementJacksonTest.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove this call to a deprecated class, it has been marked for removal.

See more on https://sonarcloud.io/project/issues?id=vaadin_flow&issues=AZrvlhKZkge5YqNjIbhP&open=AZrvlhKZkge5YqNjIbhP&pullRequest=22904
ui.getElement().setAttribute("foo", resource);

String uri = ui.getElement().getAttribute("foo");
Expand Down Expand Up @@ -1585,8 +1585,8 @@
ui.getElement().setAttribute("foo", resource);

String uri = ui.getElement().getAttribute("foo");
Optional<StreamResource> res = ui.getSession().getResourceRegistry()

Check warning on line 1588 in flow-server/src/test/java/com/vaadin/flow/dom/ElementJacksonTest.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove this call to a deprecated class, it has been marked for removal.

See more on https://sonarcloud.io/project/issues?id=vaadin_flow&issues=AZrvlhKZkge5YqNjIbhW&open=AZrvlhKZkge5YqNjIbhW&pullRequest=22904
.getResource(StreamResource.class, new URI(uri));

Check warning on line 1589 in flow-server/src/test/java/com/vaadin/flow/dom/ElementJacksonTest.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove this call to a deprecated class, it has been marked for removal.

See more on https://sonarcloud.io/project/issues?id=vaadin_flow&issues=AZrvlhKZkge5YqNjIbhX&open=AZrvlhKZkge5YqNjIbhX&pullRequest=22904
Assert.assertTrue(res.isPresent());
res = null;

Expand All @@ -1613,12 +1613,12 @@
ui.getElement().setAttribute("foo", resource);

String uri = ui.getElement().getAttribute("foo");
Optional<StreamResource> res = ui.getSession().getResourceRegistry()

Check warning on line 1616 in flow-server/src/test/java/com/vaadin/flow/dom/ElementJacksonTest.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove this call to a deprecated class, it has been marked for removal.

See more on https://sonarcloud.io/project/issues?id=vaadin_flow&issues=AZrvlhKZkge5YqNjIbhe&open=AZrvlhKZkge5YqNjIbhe&pullRequest=22904
.getResource(StreamResource.class, new URI(uri));
Assert.assertTrue(res.isPresent());
res = null;

Check warning on line 1619 in flow-server/src/test/java/com/vaadin/flow/dom/ElementJacksonTest.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove this useless assignment to local variable "res".

See more on https://sonarcloud.io/project/issues?id=vaadin_flow&issues=AZrvlhKZkge5YqNjIbhc&open=AZrvlhKZkge5YqNjIbhc&pullRequest=22904

WeakReference<StreamResource> ref = new WeakReference<>(resource);

Check warning on line 1621 in flow-server/src/test/java/com/vaadin/flow/dom/ElementJacksonTest.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove this call to a deprecated class, it has been marked for removal.

See more on https://sonarcloud.io/project/issues?id=vaadin_flow&issues=AZrvlhKZkge5YqNjIbhg&open=AZrvlhKZkge5YqNjIbhg&pullRequest=22904
resource = null;

ui.getElement().removeAttribute("foo");
Expand All @@ -1637,7 +1637,7 @@
UI ui = createUI();
UI.setCurrent(ui);

StreamResource resource = createEmptyResource("resource");

Check warning on line 1640 in flow-server/src/test/java/com/vaadin/flow/dom/ElementJacksonTest.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove this call to a deprecated class, it has been marked for removal.

See more on https://sonarcloud.io/project/issues?id=vaadin_flow&issues=AZrvlhKZkge5YqNjIbhi&open=AZrvlhKZkge5YqNjIbhi&pullRequest=22904
Element element = ElementFactory.createDiv();
element.setAttribute("foo", resource);

Expand All @@ -1646,7 +1646,7 @@
Assert.assertTrue(element.hasAttribute("foo"));

String uri = element.getAttribute("foo");
Optional<StreamResource> res = ui.getSession().getResourceRegistry()

Check warning on line 1649 in flow-server/src/test/java/com/vaadin/flow/dom/ElementJacksonTest.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove this call to a deprecated class, it has been marked for removal.

See more on https://sonarcloud.io/project/issues?id=vaadin_flow&issues=AZrvlhKZkge5YqNjIbhj&open=AZrvlhKZkge5YqNjIbhj&pullRequest=22904
.getResource(StreamResource.class, new URI(uri));
Assert.assertTrue(res.isPresent());
}
Expand All @@ -1657,11 +1657,11 @@
UI ui = createUI();
UI.setCurrent(ui);

StreamResource resource = createEmptyResource("resource1");

Check warning on line 1660 in flow-server/src/test/java/com/vaadin/flow/dom/ElementJacksonTest.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove this call to a deprecated class, it has been marked for removal.

See more on https://sonarcloud.io/project/issues?id=vaadin_flow&issues=AZrvlhKZkge5YqNjIbhn&open=AZrvlhKZkge5YqNjIbhn&pullRequest=22904
Element element = ElementFactory.createDiv();
element.setAttribute("foo", resource);

WeakReference<StreamResource> ref = new WeakReference<>(resource);

Check warning on line 1664 in flow-server/src/test/java/com/vaadin/flow/dom/ElementJacksonTest.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove this call to a deprecated class, it has been marked for removal.

See more on https://sonarcloud.io/project/issues?id=vaadin_flow&issues=AZrvlhKZkge5YqNjIbho&open=AZrvlhKZkge5YqNjIbho&pullRequest=22904
resource = null;

String resName = "resource2";
Expand All @@ -1672,8 +1672,8 @@
Assert.assertTrue(element.hasAttribute("foo"));

String uri = element.getAttribute("foo");
Optional<StreamResource> res = ui.getSession().getResourceRegistry()

Check warning on line 1675 in flow-server/src/test/java/com/vaadin/flow/dom/ElementJacksonTest.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove this call to a deprecated class, it has been marked for removal.

See more on https://sonarcloud.io/project/issues?id=vaadin_flow&issues=AZrvlhKZkge5YqNjIbhp&open=AZrvlhKZkge5YqNjIbhp&pullRequest=22904
.getResource(StreamResource.class, new URI(uri));

Check warning on line 1676 in flow-server/src/test/java/com/vaadin/flow/dom/ElementJacksonTest.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove this call to a deprecated class, it has been marked for removal.

See more on https://sonarcloud.io/project/issues?id=vaadin_flow&issues=AZrvlhKZkge5YqNjIbhq&open=AZrvlhKZkge5YqNjIbhq&pullRequest=22904
Assert.assertTrue(res.isPresent());
Assert.assertTrue(uri.endsWith(resName));

Expand All @@ -1693,8 +1693,8 @@
Element element = ElementFactory.createDiv();
element.setAttribute("foo", resource);

WeakReference<StreamResource> ref = new WeakReference<>(resource);

Check warning on line 1696 in flow-server/src/test/java/com/vaadin/flow/dom/ElementJacksonTest.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove this call to a deprecated class, it has been marked for removal.

See more on https://sonarcloud.io/project/issues?id=vaadin_flow&issues=AZrvlhKZkge5YqNjIbhu&open=AZrvlhKZkge5YqNjIbhu&pullRequest=22904
resource = null;

Check warning on line 1697 in flow-server/src/test/java/com/vaadin/flow/dom/ElementJacksonTest.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove this useless assignment to local variable "resource".

See more on https://sonarcloud.io/project/issues?id=vaadin_flow&issues=AZrvlhKZkge5YqNjIbhr&open=AZrvlhKZkge5YqNjIbhr&pullRequest=22904

element.setAttribute("foo", "bar");

Expand All @@ -1717,7 +1717,7 @@
element.setAttribute("foo", resource);

WeakReference<StreamResource> ref = new WeakReference<>(resource);
resource = null;

Check warning on line 1720 in flow-server/src/test/java/com/vaadin/flow/dom/ElementJacksonTest.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove this useless assignment to local variable "resource".

See more on https://sonarcloud.io/project/issues?id=vaadin_flow&issues=AZrvlhKZkge5YqNjIbhv&open=AZrvlhKZkge5YqNjIbhv&pullRequest=22904

element.removeAttribute("foo");

Expand Down Expand Up @@ -1756,18 +1756,18 @@

String uri = element.getAttribute("foo");
Optional<StreamResource> res = ui.getSession().getResourceRegistry()
.getResource(StreamResource.class, new URI(uri));

Check warning on line 1759 in flow-server/src/test/java/com/vaadin/flow/dom/ElementJacksonTest.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove this call to a deprecated class, it has been marked for removal.

See more on https://sonarcloud.io/project/issues?id=vaadin_flow&issues=AZrvlhKZkge5YqNjIbh3&open=AZrvlhKZkge5YqNjIbh3&pullRequest=22904
Assert.assertTrue(res.isPresent());
Assert.assertTrue(uri.endsWith(resName));
}

@Test
public void setResourceAttribute_attachElement_setRawAttributeAfterAttaching()
throws URISyntaxException, InterruptedException {

Check warning on line 1766 in flow-server/src/test/java/com/vaadin/flow/dom/ElementJacksonTest.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove the declaration of thrown exception 'java.net.URISyntaxException', as it cannot be thrown from method's body.

See more on https://sonarcloud.io/project/issues?id=vaadin_flow&issues=AZrvlhKZkge5YqNjIbh5&open=AZrvlhKZkge5YqNjIbh5&pullRequest=22904
UI ui = createUI();
UI.setCurrent(ui);

StreamResource resource = createEmptyResource("resource");

Check warning on line 1770 in flow-server/src/test/java/com/vaadin/flow/dom/ElementJacksonTest.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove this call to a deprecated class, it has been marked for removal.

See more on https://sonarcloud.io/project/issues?id=vaadin_flow&issues=AZrvlhKZkge5YqNjIbh6&open=AZrvlhKZkge5YqNjIbh6&pullRequest=22904
Element element = ElementFactory.createDiv();
element.setAttribute("foo", resource);

Expand All @@ -1793,7 +1793,7 @@
UI ui = createUI();
UI.setCurrent(ui);

StreamResource resource = createEmptyResource("resource");

Check warning on line 1796 in flow-server/src/test/java/com/vaadin/flow/dom/ElementJacksonTest.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove this call to a deprecated class, it has been marked for removal.

See more on https://sonarcloud.io/project/issues?id=vaadin_flow&issues=AZrvlhKZkge5YqNjIbh-&open=AZrvlhKZkge5YqNjIbh-&pullRequest=22904
Element element = ElementFactory.createDiv();
element.setAttribute("foo", resource);

Expand Down Expand Up @@ -1826,11 +1826,11 @@
element.setAttribute("foo", resource);
String attribute = element.getAttribute("foo");

WeakReference<StreamResource> ref = new WeakReference<>(resource);

Check warning on line 1829 in flow-server/src/test/java/com/vaadin/flow/dom/ElementJacksonTest.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove this call to a deprecated class, it has been marked for removal.

See more on https://sonarcloud.io/project/issues?id=vaadin_flow&issues=AZrvlhKZkge5YqNjIbiC&open=AZrvlhKZkge5YqNjIbiC&pullRequest=22904
resource = null;

URI uri = new URI(attribute);
Optional<StreamResource> res = ui.getSession().getResourceRegistry()

Check warning on line 1833 in flow-server/src/test/java/com/vaadin/flow/dom/ElementJacksonTest.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove this call to a deprecated class, it has been marked for removal.

See more on https://sonarcloud.io/project/issues?id=vaadin_flow&issues=AZrvlhKZkge5YqNjIbiD&open=AZrvlhKZkge5YqNjIbiD&pullRequest=22904
.getResource(StreamResource.class, uri);
Assert.assertTrue(res.isPresent());

Expand Down Expand Up @@ -1878,7 +1878,7 @@
ui.getElement().appendChild(element);

res = ui.getSession().getResourceRegistry()
.getResource(StreamResource.class, uri);

Check warning on line 1881 in flow-server/src/test/java/com/vaadin/flow/dom/ElementJacksonTest.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove this call to a deprecated class, it has been marked for removal.

See more on https://sonarcloud.io/project/issues?id=vaadin_flow&issues=AZrvlhKZkge5YqNjIbiK&open=AZrvlhKZkge5YqNjIbiK&pullRequest=22904
Assert.assertTrue(res.isPresent());
}

Expand Down Expand Up @@ -1917,7 +1917,7 @@
@Test(expected = UnsupportedOperationException.class)
public void setResourceAttribute_elementIsText_operationIsNotSupported() {
Element.createText("").setAttribute("foo",
Mockito.mock(StreamResource.class));

Check warning on line 1920 in flow-server/src/test/java/com/vaadin/flow/dom/ElementJacksonTest.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove this call to a deprecated class, it has been marked for removal.

See more on https://sonarcloud.io/project/issues?id=vaadin_flow&issues=AZrvlhKZkge5YqNjIbiQ&open=AZrvlhKZkge5YqNjIbiQ&pullRequest=22904
}

@Test
Expand Down Expand Up @@ -1947,12 +1947,12 @@
child.appendChild(grandChild);

Assert.assertEquals(childTriggered.get(), 0);
Assert.assertEquals(grandChildTriggered.get(), 0);

Check warning on line 1950 in flow-server/src/test/java/com/vaadin/flow/dom/ElementJacksonTest.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Swap these 2 arguments so they are in the correct order: expected value, actual value.

See more on https://sonarcloud.io/project/issues?id=vaadin_flow&issues=AZrvlhKakge5YqNjIbiS&open=AZrvlhKakge5YqNjIbiS&pullRequest=22904

body.appendChild(parent);

Assert.assertEquals(childTriggered.get(), 1);

Check warning on line 1954 in flow-server/src/test/java/com/vaadin/flow/dom/ElementJacksonTest.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Swap these 2 arguments so they are in the correct order: expected value, actual value.

See more on https://sonarcloud.io/project/issues?id=vaadin_flow&issues=AZrvlhKakge5YqNjIbiT&open=AZrvlhKakge5YqNjIbiT&pullRequest=22904
Assert.assertEquals(grandChildTriggered.get(), 1);

Check warning on line 1955 in flow-server/src/test/java/com/vaadin/flow/dom/ElementJacksonTest.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Swap these 2 arguments so they are in the correct order: expected value, actual value.

See more on https://sonarcloud.io/project/issues?id=vaadin_flow&issues=AZrvlhKakge5YqNjIbiU&open=AZrvlhKakge5YqNjIbiU&pullRequest=22904

body.removeAllChildren();
parent.removeAllChildren();
Expand Down Expand Up @@ -2262,8 +2262,8 @@
public void htmlComponentOuterHtml() {
Html html = new Html(
"<div style='background:green'><span><button>hello</button></span></div>");
Assert.assertEquals("<div style=\"background:green\">\n"
+ " <span>\n <button>hello</button>\n </span>\n" + "</div>",

Check warning on line 2266 in flow-server/src/test/java/com/vaadin/flow/dom/ElementJacksonTest.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Replace this String concatenation with Text block.

See more on https://sonarcloud.io/project/issues?id=vaadin_flow&issues=AZrvlhKakge5YqNjIbig&open=AZrvlhKakge5YqNjIbig&pullRequest=22904
html.getElement().getOuterHTML());
}

Expand Down Expand Up @@ -2342,6 +2342,18 @@
assertPendingJs(ui, "return $0.method($1,$2)", element, "foo", 123);
}

@Test
public void callFunctionWithBean() {
UI ui = new MockUI();
Element element = ElementFactory.createDiv();
SimpleBean bean = new SimpleBean();
element.callJsFunction("method", bean);
ui.getElement().appendChild(element);
ui.getInternals().getStateTree().runExecutionsBeforeClientResponse();

assertPendingJs(ui, "return $0.method($1)", element, bean);
}

@Test
public void callFunctionOnProperty() {
UI ui = new MockUI();
Expand Down Expand Up @@ -2683,7 +2695,7 @@

}

private static ArrayNode createNumberArray(double... items) {

Check warning on line 2698 in flow-server/src/test/java/com/vaadin/flow/dom/ElementJacksonTest.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove this unused private "createNumberArray" method.

See more on https://sonarcloud.io/project/issues?id=vaadin_flow&issues=AZrvlhKZkge5YqNjIbg1&open=AZrvlhKZkge5YqNjIbg1&pullRequest=22904
return DoubleStream.of(items).mapToObj(JacksonUtils::createNode)
.collect(JacksonUtils.asArray());
}
Expand Down
Loading