Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug 567032 issue floating license configuration wizard #482

Merged
merged 1 commit into from
Oct 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ public final class IssueLicenseRequestPage implements Supplier<IWizardPage> {
private final Supplier<Optional<Collection<UserDescriptor>>> users;
private final Supplier<Optional<ProductVersionDescriptor>> product;
private final Supplier<Optional<List<LocalDate>>> period;
private final Supplier<Optional<Integer>> capacity;
private final ComposedPage page;

IssueLicenseRequestPage(IEclipseContext context, FloatingDataPack initial) {
Expand All @@ -42,7 +41,6 @@ public final class IssueLicenseRequestPage implements Supplier<IWizardPage> {
users = page.withUsers();
product = page.withProductVersion(initial.product());
period = page.withPeriod();
capacity = page.withCapacity();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public final void installControll(Composite parent) {
@SuppressWarnings("unchecked")
@Override
public final Optional<T> data() {
return Optional.ofNullable((T) widget.getData());
return Optional.ofNullable(widget).flatMap(w -> Optional.ofNullable((T) w.getData()));
}

private void installLabel(Composite parent) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ public FLoatingLicenseData(Collection<UserDescriptor> users, LicensePlanDescript
super(plan, product, from, until);
Objects.requireNonNull(users, "PersonalLicenseData::users"); //$NON-NLS-1$
this.users = users; // FIXME: work for caching function: keep Map and reimplement retrieves

}

public FLoatingLicenseData(Collection<UserDescriptor> users, LicensePlanDescriptor plan,
Expand Down Expand Up @@ -68,7 +67,7 @@ private UserDescriptor user(String identifier) {
return users.stream()//
.filter(user -> identifier.equals(user.getIdentifier()))//
.findAny()//
.get(); // yah, fail if not found, it's a developer's
.get(); // yah, fail if not found, it's a development problem
}

}