Update Spring Boot & Hateoas (#430)

* Upgrade spring boot 1.4.4 and hateoas 0.23. Removed unneded dependency,

Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>

* Avoid link change with new hateoas version.

Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>

* Readded commons.io

Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>

* Update MariaDB driver to 1.5.7

Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>

* Added missing content to docs.

Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>

* Fix equals.

Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>

* Simplify

Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>

* Fix equal after removal of commons collections.

Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>
This commit is contained in:
Kai Zimmermann
2017-02-07 09:57:43 +01:00
committed by GitHub
parent c031142906
commit 21181bc6f8
18 changed files with 74 additions and 53 deletions

View File

@@ -19,7 +19,6 @@ import java.util.Objects;
import java.util.Set;
import java.util.stream.Collectors;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.eclipse.hawkbit.ui.artifacts.smtable.SoftwareModuleAddUpdateWindow;
import org.eclipse.hawkbit.ui.components.SPUIComponentProvider;
@@ -33,7 +32,6 @@ import org.vaadin.hene.flexibleoptiongroup.FlexibleOptionGroupItemComponent;
import com.google.common.base.Strings;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
import com.vaadin.data.Container.ItemSetChangeEvent;
import com.vaadin.data.Container.ItemSetChangeListener;
import com.vaadin.data.Property.ValueChangeEvent;
@@ -240,7 +238,7 @@ public class CommonDialogWindow extends Window {
Object value = field.getValue();
if (field instanceof Table) {
value = Sets.newHashSet(((Table) field).getContainerDataSource().getItemIds());
value = ((Table) field).getContainerDataSource().getItemIds();
}
orginalValues.put(field, value);
}
@@ -263,6 +261,9 @@ public class CommonDialogWindow extends Window {
}
protected void addComponentListeners() {
// avoid duplicate registration
removeListeners();
for (final AbstractField<?> field : allComponents) {
if (field instanceof TextChangeNotifier) {
((TextChangeNotifier) field).addTextChangeListener(new ChangeListener(field));
@@ -290,28 +291,13 @@ public class CommonDialogWindow extends Window {
}
final Object currentValue = getCurrentVaue(currentChangedComponent, newValue, field);
if (!isValueEquals(field, originalValue, currentValue)) {
if (!Objects.equals(originalValue, currentValue)) {
return true;
}
}
return false;
}
private static boolean isValueEquals(final AbstractField<?> field, final Object orginalValue,
final Object currentValue) {
if (Set.class.equals(field.getType())) {
return CollectionUtils.isEqualCollection(CollectionUtils.emptyIfNull((Collection<?>) orginalValue),
CollectionUtils.emptyIfNull((Collection<?>) currentValue));
}
if (String.class.equals(field.getType())) {
return Objects.equals(Strings.emptyToNull((String) orginalValue),
Strings.emptyToNull((String) currentValue));
}
return Objects.equals(orginalValue, currentValue);
}
private static Object getCurrentVaue(final Component currentChangedComponent, final Object newValue,
final AbstractField<?> field) {
Object currentValue = field.getValue();

View File

@@ -20,7 +20,6 @@ import java.util.Collection;
import java.util.List;
import java.util.Map;
import org.apache.commons.collections4.CollectionUtils;
import org.eclipse.hawkbit.repository.FilterParams;
import org.eclipse.hawkbit.repository.OffsetBasedPageRequest;
import org.eclipse.hawkbit.repository.TargetManagement;
@@ -39,6 +38,7 @@ import org.eclipse.hawkbit.ui.utils.SpringContextHelper;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Slice;
import org.springframework.data.domain.Sort;
import org.springframework.util.CollectionUtils;
import org.vaadin.addons.lazyquerycontainer.AbstractBeanQuery;
import org.vaadin.addons.lazyquerycontainer.QueryDefinition;
@@ -211,7 +211,7 @@ public class TargetBeanQuery extends AbstractBeanQuery<ProxyTarget> {
private boolean isAnyFilterSelected() {
final boolean isFilterSelected = isTagSelected() || isOverdueFilterEnabled();
return isFilterSelected || CollectionUtils.isNotEmpty(status) || distributionId != null
return isFilterSelected || !CollectionUtils.isEmpty(status) || distributionId != null
|| !isNullOrEmpty(searchText);
}

View File

@@ -26,7 +26,6 @@ import java.util.Set;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import org.apache.commons.collections4.CollectionUtils;
import org.eclipse.hawkbit.repository.DistributionSetManagement;
import org.eclipse.hawkbit.repository.FilterParams;
import org.eclipse.hawkbit.repository.TagManagement;
@@ -70,6 +69,7 @@ import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
import org.eclipse.hawkbit.ui.utils.UINotification;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.util.CollectionUtils;
import org.vaadin.addons.lazyquerycontainer.BeanQueryFactory;
import org.vaadin.addons.lazyquerycontainer.LazyQueryContainer;
import org.vaadin.addons.lazyquerycontainer.LazyQueryDefinition;