summaryrefslogtreecommitdiffstats
path: root/client-compiler
diff options
context:
space:
mode:
authorAhmed Ashour <asashour@yahoo.com>2017-11-01 10:36:47 +0100
committerPekka Maanpää <pekkamaa@vaadin.com>2017-11-01 11:36:47 +0200
commit3763f3f94cbcb0b5035ba547accf123b5c50ed3d (patch)
tree762058cc800575af022601d39fcdd3326a6dd078 /client-compiler
parent04905e1e2eb81770d813abda6a516254e541443d (diff)
downloadvaadin-framework-3763f3f94cbcb0b5035ba547accf123b5c50ed3d.tar.gz
vaadin-framework-3763f3f94cbcb0b5035ba547accf123b5c50ed3d.zip
Use lambda expressions. (#10268)
Diffstat (limited to 'client-compiler')
-rw-r--r--client-compiler/src/main/java/com/vaadin/server/widgetsetutils/metadata/ConnectorBundle.java25
-rwxr-xr-xclient-compiler/src/main/java/com/vaadin/tools/WidgetsetCompiler.java35
2 files changed, 21 insertions, 39 deletions
diff --git a/client-compiler/src/main/java/com/vaadin/server/widgetsetutils/metadata/ConnectorBundle.java b/client-compiler/src/main/java/com/vaadin/server/widgetsetutils/metadata/ConnectorBundle.java
index 2f64602557..5b0cd97206 100644
--- a/client-compiler/src/main/java/com/vaadin/server/widgetsetutils/metadata/ConnectorBundle.java
+++ b/client-compiler/src/main/java/com/vaadin/server/widgetsetutils/metadata/ConnectorBundle.java
@@ -60,21 +60,11 @@ public class ConnectorBundle {
static final String OLD_RENDERER_CONNECTOR_NAME = "com.vaadin.v7.client.connectors.AbstractRendererConnector";
- public static final Comparator<JClassType> jClassComparator = new Comparator<JClassType>() {
- @Override
- public int compare(JClassType o1, JClassType o2) {
- return o1.getQualifiedSourceName()
- .compareTo(o2.getQualifiedSourceName());
- }
- };
+ public static final Comparator<JClassType> jClassComparator = (o1, o2) -> o1
+ .getQualifiedSourceName().compareTo(o2.getQualifiedSourceName());
- public static final Comparator<JMethod> jMethodComparator = new Comparator<JMethod>() {
- @Override
- public int compare(JMethod o1, JMethod o2) {
- return o1.getReadableDeclaration()
- .compareTo(o2.getReadableDeclaration());
- }
- };
+ public static final Comparator<JMethod> jMethodComparator = (o1, o2) -> o1
+ .getReadableDeclaration().compareTo(o2.getReadableDeclaration());
private final String name;
private final ConnectorBundle previousBundle;
@@ -85,12 +75,7 @@ public class ConnectorBundle {
private final Set<JType> needsSerializeSupport = new HashSet<>();
private final Map<JType, GeneratedSerializer> serializers = new TreeMap<>(
- new Comparator<JType>() {
- @Override
- public int compare(JType o1, JType o2) {
- return o1.toString().compareTo(o2.toString());
- }
- });
+ (o1, o2) -> o1.toString().compareTo(o2.toString()));
private final Map<JClassType, Map<JMethod, Set<MethodAttribute>>> methodAttributes = new TreeMap<>(
jClassComparator);
diff --git a/client-compiler/src/main/java/com/vaadin/tools/WidgetsetCompiler.java b/client-compiler/src/main/java/com/vaadin/tools/WidgetsetCompiler.java
index 7e43c0850f..20bcc8714e 100755
--- a/client-compiler/src/main/java/com/vaadin/tools/WidgetsetCompiler.java
+++ b/client-compiler/src/main/java/com/vaadin/tools/WidgetsetCompiler.java
@@ -60,28 +60,25 @@ public class WidgetsetCompiler {
// thread and cannot be changed in JRE 1.5 (see
// http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6316197)
- Runnable runCompiler = new Runnable() {
- @Override
- public void run() {
- try {
- // GWTCompiler.main(args);
- // avoid warnings
+ Runnable runCompiler = () -> {
+ try {
+ // GWTCompiler.main(args);
+ // avoid warnings
- String wsname = args[args.length - 1];
+ String wsname = args[args.length - 1];
- // TODO expecting this is launched via eclipse WTP
- // project
- System.out.println(
- "Updating GWT module description file...");
- WidgetSetBuilder.updateWidgetSet(wsname);
- System.out.println("Done.");
+ // TODO expecting this is launched via eclipse WTP
+ // project
+ System.out
+ .println("Updating GWT module description file...");
+ WidgetSetBuilder.updateWidgetSet(wsname);
+ System.out.println("Done.");
- System.out.println("Starting GWT compiler");
- com.google.gwt.dev.Compiler.main(args);
- } catch (Throwable thr) {
- getLogger().log(Level.SEVERE,
- "Widgetset compilation failed", thr);
- }
+ System.out.println("Starting GWT compiler");
+ com.google.gwt.dev.Compiler.main(args);
+ } catch (Throwable thr) {
+ getLogger().log(Level.SEVERE,
+ "Widgetset compilation failed", thr);
}
};
Thread runThread = new Thread(runCompiler);