Avoid raw type bounds in class declarations to fix unchecked warnings

Make sure the generic classes MutableOfferView & AgentRegistrationView
don't use raw bounds for their associated view models, as that leads to
unchecked assignments from the model fields further down.
This commit is contained in:
Steven Barclay 2019-11-16 14:09:15 +00:00
parent 96ac86dd25
commit f3456f1920
No known key found for this signature in database
GPG key ID: 9FED6BF1176D500B
2 changed files with 4 additions and 3 deletions

View file

@ -32,6 +32,7 @@ import bisq.desktop.util.Layout;
import bisq.core.app.AppOptionKeys; import bisq.core.app.AppOptionKeys;
import bisq.core.locale.LanguageUtil; import bisq.core.locale.LanguageUtil;
import bisq.core.locale.Res; import bisq.core.locale.Res;
import bisq.core.support.dispute.agent.DisputeAgent;
import bisq.common.UserThread; import bisq.common.UserThread;
import bisq.common.util.Tuple2; import bisq.common.util.Tuple2;
@ -70,7 +71,8 @@ import static bisq.desktop.util.FormBuilder.addTopLabelTextField;
// TODO translation string keys should renamed to be more generic. // TODO translation string keys should renamed to be more generic.
// Lets do it for 1.1.7 the translator have time to add new string. // Lets do it for 1.1.7 the translator have time to add new string.
@FxmlView @FxmlView
public abstract class AgentRegistrationView<R, T extends AgentRegistrationViewModel> extends ActivatableViewAndModel<VBox, T> { public abstract class AgentRegistrationView<R extends DisputeAgent, T extends AgentRegistrationViewModel<R, ?>>
extends ActivatableViewAndModel<VBox, T> {
private final boolean useDevPrivilegeKeys; private final boolean useDevPrivilegeKeys;
private ListView<String> languagesListView; private ListView<String> languagesListView;

View file

@ -121,7 +121,7 @@ import org.jetbrains.annotations.NotNull;
import static bisq.desktop.util.FormBuilder.*; import static bisq.desktop.util.FormBuilder.*;
import static javafx.beans.binding.Bindings.createStringBinding; import static javafx.beans.binding.Bindings.createStringBinding;
public abstract class MutableOfferView<M extends MutableOfferViewModel> extends ActivatableViewAndModel<AnchorPane, M> { public abstract class MutableOfferView<M extends MutableOfferViewModel<?>> extends ActivatableViewAndModel<AnchorPane, M> {
public static final String BUYER_SECURITY_DEPOSIT_NEWS = "buyerSecurityDepositNews0.9.5"; public static final String BUYER_SECURITY_DEPOSIT_NEWS = "buyerSecurityDepositNews0.9.5";
protected final Navigation navigation; protected final Navigation navigation;
private final Preferences preferences; private final Preferences preferences;
@ -438,7 +438,6 @@ public abstract class MutableOfferView<M extends MutableOfferViewModel> extends
balanceTextField.setTargetAmount(model.getDataModel().totalToPayAsCoinProperty().get()); balanceTextField.setTargetAmount(model.getDataModel().totalToPayAsCoinProperty().get());
//noinspection PointlessBooleanExpression
if (!DevEnv.isDevMode()) { if (!DevEnv.isDevMode()) {
String key = "securityDepositInfo"; String key = "securityDepositInfo";
new Popup<>().backgroundInfo(Res.get("popup.info.securityDepositInfo")) new Popup<>().backgroundInfo(Res.get("popup.info.securityDepositInfo"))