Skip to content

Commit f48f5ab

Browse files
committed
Add nullable annotations to CustomBinding.java
1 parent 0077e82 commit f48f5ab

File tree

1 file changed

+5
-5
lines changed
  • org.jhotdraw8.fxbase/src/main/java/org.jhotdraw8.fxbase/org/jhotdraw8/fxbase/binding

1 file changed

+5
-5
lines changed

org.jhotdraw8.fxbase/src/main/java/org.jhotdraw8.fxbase/org/jhotdraw8/fxbase/binding/CustomBinding.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public static <T, M> void bindBidirectionalStrongly(
6363
Property<T> propertyA, Property<M> mediator, Function<M, Property<T>> propertyB) {
6464

6565
final ChangeListener<M> changeListener = new ChangeListener<>() {
66-
private Property<T> strongReference;
66+
private @Nullable Property<T> strongReference;
6767

6868
@Override
6969
public void changed(ObservableValue<? extends M> o, M oldv, M newv) {
@@ -85,7 +85,7 @@ public static <T, M> void bindBidirectionalStrongly2(
8585
Property<T> propertyA, Property<M> mediator, Function<M, Property<T>> propertyB) {
8686

8787
final ChangeListener<M> changeListener = new ChangeListener<>() {
88-
private Property<T> strongReference;
88+
private @Nullable Property<T> strongReference;
8989

9090
@Override
9191
public void changed(ObservableValue<? extends M> o, M oldv, M newv) {
@@ -390,7 +390,7 @@ public static <E, T> void bindElements(ObservableList<E> list, Function<E, Prope
390390
* @param <E> the element type
391391
* @param <T> the property type
392392
*/
393-
public static <E, T> void bindElements(ObservableList<E> list, Function<E, Property<T>> getter, Property<T> property, T unboundValue) {
393+
public static <E, T> void bindElements(ObservableList<E> list, Function<E, Property<T>> getter, Property<T> property, @Nullable T unboundValue) {
394394
for (E elem : list) {
395395
Property<T> p = getter.apply(elem);
396396
p.unbind();
@@ -444,7 +444,7 @@ public static <E, T> void bindElements(ObservableList<E> list, Function<E, Prope
444444
* @param <E> the element type
445445
* @param <T> the property type
446446
*/
447-
public static <E, T> void bindElements(ObservableList<E> list, Function<E, Property<T>> getter, Binding<T> binding, T unboundValue) {
447+
public static <E, T> void bindElements(ObservableList<E> list, Function<E, Property<T>> getter, Binding<T> binding, @Nullable T unboundValue) {
448448
for (E elem : list) {
449449
Property<T> p = getter.apply(elem);
450450
p.unbind();
@@ -616,7 +616,7 @@ private static class ViaProperty<AA, BB> extends SimpleObjectProperty<BB> implem
616616
}
617617

618618
@Override
619-
public void changed(ObservableValue<? extends AA> o, AA oldValue, AA newValue) {
619+
public void changed(ObservableValue<? extends AA> o, @Nullable AA oldValue, @Nullable AA newValue) {
620620
if (oldValue != null) {
621621
unbind();
622622
}

0 commit comments

Comments
 (0)