summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorAhmed Ashour <asashour@yahoo.com>2017-09-13 15:18:53 +0200
committerHenri Sara <henri.sara@gmail.com>2017-09-14 08:44:50 +0300
commitcaf41dbac44b53c475e20ccc621c80c754033df9 (patch)
tree54f8260fb352be4ef3822ccd430f7e60e5c963ac /client
parentce25750a8fd3642cf1ed7d0dac708517d5bfd226 (diff)
downloadvaadin-framework-caf41dbac44b53c475e20ccc621c80c754033df9.tar.gz
vaadin-framework-caf41dbac44b53c475e20ccc621c80c754033df9.zip
Simplify conditional logic.
Diffstat (limited to 'client')
-rw-r--r--client/src/main/java/com/vaadin/client/LayoutManager.java10
-rw-r--r--client/src/main/java/com/vaadin/client/WidgetUtil.java6
-rw-r--r--client/src/main/java/com/vaadin/client/ui/AbstractComponentConnector.java6
-rw-r--r--client/src/main/java/com/vaadin/client/ui/VDragAndDropWrapper.java6
-rw-r--r--client/src/main/java/com/vaadin/client/ui/VNotification.java6
5 files changed, 6 insertions, 28 deletions
diff --git a/client/src/main/java/com/vaadin/client/LayoutManager.java b/client/src/main/java/com/vaadin/client/LayoutManager.java
index 878ac17901..b679fe980e 100644
--- a/client/src/main/java/com/vaadin/client/LayoutManager.java
+++ b/client/src/main/java/com/vaadin/client/LayoutManager.java
@@ -144,21 +144,15 @@ public class LayoutManager {
return true;
} else if (elementResizeListeners.containsKey(e)) {
return true;
- } else if (getMeasuredSize(e, nullSize).hasDependents()) {
- return true;
- } else {
- return false;
}
+ return getMeasuredSize(e, nullSize).hasDependents();
}
private boolean needsMeasureForManagedLayout(ComponentConnector connector) {
if (connector instanceof ManagedLayout) {
return true;
- } else if (connector.getParent() instanceof ManagedLayout) {
- return true;
- } else {
- return false;
}
+ return connector.getParent() instanceof ManagedLayout;
}
/**
diff --git a/client/src/main/java/com/vaadin/client/WidgetUtil.java b/client/src/main/java/com/vaadin/client/WidgetUtil.java
index f6ffe4cecd..d42ba541c6 100644
--- a/client/src/main/java/com/vaadin/client/WidgetUtil.java
+++ b/client/src/main/java/com/vaadin/client/WidgetUtil.java
@@ -769,11 +769,7 @@ public class WidgetUtil {
com.google.gwt.dom.client.Element pe) {
String overflow = getComputedStyle(pe, "overflow");
if (overflow != null) {
- if (overflow.equals("auto") || overflow.equals("scroll")) {
- return true;
- } else {
- return false;
- }
+ return overflow.equals("auto") || overflow.equals("scroll");
} else {
return false;
}
diff --git a/client/src/main/java/com/vaadin/client/ui/AbstractComponentConnector.java b/client/src/main/java/com/vaadin/client/ui/AbstractComponentConnector.java
index 1eb9908335..8623bc1d76 100644
--- a/client/src/main/java/com/vaadin/client/ui/AbstractComponentConnector.java
+++ b/client/src/main/java/com/vaadin/client/ui/AbstractComponentConnector.java
@@ -773,12 +773,8 @@ public abstract class AbstractComponentConnector extends AbstractConnector
AbstractComponentState state = getState();
if (state.description != null && !state.description.equals("")) {
return true;
- } else if (state.errorMessage != null
- && !state.errorMessage.equals("")) {
- return true;
- } else {
- return false;
}
+ return state.errorMessage != null && !state.errorMessage.equals("");
}
/**
diff --git a/client/src/main/java/com/vaadin/client/ui/VDragAndDropWrapper.java b/client/src/main/java/com/vaadin/client/ui/VDragAndDropWrapper.java
index 9f53935440..0595d65069 100644
--- a/client/src/main/java/com/vaadin/client/ui/VDragAndDropWrapper.java
+++ b/client/src/main/java/com/vaadin/client/ui/VDragAndDropWrapper.java
@@ -667,11 +667,7 @@ public class VDragAndDropWrapper extends VCustomComponent
drag.getCurrentGwtEvent(), 0.2);
drag.getDropDetails().put("horizontalLocation",
horizontalDropLocation.toString());
- if (oldHL != horizontalDropLocation || oldVL != verticalDropLocation) {
- return true;
- } else {
- return false;
- }
+ return oldHL != horizontalDropLocation || oldVL != verticalDropLocation;
}
protected void deEmphasis(boolean doLayout) {
diff --git a/client/src/main/java/com/vaadin/client/ui/VNotification.java b/client/src/main/java/com/vaadin/client/ui/VNotification.java
index 6042ff11d6..f5815e093b 100644
--- a/client/src/main/java/com/vaadin/client/ui/VNotification.java
+++ b/client/src/main/java/com/vaadin/client/ui/VNotification.java
@@ -426,11 +426,7 @@ public class VNotification extends VOverlay {
hide();
return false;
}
- if (temporaryStyle == STYLE_SYSTEM) {
- return true;
- } else {
- return false;
- }
+ return temporaryStyle == STYLE_SYSTEM;
}
// default
switch (type) {