Clean Code Refactoring
Signed-off-by: SirWayne <dennis.melzer@bosch-si.com>
This commit is contained in:
@@ -75,7 +75,7 @@ public class RedisConfiguration {
|
||||
*/
|
||||
@Bean
|
||||
public RedisTemplate<String, Object> redisTemplate() {
|
||||
final RedisTemplate<String, Object> redisTemplate = new RedisTemplate<String, Object>();
|
||||
final RedisTemplate<String, Object> redisTemplate = new RedisTemplate<>();
|
||||
redisTemplate.setConnectionFactory(jedisConnectionFactory());
|
||||
redisTemplate.setKeySerializer(new JdkSerializationRedisSerializer());
|
||||
redisTemplate.setHashValueSerializer(new JdkSerializationRedisSerializer());
|
||||
|
||||
@@ -95,7 +95,7 @@ public class EventDistributor {
|
||||
* wants to subscribe
|
||||
*/
|
||||
public Collection<Topic> getTopics() {
|
||||
final List<Topic> topics = new ArrayList<Topic>();
|
||||
final List<Topic> topics = new ArrayList<>();
|
||||
topics.add(new PatternTopic(SUB_DISTRIBUTION_CHANNEL));
|
||||
return topics;
|
||||
}
|
||||
|
||||
@@ -21,7 +21,11 @@ import java.util.List;
|
||||
*/
|
||||
public class ListReportSeries extends AbstractReportSeries {
|
||||
|
||||
private final List<Number> data = new ArrayList<Number>();
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
private final List<Number> data = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* @param name
|
||||
|
||||
@@ -330,7 +330,7 @@ public class DeploymentManagement {
|
||||
// one we have been switched to canceling state because for targets
|
||||
// which we have changed to
|
||||
// canceling we don't want to publish the new action update event.
|
||||
final Set<Long> targetIdsCancellList = new HashSet<Long>();
|
||||
final Set<Long> targetIdsCancellList = new HashSet<>();
|
||||
targetIds.forEach(ids -> targetIdsCancellList.addAll(overrideObsoleteUpdateActions(ids)));
|
||||
|
||||
// cancel all scheduled actions which are in-active, these actions were
|
||||
@@ -430,7 +430,7 @@ public class DeploymentManagement {
|
||||
*/
|
||||
private Set<Long> overrideObsoleteUpdateActions(final List<Long> targetsIds) {
|
||||
|
||||
final Set<Long> cancelledTargetIds = new HashSet<Long>();
|
||||
final Set<Long> cancelledTargetIds = new HashSet<>();
|
||||
|
||||
// Figure out if there are potential target/action combinations that
|
||||
// need to be considered
|
||||
@@ -774,8 +774,7 @@ public class DeploymentManagement {
|
||||
multiselect.where(cb.equal(actionRoot.get(Action_.target), target));
|
||||
multiselect.orderBy(cb.desc(actionRoot.get(Action_.id)));
|
||||
multiselect.groupBy(actionRoot.get(Action_.id));
|
||||
final List<ActionWithStatusCount> resultList = entityManager.createQuery(multiselect).getResultList();
|
||||
return resultList;
|
||||
return entityManager.createQuery(multiselect).getResultList();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -57,7 +57,7 @@ public class NoCountPagingRepository {
|
||||
*/
|
||||
public <T, I extends Serializable> Slice<T> findAll(final Specification<T> spec, final Pageable pageable,
|
||||
final Class<T> domainClass) {
|
||||
final SimpleJpaNoCountRepository<T, I> noCountDao = new SimpleJpaNoCountRepository<T, I>(domainClass, em);
|
||||
final SimpleJpaNoCountRepository<T, I> noCountDao = new SimpleJpaNoCountRepository<>(domainClass, em);
|
||||
return noCountDao.findAll(spec, pageable);
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ public class NoCountPagingRepository {
|
||||
* org.springframework.data.domain.Pageable)
|
||||
*/
|
||||
public <T, I extends Serializable> Slice<T> findAll(final Pageable pageable, final Class<T> domainClass) {
|
||||
final SimpleJpaNoCountRepository<T, I> noCountDao = new SimpleJpaNoCountRepository<T, I>(domainClass, em);
|
||||
final SimpleJpaNoCountRepository<T, I> noCountDao = new SimpleJpaNoCountRepository<>(domainClass, em);
|
||||
return noCountDao.findAll(pageable);
|
||||
}
|
||||
|
||||
@@ -120,7 +120,7 @@ public class NoCountPagingRepository {
|
||||
|
||||
final List<T> content = query.getResultList();
|
||||
|
||||
return new PageImpl<T>(content, pageable, content.size());
|
||||
return new PageImpl<>(content, pageable, content.size());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -160,7 +160,7 @@ public class TagManagement {
|
||||
public void deleteTargetTag(@NotEmpty final String targetTagName) {
|
||||
final TargetTag tag = targetTagRepository.findByNameEquals(targetTagName);
|
||||
|
||||
final List<Target> changed = new LinkedList<Target>();
|
||||
final List<Target> changed = new LinkedList<>();
|
||||
for (final Target target : targetRepository.findByTag(tag)) {
|
||||
target.getTags().remove(tag);
|
||||
changed.add(target);
|
||||
@@ -311,7 +311,7 @@ public class TagManagement {
|
||||
public void deleteDistributionSetTag(@NotEmpty final String tagName) {
|
||||
final DistributionSetTag tag = distributionSetTagRepository.findByNameEquals(tagName);
|
||||
|
||||
final List<DistributionSet> changed = new LinkedList<DistributionSet>();
|
||||
final List<DistributionSet> changed = new LinkedList<>();
|
||||
for (final DistributionSet set : distributionSetRepository.findByTag(tag)) {
|
||||
set.getTags().remove(tag);
|
||||
changed.add(set);
|
||||
|
||||
@@ -63,7 +63,7 @@ public class ActionStatus extends BaseEntity {
|
||||
@CollectionTable(name = "sp_action_status_messages", joinColumns = @JoinColumn(name = "action_status_id", foreignKey = @ForeignKey(value = ConstraintMode.CONSTRAINT, name = "fk_stat_msg_act_stat") ) , indexes = {
|
||||
@Index(name = "sp_idx_action_status_msgs_01", columnList = "action_status_id") })
|
||||
@Column(name = "detail_message", length = 512)
|
||||
private final List<String> messages = new ArrayList<String>();
|
||||
private final List<String> messages = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* Creates a new {@link ActionStatus} object.
|
||||
|
||||
@@ -83,7 +83,7 @@ public class Target extends NamedEntity implements Persistable<Long> {
|
||||
@JoinTable(name = "sp_target_target_tag", joinColumns = {
|
||||
@JoinColumn(name = "target", foreignKey = @ForeignKey(value = ConstraintMode.CONSTRAINT, name = "fk_targ_targtag_target") ) }, inverseJoinColumns = {
|
||||
@JoinColumn(name = "tag", foreignKey = @ForeignKey(value = ConstraintMode.CONSTRAINT, name = "fk_targ_targtag_tag") ) })
|
||||
private Set<TargetTag> tags = new HashSet<TargetTag>();
|
||||
private Set<TargetTag> tags = new HashSet<>();
|
||||
|
||||
@CascadeOnDelete
|
||||
@OneToMany(fetch = FetchType.LAZY, orphanRemoval = true, cascade = { CascadeType.REMOVE })
|
||||
|
||||
@@ -88,7 +88,7 @@ final class DistributionSetTypeMapper {
|
||||
}
|
||||
|
||||
static List<DistributionSetTypeRest> toListResponse(final List<DistributionSetType> types) {
|
||||
final List<DistributionSetTypeRest> response = new ArrayList<DistributionSetTypeRest>();
|
||||
final List<DistributionSetTypeRest> response = new ArrayList<>();
|
||||
for (final DistributionSetType dsType : types) {
|
||||
response.add(toResponse(dsType));
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ final class SoftwareModuleTypeMapper {
|
||||
}
|
||||
|
||||
static List<SoftwareModuleTypeRest> toListResponse(final Collection<SoftwareModuleType> types) {
|
||||
final List<SoftwareModuleTypeRest> response = new ArrayList<SoftwareModuleTypeRest>();
|
||||
final List<SoftwareModuleTypeRest> response = new ArrayList<>();
|
||||
for (final SoftwareModuleType softwareModule : types) {
|
||||
response.add(toResponse(softwareModule));
|
||||
}
|
||||
|
||||
@@ -208,14 +208,13 @@ public class ArtifactDetailsLayout extends VerticalLayout {
|
||||
}
|
||||
|
||||
private Container createArtifactLazyQueryContainer() {
|
||||
final Map<String, Object> queryConfiguration = new HashMap<String, Object>();
|
||||
final Map<String, Object> queryConfiguration = new HashMap<>();
|
||||
return getArtifactLazyQueryContainer(queryConfiguration);
|
||||
}
|
||||
|
||||
private LazyQueryContainer getArtifactLazyQueryContainer(final Map<String, Object> queryConfig) {
|
||||
|
||||
final BeanQueryFactory<ArtifactBeanQuery> artifactQF = new BeanQueryFactory<ArtifactBeanQuery>(
|
||||
ArtifactBeanQuery.class);
|
||||
final BeanQueryFactory<ArtifactBeanQuery> artifactQF = new BeanQueryFactory<>(ArtifactBeanQuery.class);
|
||||
artifactQF.setQueryConfiguration(queryConfig);
|
||||
final LazyQueryContainer artifactCont = new LazyQueryContainer(new LazyQueryDefinition(true, 10, "id"),
|
||||
artifactQF);
|
||||
@@ -431,7 +430,7 @@ public class ArtifactDetailsLayout extends VerticalLayout {
|
||||
titleOfArtifactDetails.setContentMode(ContentMode.HTML);
|
||||
}
|
||||
}
|
||||
final Map<String, Object> queryConfiguration = new HashMap<String, Object>();
|
||||
final Map<String, Object> queryConfiguration = new HashMap<>();
|
||||
if (baseSwModuleId != null) {
|
||||
queryConfiguration.put(SPUIDefinitions.BY_BASE_SOFTWARE_MODULE, baseSwModuleId);
|
||||
}
|
||||
|
||||
@@ -126,7 +126,7 @@ public class UploadViewAcceptCriteria extends AbstractAcceptCriteria {
|
||||
}
|
||||
|
||||
private static Map<String, List<String>> createDropConfigurations() {
|
||||
final Map<String, List<String>> config = new HashMap<String, List<String>>();
|
||||
final Map<String, List<String>> config = new HashMap<>();
|
||||
// Delete drop area droppable components
|
||||
config.put(SPUIComponetIdProvider.DELETE_BUTTON_WRAPPER_ID, Arrays.asList(
|
||||
SPUIComponetIdProvider.UPLOAD_SOFTWARE_MODULE_TABLE, SPUIComponetIdProvider.UPLOAD_TYPE_BUTTON_PREFIX));
|
||||
@@ -135,7 +135,7 @@ public class UploadViewAcceptCriteria extends AbstractAcceptCriteria {
|
||||
}
|
||||
|
||||
private static Map<String, Object> createDropHintConfigurations() {
|
||||
final Map<String, Object> config = new HashMap<String, Object>();
|
||||
final Map<String, Object> config = new HashMap<>();
|
||||
config.put(SPUIComponetIdProvider.UPLOAD_TYPE_BUTTON_PREFIX, UploadArtifactUIEvent.SOFTWARE_TYPE_DRAG_START);
|
||||
config.put(SPUIComponetIdProvider.UPLOAD_SOFTWARE_MODULE_TABLE, UploadArtifactUIEvent.SOFTWARE_DRAG_START);
|
||||
return config;
|
||||
|
||||
@@ -76,7 +76,7 @@ public class BaseSwModuleBeanQuery extends AbstractBeanQuery<ProxyBaseSoftwareMo
|
||||
@Override
|
||||
protected List<ProxyBaseSoftwareModuleItem> loadBeans(final int startIndex, final int count) {
|
||||
final Slice<SoftwareModule> swModuleBeans;
|
||||
final List<ProxyBaseSoftwareModuleItem> proxyBeans = new ArrayList<ProxyBaseSoftwareModuleItem>();
|
||||
final List<ProxyBaseSoftwareModuleItem> proxyBeans = new ArrayList<>();
|
||||
|
||||
if (type == null && Strings.isNullOrEmpty(searchText)) {
|
||||
swModuleBeans = getSoftwareManagementService()
|
||||
|
||||
@@ -82,6 +82,7 @@ public class SoftwareModuleTable extends AbstractTable {
|
||||
/**
|
||||
* Initialize the filter layout.
|
||||
*/
|
||||
@Override
|
||||
@PostConstruct
|
||||
protected void init() {
|
||||
super.init();
|
||||
@@ -127,20 +128,17 @@ public class SoftwareModuleTable extends AbstractTable {
|
||||
*/
|
||||
@Override
|
||||
protected Container createContainer() {
|
||||
final Map<String, Object> queryConfiguration = new HashMap<String, Object>();
|
||||
final Map<String, Object> queryConfiguration = new HashMap<>();
|
||||
artifactUploadState.getSoftwareModuleFilters().getSearchText()
|
||||
.ifPresent(value -> queryConfiguration.put(SPUIDefinitions.FILTER_BY_TEXT, value));
|
||||
|
||||
artifactUploadState.getSoftwareModuleFilters().getSoftwareModuleType()
|
||||
.ifPresent(type -> queryConfiguration.put(SPUIDefinitions.BY_SOFTWARE_MODULE_TYPE, type));
|
||||
|
||||
final BeanQueryFactory<BaseSwModuleBeanQuery> swQF = new BeanQueryFactory<BaseSwModuleBeanQuery>(
|
||||
BaseSwModuleBeanQuery.class);
|
||||
final BeanQueryFactory<BaseSwModuleBeanQuery> swQF = new BeanQueryFactory<>(BaseSwModuleBeanQuery.class);
|
||||
swQF.setQueryConfiguration(queryConfiguration);
|
||||
|
||||
final LazyQueryContainer container = new LazyQueryContainer(
|
||||
new LazyQueryDefinition(true, SPUIDefinitions.PAGE_SIZE, "swId"), swQF);
|
||||
return container;
|
||||
return new LazyQueryContainer(new LazyQueryDefinition(true, SPUIDefinitions.PAGE_SIZE, "swId"), swQF);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -274,7 +272,7 @@ public class SoftwareModuleTable extends AbstractTable {
|
||||
*/
|
||||
@Override
|
||||
protected List<TableColumn> getTableVisibleColumns() {
|
||||
final List<TableColumn> columnList = new ArrayList<TableColumn>();
|
||||
final List<TableColumn> columnList = new ArrayList<>();
|
||||
if (isMaximized()) {
|
||||
columnList.add(new TableColumn(SPUILabelDefinitions.VAR_NAME, i18n.get("header.name"), 0.2F));
|
||||
columnList.add(new TableColumn(SPUILabelDefinitions.VAR_VERSION, i18n.get("header.version"), 0.1F));
|
||||
|
||||
@@ -193,7 +193,7 @@ public class CreateUpdateSoftwareTypeLayout extends CustomComponent implements C
|
||||
getPreviewButtonColor(DEFAULT_COLOR);
|
||||
tagColorPreviewBtn.setStyleName(TAG_DYNAMIC_STYLE);
|
||||
|
||||
selectors = new HashSet<ColorSelector>();
|
||||
selectors = new HashSet<>();
|
||||
selectedColor = new Color(44, 151, 32);
|
||||
selPreview = new SpColorPickerPreview(selectedColor);
|
||||
|
||||
|
||||
@@ -106,7 +106,7 @@ public class UploadConfirmationwindow implements Button.ClickListener {
|
||||
|
||||
private IndexedContainer tabelContainer;
|
||||
|
||||
private final List<UploadStatus> uploadResultList = new ArrayList<UploadStatus>();
|
||||
private final List<UploadStatus> uploadResultList = new ArrayList<>();
|
||||
|
||||
private VerticalLayout uploadArtifactDetails;
|
||||
|
||||
|
||||
@@ -102,7 +102,7 @@ public class UploadLayout extends VerticalLayout {
|
||||
|
||||
private final AtomicInteger numberOfFilesActuallyUpload = new AtomicInteger();
|
||||
|
||||
private final List<String> duplicateFileNamesList = new ArrayList<String>();
|
||||
private final List<String> duplicateFileNamesList = new ArrayList<>();
|
||||
|
||||
private Button processBtn;
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ public class UploadResultWindow implements Button.ClickListener {
|
||||
|
||||
private static final long serialVersionUID = 5205927189362269027L;
|
||||
|
||||
private List<UploadStatus> uploadResultList = new ArrayList<UploadStatus>();
|
||||
private List<UploadStatus> uploadResultList = new ArrayList<>();
|
||||
|
||||
private Button closeBtn;
|
||||
|
||||
|
||||
@@ -83,7 +83,7 @@ public class DistributionSetTypeBeanQuery extends AbstractBeanQuery<Distribution
|
||||
@Override
|
||||
protected List<DistributionSetType> loadBeans(final int startIndex, final int count) {
|
||||
Page<DistributionSetType> typeBeans;
|
||||
final List<DistributionSetType> distSetTypeList = new ArrayList<DistributionSetType>();
|
||||
final List<DistributionSetType> distSetTypeList = new ArrayList<>();
|
||||
if (startIndex == 0 && firstPageDistSetType != null) {
|
||||
typeBeans = firstPageDistSetType;
|
||||
} else {
|
||||
|
||||
@@ -80,6 +80,7 @@ public class DistributionTagToken extends AbstractTagToken {
|
||||
// To Be Done : have to set this value based on view???
|
||||
private static final Boolean NOTAGS_SELECTED = Boolean.FALSE;
|
||||
|
||||
@Override
|
||||
@PostConstruct
|
||||
protected void init() {
|
||||
super.init();
|
||||
@@ -129,7 +130,7 @@ public class DistributionTagToken extends AbstractTagToken {
|
||||
}
|
||||
|
||||
private DistributionSetTagAssigmentResult toggleAssignment(final String tagNameSelected) {
|
||||
final Set<Long> distributionList = new HashSet<Long>();
|
||||
final Set<Long> distributionList = new HashSet<>();
|
||||
distributionList.add(selectedDS.getId());
|
||||
final DistributionSetTagAssigmentResult result = distributionSetManagement.toggleTagAssignment(distributionList,
|
||||
tagNameSelected);
|
||||
@@ -160,7 +161,7 @@ public class DistributionTagToken extends AbstractTagToken {
|
||||
|
||||
/* To Be Done : this implementation will vary in views */
|
||||
private List<String> getClickedTagList() {
|
||||
return new ArrayList<String>();
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -78,7 +78,7 @@ public class TargetTagToken extends AbstractTargetTagToken {
|
||||
}
|
||||
|
||||
private TargetTagAssigmentResult toggleAssignment(final String tagNameSelected) {
|
||||
final Set<String> targetList = new HashSet<String>();
|
||||
final Set<String> targetList = new HashSet<>();
|
||||
targetList.add(selectedTarget.getControllerId());
|
||||
final TargetTagAssigmentResult result = targetManagement.toggleTagAssignment(targetList, tagNameSelected);
|
||||
uinotification.displaySuccess(HawkbitCommonUtil.getTargetTagAssigmentMsg(tagNameSelected, result, i18n));
|
||||
@@ -102,7 +102,7 @@ public class TargetTagToken extends AbstractTargetTagToken {
|
||||
|
||||
/* To Be Done : this implementation will vary in views */
|
||||
private List<String> getClickedTagList() {
|
||||
return new ArrayList<String>();
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -221,7 +221,7 @@ public class CreateUpdateDistSetTypeLayout extends CustomComponent implements Co
|
||||
|
||||
getPreviewButtonColor(DEFAULT_COLOR);
|
||||
|
||||
selectors = new HashSet<ColorSelector>();
|
||||
selectors = new HashSet<>();
|
||||
selectedColor = new Color(44, 151, 32);
|
||||
selPreview = new SpColorPickerPreview(selectedColor);
|
||||
|
||||
@@ -457,6 +457,7 @@ public class CreateUpdateDistSetTypeLayout extends CustomComponent implements Co
|
||||
sourceTable.setItemDescriptionGenerator(new ItemDescriptionGenerator() {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Override
|
||||
public String generateDescription(final Component source, final Object itemId, final Object propertyId) {
|
||||
final Item item = sourceTable.getItem(itemId);
|
||||
final String description = (String) item.getItemProperty(DIST_TYPE_DESCRIPTION).getValue();
|
||||
@@ -475,15 +476,15 @@ public class CreateUpdateDistSetTypeLayout extends CustomComponent implements Co
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private void getSelectedTableItemData(final Long id) {
|
||||
Item saveTblitem = null;
|
||||
if (null != selectedTablecontainer) {
|
||||
saveTblitem = selectedTablecontainer.addItem(id);
|
||||
saveTblitem.getItemProperty(DIST_TYPE_NAME).setValue(
|
||||
sourceTable.getContainerDataSource().getItem(id).getItemProperty(DIST_TYPE_NAME).getValue());
|
||||
saveTblitem.getItemProperty(DIST_TYPE_MANDATORY).setValue(new CheckBox());
|
||||
saveTblitem.getItemProperty(DIST_TYPE_DESCRIPTION).setValue(
|
||||
sourceTable.getContainerDataSource().getItem(id).getItemProperty(DIST_TYPE_DESCRIPTION).getValue());
|
||||
if (selectedTablecontainer == null) {
|
||||
return;
|
||||
}
|
||||
final Item saveTblitem = selectedTablecontainer.addItem(id);
|
||||
saveTblitem.getItemProperty(DIST_TYPE_NAME)
|
||||
.setValue(sourceTable.getContainerDataSource().getItem(id).getItemProperty(DIST_TYPE_NAME).getValue());
|
||||
saveTblitem.getItemProperty(DIST_TYPE_MANDATORY).setValue(new CheckBox());
|
||||
saveTblitem.getItemProperty(DIST_TYPE_DESCRIPTION).setValue(
|
||||
sourceTable.getContainerDataSource().getItem(id).getItemProperty(DIST_TYPE_DESCRIPTION).getValue());
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@@ -657,10 +658,10 @@ public class CreateUpdateDistSetTypeLayout extends CustomComponent implements Co
|
||||
DistributionSetType newDistType = new DistributionSetType(typeKeyValue, typeNameValue, typeDescValue);
|
||||
for (final Long id : itemIds) {
|
||||
final Item item = selectedTable.getItem(id);
|
||||
final String dist_type_name = (String) item.getItemProperty(DIST_TYPE_NAME).getValue();
|
||||
final String distTypeName = (String) item.getItemProperty(DIST_TYPE_NAME).getValue();
|
||||
final CheckBox mandatoryCheckBox = (CheckBox) item.getItemProperty(DIST_TYPE_MANDATORY).getValue();
|
||||
final Boolean isMandatory = mandatoryCheckBox.getValue();
|
||||
final SoftwareModuleType swModuleType = softwareManagement.findSoftwareModuleTypeByName(dist_type_name);
|
||||
final SoftwareModuleType swModuleType = softwareManagement.findSoftwareModuleTypeByName(distTypeName);
|
||||
if (isMandatory) {
|
||||
newDistType.addMandatoryModuleType(swModuleType);
|
||||
|
||||
@@ -1032,7 +1033,6 @@ public class CreateUpdateDistSetTypeLayout extends CustomComponent implements Co
|
||||
* as the selected tag from combo
|
||||
*/
|
||||
private void setTypeTagCombo(final String distSetTypeSelected) {
|
||||
boolean mandatory = false;
|
||||
typeName.setValue(distSetTypeSelected);
|
||||
getSourceTableData();
|
||||
selectedTable.getContainerDataSource().removeAllItems();
|
||||
@@ -1053,13 +1053,11 @@ public class CreateUpdateDistSetTypeLayout extends CustomComponent implements Co
|
||||
saveDistSetType.setEnabled(false);
|
||||
}
|
||||
for (final SoftwareModuleType swModuleType : selectedTypeTag.getOptionalModuleTypes()) {
|
||||
mandatory = false;
|
||||
addTargetTableforUpdate(swModuleType, mandatory);
|
||||
addTargetTableforUpdate(swModuleType, false);
|
||||
}
|
||||
|
||||
for (final SoftwareModuleType swModuleType : selectedTypeTag.getMandatoryModuleTypes()) {
|
||||
mandatory = true;
|
||||
addTargetTableforUpdate(swModuleType, mandatory);
|
||||
addTargetTableforUpdate(swModuleType, true);
|
||||
}
|
||||
|
||||
if (null == selectedTypeTag.getColour()) {
|
||||
|
||||
@@ -104,7 +104,7 @@ public class ManageDistBeanQuery extends AbstractBeanQuery<ProxyDistribution> {
|
||||
@Override
|
||||
protected List<ProxyDistribution> loadBeans(final int startIndex, final int count) {
|
||||
Page<DistributionSet> distBeans;
|
||||
final List<ProxyDistribution> proxyDistributions = new ArrayList<ProxyDistribution>();
|
||||
final List<ProxyDistribution> proxyDistributions = new ArrayList<>();
|
||||
if (startIndex == 0 && firstPageDistributionSets != null) {
|
||||
distBeans = firstPageDistributionSets;
|
||||
} else if (Strings.isNullOrEmpty(searchText)) {
|
||||
|
||||
@@ -137,7 +137,7 @@ public class DistributionsViewAcceptCriteria extends AbstractAcceptCriteria {
|
||||
}
|
||||
|
||||
private static Map<String, List<String>> createDropConfigurations() {
|
||||
final Map<String, List<String>> config = new HashMap<String, List<String>>();
|
||||
final Map<String, List<String>> config = new HashMap<>();
|
||||
|
||||
// Delete drop area droppable components
|
||||
config.put(SPUIComponetIdProvider.DELETE_BUTTON_WRAPPER_ID,
|
||||
@@ -153,7 +153,7 @@ public class DistributionsViewAcceptCriteria extends AbstractAcceptCriteria {
|
||||
}
|
||||
|
||||
private static Map<String, Object> createDropHintConfigurations() {
|
||||
final Map<String, Object> config = new HashMap<String, Object>();
|
||||
final Map<String, Object> config = new HashMap<>();
|
||||
config.put(SPUIDefinitions.DISTRIBUTION_TYPE_ID_PREFIXS, DragEvent.DISTRIBUTION_TYPE_DRAG);
|
||||
config.put(SPUIComponetIdProvider.DIST_TABLE_ID, DragEvent.DISTRIBUTION_DRAG);
|
||||
config.put(SPUIComponetIdProvider.UPLOAD_SOFTWARE_MODULE_TABLE, DragEvent.SOFTWAREMODULE_DRAG);
|
||||
|
||||
@@ -87,7 +87,7 @@ public class SwModuleBeanQuery extends AbstractBeanQuery<ProxyBaseSwModuleItem>
|
||||
@Override
|
||||
protected List<ProxyBaseSwModuleItem> loadBeans(final int startIndex, final int count) {
|
||||
final Slice<CustomSoftwareModule> swModuleBeans;
|
||||
final List<ProxyBaseSwModuleItem> proxyBeans = new ArrayList<ProxyBaseSwModuleItem>();
|
||||
final List<ProxyBaseSwModuleItem> proxyBeans = new ArrayList<>();
|
||||
|
||||
swModuleBeans = getSoftwareManagement().findSoftwareModuleOrderByDistribution(
|
||||
new OffsetBasedPageRequest(startIndex, count, new Sort(Direction.ASC, "name", "version")),
|
||||
|
||||
@@ -98,6 +98,7 @@ public class SwModuleTable extends AbstractTable {
|
||||
/**
|
||||
* Initialize the filter layout.
|
||||
*/
|
||||
@Override
|
||||
@PostConstruct
|
||||
protected void init() {
|
||||
super.init();
|
||||
@@ -177,7 +178,7 @@ public class SwModuleTable extends AbstractTable {
|
||||
*/
|
||||
@Override
|
||||
protected Container createContainer() {
|
||||
final Map<String, Object> queryConfiguration = new HashMap<String, Object>();
|
||||
final Map<String, Object> queryConfiguration = new HashMap<>();
|
||||
manageDistUIState.getSoftwareModuleFilters().getSearchText()
|
||||
.ifPresent(value -> queryConfiguration.put(SPUIDefinitions.FILTER_BY_TEXT, value));
|
||||
|
||||
@@ -187,13 +188,10 @@ public class SwModuleTable extends AbstractTable {
|
||||
manageDistUIState.getLastSelectedDistribution().ifPresent(
|
||||
distIdName -> queryConfiguration.put(SPUIDefinitions.ORDER_BY_DISTRIBUTION, distIdName.getId()));
|
||||
|
||||
final BeanQueryFactory<SwModuleBeanQuery> swQF = new BeanQueryFactory<SwModuleBeanQuery>(
|
||||
SwModuleBeanQuery.class);
|
||||
final BeanQueryFactory<SwModuleBeanQuery> swQF = new BeanQueryFactory<>(SwModuleBeanQuery.class);
|
||||
swQF.setQueryConfiguration(queryConfiguration);
|
||||
|
||||
final LazyQueryContainer container = new LazyQueryContainer(
|
||||
new LazyQueryDefinition(true, SPUIDefinitions.PAGE_SIZE, "swId"), swQF);
|
||||
return container;
|
||||
return new LazyQueryContainer(new LazyQueryDefinition(true, SPUIDefinitions.PAGE_SIZE, "swId"), swQF);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -309,7 +307,7 @@ public class SwModuleTable extends AbstractTable {
|
||||
*/
|
||||
@Override
|
||||
protected List<TableColumn> getTableVisibleColumns() {
|
||||
final List<TableColumn> columnList = new ArrayList<TableColumn>();
|
||||
final List<TableColumn> columnList = new ArrayList<>();
|
||||
if (isMaximized()) {
|
||||
columnList.add(new TableColumn(SPUILabelDefinitions.VAR_NAME, i18n.get("header.name"), 0.2F));
|
||||
columnList.add(new TableColumn(SPUILabelDefinitions.VAR_VERSION, i18n.get("header.version"), 0.1F));
|
||||
|
||||
Reference in New Issue
Block a user