From 780e9cee6b7e976285402a00ad5b282a8e79619e Mon Sep 17 00:00:00 2001 From: Ahmed Ashour Date: Fri, 20 Oct 2017 08:59:17 +0200 Subject: Simplify lambda expressions (#10198) * Simplify lambda expressions And remove unneeded 'return' keyword. * Format --- .../src/main/java/com/vaadin/test/osgi/myapplication1/MyUI.java | 9 ++++----- .../src/main/java/com/vaadin/test/osgi/myapplication/MyUI.java | 5 ++--- 2 files changed, 6 insertions(+), 8 deletions(-) (limited to 'test/servlet-containers/karaf') diff --git a/test/servlet-containers/karaf/vaadin-karaf-bundle1/src/main/java/com/vaadin/test/osgi/myapplication1/MyUI.java b/test/servlet-containers/karaf/vaadin-karaf-bundle1/src/main/java/com/vaadin/test/osgi/myapplication1/MyUI.java index 1da8cc51ff..26cf31628a 100644 --- a/test/servlet-containers/karaf/vaadin-karaf-bundle1/src/main/java/com/vaadin/test/osgi/myapplication1/MyUI.java +++ b/test/servlet-containers/karaf/vaadin-karaf-bundle1/src/main/java/com/vaadin/test/osgi/myapplication1/MyUI.java @@ -2,11 +2,11 @@ package com.vaadin.test.osgi.myapplication1; import javax.servlet.annotation.WebServlet; -import com.vaadin.annotations.Theme; -import com.vaadin.annotations.Widgetset; import org.osgi.service.component.annotations.Component; +import com.vaadin.annotations.Theme; import com.vaadin.annotations.VaadinServletConfiguration; +import com.vaadin.annotations.Widgetset; import com.vaadin.server.VaadinRequest; import com.vaadin.server.VaadinServlet; import com.vaadin.ui.Button; @@ -27,9 +27,8 @@ public class MyUI extends UI { name.setCaption("Type your name here:"); Button button = new Button("Click Me"); - button.addClickListener(e -> { - layout.addComponent(new Label("Thanks " + name.getValue() + ", it works!")); - }); + button.addClickListener(e -> layout.addComponent( + new Label("Thanks " + name.getValue() + ", it works!"))); layout.addComponents(name, button); diff --git a/test/servlet-containers/karaf/vaadin-karaf-bundle2/src/main/java/com/vaadin/test/osgi/myapplication/MyUI.java b/test/servlet-containers/karaf/vaadin-karaf-bundle2/src/main/java/com/vaadin/test/osgi/myapplication/MyUI.java index 14529ecea1..6a83b7b611 100644 --- a/test/servlet-containers/karaf/vaadin-karaf-bundle2/src/main/java/com/vaadin/test/osgi/myapplication/MyUI.java +++ b/test/servlet-containers/karaf/vaadin-karaf-bundle2/src/main/java/com/vaadin/test/osgi/myapplication/MyUI.java @@ -23,9 +23,8 @@ public class MyUI extends UI { name.setCaption("Type your name here:"); Button button = new Button("Click Me"); - button.addClickListener(e -> { - layout.addComponent(new Label("Thanks " + name.getValue() + ", it works!")); - }); + button.addClickListener(e -> layout.addComponent( + new Label("Thanks " + name.getValue() + ", it works!"))); layout.addComponents(name, button); -- cgit v1.2.3