Skip to content

Commit c51af80

Browse files
eclipse-platform-botakurtakov
authored andcommitted
Perform clean code of bundles/org.eclipse.core.databinding.property
1 parent d3ebda8 commit c51af80

27 files changed

+249
-132
lines changed

bundles/org.eclipse.core.databinding.property/src/org/eclipse/core/databinding/property/NativePropertyListener.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,18 @@ public NativePropertyListener(IProperty property, ISimplePropertyListener<S, D>
4545

4646
@Override
4747
public final void addTo(S source) {
48-
if (source != null)
48+
if (source != null) {
4949
doAddTo(source);
50+
}
5051
}
5152

5253
protected abstract void doAddTo(S source);
5354

5455
@Override
5556
public final void removeFrom(S source) {
56-
if (source != null)
57+
if (source != null) {
5758
doRemoveFrom(source);
59+
}
5860
}
5961

6062
protected abstract void doRemoveFrom(S source);

bundles/org.eclipse.core.databinding.property/src/org/eclipse/core/databinding/property/SimplePropertyEvent.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,15 @@ public SimplePropertyEvent(int type, S source, IProperty property, D diff) {
8989

9090
@Override
9191
public boolean equals(Object obj) {
92-
if (obj == this)
92+
if (obj == this) {
9393
return true;
94-
if (obj == null)
94+
}
95+
if (obj == null) {
9596
return false;
96-
if (getClass() != obj.getClass())
97+
}
98+
if (getClass() != obj.getClass()) {
9799
return false;
100+
}
98101

99102
SimplePropertyEvent<?, ?> that = (SimplePropertyEvent<?, ?>) obj;
100103
return Objects.equals(getSource(), that.getSource()) && Objects.equals(this.property, that.property)

bundles/org.eclipse.core.databinding.property/src/org/eclipse/core/databinding/property/list/DelegatingListProperty.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,13 @@ protected DelegatingListProperty(Object elementType) {
5555
* @return the property to delegate to for the specified source object.
5656
*/
5757
public final IListProperty<S, E> getDelegate(S source) {
58-
if (source == null)
58+
if (source == null) {
5959
return nullProperty;
60+
}
6061
IListProperty<S, E> delegate = doGetDelegate(source);
61-
if (delegate == null)
62+
if (delegate == null) {
6263
delegate = nullProperty;
64+
}
6365
return delegate;
6466
}
6567

bundles/org.eclipse.core.databinding.property/src/org/eclipse/core/databinding/property/list/MultiListProperty.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,9 @@ public Object getElementType() {
7575
@Override
7676
protected List<E> doGetList(S source) {
7777
List<E> list = new ArrayList<>();
78-
for (IListProperty<S, E> property : properties)
78+
for (IListProperty<S, E> property : properties) {
7979
list.addAll(property.getList(source));
80+
}
8081
return list;
8182
}
8283

bundles/org.eclipse.core.databinding.property/src/org/eclipse/core/databinding/property/map/DelegatingMapProperty.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,13 @@ protected DelegatingMapProperty(Object keyType, Object valueType) {
5858
* @return the property to delegate to for the specified source object.
5959
*/
6060
public final IMapProperty<S, K, V> getDelegate(S source) {
61-
if (source == null)
61+
if (source == null) {
6262
return nullProperty;
63+
}
6364
IMapProperty<S, K, V> delegate = doGetDelegate(source);
64-
if (delegate == null)
65+
if (delegate == null) {
6566
delegate = nullProperty;
67+
}
6668
return delegate;
6769
}
6870

bundles/org.eclipse.core.databinding.property/src/org/eclipse/core/databinding/property/map/SimpleMapProperty.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,9 @@ public IObservableMap<K, V> observe(Realm realm, S source) {
7979
* @since 1.6
8080
*/
8181
public final void setMap(S source, Map<K, V> map, MapDiff<K, V> diff) {
82-
if (source != null && !diff.isEmpty())
82+
if (source != null && !diff.isEmpty()) {
8383
doSetMap(source, map, diff);
84+
}
8485
}
8586

8687
/**

bundles/org.eclipse.core.databinding.property/src/org/eclipse/core/databinding/property/set/DelegatingSetProperty.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,13 @@ protected DelegatingSetProperty(Object elementType) {
5454
* @return the property to delegate to for the specified source object.
5555
*/
5656
protected final ISetProperty<S, E> getDelegate(S source) {
57-
if (source == null)
57+
if (source == null) {
5858
return nullProperty;
59+
}
5960
ISetProperty<S, E> delegate = doGetDelegate(source);
60-
if (delegate == null)
61+
if (delegate == null) {
6162
delegate = nullProperty;
63+
}
6264
return delegate;
6365
}
6466

bundles/org.eclipse.core.databinding.property/src/org/eclipse/core/databinding/property/set/SimpleSetProperty.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,9 @@ public IObservableSet<E> observe(Realm realm, S source) {
7676
* @since 1.6
7777
*/
7878
public final void setSet(S source, Set<E> set, SetDiff<E> diff) {
79-
if (source != null && !diff.isEmpty())
79+
if (source != null && !diff.isEmpty()) {
8080
doSetSet(source, set, diff);
81+
}
8182
}
8283

8384
/**

bundles/org.eclipse.core.databinding.property/src/org/eclipse/core/databinding/property/set/UnionSetProperty.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,9 @@ public Object getElementType() {
6262
@Override
6363
protected Set<E> doGetSet(S source) {
6464
Set<E> set = new HashSet<>();
65-
for (ISetProperty<S, E> property : properties)
65+
for (ISetProperty<S, E> property : properties) {
6666
set.addAll(property.getSet(source));
67+
}
6768
return set;
6869
}
6970

bundles/org.eclipse.core.databinding.property/src/org/eclipse/core/databinding/property/value/DelegatingValueProperty.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,13 @@ protected DelegatingValueProperty(Object valueType) {
5757
* @return the property to delegate to for the specified source object.
5858
*/
5959
public final IValueProperty<S, T> getDelegate(S source) {
60-
if (source == null)
60+
if (source == null) {
6161
return nullProperty;
62+
}
6263
IValueProperty<S, T> delegate = doGetDelegate(source);
63-
if (delegate == null)
64+
if (delegate == null) {
6465
delegate = nullProperty;
66+
}
6567
return delegate;
6668
}
6769

0 commit comments

Comments
 (0)